gosu 1.5.0 → 2.0.0.pre6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/dependencies/SDL/include/SDL.h +233 -0
- data/dependencies/SDL/include/SDL_assert.h +320 -0
- data/dependencies/SDL/include/SDL_atomic.h +414 -0
- data/dependencies/SDL/include/SDL_audio.h +1500 -0
- data/dependencies/SDL/include/{SDL3/SDL_bits.h → SDL_bits.h} +27 -47
- data/dependencies/SDL/include/{SDL3/SDL_blendmode.h → SDL_blendmode.h} +55 -59
- data/dependencies/SDL/include/SDL_clipboard.h +141 -0
- data/dependencies/SDL/include/SDL_config.h +331 -0
- data/dependencies/SDL/include/SDL_cpuinfo.h +594 -0
- data/dependencies/SDL/include/{SDL3/SDL_egl.h → SDL_egl.h} +8 -11
- data/dependencies/SDL/include/SDL_endian.h +348 -0
- data/dependencies/SDL/include/SDL_error.h +163 -0
- data/dependencies/SDL/include/SDL_events.h +1166 -0
- data/dependencies/SDL/include/SDL_filesystem.h +149 -0
- data/dependencies/SDL/include/SDL_gamecontroller.h +1074 -0
- data/dependencies/SDL/include/SDL_gesture.h +117 -0
- data/dependencies/SDL/include/SDL_guid.h +100 -0
- data/dependencies/SDL/include/SDL_haptic.h +1341 -0
- data/dependencies/SDL/include/SDL_hidapi.h +451 -0
- data/dependencies/SDL/include/SDL_hints.h +2613 -0
- data/dependencies/SDL/include/SDL_joystick.h +1069 -0
- data/dependencies/SDL/include/SDL_keyboard.h +353 -0
- data/dependencies/SDL/include/SDL_keycode.h +358 -0
- data/dependencies/SDL/include/SDL_loadso.h +115 -0
- data/dependencies/SDL/include/{SDL3/SDL_locale.h → SDL_locale.h} +24 -40
- data/dependencies/SDL/include/SDL_log.h +404 -0
- data/dependencies/SDL/include/SDL_main.h +282 -0
- data/dependencies/SDL/include/{SDL3/SDL_messagebox.h → SDL_messagebox.h} +48 -85
- data/dependencies/SDL/include/{SDL3/SDL_metal.h → SDL_metal.h} +29 -29
- data/dependencies/SDL/include/{SDL3/SDL_misc.h → SDL_misc.h} +12 -13
- data/dependencies/SDL/include/SDL_mouse.h +464 -0
- data/dependencies/SDL/include/SDL_mutex.h +545 -0
- data/dependencies/SDL/include/SDL_name.h +33 -0
- data/dependencies/SDL/include/{SDL3/SDL_opengl.h → SDL_opengl.h} +252 -1221
- data/dependencies/SDL/include/{SDL3/SDL_opengles.h → SDL_opengles.h} +7 -6
- data/dependencies/SDL/include/{SDL3/SDL_opengles2.h → SDL_opengles2.h} +11 -10
- data/dependencies/SDL/include/SDL_pixels.h +644 -0
- data/dependencies/SDL/include/SDL_platform.h +261 -0
- data/dependencies/SDL/include/{SDL3/SDL_power.h → SDL_power.h} +19 -40
- data/dependencies/SDL/include/SDL_quit.h +58 -0
- data/dependencies/SDL/include/SDL_rect.h +376 -0
- data/dependencies/SDL/include/SDL_render.h +1924 -0
- data/dependencies/SDL/include/SDL_revision.h +7 -0
- data/dependencies/SDL/include/SDL_rwops.h +841 -0
- data/dependencies/SDL/include/{SDL3/SDL_scancode.h → SDL_scancode.h} +68 -60
- data/dependencies/SDL/include/SDL_sensor.h +322 -0
- data/dependencies/SDL/include/SDL_shape.h +155 -0
- data/dependencies/SDL/include/SDL_stdinc.h +838 -0
- data/dependencies/SDL/include/SDL_surface.h +997 -0
- data/dependencies/SDL/include/SDL_system.h +623 -0
- data/dependencies/SDL/include/SDL_syswm.h +386 -0
- data/dependencies/SDL/include/{SDL3/SDL_test.h → SDL_test.h} +22 -16
- data/dependencies/SDL/include/{SDL3/SDL_test_assert.h → SDL_test_assert.h} +34 -27
- data/dependencies/SDL/include/{SDL3/SDL_test_common.h → SDL_test_common.h} +52 -109
- data/dependencies/SDL/include/{SDL3/SDL_test_compare.h → SDL_test_compare.h} +14 -22
- data/dependencies/SDL/include/{SDL3/SDL_test_crc32.h → SDL_test_crc32.h} +30 -27
- data/dependencies/SDL/include/{SDL3/SDL_test_font.h → SDL_test_font.h} +49 -50
- data/dependencies/SDL/include/{SDL3/SDL_test_fuzzer.h → SDL_test_fuzzer.h} +79 -64
- data/dependencies/SDL/include/{SDL3/SDL_test_harness.h → SDL_test_harness.h} +30 -47
- data/dependencies/SDL/include/SDL_test_images.h +78 -0
- data/dependencies/SDL/include/{SDL3/SDL_platform.h → SDL_test_log.h} +26 -25
- data/dependencies/SDL/include/{SDL3/SDL_test_md5.h → SDL_test_md5.h} +28 -21
- data/dependencies/SDL/include/{SDL3/SDL_test_memory.h → SDL_test_memory.h} +16 -19
- data/dependencies/SDL/include/SDL_test_random.h +115 -0
- data/dependencies/SDL/include/SDL_thread.h +464 -0
- data/dependencies/SDL/include/SDL_timer.h +222 -0
- data/dependencies/SDL/include/SDL_touch.h +150 -0
- data/dependencies/SDL/include/{SDL3/SDL_copying.h → SDL_types.h} +9 -2
- data/dependencies/SDL/include/SDL_version.h +204 -0
- data/dependencies/SDL/include/SDL_video.h +2178 -0
- data/dependencies/SDL/include/SDL_vulkan.h +215 -0
- data/dependencies/SDL/include/begin_code.h +187 -0
- data/dependencies/SDL/include/{SDL3/SDL_close_code.h → close_code.h} +6 -7
- data/dependencies/SDL/lib/x64/libSDL2.dll.a +0 -0
- data/dependencies/SDL/lib/x86/libSDL2.dll.a +0 -0
- data/dependencies/SDL_sound/SDL_sound.c +215 -136
- data/dependencies/SDL_sound/SDL_sound.h +725 -0
- data/dependencies/SDL_sound/SDL_sound_aiff.c +54 -55
- data/dependencies/SDL_sound/SDL_sound_au.c +32 -32
- data/dependencies/SDL_sound/SDL_sound_coreaudio.c +41 -24
- data/dependencies/SDL_sound/SDL_sound_flac.c +12 -32
- data/dependencies/SDL_sound/SDL_sound_internal.h +48 -33
- data/dependencies/SDL_sound/SDL_sound_modplug.c +29 -21
- data/dependencies/SDL_sound/SDL_sound_mp3.c +13 -35
- data/dependencies/SDL_sound/SDL_sound_raw.c +15 -14
- data/dependencies/SDL_sound/SDL_sound_shn.c +82 -82
- data/dependencies/SDL_sound/SDL_sound_voc.c +30 -30
- data/dependencies/SDL_sound/SDL_sound_vorbis.c +25 -34
- data/dependencies/SDL_sound/SDL_sound_wav.c +82 -86
- data/dependencies/SDL_sound/dr_flac.h +1281 -1845
- data/dependencies/SDL_sound/dr_mp3.h +617 -1035
- data/dependencies/SDL_sound/libmodplug/fastmix.c +1 -1
- data/dependencies/SDL_sound/libmodplug/libmodplug.h +4 -5
- data/dependencies/SDL_sound/libmodplug/load_ams.c +3 -6
- data/dependencies/SDL_sound/libmodplug/load_dsm.c +1 -2
- data/dependencies/SDL_sound/libmodplug/load_mt2.c +2 -2
- data/dependencies/SDL_sound/libmodplug/modplug.h +1 -2
- data/dependencies/SDL_sound/libmodplug/snd_fx.c +3 -3
- data/dependencies/SDL_sound/libmodplug/sndfile.c +0 -3
- data/dependencies/SDL_sound/libmodplug/sndmix.c +3 -7
- data/dependencies/SDL_sound/stb_vorbis.h +343 -397
- data/dependencies/mojoAL/AL/alc.h +2 -2
- data/dependencies/mojoAL/mojoal.c +1878 -2113
- data/dependencies/stb/stb_image.h +1381 -1192
- data/dependencies/stb/stb_image_write.h +129 -329
- data/dependencies/stb/stb_truetype.h +60 -304
- data/dependencies/utf8proc/utf8proc.c +75 -133
- data/dependencies/utf8proc/utf8proc.h +50 -131
- data/dependencies/utf8proc/utf8proc_data.h +15658 -16213
- data/ext/gosu-ffi/extconf.rb +28 -11
- data/ext/gosu-ffi/gosu-ffi.def +0 -3
- data/ffi/Gosu.cpp +29 -52
- data/ffi/Gosu.h +4 -4
- data/ffi/Gosu_Color.cpp +36 -80
- data/ffi/Gosu_FFI_internal.h +13 -12
- data/ffi/Gosu_Font.cpp +11 -16
- data/ffi/Gosu_Font.h +4 -4
- data/ffi/Gosu_Image.cpp +36 -69
- data/ffi/Gosu_Image.h +5 -16
- data/include/Gosu/Bitmap.hpp +1 -1
- data/include/Gosu/Color.hpp +4 -5
- data/include/Gosu/Graphics.hpp +0 -2
- data/include/Gosu/Image.hpp +1 -1
- data/include/Gosu/Math.hpp +5 -5
- data/include/Gosu/Utility.hpp +1 -27
- data/include/Gosu/Version.hpp +2 -2
- data/lib/SDL2.dll +0 -0
- data/lib/gosu/channel.rb +0 -1
- data/lib/gosu/color.rb +13 -36
- data/lib/gosu/compat.rb +14 -106
- data/lib/gosu/constants.rb +24 -24
- data/lib/gosu/ffi.rb +13 -24
- data/lib/gosu/font.rb +13 -19
- data/lib/gosu/gosu.rb +61 -101
- data/lib/gosu/image.rb +34 -72
- data/lib/gosu/sample.rb +0 -1
- data/lib/gosu/song.rb +0 -1
- data/lib/gosu/text_input.rb +1 -15
- data/lib/gosu/window.rb +10 -31
- data/lib64/SDL2.dll +0 -0
- data/rdoc/gosu.rb +0 -2
- data/src/Audio.cpp +16 -22
- data/src/AudioFileSDLSound.cpp +5 -5
- data/src/BinPacker.cpp +4 -5
- data/src/Bitmap.cpp +9 -16
- data/src/Buffer.cpp +14 -5
- data/src/ClipRectStack.hpp +83 -17
- data/src/Directories.cpp +1 -1
- data/src/DrawOp.hpp +17 -14
- data/src/DrawOpQueue.hpp +31 -25
- data/src/Font.cpp +1 -1
- data/src/GosuGLView.cpp +7 -1
- data/src/Graphics.cpp +25 -32
- data/src/GraphicsImpl.hpp +24 -0
- data/src/Image.cpp +2 -2
- data/src/Input.cpp +70 -66
- data/src/Macro.cpp +26 -43
- data/src/Macro.hpp +16 -22
- data/src/Math.cpp +7 -20
- data/src/OffScreenTarget.cpp +10 -3
- data/src/OpenGLContext.cpp +8 -7
- data/src/OpenGLContext.hpp +2 -2
- data/src/RenderState.hpp +54 -30
- data/src/Resolution.cpp +38 -48
- data/src/TexChunk.cpp +2 -2
- data/src/TextInput.cpp +9 -9
- data/src/Texture.cpp +1 -1
- data/src/TiledDrawable.cpp +7 -6
- data/src/TrueTypeFontUnix.cpp +9 -12
- data/src/Utility.cpp +26 -39
- data/src/UtilityWin.cpp +2 -6
- data/src/Window.cpp +34 -54
- metadata +93 -99
- data/dependencies/SDL/include/SDL3/SDL.h +0 -91
- data/dependencies/SDL/include/SDL3/SDL_assert.h +0 -710
- data/dependencies/SDL/include/SDL3/SDL_asyncio.h +0 -550
- data/dependencies/SDL/include/SDL3/SDL_atomic.h +0 -692
- data/dependencies/SDL/include/SDL3/SDL_audio.h +0 -2382
- data/dependencies/SDL/include/SDL3/SDL_begin_code.h +0 -553
- data/dependencies/SDL/include/SDL3/SDL_camera.h +0 -535
- data/dependencies/SDL/include/SDL3/SDL_clipboard.h +0 -331
- data/dependencies/SDL/include/SDL3/SDL_cpuinfo.h +0 -374
- data/dependencies/SDL/include/SDL3/SDL_dialog.h +0 -343
- data/dependencies/SDL/include/SDL3/SDL_dlopennote.h +0 -234
- data/dependencies/SDL/include/SDL3/SDL_endian.h +0 -645
- data/dependencies/SDL/include/SDL3/SDL_error.h +0 -226
- data/dependencies/SDL/include/SDL3/SDL_events.h +0 -1651
- data/dependencies/SDL/include/SDL3/SDL_filesystem.h +0 -537
- data/dependencies/SDL/include/SDL3/SDL_gamepad.h +0 -1657
- data/dependencies/SDL/include/SDL3/SDL_gpu.h +0 -4637
- data/dependencies/SDL/include/SDL3/SDL_guid.h +0 -106
- data/dependencies/SDL/include/SDL3/SDL_haptic.h +0 -1461
- data/dependencies/SDL/include/SDL3/SDL_hidapi.h +0 -571
- data/dependencies/SDL/include/SDL3/SDL_hints.h +0 -5041
- data/dependencies/SDL/include/SDL3/SDL_init.h +0 -508
- data/dependencies/SDL/include/SDL3/SDL_intrin.h +0 -410
- data/dependencies/SDL/include/SDL3/SDL_iostream.h +0 -1379
- data/dependencies/SDL/include/SDL3/SDL_joystick.h +0 -1385
- data/dependencies/SDL/include/SDL3/SDL_keyboard.h +0 -615
- data/dependencies/SDL/include/SDL3/SDL_keycode.h +0 -348
- data/dependencies/SDL/include/SDL3/SDL_loadso.h +0 -145
- data/dependencies/SDL/include/SDL3/SDL_log.h +0 -541
- data/dependencies/SDL/include/SDL3/SDL_main.h +0 -704
- data/dependencies/SDL/include/SDL3/SDL_main_impl.h +0 -149
- data/dependencies/SDL/include/SDL3/SDL_mouse.h +0 -813
- data/dependencies/SDL/include/SDL3/SDL_mutex.h +0 -1117
- data/dependencies/SDL/include/SDL3/SDL_oldnames.h +0 -1339
- data/dependencies/SDL/include/SDL3/SDL_pen.h +0 -198
- data/dependencies/SDL/include/SDL3/SDL_pixels.h +0 -1441
- data/dependencies/SDL/include/SDL3/SDL_platform_defines.h +0 -497
- data/dependencies/SDL/include/SDL3/SDL_process.h +0 -441
- data/dependencies/SDL/include/SDL3/SDL_properties.h +0 -572
- data/dependencies/SDL/include/SDL3/SDL_rect.h +0 -528
- data/dependencies/SDL/include/SDL3/SDL_render.h +0 -3034
- data/dependencies/SDL/include/SDL3/SDL_revision.h +0 -56
- data/dependencies/SDL/include/SDL3/SDL_sensor.h +0 -321
- data/dependencies/SDL/include/SDL3/SDL_stdinc.h +0 -6186
- data/dependencies/SDL/include/SDL3/SDL_storage.h +0 -686
- data/dependencies/SDL/include/SDL3/SDL_surface.h +0 -1769
- data/dependencies/SDL/include/SDL3/SDL_system.h +0 -840
- data/dependencies/SDL/include/SDL3/SDL_test_log.h +0 -83
- data/dependencies/SDL/include/SDL3/SDL_thread.h +0 -602
- data/dependencies/SDL/include/SDL3/SDL_time.h +0 -249
- data/dependencies/SDL/include/SDL3/SDL_timer.h +0 -454
- data/dependencies/SDL/include/SDL3/SDL_touch.h +0 -184
- data/dependencies/SDL/include/SDL3/SDL_tray.h +0 -544
- data/dependencies/SDL/include/SDL3/SDL_version.h +0 -198
- data/dependencies/SDL/include/SDL3/SDL_video.h +0 -3497
- data/dependencies/SDL/include/SDL3/SDL_vulkan.h +0 -287
- data/dependencies/SDL/lib/x64/libSDL3.dll.a +0 -0
- data/dependencies/SDL/lib/x86/libSDL3.dll.a +0 -0
- data/dependencies/SDL_sound/SDL3_sound/SDL_sound.h +0 -755
- data/lib/SDL3.dll +0 -0
- data/lib64/SDL3.dll +0 -0
- data/src/ClipRectStack.cpp +0 -38
- /data/dependencies/SDL/include/{SDL3/SDL_opengl_glext.h → SDL_opengl_glext.h} +0 -0
- /data/dependencies/SDL/include/{SDL3/SDL_opengles2_gl2.h → SDL_opengles2_gl2.h} +0 -0
- /data/dependencies/SDL/include/{SDL3/SDL_opengles2_gl2ext.h → SDL_opengles2_gl2ext.h} +0 -0
- /data/dependencies/SDL/include/{SDL3/SDL_opengles2_gl2platform.h → SDL_opengles2_gl2platform.h} +0 -0
- /data/dependencies/SDL/include/{SDL3/SDL_opengles2_khrplatform.h → SDL_opengles2_khrplatform.h} +0 -0
|
@@ -36,16 +36,16 @@
|
|
|
36
36
|
*
|
|
37
37
|
* The features of utf8proc include:
|
|
38
38
|
*
|
|
39
|
-
* - Transformation of strings (utf8proc_map
|
|
39
|
+
* - Transformation of strings (@ref utf8proc_map) to:
|
|
40
40
|
* - decompose (@ref UTF8PROC_DECOMPOSE) or compose (@ref UTF8PROC_COMPOSE) Unicode combining characters (http://en.wikipedia.org/wiki/Combining_character)
|
|
41
41
|
* - canonicalize Unicode compatibility characters (@ref UTF8PROC_COMPAT)
|
|
42
42
|
* - strip "ignorable" (@ref UTF8PROC_IGNORE) characters, control characters (@ref UTF8PROC_STRIPCC), or combining characters such as accents (@ref UTF8PROC_STRIPMARK)
|
|
43
43
|
* - case-folding (@ref UTF8PROC_CASEFOLD)
|
|
44
|
-
* - Unicode normalization: utf8proc_NFD
|
|
45
|
-
* - Detecting grapheme boundaries (utf8proc_grapheme_break
|
|
46
|
-
* - Character-width computation: utf8proc_charwidth
|
|
47
|
-
* - Classification of characters by Unicode category: utf8proc_category
|
|
48
|
-
* - Encode (utf8proc_encode_char
|
|
44
|
+
* - Unicode normalization: @ref utf8proc_NFD, @ref utf8proc_NFC, @ref utf8proc_NFKD, @ref utf8proc_NFKC
|
|
45
|
+
* - Detecting grapheme boundaries (@ref utf8proc_grapheme_break and @ref UTF8PROC_CHARBOUND)
|
|
46
|
+
* - Character-width computation: @ref utf8proc_charwidth
|
|
47
|
+
* - Classification of characters by Unicode category: @ref utf8proc_category and @ref utf8proc_category_string
|
|
48
|
+
* - Encode (@ref utf8proc_encode_char) and decode (@ref utf8proc_iterate) Unicode codepoints to/from UTF-8.
|
|
49
49
|
*/
|
|
50
50
|
|
|
51
51
|
/** @file */
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
* semantic-versioning rules (http://semver.org) based on API
|
|
60
60
|
* compatibility.
|
|
61
61
|
*
|
|
62
|
-
* This is also returned at runtime by utf8proc_version
|
|
62
|
+
* This is also returned at runtime by @ref utf8proc_version; however, the
|
|
63
63
|
* runtime version may append a string like "-dev" to the version number
|
|
64
64
|
* for prerelease versions.
|
|
65
65
|
*
|
|
@@ -71,7 +71,7 @@
|
|
|
71
71
|
/** The MAJOR version number (increased when backwards API compatibility is broken). */
|
|
72
72
|
#define UTF8PROC_VERSION_MAJOR 2
|
|
73
73
|
/** The MINOR version number (increased when new functionality is added in a backwards-compatible manner). */
|
|
74
|
-
#define UTF8PROC_VERSION_MINOR
|
|
74
|
+
#define UTF8PROC_VERSION_MINOR 8
|
|
75
75
|
/** The PATCH version (increased for fixes that do not change the API). */
|
|
76
76
|
#define UTF8PROC_VERSION_PATCH 0
|
|
77
77
|
/** @} */
|
|
@@ -79,7 +79,7 @@
|
|
|
79
79
|
#include <stdlib.h>
|
|
80
80
|
|
|
81
81
|
#if defined(_MSC_VER) && _MSC_VER < 1800
|
|
82
|
-
// MSVC prior to 2013 lacked stdbool.h and
|
|
82
|
+
// MSVC prior to 2013 lacked stdbool.h and inttypes.h
|
|
83
83
|
typedef signed char utf8proc_int8_t;
|
|
84
84
|
typedef unsigned char utf8proc_uint8_t;
|
|
85
85
|
typedef short utf8proc_int16_t;
|
|
@@ -107,7 +107,7 @@ typedef bool utf8proc_bool;
|
|
|
107
107
|
#else
|
|
108
108
|
# include <stddef.h>
|
|
109
109
|
# include <stdbool.h>
|
|
110
|
-
# include <
|
|
110
|
+
# include <inttypes.h>
|
|
111
111
|
typedef int8_t utf8proc_int8_t;
|
|
112
112
|
typedef uint8_t utf8proc_uint8_t;
|
|
113
113
|
typedef int16_t utf8proc_int16_t;
|
|
@@ -121,9 +121,7 @@ typedef bool utf8proc_bool;
|
|
|
121
121
|
#include <limits.h>
|
|
122
122
|
|
|
123
123
|
#ifdef UTF8PROC_STATIC
|
|
124
|
-
#
|
|
125
|
-
# define UTF8PROC_DLLEXPORT
|
|
126
|
-
# endif
|
|
124
|
+
# define UTF8PROC_DLLEXPORT
|
|
127
125
|
#else
|
|
128
126
|
# ifdef _WIN32
|
|
129
127
|
# ifdef UTF8PROC_EXPORTS
|
|
@@ -143,9 +141,7 @@ extern "C" {
|
|
|
143
141
|
#endif
|
|
144
142
|
|
|
145
143
|
/**
|
|
146
|
-
* Option flags used by several functions in the library.
|
|
147
|
-
* `unsigned int options` arguments, you can pass a bitwise-or of these
|
|
148
|
-
* enumerated constants.
|
|
144
|
+
* Option flags used by several functions in the library.
|
|
149
145
|
*/
|
|
150
146
|
typedef enum {
|
|
151
147
|
/** The given UTF-8 input is NULL terminated. */
|
|
@@ -154,7 +150,7 @@ typedef enum {
|
|
|
154
150
|
UTF8PROC_STABLE = (1<<1),
|
|
155
151
|
/** Compatibility decomposition (i.e. formatting information is lost). */
|
|
156
152
|
UTF8PROC_COMPAT = (1<<2),
|
|
157
|
-
/** Return a result with
|
|
153
|
+
/** Return a result with decomposed characters. */
|
|
158
154
|
UTF8PROC_COMPOSE = (1<<3),
|
|
159
155
|
/** Return a result with decomposed characters. */
|
|
160
156
|
UTF8PROC_DECOMPOSE = (1<<4),
|
|
@@ -212,7 +208,7 @@ typedef enum {
|
|
|
212
208
|
/**
|
|
213
209
|
* Strip unassigned codepoints.
|
|
214
210
|
*/
|
|
215
|
-
UTF8PROC_STRIPNA = (1<<14)
|
|
211
|
+
UTF8PROC_STRIPNA = (1<<14),
|
|
216
212
|
} utf8proc_option_t;
|
|
217
213
|
|
|
218
214
|
/** @name Error codes
|
|
@@ -259,64 +255,25 @@ typedef struct utf8proc_property_struct {
|
|
|
259
255
|
utf8proc_uint16_t uppercase_seqindex;
|
|
260
256
|
utf8proc_uint16_t lowercase_seqindex;
|
|
261
257
|
utf8proc_uint16_t titlecase_seqindex;
|
|
262
|
-
|
|
263
|
-
* Character combining table.
|
|
264
|
-
*
|
|
265
|
-
* The character combining table is formally indexed by two
|
|
266
|
-
* characters, the first and second character that might form a
|
|
267
|
-
* combining pair. The table entry then contains the combined
|
|
268
|
-
* character. Most character pairs cannot be combined. There are
|
|
269
|
-
* about 1,000 characters that can be the first character in a
|
|
270
|
-
* combining pair, and for most, there are only a handful for
|
|
271
|
-
* possible second characters.
|
|
272
|
-
*
|
|
273
|
-
* The combining table is stored as sparse matrix in the CSR
|
|
274
|
-
* (compressed sparse row) format. That is, it is stored as two
|
|
275
|
-
* arrays, `utf8proc_uint32_t utf8proc_combinations_second[]` and
|
|
276
|
-
* `utf8proc_uint32_t utf8proc_combinations_combined[]`. These
|
|
277
|
-
* contain the second combining characters and the combined
|
|
278
|
-
* character of every combining pair.
|
|
279
|
-
*
|
|
280
|
-
* - `comb_index`: Index into the combining table if this character
|
|
281
|
-
* is the first character in a combining pair, else 0x3ff
|
|
282
|
-
*
|
|
283
|
-
* - `comb_length`: Number of table entries for this first character
|
|
284
|
-
*
|
|
285
|
-
* - `comb_is_second`: As optimization we also record whether this
|
|
286
|
-
* character is the second combining character in any pair. If
|
|
287
|
-
* not, we can skip the table lookup.
|
|
288
|
-
*
|
|
289
|
-
* A table lookup starts from a given character pair. It first
|
|
290
|
-
* checks whether the first character is stored in the table
|
|
291
|
-
* (checking whether the index is 0x3ff) and whether the second
|
|
292
|
-
* index is stored in the table (looking at `comb_is_second`). If
|
|
293
|
-
* so, the `comb_length` table entries will be checked sequentially
|
|
294
|
-
* for a match.
|
|
295
|
-
*/
|
|
296
|
-
utf8proc_uint16_t comb_index:10;
|
|
297
|
-
utf8proc_uint16_t comb_length:5;
|
|
298
|
-
utf8proc_uint16_t comb_issecond:1;
|
|
258
|
+
utf8proc_uint16_t comb_index;
|
|
299
259
|
unsigned bidi_mirrored:1;
|
|
300
260
|
unsigned comp_exclusion:1;
|
|
301
261
|
/**
|
|
302
262
|
* Can this codepoint be ignored?
|
|
303
263
|
*
|
|
304
|
-
* Used by utf8proc_decompose_char
|
|
264
|
+
* Used by @ref utf8proc_decompose_char when @ref UTF8PROC_IGNORE is
|
|
305
265
|
* passed as an option.
|
|
306
266
|
*/
|
|
307
267
|
unsigned ignorable:1;
|
|
308
268
|
unsigned control_boundary:1;
|
|
309
269
|
/** The width of the codepoint. */
|
|
310
270
|
unsigned charwidth:2;
|
|
311
|
-
|
|
312
|
-
unsigned ambiguous_width:1;
|
|
313
|
-
unsigned pad:1;
|
|
271
|
+
unsigned pad:2;
|
|
314
272
|
/**
|
|
315
273
|
* Boundclass.
|
|
316
274
|
* @see utf8proc_boundclass_t.
|
|
317
275
|
*/
|
|
318
|
-
unsigned boundclass:
|
|
319
|
-
unsigned indic_conjunct_break:2;
|
|
276
|
+
unsigned boundclass:8;
|
|
320
277
|
} utf8proc_property_t;
|
|
321
278
|
|
|
322
279
|
/** Unicode categories. */
|
|
@@ -350,7 +307,7 @@ typedef enum {
|
|
|
350
307
|
UTF8PROC_CATEGORY_CC = 26, /**< Other, control */
|
|
351
308
|
UTF8PROC_CATEGORY_CF = 27, /**< Other, format */
|
|
352
309
|
UTF8PROC_CATEGORY_CS = 28, /**< Other, surrogate */
|
|
353
|
-
UTF8PROC_CATEGORY_CO = 29
|
|
310
|
+
UTF8PROC_CATEGORY_CO = 29, /**< Other, private use */
|
|
354
311
|
} utf8proc_category_t;
|
|
355
312
|
|
|
356
313
|
/** Bidirectional character classes. */
|
|
@@ -377,7 +334,7 @@ typedef enum {
|
|
|
377
334
|
UTF8PROC_BIDI_CLASS_LRI = 20, /**< Left-to-Right Isolate */
|
|
378
335
|
UTF8PROC_BIDI_CLASS_RLI = 21, /**< Right-to-Left Isolate */
|
|
379
336
|
UTF8PROC_BIDI_CLASS_FSI = 22, /**< First Strong Isolate */
|
|
380
|
-
UTF8PROC_BIDI_CLASS_PDI = 23
|
|
337
|
+
UTF8PROC_BIDI_CLASS_PDI = 23, /**< Pop Directional Isolate */
|
|
381
338
|
} utf8proc_bidi_class_t;
|
|
382
339
|
|
|
383
340
|
/** Decomposition type. */
|
|
@@ -397,7 +354,7 @@ typedef enum {
|
|
|
397
354
|
UTF8PROC_DECOMP_TYPE_SMALL = 13, /**< Small */
|
|
398
355
|
UTF8PROC_DECOMP_TYPE_SQUARE = 14, /**< Square */
|
|
399
356
|
UTF8PROC_DECOMP_TYPE_FRACTION = 15, /**< Fraction */
|
|
400
|
-
UTF8PROC_DECOMP_TYPE_COMPAT = 16
|
|
357
|
+
UTF8PROC_DECOMP_TYPE_COMPAT = 16, /**< Compat */
|
|
401
358
|
} utf8proc_decomp_type_t;
|
|
402
359
|
|
|
403
360
|
/** Boundclass property. (TR29) */
|
|
@@ -428,20 +385,12 @@ typedef enum {
|
|
|
428
385
|
/* the Extended_Pictographic property is used in the Unicode 11
|
|
429
386
|
grapheme-boundary rules, so we store it in the boundclass field */
|
|
430
387
|
UTF8PROC_BOUNDCLASS_EXTENDED_PICTOGRAPHIC = 19,
|
|
431
|
-
UTF8PROC_BOUNDCLASS_E_ZWG = 20
|
|
388
|
+
UTF8PROC_BOUNDCLASS_E_ZWG = 20, /* UTF8PROC_BOUNDCLASS_EXTENDED_PICTOGRAPHIC + ZWJ */
|
|
432
389
|
} utf8proc_boundclass_t;
|
|
433
390
|
|
|
434
|
-
/** Indic_Conjunct_Break property. (TR44) */
|
|
435
|
-
typedef enum {
|
|
436
|
-
UTF8PROC_INDIC_CONJUNCT_BREAK_NONE = 0,
|
|
437
|
-
UTF8PROC_INDIC_CONJUNCT_BREAK_LINKER = 1,
|
|
438
|
-
UTF8PROC_INDIC_CONJUNCT_BREAK_CONSONANT = 2,
|
|
439
|
-
UTF8PROC_INDIC_CONJUNCT_BREAK_EXTEND = 3
|
|
440
|
-
} utf8proc_indic_conjunct_break_t;
|
|
441
|
-
|
|
442
391
|
/**
|
|
443
|
-
* Function pointer type passed to utf8proc_map_custom
|
|
444
|
-
* utf8proc_decompose_custom
|
|
392
|
+
* Function pointer type passed to @ref utf8proc_map_custom and
|
|
393
|
+
* @ref utf8proc_decompose_custom, which is used to specify a user-defined
|
|
445
394
|
* mapping of codepoints to be applied in conjunction with other mappings.
|
|
446
395
|
*/
|
|
447
396
|
typedef utf8proc_int32_t (*utf8proc_custom_func)(utf8proc_int32_t codepoint, void *data);
|
|
@@ -466,7 +415,7 @@ UTF8PROC_DLLEXPORT const char *utf8proc_unicode_version(void);
|
|
|
466
415
|
|
|
467
416
|
/**
|
|
468
417
|
* Returns an informative error string for the given utf8proc error code
|
|
469
|
-
* (e.g. the error codes returned by utf8proc_map
|
|
418
|
+
* (e.g. the error codes returned by @ref utf8proc_map).
|
|
470
419
|
*/
|
|
471
420
|
UTF8PROC_DLLEXPORT const char *utf8proc_errmsg(utf8proc_ssize_t errcode);
|
|
472
421
|
|
|
@@ -521,7 +470,7 @@ UTF8PROC_DLLEXPORT const utf8proc_property_t *utf8proc_get_property(utf8proc_int
|
|
|
521
470
|
* @param dst the destination buffer.
|
|
522
471
|
* @param bufsize the size of the destination buffer.
|
|
523
472
|
* @param options one or more of the following flags:
|
|
524
|
-
* - @ref UTF8PROC_REJECTNA - return an error
|
|
473
|
+
* - @ref UTF8PROC_REJECTNA - return an error `codepoint` is unassigned
|
|
525
474
|
* - @ref UTF8PROC_IGNORE - strip "default ignorable" codepoints
|
|
526
475
|
* - @ref UTF8PROC_CASEFOLD - apply Unicode casefolding
|
|
527
476
|
* - @ref UTF8PROC_COMPAT - replace certain codepoints with their
|
|
@@ -532,18 +481,12 @@ UTF8PROC_DLLEXPORT const utf8proc_property_t *utf8proc_get_property(utf8proc_int
|
|
|
532
481
|
* - @ref UTF8PROC_STRIPNA - remove unassigned codepoints
|
|
533
482
|
* @param last_boundclass
|
|
534
483
|
* Pointer to an integer variable containing
|
|
535
|
-
* the previous codepoint's
|
|
536
|
-
* option is used.
|
|
537
|
-
* the beginning of the string, and is thereafter updated automatically. Otherwise, this parameter is ignored.
|
|
538
|
-
*
|
|
539
|
-
* In the current version of utf8proc, the maximum destination buffer with the @ref UTF8PROC_DECOMPOSE
|
|
540
|
-
* option is 4 elements (or double that with @ref UTF8PROC_CHARBOUND), so this is a good default size.
|
|
541
|
-
* However, this may increase in future Unicode versions, so you should always check the return value
|
|
542
|
-
* as described below.
|
|
484
|
+
* the previous codepoint's boundary class if the @ref UTF8PROC_CHARBOUND
|
|
485
|
+
* option is used. Otherwise, this parameter is ignored.
|
|
543
486
|
*
|
|
544
487
|
* @return
|
|
545
488
|
* In case of success, the number of codepoints written is returned; in case
|
|
546
|
-
* of an error, a negative error code is returned (utf8proc_errmsg
|
|
489
|
+
* of an error, a negative error code is returned (@ref utf8proc_errmsg).
|
|
547
490
|
* @par
|
|
548
491
|
* If the number of written codepoints would be bigger than `bufsize`, the
|
|
549
492
|
* required buffer size is returned, while the buffer will be overwritten with
|
|
@@ -551,11 +494,11 @@ UTF8PROC_DLLEXPORT const utf8proc_property_t *utf8proc_get_property(utf8proc_int
|
|
|
551
494
|
*/
|
|
552
495
|
UTF8PROC_DLLEXPORT utf8proc_ssize_t utf8proc_decompose_char(
|
|
553
496
|
utf8proc_int32_t codepoint, utf8proc_int32_t *dst, utf8proc_ssize_t bufsize,
|
|
554
|
-
|
|
497
|
+
utf8proc_option_t options, int *last_boundclass
|
|
555
498
|
);
|
|
556
499
|
|
|
557
500
|
/**
|
|
558
|
-
* The same as utf8proc_decompose_char
|
|
501
|
+
* The same as @ref utf8proc_decompose_char, but acts on a whole UTF-8
|
|
559
502
|
* string and orders the decomposed sequences correctly.
|
|
560
503
|
*
|
|
561
504
|
* If the @ref UTF8PROC_NULLTERM flag in `options` is set, processing
|
|
@@ -564,8 +507,8 @@ UTF8PROC_DLLEXPORT utf8proc_ssize_t utf8proc_decompose_char(
|
|
|
564
507
|
* codepoints) is written into the buffer being pointed to by
|
|
565
508
|
* `buffer` (which must contain at least `bufsize` entries). In case of
|
|
566
509
|
* success, the number of codepoints written is returned; in case of an
|
|
567
|
-
* error, a negative error code is returned (utf8proc_errmsg
|
|
568
|
-
* See utf8proc_decompose_custom
|
|
510
|
+
* error, a negative error code is returned (@ref utf8proc_errmsg).
|
|
511
|
+
* See @ref utf8proc_decompose_custom to supply additional transformations.
|
|
569
512
|
*
|
|
570
513
|
* If the number of written codepoints would be bigger than `bufsize`, the
|
|
571
514
|
* required buffer size is returned, while the buffer will be overwritten with
|
|
@@ -573,18 +516,18 @@ UTF8PROC_DLLEXPORT utf8proc_ssize_t utf8proc_decompose_char(
|
|
|
573
516
|
*/
|
|
574
517
|
UTF8PROC_DLLEXPORT utf8proc_ssize_t utf8proc_decompose(
|
|
575
518
|
const utf8proc_uint8_t *str, utf8proc_ssize_t strlen,
|
|
576
|
-
utf8proc_int32_t *buffer, utf8proc_ssize_t bufsize,
|
|
519
|
+
utf8proc_int32_t *buffer, utf8proc_ssize_t bufsize, utf8proc_option_t options
|
|
577
520
|
);
|
|
578
521
|
|
|
579
522
|
/**
|
|
580
|
-
* The same as utf8proc_decompose
|
|
523
|
+
* The same as @ref utf8proc_decompose, but also takes a `custom_func` mapping function
|
|
581
524
|
* that is called on each codepoint in `str` before any other transformations
|
|
582
525
|
* (along with a `custom_data` pointer that is passed through to `custom_func`).
|
|
583
|
-
* The `custom_func` argument is ignored if it is `NULL`. See also utf8proc_map_custom
|
|
526
|
+
* The `custom_func` argument is ignored if it is `NULL`. See also @ref utf8proc_map_custom.
|
|
584
527
|
*/
|
|
585
528
|
UTF8PROC_DLLEXPORT utf8proc_ssize_t utf8proc_decompose_custom(
|
|
586
529
|
const utf8proc_uint8_t *str, utf8proc_ssize_t strlen,
|
|
587
|
-
utf8proc_int32_t *buffer, utf8proc_ssize_t bufsize,
|
|
530
|
+
utf8proc_int32_t *buffer, utf8proc_ssize_t bufsize, utf8proc_option_t options,
|
|
588
531
|
utf8proc_custom_func custom_func, void *custom_data
|
|
589
532
|
);
|
|
590
533
|
|
|
@@ -606,9 +549,12 @@ UTF8PROC_DLLEXPORT utf8proc_ssize_t utf8proc_decompose_custom(
|
|
|
606
549
|
*
|
|
607
550
|
* @return
|
|
608
551
|
* In case of success, the length (in codepoints) of the normalized UTF-32 string is
|
|
609
|
-
* returned; otherwise, a negative error code is returned (utf8proc_errmsg
|
|
552
|
+
* returned; otherwise, a negative error code is returned (@ref utf8proc_errmsg).
|
|
553
|
+
*
|
|
554
|
+
* @warning The entries of the array pointed to by `str` have to be in the
|
|
555
|
+
* range `0x0000` to `0x10FFFF`. Otherwise, the program might crash!
|
|
610
556
|
*/
|
|
611
|
-
UTF8PROC_DLLEXPORT utf8proc_ssize_t utf8proc_normalize_utf32(utf8proc_int32_t *buffer, utf8proc_ssize_t length,
|
|
557
|
+
UTF8PROC_DLLEXPORT utf8proc_ssize_t utf8proc_normalize_utf32(utf8proc_int32_t *buffer, utf8proc_ssize_t length, utf8proc_option_t options);
|
|
612
558
|
|
|
613
559
|
/**
|
|
614
560
|
* Reencodes the sequence of `length` codepoints pointed to by `buffer`
|
|
@@ -631,14 +577,14 @@ UTF8PROC_DLLEXPORT utf8proc_ssize_t utf8proc_normalize_utf32(utf8proc_int32_t *b
|
|
|
631
577
|
* @return
|
|
632
578
|
* In case of success, the length (in bytes) of the resulting nul-terminated
|
|
633
579
|
* UTF-8 string is returned; otherwise, a negative error code is returned
|
|
634
|
-
* (utf8proc_errmsg
|
|
580
|
+
* (@ref utf8proc_errmsg).
|
|
635
581
|
*
|
|
636
582
|
* @warning The amount of free space pointed to by `buffer` must
|
|
637
583
|
* exceed the amount of the input data by one byte, and the
|
|
638
584
|
* entries of the array pointed to by `str` have to be in the
|
|
639
585
|
* range `0x0000` to `0x10FFFF`. Otherwise, the program might crash!
|
|
640
586
|
*/
|
|
641
|
-
UTF8PROC_DLLEXPORT utf8proc_ssize_t utf8proc_reencode(utf8proc_int32_t *buffer, utf8proc_ssize_t length,
|
|
587
|
+
UTF8PROC_DLLEXPORT utf8proc_ssize_t utf8proc_reencode(utf8proc_int32_t *buffer, utf8proc_ssize_t length, utf8proc_option_t options);
|
|
642
588
|
|
|
643
589
|
/**
|
|
644
590
|
* Given a pair of consecutive codepoints, return whether a grapheme break is
|
|
@@ -661,7 +607,7 @@ UTF8PROC_DLLEXPORT utf8proc_bool utf8proc_grapheme_break_stateful(
|
|
|
661
607
|
utf8proc_int32_t codepoint1, utf8proc_int32_t codepoint2, utf8proc_int32_t *state);
|
|
662
608
|
|
|
663
609
|
/**
|
|
664
|
-
* Same as utf8proc_grapheme_break_stateful
|
|
610
|
+
* Same as @ref utf8proc_grapheme_break_stateful, except without support for the
|
|
665
611
|
* Unicode 9 additions to the algorithm. Supported for legacy reasons.
|
|
666
612
|
*/
|
|
667
613
|
UTF8PROC_DLLEXPORT utf8proc_bool utf8proc_grapheme_break(
|
|
@@ -708,17 +654,9 @@ UTF8PROC_DLLEXPORT int utf8proc_isupper(utf8proc_int32_t c);
|
|
|
708
654
|
*
|
|
709
655
|
* @note
|
|
710
656
|
* If you want to check for particular types of non-printable characters,
|
|
711
|
-
* (analogous to `isprint` or `iscntrl`), use utf8proc_category
|
|
657
|
+
* (analogous to `isprint` or `iscntrl`), use @ref utf8proc_category. */
|
|
712
658
|
UTF8PROC_DLLEXPORT int utf8proc_charwidth(utf8proc_int32_t codepoint);
|
|
713
659
|
|
|
714
|
-
/**
|
|
715
|
-
* Given a codepoint, return whether it has East Asian width class A (Ambiguous)
|
|
716
|
-
*
|
|
717
|
-
* Codepoints with this property are considered to have charwidth 1 (if they are printable)
|
|
718
|
-
* but some East Asian fonts render them as double width.
|
|
719
|
-
*/
|
|
720
|
-
UTF8PROC_DLLEXPORT utf8proc_bool utf8proc_charwidth_ambiguous(utf8proc_int32_t codepoint);
|
|
721
|
-
|
|
722
660
|
/**
|
|
723
661
|
* Return the Unicode category for the codepoint (one of the
|
|
724
662
|
* @ref utf8proc_category_t constants.)
|
|
@@ -742,22 +680,16 @@ UTF8PROC_DLLEXPORT const char *utf8proc_category_string(utf8proc_int32_t codepoi
|
|
|
742
680
|
* contain NULL characters with the string if `str` contained NULL
|
|
743
681
|
* characters). Other flags in the `options` field are passed to the
|
|
744
682
|
* functions defined above, and regarded as described. See also
|
|
745
|
-
* utf8proc_map_custom
|
|
683
|
+
* @ref utf8proc_map_custom to supply a custom codepoint transformation.
|
|
746
684
|
*
|
|
747
685
|
* In case of success the length of the new string is returned,
|
|
748
686
|
* otherwise a negative error code is returned.
|
|
749
687
|
*
|
|
750
688
|
* @note The memory of the new UTF-8 string will have been allocated
|
|
751
689
|
* with `malloc`, and should therefore be deallocated with `free`.
|
|
752
|
-
* However, it is safer to deallocate it with @ref utf8proc_free in
|
|
753
|
-
* case your application is linked to a different C library than utf8proc.
|
|
754
|
-
*
|
|
755
|
-
* @note `utf8proc_map` simply calls `utf8proc_decompose` followed by `utf8proc_reencode`,
|
|
756
|
-
* and applications requiring greater control over memory allocation should instead call
|
|
757
|
-
* those two functions directly.
|
|
758
690
|
*/
|
|
759
691
|
UTF8PROC_DLLEXPORT utf8proc_ssize_t utf8proc_map(
|
|
760
|
-
const utf8proc_uint8_t *str, utf8proc_ssize_t strlen, utf8proc_uint8_t **dstptr,
|
|
692
|
+
const utf8proc_uint8_t *str, utf8proc_ssize_t strlen, utf8proc_uint8_t **dstptr, utf8proc_option_t options
|
|
761
693
|
);
|
|
762
694
|
|
|
763
695
|
/**
|
|
@@ -767,7 +699,7 @@ UTF8PROC_DLLEXPORT utf8proc_ssize_t utf8proc_map(
|
|
|
767
699
|
* The `custom_func` argument is ignored if it is `NULL`.
|
|
768
700
|
*/
|
|
769
701
|
UTF8PROC_DLLEXPORT utf8proc_ssize_t utf8proc_map_custom(
|
|
770
|
-
const utf8proc_uint8_t *str, utf8proc_ssize_t strlen, utf8proc_uint8_t **dstptr,
|
|
702
|
+
const utf8proc_uint8_t *str, utf8proc_ssize_t strlen, utf8proc_uint8_t **dstptr, utf8proc_option_t options,
|
|
771
703
|
utf8proc_custom_func custom_func, void *custom_data
|
|
772
704
|
);
|
|
773
705
|
|
|
@@ -775,13 +707,8 @@ UTF8PROC_DLLEXPORT utf8proc_ssize_t utf8proc_map_custom(
|
|
|
775
707
|
*
|
|
776
708
|
* Returns a pointer to newly allocated memory of a NFD, NFC, NFKD, NFKC or
|
|
777
709
|
* NFKC_Casefold normalized version of the null-terminated string `str`. These
|
|
778
|
-
* are shortcuts to calling utf8proc_map
|
|
710
|
+
* are shortcuts to calling @ref utf8proc_map with @ref UTF8PROC_NULLTERM
|
|
779
711
|
* combined with @ref UTF8PROC_STABLE and flags indicating the normalization.
|
|
780
|
-
*
|
|
781
|
-
* @note The memory of the new UTF-8 string will have been allocated
|
|
782
|
-
* with `malloc`, and should therefore be deallocated with `free`.
|
|
783
|
-
* However, it is safer to deallocate it with @ref utf8proc_free in
|
|
784
|
-
* case your application is linked to a different C library than utf8proc.
|
|
785
712
|
*/
|
|
786
713
|
/** @{ */
|
|
787
714
|
/** NFD normalization (@ref UTF8PROC_DECOMPOSE). */
|
|
@@ -799,14 +726,6 @@ UTF8PROC_DLLEXPORT utf8proc_uint8_t *utf8proc_NFKC(const utf8proc_uint8_t *str);
|
|
|
799
726
|
UTF8PROC_DLLEXPORT utf8proc_uint8_t *utf8proc_NFKC_Casefold(const utf8proc_uint8_t *str);
|
|
800
727
|
/** @} */
|
|
801
728
|
|
|
802
|
-
/**
|
|
803
|
-
* Deallocate memory allocated and returned by @ref utf8proc_map and similar functions
|
|
804
|
-
* (which simply calls the `free` function from the underlying C library linked to utf8proc).
|
|
805
|
-
* It is safer to call `utf8proc_free` than calling `free` directly, in case your application
|
|
806
|
-
* is linked to a different C library with incompatible `malloc` and `free` functions.
|
|
807
|
-
*/
|
|
808
|
-
UTF8PROC_DLLEXPORT void utf8proc_free(utf8proc_uint8_t *ptr);
|
|
809
|
-
|
|
810
729
|
#ifdef __cplusplus
|
|
811
730
|
}
|
|
812
731
|
#endif
|