diff options
| author | skytrias <skytrias@protonmail.com> | 2024-03-18 22:32:16 +0100 |
|---|---|---|
| committer | skytrias <skytrias@protonmail.com> | 2024-03-18 22:32:16 +0100 |
| commit | ba46b0a5351a1deef1b008cfebd6f15b4ac291fc (patch) | |
| tree | be6913361ca66ed789b8818dc9b068590e32d00b | |
| parent | bca4c37f02879ba0b7e4f488659600da9d086d4d (diff) | |
distinct, const format, proper cstring parameters
| -rw-r--r-- | core/sys/orca/app.odin | 2 | ||||
| -rw-r--r-- | core/sys/orca/graphics.odin | 12 | ||||
| -rw-r--r-- | core/sys/orca/utf8.odin | 248 | ||||
| -rw-r--r-- | core/sys/orca/util.odin | 10 |
4 files changed, 135 insertions, 137 deletions
diff --git a/core/sys/orca/app.odin b/core/sys/orca/app.odin index 174df5d90..0cf42b80b 100644 --- a/core/sys/orca/app.odin +++ b/core/sys/orca/app.odin @@ -2,7 +2,7 @@ package orca import "core:c" -window :: u64 +window :: distinct u64 mouse_cursor :: enum c.int { ARROW, diff --git a/core/sys/orca/graphics.odin b/core/sys/orca/graphics.odin index d1aa59ef8..b2cfb7980 100644 --- a/core/sys/orca/graphics.odin +++ b/core/sys/orca/graphics.odin @@ -3,14 +3,14 @@ package orca import "core:c" // types -color :: [4]f32 -utf32 :: u32 +color :: distinct [4]f32 +utf32 :: rune // handles -surface :: u64 -font :: u64 -image :: u64 -canvas :: u64 +surface :: distinct u64 +font :: distinct u64 +image :: distinct u64 +canvas :: distinct u64 joint_type :: enum c.int { MITER, diff --git a/core/sys/orca/utf8.odin b/core/sys/orca/utf8.odin index 5b86f0c19..4800fb3fa 100644 --- a/core/sys/orca/utf8.odin +++ b/core/sys/orca/utf8.odin @@ -5,127 +5,127 @@ unicode_range :: struct { count: u32, } -UNICODE_BASIC_LATIN:: unicode_range { 0x0000, 127 } -UNICODE_C1_CONTROLS_AND_LATIN_1_SUPPLEMENT:: unicode_range { 0x0080, 127 } -UNICODE_LATIN_EXTENDED_A:: unicode_range { 0x0100, 127 } -UNICODE_LATIN_EXTENDED_B:: unicode_range { 0x0180, 207 } -UNICODE_IPA_EXTENSIONS:: unicode_range { 0x0250, 95 } -UNICODE_SPACING_MODIFIER_LETTERS:: unicode_range { 0x02b0, 79 } -UNICODE_COMBINING_DIACRITICAL_MARKS:: unicode_range { 0x0300, 111 } -UNICODE_GREEK_COPTIC:: unicode_range { 0x0370, 143 } -UNICODE_CYRILLIC:: unicode_range { 0x0400, 255 } -UNICODE_CYRILLIC_SUPPLEMENT:: unicode_range { 0x0500, 47 } -UNICODE_ARMENIAN:: unicode_range { 0x0530, 95 } -UNICODE_HEBREW:: unicode_range { 0x0590, 111 } -UNICODE_ARABIC:: unicode_range { 0x0600, 255 } -UNICODE_SYRIAC:: unicode_range { 0x0700, 79 } -UNICODE_THAANA:: unicode_range { 0x0780, 63 } -UNICODE_DEVANAGARI:: unicode_range { 0x0900, 127 } -UNICODE_BENGALI_ASSAMESE:: unicode_range { 0x0980, 127 } -UNICODE_GURMUKHI:: unicode_range { 0x0a00, 127 } -UNICODE_GUJARATI:: unicode_range { 0x0a80, 127 } -UNICODE_ORIYA:: unicode_range { 0x0b00, 127 } -UNICODE_TAMIL:: unicode_range { 0x0b80, 127 } -UNICODE_TELUGU:: unicode_range { 0x0c00, 127 } -UNICODE_KANNADA:: unicode_range { 0x0c80, 127 } -UNICODE_MALAYALAM:: unicode_range { 0x0d00, 255 } -UNICODE_SINHALA:: unicode_range { 0x0d80, 127 } -UNICODE_THAI:: unicode_range { 0x0e00, 127 } -UNICODE_LAO:: unicode_range { 0x0e80, 127 } -UNICODE_TIBETAN:: unicode_range { 0x0f00, 255 } -UNICODE_MYANMAR:: unicode_range { 0x1000, 159 } -UNICODE_GEORGIAN:: unicode_range { 0x10a0, 95 } -UNICODE_HANGUL_JAMO:: unicode_range { 0x1100, 255 } -UNICODE_ETHIOPIC:: unicode_range { 0x1200, 383 } -UNICODE_CHEROKEE:: unicode_range { 0x13a0, 95 } -UNICODE_UNIFIED_CANADIAN_ABORIGINAL_SYLLABICS:: unicode_range { 0x1400, 639 } -UNICODE_OGHAM:: unicode_range { 0x1680, 31 } -UNICODE_RUNIC:: unicode_range { 0x16a0, 95 } -UNICODE_TAGALOG:: unicode_range { 0x1700, 31 } -UNICODE_HANUNOO:: unicode_range { 0x1720, 31 } -UNICODE_BUHID:: unicode_range { 0x1740, 31 } -UNICODE_TAGBANWA:: unicode_range { 0x1760, 31 } -UNICODE_KHMER:: unicode_range { 0x1780, 127 } -UNICODE_MONGOLIAN:: unicode_range { 0x1800, 175 } -UNICODE_LIMBU:: unicode_range { 0x1900, 79 } -UNICODE_TAI_LE:: unicode_range { 0x1950, 47 } -UNICODE_KHMER_SYMBOLS:: unicode_range { 0x19e0, 31 } -UNICODE_PHONETIC_EXTENSIONS:: unicode_range { 0x1d00, 127 } -UNICODE_LATIN_EXTENDED_ADDITIONAL:: unicode_range { 0x1e00, 255 } -UNICODE_GREEK_EXTENDED:: unicode_range { 0x1f00, 255 } -UNICODE_GENERAL_PUNCTUATION:: unicode_range { 0x2000, 111 } -UNICODE_SUPERSCRIPTS_AND_SUBSCRIPTS:: unicode_range { 0x2070, 47 } -UNICODE_CURRENCY_SYMBOLS:: unicode_range { 0x20a0, 47 } -UNICODE_COMBINING_DIACRITICAL_MARKS_FOR_SYMBOLS:: unicode_range { 0x20d0, 47 } -UNICODE_LETTERLIKE_SYMBOLS:: unicode_range { 0x2100, 79 } -UNICODE_NUMBER_FORMS:: unicode_range { 0x2150, 63 } -UNICODE_ARROWS:: unicode_range { 0x2190, 111 } -UNICODE_MATHEMATICAL_OPERATORS:: unicode_range { 0x2200, 255 } -UNICODE_MISCELLANEOUS_TECHNICAL:: unicode_range { 0x2300, 255 } -UNICODE_CONTROL_PICTURES:: unicode_range { 0x2400, 63 } -UNICODE_OPTICAL_CHARACTER_RECOGNITION:: unicode_range { 0x2440, 31 } -UNICODE_ENCLOSED_ALPHANUMERICS:: unicode_range { 0x2460, 159 } -UNICODE_BOX_DRAWING:: unicode_range { 0x2500, 127 } -UNICODE_BLOCK_ELEMENTS:: unicode_range { 0x2580, 31 } -UNICODE_GEOMETRIC_SHAPES:: unicode_range { 0x25a0, 95 } -UNICODE_MISCELLANEOUS_SYMBOLS:: unicode_range { 0x2600, 255 } -UNICODE_DINGBATS:: unicode_range { 0x2700, 191 } -UNICODE_MISCELLANEOUS_MATHEMATICAL_SYMBOLS_A:: unicode_range { 0x27c0, 47 } -UNICODE_SUPPLEMENTAL_ARROWS_A:: unicode_range { 0x27f0, 15 } -UNICODE_BRAILLE_PATTERNS:: unicode_range { 0x2800, 255 } -UNICODE_SUPPLEMENTAL_ARROWS_B:: unicode_range { 0x2900, 127 } -UNICODE_MISCELLANEOUS_MATHEMATICAL_SYMBOLS_B:: unicode_range { 0x2980, 127 } -UNICODE_SUPPLEMENTAL_MATHEMATICAL_OPERATORS:: unicode_range { 0x2a00, 255 } -UNICODE_MISCELLANEOUS_SYMBOLS_AND_ARROWS:: unicode_range { 0x2b00, 255 } -UNICODE_CJK_RADICALS_SUPPLEMENT:: unicode_range { 0x2e80, 127 } -UNICODE_KANGXI_RADICALS:: unicode_range { 0x2f00, 223 } -UNICODE_IDEOGRAPHIC_DESCRIPTION_CHARACTERS:: unicode_range { 0x2ff0, 15 } -UNICODE_CJK_SYMBOLS_AND_PUNCTUATION:: unicode_range { 0x3000, 63 } -UNICODE_HIRAGANA:: unicode_range { 0x3040, 95 } -UNICODE_KATAKANA:: unicode_range { 0x30a0, 95 } -UNICODE_BOPOMOFO:: unicode_range { 0x3100, 47 } -UNICODE_HANGUL_COMPATIBILITY_JAMO:: unicode_range { 0x3130, 95 } -UNICODE_KANBUN_KUNTEN:: unicode_range { 0x3190, 15 } -UNICODE_BOPOMOFO_EXTENDED:: unicode_range { 0x31a0, 31 } -UNICODE_KATAKANA_PHONETIC_EXTENSIONS:: unicode_range { 0x31f0, 15 } -UNICODE_ENCLOSED_CJK_LETTERS_AND_MONTHS:: unicode_range { 0x3200, 255 } -UNICODE_CJK_COMPATIBILITY:: unicode_range { 0x3300, 255 } -UNICODE_CJK_UNIFIED_IDEOGRAPHS_EXTENSION_A:: unicode_range { 0x3400, 6591 } -UNICODE_YIJING_HEXAGRAM_SYMBOLS:: unicode_range { 0x4dc0, 63 } -UNICODE_CJK_UNIFIED_IDEOGRAPHS:: unicode_range { 0x4e00, 20911 } -UNICODE_YI_SYLLABLES:: unicode_range { 0xa000, 1167 } -UNICODE_YI_RADICALS:: unicode_range { 0xa490, 63 } -UNICODE_HANGUL_SYLLABLES:: unicode_range { 0xac00, 11183 } -UNICODE_HIGH_SURROGATE_AREA:: unicode_range { 0xd800, 1023 } -UNICODE_LOW_SURROGATE_AREA:: unicode_range { 0xdc00, 1023 } -UNICODE_PRIVATE_USE_AREA:: unicode_range { 0xe000, 6399 } -UNICODE_CJK_COMPATIBILITY_IDEOGRAPHS:: unicode_range { 0xf900, 511 } -UNICODE_ALPHABETIC_PRESENTATION_FORMS:: unicode_range { 0xfb00, 79 } -UNICODE_ARABIC_PRESENTATION_FORMS_A:: unicode_range { 0xfb50, 687 } -UNICODE_VARIATION_SELECTORS:: unicode_range { 0xfe00, 15 } -UNICODE_COMBINING_HALF_MARKS:: unicode_range { 0xfe20, 15 } -UNICODE_CJK_COMPATIBILITY_FORMS:: unicode_range { 0xfe30, 31 } -UNICODE_SMALL_FORM_VARIANTS:: unicode_range { 0xfe50, 31 } -UNICODE_ARABIC_PRESENTATION_FORMS_B:: unicode_range { 0xfe70, 143 } -UNICODE_HALFWIDTH_AND_FULLWIDTH_FORMS:: unicode_range { 0xff00, 239 } -UNICODE_SPECIALS:: unicode_range { 0xfff0, 15 } -UNICODE_LINEAR_B_SYLLABARY:: unicode_range { 0x10000, 127 } -UNICODE_LINEAR_B_IDEOGRAMS:: unicode_range { 0x10080, 127 } -UNICODE_AEGEAN_NUMBERS:: unicode_range { 0x10100, 63 } -UNICODE_OLD_ITALIC:: unicode_range { 0x10300, 47 } -UNICODE_GOTHIC:: unicode_range { 0x10330, 31 } -UNICODE_UGARITIC:: unicode_range { 0x10380, 31 } -UNICODE_DESERET:: unicode_range { 0x10400, 79 } -UNICODE_SHAVIAN:: unicode_range { 0x10450, 47 } -UNICODE_OSMANYA:: unicode_range { 0x10480, 47 } -UNICODE_CYPRIOT_SYLLABARY:: unicode_range { 0x10800, 63 } -UNICODE_BYZANTINE_MUSICAL_SYMBOLS:: unicode_range { 0x1d000, 255 } -UNICODE_MUSICAL_SYMBOLS:: unicode_range { 0x1d100, 255 } -UNICODE_TAI_XUAN_JING_SYMBOLS:: unicode_range { 0x1d300, 95 } -UNICODE_MATHEMATICAL_ALPHANUMERIC_SYMBOLS:: unicode_range { 0x1d400, 1023 } -UNICODE_CJK_UNIFIED_IDEOGRAPHS_EXTENSION_B:: unicode_range { 0x20000, 42719 } -UNICODE_CJK_COMPATIBILITY_IDEOGRAPHS_SUPPLEMENT:: unicode_range { 0x2f800, 543 } -UNICODE_TAGS:: unicode_range { 0xe0000, 127 } -UNICODE_VARIATION_SELECTORS_SUPPLEMENT:: unicode_range { 0xe0100, 239 } -UNICODE_SUPPLEMENTARY_PRIVATE_USE_AREA_A:: unicode_range { 0xf0000, 65533 } -UNICODE_SUPPLEMENTARY_PRIVATE_USE_AREA_B :: unicode_range { 0x100000, 65533 } +UNICODE_BASIC_LATIN :: unicode_range { 0x0000, 127 } +UNICODE_C1_CONTROLS_AND_LATIN_1_SUPPLEMENT :: unicode_range { 0x0080, 127 } +UNICODE_LATIN_EXTENDED_A :: unicode_range { 0x0100, 127 } +UNICODE_LATIN_EXTENDED_B :: unicode_range { 0x0180, 207 } +UNICODE_IPA_EXTENSIONS :: unicode_range { 0x0250, 95 } +UNICODE_SPACING_MODIFIER_LETTERS :: unicode_range { 0x02b0, 79 } +UNICODE_COMBINING_DIACRITICAL_MARKS :: unicode_range { 0x0300, 111 } +UNICODE_GREEK_COPTIC :: unicode_range { 0x0370, 143 } +UNICODE_CYRILLIC :: unicode_range { 0x0400, 255 } +UNICODE_CYRILLIC_SUPPLEMENT :: unicode_range { 0x0500, 47 } +UNICODE_ARMENIAN :: unicode_range { 0x0530, 95 } +UNICODE_HEBREW :: unicode_range { 0x0590, 111 } +UNICODE_ARABIC :: unicode_range { 0x0600, 255 } +UNICODE_SYRIAC :: unicode_range { 0x0700, 79 } +UNICODE_THAANA :: unicode_range { 0x0780, 63 } +UNICODE_DEVANAGARI :: unicode_range { 0x0900, 127 } +UNICODE_BENGALI_ASSAMESE :: unicode_range { 0x0980, 127 } +UNICODE_GURMUKHI :: unicode_range { 0x0a00, 127 } +UNICODE_GUJARATI :: unicode_range { 0x0a80, 127 } +UNICODE_ORIYA :: unicode_range { 0x0b00, 127 } +UNICODE_TAMIL :: unicode_range { 0x0b80, 127 } +UNICODE_TELUGU :: unicode_range { 0x0c00, 127 } +UNICODE_KANNADA :: unicode_range { 0x0c80, 127 } +UNICODE_MALAYALAM :: unicode_range { 0x0d00, 255 } +UNICODE_SINHALA :: unicode_range { 0x0d80, 127 } +UNICODE_THAI :: unicode_range { 0x0e00, 127 } +UNICODE_LAO :: unicode_range { 0x0e80, 127 } +UNICODE_TIBETAN :: unicode_range { 0x0f00, 255 } +UNICODE_MYANMAR :: unicode_range { 0x1000, 159 } +UNICODE_GEORGIAN :: unicode_range { 0x10a0, 95 } +UNICODE_HANGUL_JAMO :: unicode_range { 0x1100, 255 } +UNICODE_ETHIOPIC :: unicode_range { 0x1200, 383 } +UNICODE_CHEROKEE :: unicode_range { 0x13a0, 95 } +UNICODE_UNIFIED_CANADIAN_ABORIGINAL_SYLLABICS :: unicode_range { 0x1400, 639 } +UNICODE_OGHAM :: unicode_range { 0x1680, 31 } +UNICODE_RUNIC :: unicode_range { 0x16a0, 95 } +UNICODE_TAGALOG :: unicode_range { 0x1700, 31 } +UNICODE_HANUNOO :: unicode_range { 0x1720, 31 } +UNICODE_BUHID :: unicode_range { 0x1740, 31 } +UNICODE_TAGBANWA :: unicode_range { 0x1760, 31 } +UNICODE_KHMER :: unicode_range { 0x1780, 127 } +UNICODE_MONGOLIAN :: unicode_range { 0x1800, 175 } +UNICODE_LIMBU :: unicode_range { 0x1900, 79 } +UNICODE_TAI_LE :: unicode_range { 0x1950, 47 } +UNICODE_KHMER_SYMBOLS :: unicode_range { 0x19e0, 31 } +UNICODE_PHONETIC_EXTENSIONS :: unicode_range { 0x1d00, 127 } +UNICODE_LATIN_EXTENDED_ADDITIONAL :: unicode_range { 0x1e00, 255 } +UNICODE_GREEK_EXTENDED :: unicode_range { 0x1f00, 255 } +UNICODE_GENERAL_PUNCTUATION :: unicode_range { 0x2000, 111 } +UNICODE_SUPERSCRIPTS_AND_SUBSCRIPTS :: unicode_range { 0x2070, 47 } +UNICODE_CURRENCY_SYMBOLS :: unicode_range { 0x20a0, 47 } +UNICODE_COMBINING_DIACRITICAL_MARKS_FOR_SYMBOLS :: unicode_range { 0x20d0, 47 } +UNICODE_LETTERLIKE_SYMBOLS :: unicode_range { 0x2100, 79 } +UNICODE_NUMBER_FORMS :: unicode_range { 0x2150, 63 } +UNICODE_ARROWS :: unicode_range { 0x2190, 111 } +UNICODE_MATHEMATICAL_OPERATORS :: unicode_range { 0x2200, 255 } +UNICODE_MISCELLANEOUS_TECHNICAL :: unicode_range { 0x2300, 255 } +UNICODE_CONTROL_PICTURES :: unicode_range { 0x2400, 63 } +UNICODE_OPTICAL_CHARACTER_RECOGNITION :: unicode_range { 0x2440, 31 } +UNICODE_ENCLOSED_ALPHANUMERICS :: unicode_range { 0x2460, 159 } +UNICODE_BOX_DRAWING :: unicode_range { 0x2500, 127 } +UNICODE_BLOCK_ELEMENTS :: unicode_range { 0x2580, 31 } +UNICODE_GEOMETRIC_SHAPES :: unicode_range { 0x25a0, 95 } +UNICODE_MISCELLANEOUS_SYMBOLS :: unicode_range { 0x2600, 255 } +UNICODE_DINGBATS :: unicode_range { 0x2700, 191 } +UNICODE_MISCELLANEOUS_MATHEMATICAL_SYMBOLS_A :: unicode_range { 0x27c0, 47 } +UNICODE_SUPPLEMENTAL_ARROWS_A :: unicode_range { 0x27f0, 15 } +UNICODE_BRAILLE_PATTERNS :: unicode_range { 0x2800, 255 } +UNICODE_SUPPLEMENTAL_ARROWS_B :: unicode_range { 0x2900, 127 } +UNICODE_MISCELLANEOUS_MATHEMATICAL_SYMBOLS_B :: unicode_range { 0x2980, 127 } +UNICODE_SUPPLEMENTAL_MATHEMATICAL_OPERATORS :: unicode_range { 0x2a00, 255 } +UNICODE_MISCELLANEOUS_SYMBOLS_AND_ARROWS :: unicode_range { 0x2b00, 255 } +UNICODE_CJK_RADICALS_SUPPLEMENT :: unicode_range { 0x2e80, 127 } +UNICODE_KANGXI_RADICALS :: unicode_range { 0x2f00, 223 } +UNICODE_IDEOGRAPHIC_DESCRIPTION_CHARACTERS :: unicode_range { 0x2ff0, 15 } +UNICODE_CJK_SYMBOLS_AND_PUNCTUATION :: unicode_range { 0x3000, 63 } +UNICODE_HIRAGANA :: unicode_range { 0x3040, 95 } +UNICODE_KATAKANA :: unicode_range { 0x30a0, 95 } +UNICODE_BOPOMOFO :: unicode_range { 0x3100, 47 } +UNICODE_HANGUL_COMPATIBILITY_JAMO :: unicode_range { 0x3130, 95 } +UNICODE_KANBUN_KUNTEN :: unicode_range { 0x3190, 15 } +UNICODE_BOPOMOFO_EXTENDED :: unicode_range { 0x31a0, 31 } +UNICODE_KATAKANA_PHONETIC_EXTENSIONS :: unicode_range { 0x31f0, 15 } +UNICODE_ENCLOSED_CJK_LETTERS_AND_MONTHS :: unicode_range { 0x3200, 255 } +UNICODE_CJK_COMPATIBILITY :: unicode_range { 0x3300, 255 } +UNICODE_CJK_UNIFIED_IDEOGRAPHS_EXTENSION_A :: unicode_range { 0x3400, 6591 } +UNICODE_YIJING_HEXAGRAM_SYMBOLS :: unicode_range { 0x4dc0, 63 } +UNICODE_CJK_UNIFIED_IDEOGRAPHS :: unicode_range { 0x4e00, 20911 } +UNICODE_YI_SYLLABLES :: unicode_range { 0xa000, 1167 } +UNICODE_YI_RADICALS :: unicode_range { 0xa490, 63 } +UNICODE_HANGUL_SYLLABLES :: unicode_range { 0xac00, 11183 } +UNICODE_HIGH_SURROGATE_AREA :: unicode_range { 0xd800, 1023 } +UNICODE_LOW_SURROGATE_AREA :: unicode_range { 0xdc00, 1023 } +UNICODE_PRIVATE_USE_AREA :: unicode_range { 0xe000, 6399 } +UNICODE_CJK_COMPATIBILITY_IDEOGRAPHS :: unicode_range { 0xf900, 511 } +UNICODE_ALPHABETIC_PRESENTATION_FORMS :: unicode_range { 0xfb00, 79 } +UNICODE_ARABIC_PRESENTATION_FORMS_A :: unicode_range { 0xfb50, 687 } +UNICODE_VARIATION_SELECTORS :: unicode_range { 0xfe00, 15 } +UNICODE_COMBINING_HALF_MARKS :: unicode_range { 0xfe20, 15 } +UNICODE_CJK_COMPATIBILITY_FORMS :: unicode_range { 0xfe30, 31 } +UNICODE_SMALL_FORM_VARIANTS :: unicode_range { 0xfe50, 31 } +UNICODE_ARABIC_PRESENTATION_FORMS_B :: unicode_range { 0xfe70, 143 } +UNICODE_HALFWIDTH_AND_FULLWIDTH_FORMS :: unicode_range { 0xff00, 239 } +UNICODE_SPECIALS :: unicode_range { 0xfff0, 15 } +UNICODE_LINEAR_B_SYLLABARY :: unicode_range { 0x10000, 127 } +UNICODE_LINEAR_B_IDEOGRAMS :: unicode_range { 0x10080, 127 } +UNICODE_AEGEAN_NUMBERS :: unicode_range { 0x10100, 63 } +UNICODE_OLD_ITALIC :: unicode_range { 0x10300, 47 } +UNICODE_GOTHIC :: unicode_range { 0x10330, 31 } +UNICODE_UGARITIC :: unicode_range { 0x10380, 31 } +UNICODE_DESERET :: unicode_range { 0x10400, 79 } +UNICODE_SHAVIAN :: unicode_range { 0x10450, 47 } +UNICODE_OSMANYA :: unicode_range { 0x10480, 47 } +UNICODE_CYPRIOT_SYLLABARY :: unicode_range { 0x10800, 63 } +UNICODE_BYZANTINE_MUSICAL_SYMBOLS :: unicode_range { 0x1d000, 255 } +UNICODE_MUSICAL_SYMBOLS :: unicode_range { 0x1d100, 255 } +UNICODE_TAI_XUAN_JING_SYMBOLS :: unicode_range { 0x1d300, 95 } +UNICODE_MATHEMATICAL_ALPHANUMERIC_SYMBOLS :: unicode_range { 0x1d400, 1023 } +UNICODE_CJK_UNIFIED_IDEOGRAPHS_EXTENSION_B :: unicode_range { 0x20000, 42719 } +UNICODE_CJK_COMPATIBILITY_IDEOGRAPHS_SUPPLEMENT :: unicode_range { 0x2f800, 543 } +UNICODE_TAGS :: unicode_range { 0xe0000, 127 } +UNICODE_VARIATION_SELECTORS_SUPPLEMENT :: unicode_range { 0xe0100, 239 } +UNICODE_SUPPLEMENTARY_PRIVATE_USE_AREA_A :: unicode_range { 0xf0000, 65533 } +UNICODE_SUPPLEMENTARY_PRIVATE_USE_AREA_B :: unicode_range { 0x100000, 65533 } diff --git a/core/sys/orca/util.odin b/core/sys/orca/util.odin index 4d01234bf..7d1929748 100644 --- a/core/sys/orca/util.odin +++ b/core/sys/orca/util.odin @@ -21,7 +21,7 @@ base_allocator :: struct { arena_chunk :: struct { listElt: list_elt, - ptr: ^c.char, + ptr: [^]byte, offset: u64, committed: u64, cap: u64, @@ -161,8 +161,6 @@ list_iterate :: proc "c" (iter: ^List_Iterator($T)) -> (ptr: ^T, ok: bool) { // Strings / string lists / path strings //---------------------------------------------------------------- -// TODO use odin cstring when ^c.char is used? - str8 :: string str32 :: []rune @@ -179,8 +177,8 @@ str8_elt :: struct { @(default_calling_convention="c", link_prefix="oc_") foreign { - str8_push_buffer :: proc(arena: ^arena, len: u64, buffer: ^c.char) -> str8 --- - str8_push_cstring :: proc(arena: ^arena, str: ^c.char) -> str8 --- + str8_push_buffer :: proc(arena: ^arena, len: u64, buffer: [^]c.char) -> str8 --- + str8_push_cstring :: proc(arena: ^arena, str: cstring) -> str8 --- str8_push_copy :: proc(arena: ^arena, s: str8) -> str8 --- str8_push_slice :: proc(arena: ^arena, s: str8, start: u64, end: u64) -> str8 --- @@ -188,7 +186,7 @@ foreign { str8_pushfv :: proc(arena: ^arena, format: cstring, args: c.va_list) -> str8 --- str8_pushf :: proc(arena: ^arena, format: cstring, #c_vararg args: ..any) -> str8 --- - str8_to_cstring :: proc(arena: ^arena, string: str8) -> ^c.char --- + str8_to_cstring :: proc(arena: ^arena, string: str8) -> cstring --- str8_list_push :: proc(arena: ^arena, list: ^str8_list, str: str8) --- str8_list_pushf :: proc(arena: ^arena, list: ^str8_list, format: cstring, #c_vararg args: ..any) --- |