From 7d17ab1db0d24dce7bda5f25570a860d676836ad Mon Sep 17 00:00:00 2001 From: Luc Sarzyniec Date: Thu, 4 May 2017 17:41:25 +0200 Subject: [PATCH 1/9] Add a program to find out ICU version and so symbols suffix --- spec/icu_info_spec.cr | 20 +++++++++ src/icu_info.cr | 101 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 121 insertions(+) create mode 100644 spec/icu_info_spec.cr create mode 100644 src/icu_info.cr diff --git a/spec/icu_info_spec.cr b/spec/icu_info_spec.cr new file mode 100644 index 0000000..19135ac --- /dev/null +++ b/spec/icu_info_spec.cr @@ -0,0 +1,20 @@ +require "./spec_helper" +require "../src/icu_info" + +describe "icu_version" do + it "returns the version of the ICU lib" do + icu_version().should match(/^[0-9][0-9\.]*$/) + end +end + +describe "icu_sem_version" do + it "returns the version of the ICU lib in semantic versioning format" do + icu_sem_version().should match(/^[0-9]+\.[0-9]+\.[0-9]+$/) + end +end + +describe "icu_so_symbols_suffix" do + it "returns the version suffix added to symbols in so files of the ICU lib" do + icu_so_symbols_suffix().should match(/^[0-9_]*$/) + end +end diff --git a/src/icu_info.cr b/src/icu_info.cr new file mode 100644 index 0000000..567a35b --- /dev/null +++ b/src/icu_info.cr @@ -0,0 +1,101 @@ +require "xml" +require "c/dlfcn" + +PKGNAME = "icu-uc" +TESTFUNC = "u_init" +{% if flag?(:darwin) %} +SOFILE = "libicuuc.dylib" +{% elsif flag?(:windows) %} +SOFILE = "libicuuc.dll" +{% else %} +SOFILE = "libicuuc.so" +{% end %} + +def icu_version : String + version = nil + if system("command -v icuinfo > /dev/null") + icuinfo = `icuinfo -v` + begin + doc = XML.parse(icuinfo) + if params = doc.first_element_child + if params.name == "icuSystemParams" # ICU >= 49.0 + params.children.select(&.element?).each do |param| + if param.name == "param" && param["name"]? == "version" + version = param.content.strip + break + end + end + elsif params.name == "ICUINFO" # ICU < 49.0 + if v = params.content.match(/Compiled-Version\s*:\s*([0-9\.]+)/) + version = v[1] + end + end + end + rescue XML::Error + end + else + STDERR.puts %(WARNING: cannot find the "icuinfo" tool in PATH) + {% if flag?(:darwin) %} + STDERR.puts %(\t(on OSX, please check that you've run "brew link icu4c")) + {% end %} + end + + if !version && system("command -v pkg-config > /dev/null") + version = `pkg-config --modversion #{PKGNAME}`.strip + end + + abort("cannot find ICU version", 3) if !version || version.empty? + + version +end + +def icu_sem_version : String + # convert ICU version to semantic versioning + version = icu_version() + v = version.split(".") + if v.size == 3 + version + elsif v.size > 3 + v[0..2].join(".") + else + 3.times.map { |i| v[i]? || "0" }.join(".") + end +end + +def icu_possible_suffixes(version : String) : Array(String) + v = version.split(".") + [ + "", + "_#{version}", + "_#{v[0]}", + "_#{v[0]}#{v[1]}", + "_#{v[0]}_#{v[1]}", + "_#{v[0][0]}_#{v[0][1]? || v[1][0]}", + ].uniq +end + +def icu_so_symbols_suffix + suffixes = icu_possible_suffixes(icu_version()) + + handle = LibC.dlopen(SOFILE, LibC::RTLD_LAZY) + abort("cannot load the #{SOFILE} file", 1) if handle.null? + + begin + suffixes.each do |suffix| + LibC.dlsym(handle, "#{TESTFUNC}#{suffix}") + return suffix if LibC.dlerror.null? + end + abort("cannot find so symbols suffix", 2) + ensure + LibC.dlclose(handle) + end +end + +case ARGV[0]? +when "--version" + puts icu_version() +when "--sem-version" + puts icu_sem_version() +when "--so-symbols-suffix" + puts icu_so_symbols_suffix() +end From 4a900704e6d2ded9e69df0f73f97d1945b7e07ec Mon Sep 17 00:00:00 2001 From: Luc Sarzyniec Date: Thu, 4 May 2017 17:43:21 +0200 Subject: [PATCH 2/9] Add a program to rewrite sources with macros for C func. version suffix --- src/lib_generator.cr | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 src/lib_generator.cr diff --git a/src/lib_generator.cr b/src/lib_generator.cr new file mode 100644 index 0000000..bf04c06 --- /dev/null +++ b/src/lib_generator.cr @@ -0,0 +1,34 @@ +require "compiler/crystal/tools/formatter" + +LIB_DIR = "lib_icu" +ICU_INFO = "icu_info.cr" + +Dir[File.join(File.dirname(__FILE__), LIB_DIR, "**", "*.cr")].each do |file| + abort "cannot read #{file}" unless File.readable?(file) + src = File.read(file) + src = Crystal.format(src) + + # run the suffix finder program to initialize the SYMS_SUFFIX constant + # in the common lib file + if File.basename(file) == "#{LIB_DIR}.cr" + constdef = <<-EOS + VERSION={{ run("../#{ICU_INFO}", "--sem-version").strip.stringify }} + SYMS_SUFFIX={{ run("../#{ICU_INFO}", "--so-symbols-suffix").strip.stringify }} + {% end %} + + {% begin %} + + EOS + else + constdef = "" + end + + # add macro blocks in the body of every lib files + src = src.gsub(/^(lib \w+)\n(.+)end$/m, "\\1\n {% begin %}\n#{constdef}\\2 {% end %}\nend") + + # replace the current suffix by the SYMS_SUFFIX constant (macro) + src = src.gsub(/^(\s*fun\s+\w+\s*=\s*\w+?)(_[0-9_]+)?([\(\s:]|$)/m, "\\1{{SYMS_SUFFIX.id}}\\3") + + abort "cannot write #{file}" unless File.writable?(file) + File.write(file, Crystal.format(src)) +end From 629a3c58fd4d499b0fd575c73fafcd4b692cf6f4 Mon Sep 17 00:00:00 2001 From: Luc Sarzyniec Date: Thu, 4 May 2017 18:01:32 +0200 Subject: [PATCH 3/9] Add a Makefile to automatize binding's re-generation --- Makefile | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..79e827e --- /dev/null +++ b/Makefile @@ -0,0 +1,21 @@ +CRBIN=crystal +LGBIN=lib/libgen/bin/libgen +LGCONF=lib.yml +GENSRC=src/lib_generator.cr + +generate_lib: $(LGBIN) $(LGCONF) + rm -rf src/lib_icu + $(LGBIN) $(LGCONF) + $(CRBIN) run $(GENSRC) + +$(LGBIN): lib/libgen + cd lib/libgen && $(CRBIN) deps build + +lib/libgen: shard.yml + $(CRBIN) deps install + +clean: + rm -rf lib + rm -rf .crystal + +.PHONY: clean From a89778ada115fa8a136a86e1cfe8b4f24ec2658c Mon Sep 17 00:00:00 2001 From: Luc Sarzyniec Date: Thu, 4 May 2017 17:48:25 +0200 Subject: [PATCH 4/9] Remove linking to liculx and licule for better compatibility (macOS) --- lib.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib.yml b/lib.yml index 645715e..03b5b38 100644 --- a/lib.yml +++ b/lib.yml @@ -1,7 +1,7 @@ --- name: LibICU -ldflags: "-licuio -licui18n -liculx -licule -licuuc -licudata" -packages: "icu-uc icu-i18n icu-io icu-lx icu-le" +ldflags: "-licuio -licui18n -licuuc -licudata" +packages: "icu-uc icu-i18n icu-io" destdir: src/lib_icu/ rename: rules: From 5078fa844038dbaf6d329c655dde8529b3a6edce Mon Sep 17 00:00:00 2001 From: Luc Sarzyniec Date: Thu, 4 May 2017 17:49:37 +0200 Subject: [PATCH 5/9] Regenerate the LibICU binding (add macros for suffix and lib's version) --- src/lib_icu/lib_icu.cr | 167 +++++++++++++++++++----------------- src/lib_icu/ubidi.cr | 86 ++++++++++--------- src/lib_icu/ubrk.cr | 44 +++++----- src/lib_icu/ucal.cr | 94 ++++++++++---------- src/lib_icu/ucnv.cr | 134 +++++++++++++++-------------- src/lib_icu/ucol.cr | 106 ++++++++++++----------- src/lib_icu/ucsdet.cr | 34 ++++---- src/lib_icu/ucurr.cr | 30 ++++--- src/lib_icu/udat.cr | 118 ++++++++++++------------- src/lib_icu/udata.cr | 20 +++-- src/lib_icu/uenum.cr | 18 ++-- src/lib_icu/uidna.cr | 34 ++++---- src/lib_icu/uloc.cr | 98 ++++++++++----------- src/lib_icu/unorm2.cr | 46 +++++----- src/lib_icu/unum.cr | 60 ++++++------- src/lib_icu/upluralrules.cr | 12 +-- src/lib_icu/uregex.cr | 126 ++++++++++++++------------- src/lib_icu/uregion.cr | 30 ++++--- src/lib_icu/ures.cr | 64 +++++++------- src/lib_icu/usearch.cr | 58 +++++++------ src/lib_icu/uset.cr | 116 +++++++++++++------------ src/lib_icu/uspoof.cr | 48 ++++++----- src/lib_icu/usprep.cr | 12 +-- src/lib_icu/ustring.cr | 112 ++++++++++++------------ src/lib_icu/utext.cr | 52 +++++------ src/lib_icu/utmscale.cr | 10 ++- src/lib_icu/utrans.cr | 40 +++++---- 27 files changed, 914 insertions(+), 855 deletions(-) diff --git a/src/lib_icu/lib_icu.cr b/src/lib_icu/lib_icu.cr index 3d68f30..c7c1e75 100644 --- a/src/lib_icu/lib_icu.cr +++ b/src/lib_icu/lib_icu.cr @@ -1,5 +1,11 @@ -@[Link(ldflags: "`command -v pkg-config > /dev/null && pkg-config --libs icu-uc icu-i18n icu-io icu-lx icu-le || printf %s '-licuio -licui18n -liculx -licule -licuuc -licudata'`")] +@[Link(ldflags: "`command -v pkg-config > /dev/null && pkg-config --libs icu-uc icu-i18n icu-io 2> /dev/null|| printf %s '-licuio -licui18n -licuuc -licudata'`")] lib LibICU + {% begin %} + VERSION={{ run("../icu_info.cr", "--sem-version").strip.stringify }} + SYMS_SUFFIX={{ run("../icu_info.cr", "--so-symbols-suffix").strip.stringify }} + {% end %} + + {% begin %} alias Int32T = LibC::Int alias Int64T = LibC::Long alias Int8T = LibC::Char @@ -408,85 +414,85 @@ lib LibICU ULongPropertyName = 1 UPropertyNameChoiceCount = 2 end - fun u_char_age = u_charAge_52(c : UChar32, version_array : UVersionInfo) - fun u_char_digit_value = u_charDigitValue_52(c : UChar32) : Int32T - fun u_char_direction = u_charDirection_52(c : UChar32) : UCharDirection - fun u_char_from_name = u_charFromName_52(name_choice : UCharNameChoice, name : LibC::Char*, p_error_code : UErrorCode*) : UChar32 - fun u_char_mirror = u_charMirror_52(c : UChar32) : UChar32 - fun u_char_name = u_charName_52(code : UChar32, name_choice : UCharNameChoice, buffer : LibC::Char*, buffer_length : Int32T, p_error_code : UErrorCode*) : Int32T - fun u_char_type = u_charType_52(c : UChar32) : Int8T - fun u_chars_to_u_chars = u_charsToUChars_52(cs : LibC::Char*, us : UChar*, length : Int32T) - fun u_digit = u_digit_52(ch : UChar32, radix : Int8T) : Int32T - fun u_enum_char_names = u_enumCharNames_52(start : UChar32, limit : UChar32, fn : (Void*, UChar32, UCharNameChoice, LibC::Char*, Int32T -> UBool), context : Void*, name_choice : UCharNameChoice, p_error_code : UErrorCode*) - fun u_enum_char_types = u_enumCharTypes_52(enum_range : (Void*, UChar32, UChar32, UCharCategory -> UBool), context : Void*) - fun u_error_name = u_errorName_52(code : UErrorCode) : LibC::Char* - fun u_fold_case = u_foldCase_52(c : UChar32, options : Uint32T) : UChar32 - fun u_for_digit = u_forDigit_52(digit : Int32T, radix : Int8T) : UChar32 - fun u_get_bidi_paired_bracket = u_getBidiPairedBracket_52(c : UChar32) : UChar32 - fun u_get_combining_class = u_getCombiningClass_52(c : UChar32) : Uint8T - fun u_get_data_directory = u_getDataDirectory_52 : LibC::Char* - fun u_get_fc_nfkc_closure = u_getFC_NFKC_Closure_52(c : UChar32, dest : UChar*, dest_capacity : Int32T, p_error_code : UErrorCode*) : Int32T - fun u_get_int_property_max_value = u_getIntPropertyMaxValue_52(which : UProperty) : Int32T - fun u_get_int_property_min_value = u_getIntPropertyMinValue_52(which : UProperty) : Int32T - fun u_get_int_property_value = u_getIntPropertyValue_52(c : UChar32, which : UProperty) : Int32T - fun u_get_iso_comment = u_getISOComment_52(c : UChar32, dest : LibC::Char*, dest_capacity : Int32T, p_error_code : UErrorCode*) : Int32T - fun u_get_numeric_value = u_getNumericValue_52(c : UChar32) : LibC::Double - fun u_get_property_enum = u_getPropertyEnum_52(alias : LibC::Char*) : UProperty - fun u_get_property_name = u_getPropertyName_52(property : UProperty, name_choice : UPropertyNameChoice) : LibC::Char* - fun u_get_property_value_enum = u_getPropertyValueEnum_52(property : UProperty, alias : LibC::Char*) : Int32T - fun u_get_property_value_name = u_getPropertyValueName_52(property : UProperty, value : Int32T, name_choice : UPropertyNameChoice) : LibC::Char* - fun u_get_unicode_version = u_getUnicodeVersion_52(version_array : UVersionInfo) - fun u_get_version = u_getVersion_52(version_array : UVersionInfo) - fun u_has_binary_property = u_hasBinaryProperty_52(c : UChar32, which : UProperty) : UBool - fun u_is_id_ignorable = u_isIDIgnorable_52(c : UChar32) : UBool - fun u_is_id_part = u_isIDPart_52(c : UChar32) : UBool - fun u_is_id_start = u_isIDStart_52(c : UChar32) : UBool - fun u_is_iso_control = u_isISOControl_52(c : UChar32) : UBool - fun u_is_java_id_part = u_isJavaIDPart_52(c : UChar32) : UBool - fun u_is_java_id_start = u_isJavaIDStart_52(c : UChar32) : UBool - fun u_is_java_space_char = u_isJavaSpaceChar_52(c : UChar32) : UBool - fun u_is_mirrored = u_isMirrored_52(c : UChar32) : UBool - fun u_is_u_alphabetic = u_isUAlphabetic_52(c : UChar32) : UBool - fun u_is_u_lowercase = u_isULowercase_52(c : UChar32) : UBool - fun u_is_u_uppercase = u_isUUppercase_52(c : UChar32) : UBool - fun u_is_u_white_space = u_isUWhiteSpace_52(c : UChar32) : UBool - fun u_is_whitespace = u_isWhitespace_52(c : UChar32) : UBool - fun u_isalnum = u_isalnum_52(c : UChar32) : UBool - fun u_isalpha = u_isalpha_52(c : UChar32) : UBool - fun u_isbase = u_isbase_52(c : UChar32) : UBool - fun u_isblank = u_isblank_52(c : UChar32) : UBool - fun u_iscntrl = u_iscntrl_52(c : UChar32) : UBool - fun u_isdefined = u_isdefined_52(c : UChar32) : UBool - fun u_isdigit = u_isdigit_52(c : UChar32) : UBool - fun u_isgraph = u_isgraph_52(c : UChar32) : UBool - fun u_islower = u_islower_52(c : UChar32) : UBool - fun u_isprint = u_isprint_52(c : UChar32) : UBool - fun u_ispunct = u_ispunct_52(c : UChar32) : UBool - fun u_isspace = u_isspace_52(c : UChar32) : UBool - fun u_istitle = u_istitle_52(c : UChar32) : UBool - fun u_isupper = u_isupper_52(c : UChar32) : UBool - fun u_isxdigit = u_isxdigit_52(c : UChar32) : UBool - fun u_set_data_directory = u_setDataDirectory_52(directory : LibC::Char*) - fun u_tolower = u_tolower_52(c : UChar32) : UChar32 - fun u_totitle = u_totitle_52(c : UChar32) : UChar32 - fun u_toupper = u_toupper_52(c : UChar32) : UChar32 - fun u_u_chars_to_chars = u_UCharsToChars_52(us : UChar*, cs : LibC::Char*, length : Int32T) - fun u_version_from_string = u_versionFromString_52(version_array : UVersionInfo, version_string : LibC::Char*) - fun u_version_from_u_string = u_versionFromUString_52(version_array : UVersionInfo, version_string : UChar*) - fun u_version_to_string = u_versionToString_52(version_array : UVersionInfo, version_string : LibC::Char*) - fun ufmt_close = ufmt_close_52(fmt : UFormattable*) - fun ufmt_get_array_item_by_index = ufmt_getArrayItemByIndex_52(fmt : UFormattable*, n : Int32T, status : UErrorCode*) : UFormattable* - fun ufmt_get_array_length = ufmt_getArrayLength_52(fmt : UFormattable*, status : UErrorCode*) : Int32T - fun ufmt_get_date = ufmt_getDate_52(fmt : UFormattable*, status : UErrorCode*) : UDate - fun ufmt_get_dec_num_chars = ufmt_getDecNumChars_52(fmt : UFormattable*, len : Int32T*, status : UErrorCode*) : LibC::Char* - fun ufmt_get_double = ufmt_getDouble_52(fmt : UFormattable*, status : UErrorCode*) : LibC::Double - fun ufmt_get_int64 = ufmt_getInt64_52(fmt : UFormattable*, status : UErrorCode*) : Int64T - fun ufmt_get_long = ufmt_getLong_52(fmt : UFormattable*, status : UErrorCode*) : Int32T - fun ufmt_get_object = ufmt_getObject_52(fmt : UFormattable*, status : UErrorCode*) : Void* - fun ufmt_get_type = ufmt_getType_52(fmt : UFormattable*, status : UErrorCode*) : UFormattableType - fun ufmt_get_u_chars = ufmt_getUChars_52(fmt : UFormattable*, len : Int32T*, status : UErrorCode*) : UChar* - fun ufmt_is_numeric = ufmt_isNumeric_52(fmt : UFormattable*) : UBool - fun ufmt_open = ufmt_open_52(status : UErrorCode*) : UFormattable* + fun u_char_age = u_charAge{{SYMS_SUFFIX.id}}(c : UChar32, version_array : UVersionInfo) + fun u_char_digit_value = u_charDigitValue{{SYMS_SUFFIX.id}}(c : UChar32) : Int32T + fun u_char_direction = u_charDirection{{SYMS_SUFFIX.id}}(c : UChar32) : UCharDirection + fun u_char_from_name = u_charFromName{{SYMS_SUFFIX.id}}(name_choice : UCharNameChoice, name : LibC::Char*, p_error_code : UErrorCode*) : UChar32 + fun u_char_mirror = u_charMirror{{SYMS_SUFFIX.id}}(c : UChar32) : UChar32 + fun u_char_name = u_charName{{SYMS_SUFFIX.id}}(code : UChar32, name_choice : UCharNameChoice, buffer : LibC::Char*, buffer_length : Int32T, p_error_code : UErrorCode*) : Int32T + fun u_char_type = u_charType{{SYMS_SUFFIX.id}}(c : UChar32) : Int8T + fun u_chars_to_u_chars = u_charsToUChars{{SYMS_SUFFIX.id}}(cs : LibC::Char*, us : UChar*, length : Int32T) + fun u_digit = u_digit{{SYMS_SUFFIX.id}}(ch : UChar32, radix : Int8T) : Int32T + fun u_enum_char_names = u_enumCharNames{{SYMS_SUFFIX.id}}(start : UChar32, limit : UChar32, fn : (Void*, UChar32, UCharNameChoice, LibC::Char*, Int32T -> UBool), context : Void*, name_choice : UCharNameChoice, p_error_code : UErrorCode*) + fun u_enum_char_types = u_enumCharTypes{{SYMS_SUFFIX.id}}(enum_range : (Void*, UChar32, UChar32, UCharCategory -> UBool), context : Void*) + fun u_error_name = u_errorName{{SYMS_SUFFIX.id}}(code : UErrorCode) : LibC::Char* + fun u_fold_case = u_foldCase{{SYMS_SUFFIX.id}}(c : UChar32, options : Uint32T) : UChar32 + fun u_for_digit = u_forDigit{{SYMS_SUFFIX.id}}(digit : Int32T, radix : Int8T) : UChar32 + fun u_get_bidi_paired_bracket = u_getBidiPairedBracket{{SYMS_SUFFIX.id}}(c : UChar32) : UChar32 + fun u_get_combining_class = u_getCombiningClass{{SYMS_SUFFIX.id}}(c : UChar32) : Uint8T + fun u_get_data_directory = u_getDataDirectory{{SYMS_SUFFIX.id}} : LibC::Char* + fun u_get_fc_nfkc_closure = u_getFC_NFKC_Closure{{SYMS_SUFFIX.id}}(c : UChar32, dest : UChar*, dest_capacity : Int32T, p_error_code : UErrorCode*) : Int32T + fun u_get_int_property_max_value = u_getIntPropertyMaxValue{{SYMS_SUFFIX.id}}(which : UProperty) : Int32T + fun u_get_int_property_min_value = u_getIntPropertyMinValue{{SYMS_SUFFIX.id}}(which : UProperty) : Int32T + fun u_get_int_property_value = u_getIntPropertyValue{{SYMS_SUFFIX.id}}(c : UChar32, which : UProperty) : Int32T + fun u_get_iso_comment = u_getISOComment{{SYMS_SUFFIX.id}}(c : UChar32, dest : LibC::Char*, dest_capacity : Int32T, p_error_code : UErrorCode*) : Int32T + fun u_get_numeric_value = u_getNumericValue{{SYMS_SUFFIX.id}}(c : UChar32) : LibC::Double + fun u_get_property_enum = u_getPropertyEnum{{SYMS_SUFFIX.id}}(alias : LibC::Char*) : UProperty + fun u_get_property_name = u_getPropertyName{{SYMS_SUFFIX.id}}(property : UProperty, name_choice : UPropertyNameChoice) : LibC::Char* + fun u_get_property_value_enum = u_getPropertyValueEnum{{SYMS_SUFFIX.id}}(property : UProperty, alias : LibC::Char*) : Int32T + fun u_get_property_value_name = u_getPropertyValueName{{SYMS_SUFFIX.id}}(property : UProperty, value : Int32T, name_choice : UPropertyNameChoice) : LibC::Char* + fun u_get_unicode_version = u_getUnicodeVersion{{SYMS_SUFFIX.id}}(version_array : UVersionInfo) + fun u_get_version = u_getVersion{{SYMS_SUFFIX.id}}(version_array : UVersionInfo) + fun u_has_binary_property = u_hasBinaryProperty{{SYMS_SUFFIX.id}}(c : UChar32, which : UProperty) : UBool + fun u_is_id_ignorable = u_isIDIgnorable{{SYMS_SUFFIX.id}}(c : UChar32) : UBool + fun u_is_id_part = u_isIDPart{{SYMS_SUFFIX.id}}(c : UChar32) : UBool + fun u_is_id_start = u_isIDStart{{SYMS_SUFFIX.id}}(c : UChar32) : UBool + fun u_is_iso_control = u_isISOControl{{SYMS_SUFFIX.id}}(c : UChar32) : UBool + fun u_is_java_id_part = u_isJavaIDPart{{SYMS_SUFFIX.id}}(c : UChar32) : UBool + fun u_is_java_id_start = u_isJavaIDStart{{SYMS_SUFFIX.id}}(c : UChar32) : UBool + fun u_is_java_space_char = u_isJavaSpaceChar{{SYMS_SUFFIX.id}}(c : UChar32) : UBool + fun u_is_mirrored = u_isMirrored{{SYMS_SUFFIX.id}}(c : UChar32) : UBool + fun u_is_u_alphabetic = u_isUAlphabetic{{SYMS_SUFFIX.id}}(c : UChar32) : UBool + fun u_is_u_lowercase = u_isULowercase{{SYMS_SUFFIX.id}}(c : UChar32) : UBool + fun u_is_u_uppercase = u_isUUppercase{{SYMS_SUFFIX.id}}(c : UChar32) : UBool + fun u_is_u_white_space = u_isUWhiteSpace{{SYMS_SUFFIX.id}}(c : UChar32) : UBool + fun u_is_whitespace = u_isWhitespace{{SYMS_SUFFIX.id}}(c : UChar32) : UBool + fun u_isalnum = u_isalnum{{SYMS_SUFFIX.id}}(c : UChar32) : UBool + fun u_isalpha = u_isalpha{{SYMS_SUFFIX.id}}(c : UChar32) : UBool + fun u_isbase = u_isbase{{SYMS_SUFFIX.id}}(c : UChar32) : UBool + fun u_isblank = u_isblank{{SYMS_SUFFIX.id}}(c : UChar32) : UBool + fun u_iscntrl = u_iscntrl{{SYMS_SUFFIX.id}}(c : UChar32) : UBool + fun u_isdefined = u_isdefined{{SYMS_SUFFIX.id}}(c : UChar32) : UBool + fun u_isdigit = u_isdigit{{SYMS_SUFFIX.id}}(c : UChar32) : UBool + fun u_isgraph = u_isgraph{{SYMS_SUFFIX.id}}(c : UChar32) : UBool + fun u_islower = u_islower{{SYMS_SUFFIX.id}}(c : UChar32) : UBool + fun u_isprint = u_isprint{{SYMS_SUFFIX.id}}(c : UChar32) : UBool + fun u_ispunct = u_ispunct{{SYMS_SUFFIX.id}}(c : UChar32) : UBool + fun u_isspace = u_isspace{{SYMS_SUFFIX.id}}(c : UChar32) : UBool + fun u_istitle = u_istitle{{SYMS_SUFFIX.id}}(c : UChar32) : UBool + fun u_isupper = u_isupper{{SYMS_SUFFIX.id}}(c : UChar32) : UBool + fun u_isxdigit = u_isxdigit{{SYMS_SUFFIX.id}}(c : UChar32) : UBool + fun u_set_data_directory = u_setDataDirectory{{SYMS_SUFFIX.id}}(directory : LibC::Char*) + fun u_tolower = u_tolower{{SYMS_SUFFIX.id}}(c : UChar32) : UChar32 + fun u_totitle = u_totitle{{SYMS_SUFFIX.id}}(c : UChar32) : UChar32 + fun u_toupper = u_toupper{{SYMS_SUFFIX.id}}(c : UChar32) : UChar32 + fun u_u_chars_to_chars = u_UCharsToChars{{SYMS_SUFFIX.id}}(us : UChar*, cs : LibC::Char*, length : Int32T) + fun u_version_from_string = u_versionFromString{{SYMS_SUFFIX.id}}(version_array : UVersionInfo, version_string : LibC::Char*) + fun u_version_from_u_string = u_versionFromUString{{SYMS_SUFFIX.id}}(version_array : UVersionInfo, version_string : UChar*) + fun u_version_to_string = u_versionToString{{SYMS_SUFFIX.id}}(version_array : UVersionInfo, version_string : LibC::Char*) + fun ufmt_close = ufmt_close{{SYMS_SUFFIX.id}}(fmt : UFormattable*) + fun ufmt_get_array_item_by_index = ufmt_getArrayItemByIndex{{SYMS_SUFFIX.id}}(fmt : UFormattable*, n : Int32T, status : UErrorCode*) : UFormattable* + fun ufmt_get_array_length = ufmt_getArrayLength{{SYMS_SUFFIX.id}}(fmt : UFormattable*, status : UErrorCode*) : Int32T + fun ufmt_get_date = ufmt_getDate{{SYMS_SUFFIX.id}}(fmt : UFormattable*, status : UErrorCode*) : UDate + fun ufmt_get_dec_num_chars = ufmt_getDecNumChars{{SYMS_SUFFIX.id}}(fmt : UFormattable*, len : Int32T*, status : UErrorCode*) : LibC::Char* + fun ufmt_get_double = ufmt_getDouble{{SYMS_SUFFIX.id}}(fmt : UFormattable*, status : UErrorCode*) : LibC::Double + fun ufmt_get_int64 = ufmt_getInt64{{SYMS_SUFFIX.id}}(fmt : UFormattable*, status : UErrorCode*) : Int64T + fun ufmt_get_long = ufmt_getLong{{SYMS_SUFFIX.id}}(fmt : UFormattable*, status : UErrorCode*) : Int32T + fun ufmt_get_object = ufmt_getObject{{SYMS_SUFFIX.id}}(fmt : UFormattable*, status : UErrorCode*) : Void* + fun ufmt_get_type = ufmt_getType{{SYMS_SUFFIX.id}}(fmt : UFormattable*, status : UErrorCode*) : UFormattableType + fun ufmt_get_u_chars = ufmt_getUChars{{SYMS_SUFFIX.id}}(fmt : UFormattable*, len : Int32T*, status : UErrorCode*) : UChar* + fun ufmt_is_numeric = ufmt_isNumeric{{SYMS_SUFFIX.id}}(fmt : UFormattable*) : UBool + fun ufmt_open = ufmt_open{{SYMS_SUFFIX.id}}(status : UErrorCode*) : UFormattable* struct UCharIterator context : Void* @@ -570,6 +576,7 @@ lib LibICU type UCollator = Void* type UEnumeration = Void* type USet = Void* + {% end %} end require "./ustring.cr" diff --git a/src/lib_icu/ubidi.cr b/src/lib_icu/ubidi.cr index 67785c7..6811d25 100644 --- a/src/lib_icu/ubidi.cr +++ b/src/lib_icu/ubidi.cr @@ -1,5 +1,6 @@ -@[Link(ldflags: "`command -v pkg-config > /dev/null && pkg-config --libs icu-uc icu-i18n icu-io icu-lx icu-le || printf %s '-licuio -licui18n -liculx -licule -licuuc -licudata'`")] +@[Link(ldflags: "`command -v pkg-config > /dev/null && pkg-config --libs icu-uc icu-i18n icu-io 2> /dev/null|| printf %s '-licuio -licui18n -licuuc -licudata'`")] lib LibICU + {% begin %} alias UBiDiLevel = Uint8T enum UBiDiDirection UbidiLtr = 0 @@ -17,46 +18,47 @@ lib LibICU UbidiReorderInverseForNumbersSpecial = 6 UbidiReorderCount = 7 end - fun ubidi_close = ubidi_close_52(p_bi_di : UBiDi) - fun ubidi_count_paragraphs = ubidi_countParagraphs_52(p_bi_di : UBiDi) : Int32T - fun ubidi_count_runs = ubidi_countRuns_52(p_bi_di : UBiDi, p_error_code : UErrorCode*) : Int32T - fun ubidi_get_base_direction = ubidi_getBaseDirection_52(text : UChar*, length : Int32T) : UBiDiDirection - fun ubidi_get_class_callback = ubidi_getClassCallback_52(p_bi_di : UBiDi, fn : (Void*, UChar32 -> UCharDirection)*, context : Void**) - fun ubidi_get_customized_class = ubidi_getCustomizedClass_52(p_bi_di : UBiDi, c : UChar32) : UCharDirection - fun ubidi_get_direction = ubidi_getDirection_52(p_bi_di : UBiDi) : UBiDiDirection - fun ubidi_get_length = ubidi_getLength_52(p_bi_di : UBiDi) : Int32T - fun ubidi_get_level_at = ubidi_getLevelAt_52(p_bi_di : UBiDi, char_index : Int32T) : UBiDiLevel - fun ubidi_get_levels = ubidi_getLevels_52(p_bi_di : UBiDi, p_error_code : UErrorCode*) : UBiDiLevel* - fun ubidi_get_logical_index = ubidi_getLogicalIndex_52(p_bi_di : UBiDi, visual_index : Int32T, p_error_code : UErrorCode*) : Int32T - fun ubidi_get_logical_map = ubidi_getLogicalMap_52(p_bi_di : UBiDi, index_map : Int32T*, p_error_code : UErrorCode*) - fun ubidi_get_logical_run = ubidi_getLogicalRun_52(p_bi_di : UBiDi, logical_position : Int32T, p_logical_limit : Int32T*, p_level : UBiDiLevel*) - fun ubidi_get_para_level = ubidi_getParaLevel_52(p_bi_di : UBiDi) : UBiDiLevel - fun ubidi_get_paragraph = ubidi_getParagraph_52(p_bi_di : UBiDi, char_index : Int32T, p_para_start : Int32T*, p_para_limit : Int32T*, p_para_level : UBiDiLevel*, p_error_code : UErrorCode*) : Int32T - fun ubidi_get_paragraph_by_index = ubidi_getParagraphByIndex_52(p_bi_di : UBiDi, para_index : Int32T, p_para_start : Int32T*, p_para_limit : Int32T*, p_para_level : UBiDiLevel*, p_error_code : UErrorCode*) - fun ubidi_get_processed_length = ubidi_getProcessedLength_52(p_bi_di : UBiDi) : Int32T - fun ubidi_get_reordering_mode = ubidi_getReorderingMode_52(p_bi_di : UBiDi) : UBiDiReorderingMode - fun ubidi_get_reordering_options = ubidi_getReorderingOptions_52(p_bi_di : UBiDi) : Uint32T - fun ubidi_get_result_length = ubidi_getResultLength_52(p_bi_di : UBiDi) : Int32T - fun ubidi_get_text = ubidi_getText_52(p_bi_di : UBiDi) : UChar* - fun ubidi_get_visual_index = ubidi_getVisualIndex_52(p_bi_di : UBiDi, logical_index : Int32T, p_error_code : UErrorCode*) : Int32T - fun ubidi_get_visual_map = ubidi_getVisualMap_52(p_bi_di : UBiDi, index_map : Int32T*, p_error_code : UErrorCode*) - fun ubidi_get_visual_run = ubidi_getVisualRun_52(p_bi_di : UBiDi, run_index : Int32T, p_logical_start : Int32T*, p_length : Int32T*) : UBiDiDirection - fun ubidi_invert_map = ubidi_invertMap_52(src_map : Int32T*, dest_map : Int32T*, length : Int32T) - fun ubidi_is_inverse = ubidi_isInverse_52(p_bi_di : UBiDi) : UBool - fun ubidi_is_order_paragraphs_ltr = ubidi_isOrderParagraphsLTR_52(p_bi_di : UBiDi) : UBool - fun ubidi_open = ubidi_open_52 : UBiDi - fun ubidi_open_sized = ubidi_openSized_52(max_length : Int32T, max_run_count : Int32T, p_error_code : UErrorCode*) : UBiDi - fun ubidi_order_paragraphs_ltr = ubidi_orderParagraphsLTR_52(p_bi_di : UBiDi, order_paragraphs_ltr : UBool) - fun ubidi_reorder_logical = ubidi_reorderLogical_52(levels : UBiDiLevel*, length : Int32T, index_map : Int32T*) - fun ubidi_reorder_visual = ubidi_reorderVisual_52(levels : UBiDiLevel*, length : Int32T, index_map : Int32T*) - fun ubidi_set_class_callback = ubidi_setClassCallback_52(p_bi_di : UBiDi, new_fn : (Void*, UChar32 -> UCharDirection), new_context : Void*, old_fn : (Void*, UChar32 -> UCharDirection)*, old_context : Void**, p_error_code : UErrorCode*) - fun ubidi_set_context = ubidi_setContext_52(p_bi_di : UBiDi, prologue : UChar*, pro_length : Int32T, epilogue : UChar*, epi_length : Int32T, p_error_code : UErrorCode*) - fun ubidi_set_inverse = ubidi_setInverse_52(p_bi_di : UBiDi, is_inverse : UBool) - fun ubidi_set_line = ubidi_setLine_52(p_para_bi_di : UBiDi, start : Int32T, limit : Int32T, p_line_bi_di : UBiDi, p_error_code : UErrorCode*) - fun ubidi_set_para = ubidi_setPara_52(p_bi_di : UBiDi, text : UChar*, length : Int32T, para_level : UBiDiLevel, embedding_levels : UBiDiLevel*, p_error_code : UErrorCode*) - fun ubidi_set_reordering_mode = ubidi_setReorderingMode_52(p_bi_di : UBiDi, reordering_mode : UBiDiReorderingMode) - fun ubidi_set_reordering_options = ubidi_setReorderingOptions_52(p_bi_di : UBiDi, reordering_options : Uint32T) - fun ubidi_write_reordered = ubidi_writeReordered_52(p_bi_di : UBiDi, dest : UChar*, dest_size : Int32T, options : Uint16T, p_error_code : UErrorCode*) : Int32T - fun ubidi_write_reverse = ubidi_writeReverse_52(src : UChar*, src_length : Int32T, dest : UChar*, dest_size : Int32T, options : Uint16T, p_error_code : UErrorCode*) : Int32T + fun ubidi_close = ubidi_close{{SYMS_SUFFIX.id}}(p_bi_di : UBiDi) + fun ubidi_count_paragraphs = ubidi_countParagraphs{{SYMS_SUFFIX.id}}(p_bi_di : UBiDi) : Int32T + fun ubidi_count_runs = ubidi_countRuns{{SYMS_SUFFIX.id}}(p_bi_di : UBiDi, p_error_code : UErrorCode*) : Int32T + fun ubidi_get_base_direction = ubidi_getBaseDirection{{SYMS_SUFFIX.id}}(text : UChar*, length : Int32T) : UBiDiDirection + fun ubidi_get_class_callback = ubidi_getClassCallback{{SYMS_SUFFIX.id}}(p_bi_di : UBiDi, fn : (Void*, UChar32 -> UCharDirection)*, context : Void**) + fun ubidi_get_customized_class = ubidi_getCustomizedClass{{SYMS_SUFFIX.id}}(p_bi_di : UBiDi, c : UChar32) : UCharDirection + fun ubidi_get_direction = ubidi_getDirection{{SYMS_SUFFIX.id}}(p_bi_di : UBiDi) : UBiDiDirection + fun ubidi_get_length = ubidi_getLength{{SYMS_SUFFIX.id}}(p_bi_di : UBiDi) : Int32T + fun ubidi_get_level_at = ubidi_getLevelAt{{SYMS_SUFFIX.id}}(p_bi_di : UBiDi, char_index : Int32T) : UBiDiLevel + fun ubidi_get_levels = ubidi_getLevels{{SYMS_SUFFIX.id}}(p_bi_di : UBiDi, p_error_code : UErrorCode*) : UBiDiLevel* + fun ubidi_get_logical_index = ubidi_getLogicalIndex{{SYMS_SUFFIX.id}}(p_bi_di : UBiDi, visual_index : Int32T, p_error_code : UErrorCode*) : Int32T + fun ubidi_get_logical_map = ubidi_getLogicalMap{{SYMS_SUFFIX.id}}(p_bi_di : UBiDi, index_map : Int32T*, p_error_code : UErrorCode*) + fun ubidi_get_logical_run = ubidi_getLogicalRun{{SYMS_SUFFIX.id}}(p_bi_di : UBiDi, logical_position : Int32T, p_logical_limit : Int32T*, p_level : UBiDiLevel*) + fun ubidi_get_para_level = ubidi_getParaLevel{{SYMS_SUFFIX.id}}(p_bi_di : UBiDi) : UBiDiLevel + fun ubidi_get_paragraph = ubidi_getParagraph{{SYMS_SUFFIX.id}}(p_bi_di : UBiDi, char_index : Int32T, p_para_start : Int32T*, p_para_limit : Int32T*, p_para_level : UBiDiLevel*, p_error_code : UErrorCode*) : Int32T + fun ubidi_get_paragraph_by_index = ubidi_getParagraphByIndex{{SYMS_SUFFIX.id}}(p_bi_di : UBiDi, para_index : Int32T, p_para_start : Int32T*, p_para_limit : Int32T*, p_para_level : UBiDiLevel*, p_error_code : UErrorCode*) + fun ubidi_get_processed_length = ubidi_getProcessedLength{{SYMS_SUFFIX.id}}(p_bi_di : UBiDi) : Int32T + fun ubidi_get_reordering_mode = ubidi_getReorderingMode{{SYMS_SUFFIX.id}}(p_bi_di : UBiDi) : UBiDiReorderingMode + fun ubidi_get_reordering_options = ubidi_getReorderingOptions{{SYMS_SUFFIX.id}}(p_bi_di : UBiDi) : Uint32T + fun ubidi_get_result_length = ubidi_getResultLength{{SYMS_SUFFIX.id}}(p_bi_di : UBiDi) : Int32T + fun ubidi_get_text = ubidi_getText{{SYMS_SUFFIX.id}}(p_bi_di : UBiDi) : UChar* + fun ubidi_get_visual_index = ubidi_getVisualIndex{{SYMS_SUFFIX.id}}(p_bi_di : UBiDi, logical_index : Int32T, p_error_code : UErrorCode*) : Int32T + fun ubidi_get_visual_map = ubidi_getVisualMap{{SYMS_SUFFIX.id}}(p_bi_di : UBiDi, index_map : Int32T*, p_error_code : UErrorCode*) + fun ubidi_get_visual_run = ubidi_getVisualRun{{SYMS_SUFFIX.id}}(p_bi_di : UBiDi, run_index : Int32T, p_logical_start : Int32T*, p_length : Int32T*) : UBiDiDirection + fun ubidi_invert_map = ubidi_invertMap{{SYMS_SUFFIX.id}}(src_map : Int32T*, dest_map : Int32T*, length : Int32T) + fun ubidi_is_inverse = ubidi_isInverse{{SYMS_SUFFIX.id}}(p_bi_di : UBiDi) : UBool + fun ubidi_is_order_paragraphs_ltr = ubidi_isOrderParagraphsLTR{{SYMS_SUFFIX.id}}(p_bi_di : UBiDi) : UBool + fun ubidi_open = ubidi_open{{SYMS_SUFFIX.id}} : UBiDi + fun ubidi_open_sized = ubidi_openSized{{SYMS_SUFFIX.id}}(max_length : Int32T, max_run_count : Int32T, p_error_code : UErrorCode*) : UBiDi + fun ubidi_order_paragraphs_ltr = ubidi_orderParagraphsLTR{{SYMS_SUFFIX.id}}(p_bi_di : UBiDi, order_paragraphs_ltr : UBool) + fun ubidi_reorder_logical = ubidi_reorderLogical{{SYMS_SUFFIX.id}}(levels : UBiDiLevel*, length : Int32T, index_map : Int32T*) + fun ubidi_reorder_visual = ubidi_reorderVisual{{SYMS_SUFFIX.id}}(levels : UBiDiLevel*, length : Int32T, index_map : Int32T*) + fun ubidi_set_class_callback = ubidi_setClassCallback{{SYMS_SUFFIX.id}}(p_bi_di : UBiDi, new_fn : (Void*, UChar32 -> UCharDirection), new_context : Void*, old_fn : (Void*, UChar32 -> UCharDirection)*, old_context : Void**, p_error_code : UErrorCode*) + fun ubidi_set_context = ubidi_setContext{{SYMS_SUFFIX.id}}(p_bi_di : UBiDi, prologue : UChar*, pro_length : Int32T, epilogue : UChar*, epi_length : Int32T, p_error_code : UErrorCode*) + fun ubidi_set_inverse = ubidi_setInverse{{SYMS_SUFFIX.id}}(p_bi_di : UBiDi, is_inverse : UBool) + fun ubidi_set_line = ubidi_setLine{{SYMS_SUFFIX.id}}(p_para_bi_di : UBiDi, start : Int32T, limit : Int32T, p_line_bi_di : UBiDi, p_error_code : UErrorCode*) + fun ubidi_set_para = ubidi_setPara{{SYMS_SUFFIX.id}}(p_bi_di : UBiDi, text : UChar*, length : Int32T, para_level : UBiDiLevel, embedding_levels : UBiDiLevel*, p_error_code : UErrorCode*) + fun ubidi_set_reordering_mode = ubidi_setReorderingMode{{SYMS_SUFFIX.id}}(p_bi_di : UBiDi, reordering_mode : UBiDiReorderingMode) + fun ubidi_set_reordering_options = ubidi_setReorderingOptions{{SYMS_SUFFIX.id}}(p_bi_di : UBiDi, reordering_options : Uint32T) + fun ubidi_write_reordered = ubidi_writeReordered{{SYMS_SUFFIX.id}}(p_bi_di : UBiDi, dest : UChar*, dest_size : Int32T, options : Uint16T, p_error_code : UErrorCode*) : Int32T + fun ubidi_write_reverse = ubidi_writeReverse{{SYMS_SUFFIX.id}}(src : UChar*, src_length : Int32T, dest : UChar*, dest_size : Int32T, options : Uint16T, p_error_code : UErrorCode*) : Int32T type UBiDi = Void* + {% end %} end diff --git a/src/lib_icu/ubrk.cr b/src/lib_icu/ubrk.cr index 024051c..0c89a2f 100644 --- a/src/lib_icu/ubrk.cr +++ b/src/lib_icu/ubrk.cr @@ -1,5 +1,6 @@ -@[Link(ldflags: "`command -v pkg-config > /dev/null && pkg-config --libs icu-uc icu-i18n icu-io icu-lx icu-le || printf %s '-licuio -licui18n -liculx -licule -licuuc -licudata'`")] +@[Link(ldflags: "`command -v pkg-config > /dev/null && pkg-config --libs icu-uc icu-i18n icu-io 2> /dev/null|| printf %s '-licuio -licui18n -licuuc -licudata'`")] lib LibICU + {% begin %} enum UBreakIteratorType UbrkCharacter = 0 UbrkWord = 1 @@ -8,24 +9,25 @@ lib LibICU UbrkTitle = 4 UbrkCount = 5 end - fun ubrk_close = ubrk_close_52(bi : UBreakIterator) - fun ubrk_count_available = ubrk_countAvailable_52 : Int32T - fun ubrk_current = ubrk_current_52(bi : UBreakIterator) : Int32T - fun ubrk_first = ubrk_first_52(bi : UBreakIterator) : Int32T - fun ubrk_following = ubrk_following_52(bi : UBreakIterator, offset : Int32T) : Int32T - fun ubrk_get_available = ubrk_getAvailable_52(index : Int32T) : LibC::Char* - fun ubrk_get_locale_by_type = ubrk_getLocaleByType_52(bi : UBreakIterator, type : ULocDataLocaleType, status : UErrorCode*) : LibC::Char* - fun ubrk_get_rule_status = ubrk_getRuleStatus_52(bi : UBreakIterator) : Int32T - fun ubrk_get_rule_status_vec = ubrk_getRuleStatusVec_52(bi : UBreakIterator, fill_in_vec : Int32T*, capacity : Int32T, status : UErrorCode*) : Int32T - fun ubrk_is_boundary = ubrk_isBoundary_52(bi : UBreakIterator, offset : Int32T) : UBool - fun ubrk_last = ubrk_last_52(bi : UBreakIterator) : Int32T - fun ubrk_next = ubrk_next_52(bi : UBreakIterator) : Int32T - fun ubrk_open = ubrk_open_52(type : UBreakIteratorType, locale : LibC::Char*, text : UChar*, text_length : Int32T, status : UErrorCode*) : UBreakIterator - fun ubrk_open_rules = ubrk_openRules_52(rules : UChar*, rules_length : Int32T, text : UChar*, text_length : Int32T, parse_err : UParseError*, status : UErrorCode*) : UBreakIterator - fun ubrk_preceding = ubrk_preceding_52(bi : UBreakIterator, offset : Int32T) : Int32T - fun ubrk_previous = ubrk_previous_52(bi : UBreakIterator) : Int32T - fun ubrk_refresh_u_text = ubrk_refreshUText_52(bi : UBreakIterator, text : UText*, status : UErrorCode*) - fun ubrk_safe_clone = ubrk_safeClone_52(bi : UBreakIterator, stack_buffer : Void*, p_buffer_size : Int32T*, status : UErrorCode*) : UBreakIterator - fun ubrk_set_text = ubrk_setText_52(bi : UBreakIterator, text : UChar*, text_length : Int32T, status : UErrorCode*) - fun ubrk_set_u_text = ubrk_setUText_52(bi : UBreakIterator, text : UText*, status : UErrorCode*) + fun ubrk_close = ubrk_close{{SYMS_SUFFIX.id}}(bi : UBreakIterator) + fun ubrk_count_available = ubrk_countAvailable{{SYMS_SUFFIX.id}} : Int32T + fun ubrk_current = ubrk_current{{SYMS_SUFFIX.id}}(bi : UBreakIterator) : Int32T + fun ubrk_first = ubrk_first{{SYMS_SUFFIX.id}}(bi : UBreakIterator) : Int32T + fun ubrk_following = ubrk_following{{SYMS_SUFFIX.id}}(bi : UBreakIterator, offset : Int32T) : Int32T + fun ubrk_get_available = ubrk_getAvailable{{SYMS_SUFFIX.id}}(index : Int32T) : LibC::Char* + fun ubrk_get_locale_by_type = ubrk_getLocaleByType{{SYMS_SUFFIX.id}}(bi : UBreakIterator, type : ULocDataLocaleType, status : UErrorCode*) : LibC::Char* + fun ubrk_get_rule_status = ubrk_getRuleStatus{{SYMS_SUFFIX.id}}(bi : UBreakIterator) : Int32T + fun ubrk_get_rule_status_vec = ubrk_getRuleStatusVec{{SYMS_SUFFIX.id}}(bi : UBreakIterator, fill_in_vec : Int32T*, capacity : Int32T, status : UErrorCode*) : Int32T + fun ubrk_is_boundary = ubrk_isBoundary{{SYMS_SUFFIX.id}}(bi : UBreakIterator, offset : Int32T) : UBool + fun ubrk_last = ubrk_last{{SYMS_SUFFIX.id}}(bi : UBreakIterator) : Int32T + fun ubrk_next = ubrk_next{{SYMS_SUFFIX.id}}(bi : UBreakIterator) : Int32T + fun ubrk_open = ubrk_open{{SYMS_SUFFIX.id}}(type : UBreakIteratorType, locale : LibC::Char*, text : UChar*, text_length : Int32T, status : UErrorCode*) : UBreakIterator + fun ubrk_open_rules = ubrk_openRules{{SYMS_SUFFIX.id}}(rules : UChar*, rules_length : Int32T, text : UChar*, text_length : Int32T, parse_err : UParseError*, status : UErrorCode*) : UBreakIterator + fun ubrk_preceding = ubrk_preceding{{SYMS_SUFFIX.id}}(bi : UBreakIterator, offset : Int32T) : Int32T + fun ubrk_previous = ubrk_previous{{SYMS_SUFFIX.id}}(bi : UBreakIterator) : Int32T + fun ubrk_refresh_u_text = ubrk_refreshUText{{SYMS_SUFFIX.id}}(bi : UBreakIterator, text : UText*, status : UErrorCode*) + fun ubrk_safe_clone = ubrk_safeClone{{SYMS_SUFFIX.id}}(bi : UBreakIterator, stack_buffer : Void*, p_buffer_size : Int32T*, status : UErrorCode*) : UBreakIterator + fun ubrk_set_text = ubrk_setText{{SYMS_SUFFIX.id}}(bi : UBreakIterator, text : UChar*, text_length : Int32T, status : UErrorCode*) + fun ubrk_set_u_text = ubrk_setUText{{SYMS_SUFFIX.id}}(bi : UBreakIterator, text : UText*, status : UErrorCode*) + {% end %} end diff --git a/src/lib_icu/ucal.cr b/src/lib_icu/ucal.cr index 6b7ccd3..440cb9c 100644 --- a/src/lib_icu/ucal.cr +++ b/src/lib_icu/ucal.cr @@ -1,5 +1,6 @@ -@[Link(ldflags: "`command -v pkg-config > /dev/null && pkg-config --libs icu-uc icu-i18n icu-io icu-lx icu-le || printf %s '-licuio -licui18n -liculx -licule -licuuc -licudata'`")] +@[Link(ldflags: "`command -v pkg-config > /dev/null && pkg-config --libs icu-uc icu-i18n icu-io 2> /dev/null|| printf %s '-licuio -licui18n -licuuc -licudata'`")] lib LibICU + {% begin %} enum UCalendarAttribute UcalLenient = 0 UcalFirstDayOfWeek = 1 @@ -52,49 +53,50 @@ lib LibICU UcalTzTransitionPrevious = 2 UcalTzTransitionPreviousInclusive = 3 end - fun ucal_add = ucal_add_52(cal : UCalendar*, field : UCalendarDateFields, amount : Int32T, status : UErrorCode*) - fun ucal_clear = ucal_clear_52(calendar : UCalendar*) - fun ucal_clear_field = ucal_clearField_52(cal : UCalendar*, field : UCalendarDateFields) - fun ucal_clone = ucal_clone_52(cal : UCalendar*, status : UErrorCode*) : UCalendar* - fun ucal_close = ucal_close_52(cal : UCalendar*) - fun ucal_count_available = ucal_countAvailable_52 : Int32T - fun ucal_equivalent_to = ucal_equivalentTo_52(cal1 : UCalendar*, cal2 : UCalendar*) : UBool - fun ucal_get = ucal_get_52(cal : UCalendar*, field : UCalendarDateFields, status : UErrorCode*) : Int32T - fun ucal_get_attribute = ucal_getAttribute_52(cal : UCalendar*, attr : UCalendarAttribute) : Int32T - fun ucal_get_available = ucal_getAvailable_52(locale_index : Int32T) : LibC::Char* - fun ucal_get_canonical_time_zone_id = ucal_getCanonicalTimeZoneID_52(id : UChar*, len : Int32T, result : UChar*, result_capacity : Int32T, is_system_id : UBool*, status : UErrorCode*) : Int32T - fun ucal_get_day_of_week_type = ucal_getDayOfWeekType_52(cal : UCalendar*, day_of_week : UCalendarDaysOfWeek, status : UErrorCode*) : UCalendarWeekdayType - fun ucal_get_default_time_zone = ucal_getDefaultTimeZone_52(result : UChar*, result_capacity : Int32T, ec : UErrorCode*) : Int32T - fun ucal_get_dst_savings = ucal_getDSTSavings_52(zone_id : UChar*, ec : UErrorCode*) : Int32T - fun ucal_get_field_difference = ucal_getFieldDifference_52(cal : UCalendar*, target : UDate, field : UCalendarDateFields, status : UErrorCode*) : Int32T - fun ucal_get_gregorian_change = ucal_getGregorianChange_52(cal : UCalendar*, p_error_code : UErrorCode*) : UDate - fun ucal_get_keyword_values_for_locale = ucal_getKeywordValuesForLocale_52(key : LibC::Char*, locale : LibC::Char*, commonly_used : UBool, status : UErrorCode*) : UEnumeration - fun ucal_get_limit = ucal_getLimit_52(cal : UCalendar*, field : UCalendarDateFields, type : UCalendarLimitType, status : UErrorCode*) : Int32T - fun ucal_get_locale_by_type = ucal_getLocaleByType_52(cal : UCalendar*, type : ULocDataLocaleType, status : UErrorCode*) : LibC::Char* - fun ucal_get_millis = ucal_getMillis_52(cal : UCalendar*, status : UErrorCode*) : UDate - fun ucal_get_now = ucal_getNow_52 : UDate - fun ucal_get_time_zone_display_name = ucal_getTimeZoneDisplayName_52(cal : UCalendar*, type : UCalendarDisplayNameType, locale : LibC::Char*, result : UChar*, result_length : Int32T, status : UErrorCode*) : Int32T - fun ucal_get_time_zone_id = ucal_getTimeZoneID_52(cal : UCalendar*, result : UChar*, result_length : Int32T, status : UErrorCode*) : Int32T - fun ucal_get_time_zone_id_for_windows_id = ucal_getTimeZoneIDForWindowsID_52(winid : UChar*, len : Int32T, region : LibC::Char*, id : UChar*, id_capacity : Int32T, status : UErrorCode*) : Int32T - fun ucal_get_time_zone_transition_date = ucal_getTimeZoneTransitionDate_52(cal : UCalendar*, type : UTimeZoneTransitionType, transition : UDate*, status : UErrorCode*) : UBool - fun ucal_get_type = ucal_getType_52(cal : UCalendar*, status : UErrorCode*) : LibC::Char* - fun ucal_get_tz_data_version = ucal_getTZDataVersion_52(status : UErrorCode*) : LibC::Char* - fun ucal_get_weekend_transition = ucal_getWeekendTransition_52(cal : UCalendar*, day_of_week : UCalendarDaysOfWeek, status : UErrorCode*) : Int32T - fun ucal_get_windows_time_zone_id = ucal_getWindowsTimeZoneID_52(id : UChar*, len : Int32T, winid : UChar*, winid_capacity : Int32T, status : UErrorCode*) : Int32T - fun ucal_in_daylight_time = ucal_inDaylightTime_52(cal : UCalendar*, status : UErrorCode*) : UBool - fun ucal_is_set = ucal_isSet_52(cal : UCalendar*, field : UCalendarDateFields) : UBool - fun ucal_is_weekend = ucal_isWeekend_52(cal : UCalendar*, date : UDate, status : UErrorCode*) : UBool - fun ucal_open = ucal_open_52(zone_id : UChar*, len : Int32T, locale : LibC::Char*, type : UCalendarType, status : UErrorCode*) : UCalendar* - fun ucal_open_country_time_zones = ucal_openCountryTimeZones_52(country : LibC::Char*, ec : UErrorCode*) : UEnumeration - fun ucal_open_time_zone_id_enumeration = ucal_openTimeZoneIDEnumeration_52(zone_type : USystemTimeZoneType, region : LibC::Char*, raw_offset : Int32T*, ec : UErrorCode*) : UEnumeration - fun ucal_open_time_zones = ucal_openTimeZones_52(ec : UErrorCode*) : UEnumeration - fun ucal_roll = ucal_roll_52(cal : UCalendar*, field : UCalendarDateFields, amount : Int32T, status : UErrorCode*) - fun ucal_set = ucal_set_52(cal : UCalendar*, field : UCalendarDateFields, value : Int32T) - fun ucal_set_attribute = ucal_setAttribute_52(cal : UCalendar*, attr : UCalendarAttribute, new_value : Int32T) - fun ucal_set_date = ucal_setDate_52(cal : UCalendar*, year : Int32T, month : Int32T, date : Int32T, status : UErrorCode*) - fun ucal_set_date_time = ucal_setDateTime_52(cal : UCalendar*, year : Int32T, month : Int32T, date : Int32T, hour : Int32T, minute : Int32T, second : Int32T, status : UErrorCode*) - fun ucal_set_default_time_zone = ucal_setDefaultTimeZone_52(zone_id : UChar*, ec : UErrorCode*) - fun ucal_set_gregorian_change = ucal_setGregorianChange_52(cal : UCalendar*, date : UDate, p_error_code : UErrorCode*) - fun ucal_set_millis = ucal_setMillis_52(cal : UCalendar*, date_time : UDate, status : UErrorCode*) - fun ucal_set_time_zone = ucal_setTimeZone_52(cal : UCalendar*, zone_id : UChar*, len : Int32T, status : UErrorCode*) + fun ucal_add = ucal_add{{SYMS_SUFFIX.id}}(cal : UCalendar*, field : UCalendarDateFields, amount : Int32T, status : UErrorCode*) + fun ucal_clear = ucal_clear{{SYMS_SUFFIX.id}}(calendar : UCalendar*) + fun ucal_clear_field = ucal_clearField{{SYMS_SUFFIX.id}}(cal : UCalendar*, field : UCalendarDateFields) + fun ucal_clone = ucal_clone{{SYMS_SUFFIX.id}}(cal : UCalendar*, status : UErrorCode*) : UCalendar* + fun ucal_close = ucal_close{{SYMS_SUFFIX.id}}(cal : UCalendar*) + fun ucal_count_available = ucal_countAvailable{{SYMS_SUFFIX.id}} : Int32T + fun ucal_equivalent_to = ucal_equivalentTo{{SYMS_SUFFIX.id}}(cal1 : UCalendar*, cal2 : UCalendar*) : UBool + fun ucal_get = ucal_get{{SYMS_SUFFIX.id}}(cal : UCalendar*, field : UCalendarDateFields, status : UErrorCode*) : Int32T + fun ucal_get_attribute = ucal_getAttribute{{SYMS_SUFFIX.id}}(cal : UCalendar*, attr : UCalendarAttribute) : Int32T + fun ucal_get_available = ucal_getAvailable{{SYMS_SUFFIX.id}}(locale_index : Int32T) : LibC::Char* + fun ucal_get_canonical_time_zone_id = ucal_getCanonicalTimeZoneID{{SYMS_SUFFIX.id}}(id : UChar*, len : Int32T, result : UChar*, result_capacity : Int32T, is_system_id : UBool*, status : UErrorCode*) : Int32T + fun ucal_get_day_of_week_type = ucal_getDayOfWeekType{{SYMS_SUFFIX.id}}(cal : UCalendar*, day_of_week : UCalendarDaysOfWeek, status : UErrorCode*) : UCalendarWeekdayType + fun ucal_get_default_time_zone = ucal_getDefaultTimeZone{{SYMS_SUFFIX.id}}(result : UChar*, result_capacity : Int32T, ec : UErrorCode*) : Int32T + fun ucal_get_dst_savings = ucal_getDSTSavings{{SYMS_SUFFIX.id}}(zone_id : UChar*, ec : UErrorCode*) : Int32T + fun ucal_get_field_difference = ucal_getFieldDifference{{SYMS_SUFFIX.id}}(cal : UCalendar*, target : UDate, field : UCalendarDateFields, status : UErrorCode*) : Int32T + fun ucal_get_gregorian_change = ucal_getGregorianChange{{SYMS_SUFFIX.id}}(cal : UCalendar*, p_error_code : UErrorCode*) : UDate + fun ucal_get_keyword_values_for_locale = ucal_getKeywordValuesForLocale{{SYMS_SUFFIX.id}}(key : LibC::Char*, locale : LibC::Char*, commonly_used : UBool, status : UErrorCode*) : UEnumeration + fun ucal_get_limit = ucal_getLimit{{SYMS_SUFFIX.id}}(cal : UCalendar*, field : UCalendarDateFields, type : UCalendarLimitType, status : UErrorCode*) : Int32T + fun ucal_get_locale_by_type = ucal_getLocaleByType{{SYMS_SUFFIX.id}}(cal : UCalendar*, type : ULocDataLocaleType, status : UErrorCode*) : LibC::Char* + fun ucal_get_millis = ucal_getMillis{{SYMS_SUFFIX.id}}(cal : UCalendar*, status : UErrorCode*) : UDate + fun ucal_get_now = ucal_getNow{{SYMS_SUFFIX.id}} : UDate + fun ucal_get_time_zone_display_name = ucal_getTimeZoneDisplayName{{SYMS_SUFFIX.id}}(cal : UCalendar*, type : UCalendarDisplayNameType, locale : LibC::Char*, result : UChar*, result_length : Int32T, status : UErrorCode*) : Int32T + fun ucal_get_time_zone_id = ucal_getTimeZoneID{{SYMS_SUFFIX.id}}(cal : UCalendar*, result : UChar*, result_length : Int32T, status : UErrorCode*) : Int32T + fun ucal_get_time_zone_id_for_windows_id = ucal_getTimeZoneIDForWindowsID{{SYMS_SUFFIX.id}}(winid : UChar*, len : Int32T, region : LibC::Char*, id : UChar*, id_capacity : Int32T, status : UErrorCode*) : Int32T + fun ucal_get_time_zone_transition_date = ucal_getTimeZoneTransitionDate{{SYMS_SUFFIX.id}}(cal : UCalendar*, type : UTimeZoneTransitionType, transition : UDate*, status : UErrorCode*) : UBool + fun ucal_get_type = ucal_getType{{SYMS_SUFFIX.id}}(cal : UCalendar*, status : UErrorCode*) : LibC::Char* + fun ucal_get_tz_data_version = ucal_getTZDataVersion{{SYMS_SUFFIX.id}}(status : UErrorCode*) : LibC::Char* + fun ucal_get_weekend_transition = ucal_getWeekendTransition{{SYMS_SUFFIX.id}}(cal : UCalendar*, day_of_week : UCalendarDaysOfWeek, status : UErrorCode*) : Int32T + fun ucal_get_windows_time_zone_id = ucal_getWindowsTimeZoneID{{SYMS_SUFFIX.id}}(id : UChar*, len : Int32T, winid : UChar*, winid_capacity : Int32T, status : UErrorCode*) : Int32T + fun ucal_in_daylight_time = ucal_inDaylightTime{{SYMS_SUFFIX.id}}(cal : UCalendar*, status : UErrorCode*) : UBool + fun ucal_is_set = ucal_isSet{{SYMS_SUFFIX.id}}(cal : UCalendar*, field : UCalendarDateFields) : UBool + fun ucal_is_weekend = ucal_isWeekend{{SYMS_SUFFIX.id}}(cal : UCalendar*, date : UDate, status : UErrorCode*) : UBool + fun ucal_open = ucal_open{{SYMS_SUFFIX.id}}(zone_id : UChar*, len : Int32T, locale : LibC::Char*, type : UCalendarType, status : UErrorCode*) : UCalendar* + fun ucal_open_country_time_zones = ucal_openCountryTimeZones{{SYMS_SUFFIX.id}}(country : LibC::Char*, ec : UErrorCode*) : UEnumeration + fun ucal_open_time_zone_id_enumeration = ucal_openTimeZoneIDEnumeration{{SYMS_SUFFIX.id}}(zone_type : USystemTimeZoneType, region : LibC::Char*, raw_offset : Int32T*, ec : UErrorCode*) : UEnumeration + fun ucal_open_time_zones = ucal_openTimeZones{{SYMS_SUFFIX.id}}(ec : UErrorCode*) : UEnumeration + fun ucal_roll = ucal_roll{{SYMS_SUFFIX.id}}(cal : UCalendar*, field : UCalendarDateFields, amount : Int32T, status : UErrorCode*) + fun ucal_set = ucal_set{{SYMS_SUFFIX.id}}(cal : UCalendar*, field : UCalendarDateFields, value : Int32T) + fun ucal_set_attribute = ucal_setAttribute{{SYMS_SUFFIX.id}}(cal : UCalendar*, attr : UCalendarAttribute, new_value : Int32T) + fun ucal_set_date = ucal_setDate{{SYMS_SUFFIX.id}}(cal : UCalendar*, year : Int32T, month : Int32T, date : Int32T, status : UErrorCode*) + fun ucal_set_date_time = ucal_setDateTime{{SYMS_SUFFIX.id}}(cal : UCalendar*, year : Int32T, month : Int32T, date : Int32T, hour : Int32T, minute : Int32T, second : Int32T, status : UErrorCode*) + fun ucal_set_default_time_zone = ucal_setDefaultTimeZone{{SYMS_SUFFIX.id}}(zone_id : UChar*, ec : UErrorCode*) + fun ucal_set_gregorian_change = ucal_setGregorianChange{{SYMS_SUFFIX.id}}(cal : UCalendar*, date : UDate, p_error_code : UErrorCode*) + fun ucal_set_millis = ucal_setMillis{{SYMS_SUFFIX.id}}(cal : UCalendar*, date_time : UDate, status : UErrorCode*) + fun ucal_set_time_zone = ucal_setTimeZone{{SYMS_SUFFIX.id}}(cal : UCalendar*, zone_id : UChar*, len : Int32T, status : UErrorCode*) + {% end %} end diff --git a/src/lib_icu/ucnv.cr b/src/lib_icu/ucnv.cr index cb47e1f..0fb3c99 100644 --- a/src/lib_icu/ucnv.cr +++ b/src/lib_icu/ucnv.cr @@ -1,5 +1,6 @@ -@[Link(ldflags: "`command -v pkg-config > /dev/null && pkg-config --libs icu-uc icu-i18n icu-io icu-lx icu-le || printf %s '-licuio -licui18n -liculx -licule -licuuc -licudata'`")] +@[Link(ldflags: "`command -v pkg-config > /dev/null && pkg-config --libs icu-uc icu-i18n icu-io 2> /dev/null|| printf %s '-licuio -licui18n -licuuc -licudata'`")] lib LibICU + {% begin %} alias UConverterFromUCallback = (Void*, UConverterFromUnicodeArgs*, UChar*, Int32T, UChar32, UConverterCallbackReason, UErrorCode* -> Void) alias UConverterToUCallback = (Void*, UConverterToUnicodeArgs*, LibC::Char*, Int32T, UConverterCallbackReason, UErrorCode* -> Void) enum UConverterCallbackReason @@ -58,71 +59,71 @@ lib LibICU UcnvRoundtripAndFallbackSet = 1 UcnvSetCount = 2 end - fun ucnv_close = ucnv_close_52(converter : UConverter) - fun ucnv_compare_names = ucnv_compareNames_52(name1 : LibC::Char*, name2 : LibC::Char*) : LibC::Int - fun ucnv_convert = ucnv_convert_52(to_converter_name : LibC::Char*, from_converter_name : LibC::Char*, target : LibC::Char*, target_capacity : Int32T, source : LibC::Char*, source_length : Int32T, p_error_code : UErrorCode*) : Int32T - fun ucnv_convert_ex = ucnv_convertEx_52(target_cnv : UConverter, source_cnv : UConverter, target : LibC::Char**, target_limit : LibC::Char*, source : LibC::Char**, source_limit : LibC::Char*, pivot_start : UChar*, pivot_source : UChar**, pivot_target : UChar**, pivot_limit : UChar*, reset : UBool, flush : UBool, p_error_code : UErrorCode*) - fun ucnv_count_aliases = ucnv_countAliases_52(alias : LibC::Char*, p_error_code : UErrorCode*) : Uint16T - fun ucnv_count_available = ucnv_countAvailable_52 : Int32T - fun ucnv_count_standards = ucnv_countStandards_52 : Uint16T - fun ucnv_detect_unicode_signature = ucnv_detectUnicodeSignature_52(source : LibC::Char*, source_length : Int32T, signature_length : Int32T*, p_error_code : UErrorCode*) : LibC::Char* - fun ucnv_fix_file_separator = ucnv_fixFileSeparator_52(cnv : UConverter, source : UChar*, source_len : Int32T) - fun ucnv_flush_cache = ucnv_flushCache_52 : Int32T - fun ucnv_from_algorithmic = ucnv_fromAlgorithmic_52(cnv : UConverter, algorithmic_type : UConverterType, target : LibC::Char*, target_capacity : Int32T, source : LibC::Char*, source_length : Int32T, p_error_code : UErrorCode*) : Int32T - fun ucnv_from_u_chars = ucnv_fromUChars_52(cnv : UConverter, dest : LibC::Char*, dest_capacity : Int32T, src : UChar*, src_length : Int32T, p_error_code : UErrorCode*) : Int32T - fun ucnv_from_u_count_pending = ucnv_fromUCountPending_52(cnv : UConverter, status : UErrorCode*) : Int32T - fun ucnv_from_unicode = ucnv_fromUnicode_52(converter : UConverter, target : LibC::Char**, target_limit : LibC::Char*, source : UChar**, source_limit : UChar*, offsets : Int32T*, flush : UBool, err : UErrorCode*) - fun ucnv_get_alias = ucnv_getAlias_52(alias : LibC::Char*, n : Uint16T, p_error_code : UErrorCode*) : LibC::Char* - fun ucnv_get_aliases = ucnv_getAliases_52(alias : LibC::Char*, aliases : LibC::Char**, p_error_code : UErrorCode*) - fun ucnv_get_available_name = ucnv_getAvailableName_52(n : Int32T) : LibC::Char* - fun ucnv_get_canonical_name = ucnv_getCanonicalName_52(alias : LibC::Char*, standard : LibC::Char*, p_error_code : UErrorCode*) : LibC::Char* - fun ucnv_get_ccsid = ucnv_getCCSID_52(converter : UConverter, err : UErrorCode*) : Int32T - fun ucnv_get_default_name = ucnv_getDefaultName_52 : LibC::Char* - fun ucnv_get_display_name = ucnv_getDisplayName_52(converter : UConverter, display_locale : LibC::Char*, display_name : UChar*, display_name_capacity : Int32T, err : UErrorCode*) : Int32T - fun ucnv_get_from_u_call_back = ucnv_getFromUCallBack_52(converter : UConverter, action : UConverterFromUCallback*, context : Void**) - fun ucnv_get_invalid_chars = ucnv_getInvalidChars_52(converter : UConverter, err_bytes : LibC::Char*, len : Int8T*, err : UErrorCode*) - fun ucnv_get_invalid_u_chars = ucnv_getInvalidUChars_52(converter : UConverter, err_u_chars : UChar*, len : Int8T*, err : UErrorCode*) - fun ucnv_get_max_char_size = ucnv_getMaxCharSize_52(converter : UConverter) : Int8T - fun ucnv_get_min_char_size = ucnv_getMinCharSize_52(converter : UConverter) : Int8T - fun ucnv_get_name = ucnv_getName_52(converter : UConverter, err : UErrorCode*) : LibC::Char* - fun ucnv_get_next_u_char = ucnv_getNextUChar_52(converter : UConverter, source : LibC::Char**, source_limit : LibC::Char*, err : UErrorCode*) : UChar32 - fun ucnv_get_platform = ucnv_getPlatform_52(converter : UConverter, err : UErrorCode*) : UConverterPlatform - fun ucnv_get_standard = ucnv_getStandard_52(n : Uint16T, p_error_code : UErrorCode*) : LibC::Char* - fun ucnv_get_standard_name = ucnv_getStandardName_52(name : LibC::Char*, standard : LibC::Char*, p_error_code : UErrorCode*) : LibC::Char* - fun ucnv_get_starters = ucnv_getStarters_52(converter : UConverter, starters : UBool[256], err : UErrorCode*) - fun ucnv_get_subst_chars = ucnv_getSubstChars_52(converter : UConverter, sub_chars : LibC::Char*, len : Int8T*, err : UErrorCode*) - fun ucnv_get_to_u_call_back = ucnv_getToUCallBack_52(converter : UConverter, action : UConverterToUCallback*, context : Void**) - fun ucnv_get_type = ucnv_getType_52(converter : UConverter) : UConverterType - fun ucnv_get_unicode_set = ucnv_getUnicodeSet_52(cnv : UConverter, set_fill_in : USet, which_set : UConverterUnicodeSet, p_error_code : UErrorCode*) - fun ucnv_is_ambiguous = ucnv_isAmbiguous_52(cnv : UConverter) : UBool - fun ucnv_is_fixed_width = ucnv_isFixedWidth_52(cnv : UConverter, status : UErrorCode*) : UBool - fun ucnv_open = ucnv_open_52(converter_name : LibC::Char*, err : UErrorCode*) : UConverter - fun ucnv_open_all_names = ucnv_openAllNames_52(p_error_code : UErrorCode*) : UEnumeration - fun ucnv_open_ccsid = ucnv_openCCSID_52(codepage : Int32T, platform : UConverterPlatform, err : UErrorCode*) : UConverter - fun ucnv_open_package = ucnv_openPackage_52(package_name : LibC::Char*, converter_name : LibC::Char*, err : UErrorCode*) : UConverter - fun ucnv_open_standard_names = ucnv_openStandardNames_52(conv_name : LibC::Char*, standard : LibC::Char*, p_error_code : UErrorCode*) : UEnumeration - fun ucnv_open_u = ucnv_openU_52(name : UChar*, err : UErrorCode*) : UConverter - fun ucnv_reset = ucnv_reset_52(converter : UConverter) - fun ucnv_reset_from_unicode = ucnv_resetFromUnicode_52(converter : UConverter) - fun ucnv_reset_to_unicode = ucnv_resetToUnicode_52(converter : UConverter) - fun ucnv_safe_clone = ucnv_safeClone_52(cnv : UConverter, stack_buffer : Void*, p_buffer_size : Int32T*, status : UErrorCode*) : UConverter - fun ucnv_set_default_name = ucnv_setDefaultName_52(name : LibC::Char*) - fun ucnv_set_fallback = ucnv_setFallback_52(cnv : UConverter, uses_fallback : UBool) - fun ucnv_set_from_u_call_back = ucnv_setFromUCallBack_52(converter : UConverter, new_action : UConverterFromUCallback, new_context : Void*, old_action : UConverterFromUCallback*, old_context : Void**, err : UErrorCode*) - fun ucnv_set_subst_chars = ucnv_setSubstChars_52(converter : UConverter, sub_chars : LibC::Char*, len : Int8T, err : UErrorCode*) - fun ucnv_set_subst_string = ucnv_setSubstString_52(cnv : UConverter, s : UChar*, length : Int32T, err : UErrorCode*) - fun ucnv_set_to_u_call_back = ucnv_setToUCallBack_52(converter : UConverter, new_action : UConverterToUCallback, new_context : Void*, old_action : UConverterToUCallback*, old_context : Void**, err : UErrorCode*) - fun ucnv_to_algorithmic = ucnv_toAlgorithmic_52(algorithmic_type : UConverterType, cnv : UConverter, target : LibC::Char*, target_capacity : Int32T, source : LibC::Char*, source_length : Int32T, p_error_code : UErrorCode*) : Int32T - fun ucnv_to_u_chars = ucnv_toUChars_52(cnv : UConverter, dest : UChar*, dest_capacity : Int32T, src : LibC::Char*, src_length : Int32T, p_error_code : UErrorCode*) : Int32T - fun ucnv_to_u_count_pending = ucnv_toUCountPending_52(cnv : UConverter, status : UErrorCode*) : Int32T - fun ucnv_to_unicode = ucnv_toUnicode_52(converter : UConverter, target : UChar**, target_limit : UChar*, source : LibC::Char**, source_limit : LibC::Char*, offsets : Int32T*, flush : UBool, err : UErrorCode*) - fun ucnv_uses_fallback = ucnv_usesFallback_52(cnv : UConverter) : UBool - fun ucnvsel_close = ucnvsel_close_52(sel : UConverterSelector) - fun ucnvsel_open = ucnvsel_open_52(converter_list : LibC::Char**, converter_list_size : Int32T, excluded_code_points : USet, which_set : UConverterUnicodeSet, status : UErrorCode*) : UConverterSelector - fun ucnvsel_open_from_serialized = ucnvsel_openFromSerialized_52(buffer : Void*, length : Int32T, status : UErrorCode*) : UConverterSelector - fun ucnvsel_select_for_string = ucnvsel_selectForString_52(sel : UConverterSelector, s : UChar*, length : Int32T, status : UErrorCode*) : UEnumeration - fun ucnvsel_select_for_ut_f8 = ucnvsel_selectForUTF8_52(sel : UConverterSelector, s : LibC::Char*, length : Int32T, status : UErrorCode*) : UEnumeration - fun ucnvsel_serialize = ucnvsel_serialize_52(sel : UConverterSelector, buffer : Void*, buffer_capacity : Int32T, status : UErrorCode*) : Int32T + fun ucnv_close = ucnv_close{{SYMS_SUFFIX.id}}(converter : UConverter) + fun ucnv_compare_names = ucnv_compareNames{{SYMS_SUFFIX.id}}(name1 : LibC::Char*, name2 : LibC::Char*) : LibC::Int + fun ucnv_convert = ucnv_convert{{SYMS_SUFFIX.id}}(to_converter_name : LibC::Char*, from_converter_name : LibC::Char*, target : LibC::Char*, target_capacity : Int32T, source : LibC::Char*, source_length : Int32T, p_error_code : UErrorCode*) : Int32T + fun ucnv_convert_ex = ucnv_convertEx{{SYMS_SUFFIX.id}}(target_cnv : UConverter, source_cnv : UConverter, target : LibC::Char**, target_limit : LibC::Char*, source : LibC::Char**, source_limit : LibC::Char*, pivot_start : UChar*, pivot_source : UChar**, pivot_target : UChar**, pivot_limit : UChar*, reset : UBool, flush : UBool, p_error_code : UErrorCode*) + fun ucnv_count_aliases = ucnv_countAliases{{SYMS_SUFFIX.id}}(alias : LibC::Char*, p_error_code : UErrorCode*) : Uint16T + fun ucnv_count_available = ucnv_countAvailable{{SYMS_SUFFIX.id}} : Int32T + fun ucnv_count_standards = ucnv_countStandards{{SYMS_SUFFIX.id}} : Uint16T + fun ucnv_detect_unicode_signature = ucnv_detectUnicodeSignature{{SYMS_SUFFIX.id}}(source : LibC::Char*, source_length : Int32T, signature_length : Int32T*, p_error_code : UErrorCode*) : LibC::Char* + fun ucnv_fix_file_separator = ucnv_fixFileSeparator{{SYMS_SUFFIX.id}}(cnv : UConverter, source : UChar*, source_len : Int32T) + fun ucnv_flush_cache = ucnv_flushCache{{SYMS_SUFFIX.id}} : Int32T + fun ucnv_from_algorithmic = ucnv_fromAlgorithmic{{SYMS_SUFFIX.id}}(cnv : UConverter, algorithmic_type : UConverterType, target : LibC::Char*, target_capacity : Int32T, source : LibC::Char*, source_length : Int32T, p_error_code : UErrorCode*) : Int32T + fun ucnv_from_u_chars = ucnv_fromUChars{{SYMS_SUFFIX.id}}(cnv : UConverter, dest : LibC::Char*, dest_capacity : Int32T, src : UChar*, src_length : Int32T, p_error_code : UErrorCode*) : Int32T + fun ucnv_from_u_count_pending = ucnv_fromUCountPending{{SYMS_SUFFIX.id}}(cnv : UConverter, status : UErrorCode*) : Int32T + fun ucnv_from_unicode = ucnv_fromUnicode{{SYMS_SUFFIX.id}}(converter : UConverter, target : LibC::Char**, target_limit : LibC::Char*, source : UChar**, source_limit : UChar*, offsets : Int32T*, flush : UBool, err : UErrorCode*) + fun ucnv_get_alias = ucnv_getAlias{{SYMS_SUFFIX.id}}(alias : LibC::Char*, n : Uint16T, p_error_code : UErrorCode*) : LibC::Char* + fun ucnv_get_aliases = ucnv_getAliases{{SYMS_SUFFIX.id}}(alias : LibC::Char*, aliases : LibC::Char**, p_error_code : UErrorCode*) + fun ucnv_get_available_name = ucnv_getAvailableName{{SYMS_SUFFIX.id}}(n : Int32T) : LibC::Char* + fun ucnv_get_canonical_name = ucnv_getCanonicalName{{SYMS_SUFFIX.id}}(alias : LibC::Char*, standard : LibC::Char*, p_error_code : UErrorCode*) : LibC::Char* + fun ucnv_get_ccsid = ucnv_getCCSID{{SYMS_SUFFIX.id}}(converter : UConverter, err : UErrorCode*) : Int32T + fun ucnv_get_default_name = ucnv_getDefaultName{{SYMS_SUFFIX.id}} : LibC::Char* + fun ucnv_get_display_name = ucnv_getDisplayName{{SYMS_SUFFIX.id}}(converter : UConverter, display_locale : LibC::Char*, display_name : UChar*, display_name_capacity : Int32T, err : UErrorCode*) : Int32T + fun ucnv_get_from_u_call_back = ucnv_getFromUCallBack{{SYMS_SUFFIX.id}}(converter : UConverter, action : UConverterFromUCallback*, context : Void**) + fun ucnv_get_invalid_chars = ucnv_getInvalidChars{{SYMS_SUFFIX.id}}(converter : UConverter, err_bytes : LibC::Char*, len : Int8T*, err : UErrorCode*) + fun ucnv_get_invalid_u_chars = ucnv_getInvalidUChars{{SYMS_SUFFIX.id}}(converter : UConverter, err_u_chars : UChar*, len : Int8T*, err : UErrorCode*) + fun ucnv_get_max_char_size = ucnv_getMaxCharSize{{SYMS_SUFFIX.id}}(converter : UConverter) : Int8T + fun ucnv_get_min_char_size = ucnv_getMinCharSize{{SYMS_SUFFIX.id}}(converter : UConverter) : Int8T + fun ucnv_get_name = ucnv_getName{{SYMS_SUFFIX.id}}(converter : UConverter, err : UErrorCode*) : LibC::Char* + fun ucnv_get_next_u_char = ucnv_getNextUChar{{SYMS_SUFFIX.id}}(converter : UConverter, source : LibC::Char**, source_limit : LibC::Char*, err : UErrorCode*) : UChar32 + fun ucnv_get_platform = ucnv_getPlatform{{SYMS_SUFFIX.id}}(converter : UConverter, err : UErrorCode*) : UConverterPlatform + fun ucnv_get_standard = ucnv_getStandard{{SYMS_SUFFIX.id}}(n : Uint16T, p_error_code : UErrorCode*) : LibC::Char* + fun ucnv_get_standard_name = ucnv_getStandardName{{SYMS_SUFFIX.id}}(name : LibC::Char*, standard : LibC::Char*, p_error_code : UErrorCode*) : LibC::Char* + fun ucnv_get_starters = ucnv_getStarters{{SYMS_SUFFIX.id}}(converter : UConverter, starters : UBool[256], err : UErrorCode*) + fun ucnv_get_subst_chars = ucnv_getSubstChars{{SYMS_SUFFIX.id}}(converter : UConverter, sub_chars : LibC::Char*, len : Int8T*, err : UErrorCode*) + fun ucnv_get_to_u_call_back = ucnv_getToUCallBack{{SYMS_SUFFIX.id}}(converter : UConverter, action : UConverterToUCallback*, context : Void**) + fun ucnv_get_type = ucnv_getType{{SYMS_SUFFIX.id}}(converter : UConverter) : UConverterType + fun ucnv_get_unicode_set = ucnv_getUnicodeSet{{SYMS_SUFFIX.id}}(cnv : UConverter, set_fill_in : USet, which_set : UConverterUnicodeSet, p_error_code : UErrorCode*) + fun ucnv_is_ambiguous = ucnv_isAmbiguous{{SYMS_SUFFIX.id}}(cnv : UConverter) : UBool + fun ucnv_is_fixed_width = ucnv_isFixedWidth{{SYMS_SUFFIX.id}}(cnv : UConverter, status : UErrorCode*) : UBool + fun ucnv_open = ucnv_open{{SYMS_SUFFIX.id}}(converter_name : LibC::Char*, err : UErrorCode*) : UConverter + fun ucnv_open_all_names = ucnv_openAllNames{{SYMS_SUFFIX.id}}(p_error_code : UErrorCode*) : UEnumeration + fun ucnv_open_ccsid = ucnv_openCCSID{{SYMS_SUFFIX.id}}(codepage : Int32T, platform : UConverterPlatform, err : UErrorCode*) : UConverter + fun ucnv_open_package = ucnv_openPackage{{SYMS_SUFFIX.id}}(package_name : LibC::Char*, converter_name : LibC::Char*, err : UErrorCode*) : UConverter + fun ucnv_open_standard_names = ucnv_openStandardNames{{SYMS_SUFFIX.id}}(conv_name : LibC::Char*, standard : LibC::Char*, p_error_code : UErrorCode*) : UEnumeration + fun ucnv_open_u = ucnv_openU{{SYMS_SUFFIX.id}}(name : UChar*, err : UErrorCode*) : UConverter + fun ucnv_reset = ucnv_reset{{SYMS_SUFFIX.id}}(converter : UConverter) + fun ucnv_reset_from_unicode = ucnv_resetFromUnicode{{SYMS_SUFFIX.id}}(converter : UConverter) + fun ucnv_reset_to_unicode = ucnv_resetToUnicode{{SYMS_SUFFIX.id}}(converter : UConverter) + fun ucnv_safe_clone = ucnv_safeClone{{SYMS_SUFFIX.id}}(cnv : UConverter, stack_buffer : Void*, p_buffer_size : Int32T*, status : UErrorCode*) : UConverter + fun ucnv_set_default_name = ucnv_setDefaultName{{SYMS_SUFFIX.id}}(name : LibC::Char*) + fun ucnv_set_fallback = ucnv_setFallback{{SYMS_SUFFIX.id}}(cnv : UConverter, uses_fallback : UBool) + fun ucnv_set_from_u_call_back = ucnv_setFromUCallBack{{SYMS_SUFFIX.id}}(converter : UConverter, new_action : UConverterFromUCallback, new_context : Void*, old_action : UConverterFromUCallback*, old_context : Void**, err : UErrorCode*) + fun ucnv_set_subst_chars = ucnv_setSubstChars{{SYMS_SUFFIX.id}}(converter : UConverter, sub_chars : LibC::Char*, len : Int8T, err : UErrorCode*) + fun ucnv_set_subst_string = ucnv_setSubstString{{SYMS_SUFFIX.id}}(cnv : UConverter, s : UChar*, length : Int32T, err : UErrorCode*) + fun ucnv_set_to_u_call_back = ucnv_setToUCallBack{{SYMS_SUFFIX.id}}(converter : UConverter, new_action : UConverterToUCallback, new_context : Void*, old_action : UConverterToUCallback*, old_context : Void**, err : UErrorCode*) + fun ucnv_to_algorithmic = ucnv_toAlgorithmic{{SYMS_SUFFIX.id}}(algorithmic_type : UConverterType, cnv : UConverter, target : LibC::Char*, target_capacity : Int32T, source : LibC::Char*, source_length : Int32T, p_error_code : UErrorCode*) : Int32T + fun ucnv_to_u_chars = ucnv_toUChars{{SYMS_SUFFIX.id}}(cnv : UConverter, dest : UChar*, dest_capacity : Int32T, src : LibC::Char*, src_length : Int32T, p_error_code : UErrorCode*) : Int32T + fun ucnv_to_u_count_pending = ucnv_toUCountPending{{SYMS_SUFFIX.id}}(cnv : UConverter, status : UErrorCode*) : Int32T + fun ucnv_to_unicode = ucnv_toUnicode{{SYMS_SUFFIX.id}}(converter : UConverter, target : UChar**, target_limit : UChar*, source : LibC::Char**, source_limit : LibC::Char*, offsets : Int32T*, flush : UBool, err : UErrorCode*) + fun ucnv_uses_fallback = ucnv_usesFallback{{SYMS_SUFFIX.id}}(cnv : UConverter) : UBool + fun ucnvsel_close = ucnvsel_close{{SYMS_SUFFIX.id}}(sel : UConverterSelector) + fun ucnvsel_open = ucnvsel_open{{SYMS_SUFFIX.id}}(converter_list : LibC::Char**, converter_list_size : Int32T, excluded_code_points : USet, which_set : UConverterUnicodeSet, status : UErrorCode*) : UConverterSelector + fun ucnvsel_open_from_serialized = ucnvsel_openFromSerialized{{SYMS_SUFFIX.id}}(buffer : Void*, length : Int32T, status : UErrorCode*) : UConverterSelector + fun ucnvsel_select_for_string = ucnvsel_selectForString{{SYMS_SUFFIX.id}}(sel : UConverterSelector, s : UChar*, length : Int32T, status : UErrorCode*) : UEnumeration + fun ucnvsel_select_for_ut_f8 = ucnvsel_selectForUTF8{{SYMS_SUFFIX.id}}(sel : UConverterSelector, s : LibC::Char*, length : Int32T, status : UErrorCode*) : UEnumeration + fun ucnvsel_serialize = ucnvsel_serialize{{SYMS_SUFFIX.id}}(sel : UConverterSelector, buffer : Void*, buffer_capacity : Int32T, status : UErrorCode*) : Int32T struct UConverterFromUnicodeArgs size : Uint16T @@ -148,4 +149,5 @@ lib LibICU type UConverter = Void* type UConverterSelector = Void* + {% end %} end diff --git a/src/lib_icu/ucol.cr b/src/lib_icu/ucol.cr index 9993c53..45cc2ac 100644 --- a/src/lib_icu/ucol.cr +++ b/src/lib_icu/ucol.cr @@ -1,5 +1,6 @@ -@[Link(ldflags: "`command -v pkg-config > /dev/null && pkg-config --libs icu-uc icu-i18n icu-io icu-lx icu-le || printf %s '-licuio -licui18n -liculx -licule -licuuc -licudata'`")] +@[Link(ldflags: "`command -v pkg-config > /dev/null && pkg-config --libs icu-uc icu-i18n icu-io 2> /dev/null|| printf %s '-licuio -licui18n -licuuc -licudata'`")] lib LibICU + {% begin %} alias UCollationStrength = UColAttributeValue enum UColAttribute UcolFrenchCollation = 0 @@ -46,55 +47,56 @@ lib LibICU UcolGreater = 1 UcolLess = -1 end - fun ucol_clone_binary = ucol_cloneBinary_52(coll : UCollator, buffer : Uint8T*, capacity : Int32T, status : UErrorCode*) : Int32T - fun ucol_close = ucol_close_52(coll : UCollator) - fun ucol_count_available = ucol_countAvailable_52 : Int32T - fun ucol_equal = ucol_equal_52(coll : UCollator, source : UChar*, source_length : Int32T, target : UChar*, target_length : Int32T) : UBool - fun ucol_equals = ucol_equals_52(source : UCollator, target : UCollator) : UBool - fun ucol_forget_uca = ucol_forgetUCA_52 - fun ucol_get_attribute = ucol_getAttribute_52(coll : UCollator, attr : UColAttribute, status : UErrorCode*) : UColAttributeValue - fun ucol_get_attribute_or_default = ucol_getAttributeOrDefault_52(coll : UCollator, attr : UColAttribute, status : UErrorCode*) : UColAttributeValue - fun ucol_get_available = ucol_getAvailable_52(locale_index : Int32T) : LibC::Char* - fun ucol_get_bound = ucol_getBound_52(source : Uint8T*, source_length : Int32T, bound_type : UColBoundMode, no_of_levels : Uint32T, result : Uint8T*, result_length : Int32T, status : UErrorCode*) : Int32T - fun ucol_get_contractions = ucol_getContractions_52(coll : UCollator, conts : USet, status : UErrorCode*) : Int32T - fun ucol_get_contractions_and_expansions = ucol_getContractionsAndExpansions_52(coll : UCollator, contractions : USet, expansions : USet, add_prefixes : UBool, status : UErrorCode*) - fun ucol_get_display_name = ucol_getDisplayName_52(obj_loc : LibC::Char*, disp_loc : LibC::Char*, result : UChar*, result_length : Int32T, status : UErrorCode*) : Int32T - fun ucol_get_equivalent_reorder_codes = ucol_getEquivalentReorderCodes_52(reorder_code : Int32T, dest : Int32T*, dest_capacity : Int32T, p_error_code : UErrorCode*) : Int32T - fun ucol_get_functional_equivalent = ucol_getFunctionalEquivalent_52(result : LibC::Char*, result_capacity : Int32T, keyword : LibC::Char*, locale : LibC::Char*, is_available : UBool*, status : UErrorCode*) : Int32T - fun ucol_get_keyword_values = ucol_getKeywordValues_52(keyword : LibC::Char*, status : UErrorCode*) : UEnumeration - fun ucol_get_keyword_values_for_locale = ucol_getKeywordValuesForLocale_52(key : LibC::Char*, locale : LibC::Char*, commonly_used : UBool, status : UErrorCode*) : UEnumeration - fun ucol_get_keywords = ucol_getKeywords_52(status : UErrorCode*) : UEnumeration - fun ucol_get_locale = ucol_getLocale_52(coll : UCollator, type : ULocDataLocaleType, status : UErrorCode*) : LibC::Char* - fun ucol_get_locale_by_type = ucol_getLocaleByType_52(coll : UCollator, type : ULocDataLocaleType, status : UErrorCode*) : LibC::Char* - fun ucol_get_reorder_codes = ucol_getReorderCodes_52(coll : UCollator, dest : Int32T*, dest_capacity : Int32T, p_error_code : UErrorCode*) : Int32T - fun ucol_get_rules = ucol_getRules_52(coll : UCollator, length : Int32T*) : UChar* - fun ucol_get_rules_ex = ucol_getRulesEx_52(coll : UCollator, delta : UColRuleOption, buffer : UChar*, buffer_len : Int32T) : Int32T - fun ucol_get_short_definition_string = ucol_getShortDefinitionString_52(coll : UCollator, locale : LibC::Char*, buffer : LibC::Char*, capacity : Int32T, status : UErrorCode*) : Int32T - fun ucol_get_sort_key = ucol_getSortKey_52(coll : UCollator, source : UChar*, source_length : Int32T, result : Uint8T*, result_length : Int32T) : Int32T - fun ucol_get_strength = ucol_getStrength_52(coll : UCollator) : UCollationStrength - fun ucol_get_tailored_set = ucol_getTailoredSet_52(coll : UCollator, status : UErrorCode*) : USet - fun ucol_get_uca_version = ucol_getUCAVersion_52(coll : UCollator, info : UVersionInfo) - fun ucol_get_unsafe_set = ucol_getUnsafeSet_52(coll : UCollator, unsafe : USet, status : UErrorCode*) : Int32T - fun ucol_get_variable_top = ucol_getVariableTop_52(coll : UCollator, status : UErrorCode*) : Uint32T - fun ucol_get_version = ucol_getVersion_52(coll : UCollator, info : UVersionInfo) - fun ucol_greater = ucol_greater_52(coll : UCollator, source : UChar*, source_length : Int32T, target : UChar*, target_length : Int32T) : UBool - fun ucol_greater_or_equal = ucol_greaterOrEqual_52(coll : UCollator, source : UChar*, source_length : Int32T, target : UChar*, target_length : Int32T) : UBool - fun ucol_merge_sortkeys = ucol_mergeSortkeys_52(src1 : Uint8T*, src1length : Int32T, src2 : Uint8T*, src2length : Int32T, dest : Uint8T*, dest_capacity : Int32T) : Int32T - fun ucol_next_sort_key_part = ucol_nextSortKeyPart_52(coll : UCollator, iter : UCharIterator*, state : Uint32T[2], dest : Uint8T*, count : Int32T, status : UErrorCode*) : Int32T - fun ucol_normalize_short_definition_string = ucol_normalizeShortDefinitionString_52(source : LibC::Char*, destination : LibC::Char*, capacity : Int32T, parse_error : UParseError*, status : UErrorCode*) : Int32T - fun ucol_open = ucol_open_52(loc : LibC::Char*, status : UErrorCode*) : UCollator - fun ucol_open_available_locales = ucol_openAvailableLocales_52(status : UErrorCode*) : UEnumeration - fun ucol_open_binary = ucol_openBinary_52(bin : Uint8T*, length : Int32T, base : UCollator, status : UErrorCode*) : UCollator - fun ucol_open_from_short_string = ucol_openFromShortString_52(definition : LibC::Char*, force_defaults : UBool, parse_error : UParseError*, status : UErrorCode*) : UCollator - fun ucol_open_rules = ucol_openRules_52(rules : UChar*, rules_length : Int32T, normalization_mode : UColAttributeValue, strength : UCollationStrength, parse_error : UParseError*, status : UErrorCode*) : UCollator - fun ucol_prepare_short_string_open = ucol_prepareShortStringOpen_52(definition : LibC::Char*, force_defaults : UBool, parse_error : UParseError*, status : UErrorCode*) - fun ucol_restore_variable_top = ucol_restoreVariableTop_52(coll : UCollator, var_top : Uint32T, status : UErrorCode*) - fun ucol_safe_clone = ucol_safeClone_52(coll : UCollator, stack_buffer : Void*, p_buffer_size : Int32T*, status : UErrorCode*) : UCollator - fun ucol_set_attribute = ucol_setAttribute_52(coll : UCollator, attr : UColAttribute, value : UColAttributeValue, status : UErrorCode*) - fun ucol_set_reorder_codes = ucol_setReorderCodes_52(coll : UCollator, reorder_codes : Int32T*, reorder_codes_length : Int32T, p_error_code : UErrorCode*) - fun ucol_set_strength = ucol_setStrength_52(coll : UCollator, strength : UCollationStrength) - fun ucol_set_variable_top = ucol_setVariableTop_52(coll : UCollator, var_top : UChar*, len : Int32T, status : UErrorCode*) : Uint32T - fun ucol_strcoll = ucol_strcoll_52(coll : UCollator, source : UChar*, source_length : Int32T, target : UChar*, target_length : Int32T) : UCollationResult - fun ucol_strcoll_iter = ucol_strcollIter_52(coll : UCollator, s_iter : UCharIterator*, t_iter : UCharIterator*, status : UErrorCode*) : UCollationResult - fun ucol_strcoll_ut_f8 = ucol_strcollUTF8_52(coll : UCollator, source : LibC::Char*, source_length : Int32T, target : LibC::Char*, target_length : Int32T, status : UErrorCode*) : UCollationResult + fun ucol_clone_binary = ucol_cloneBinary{{SYMS_SUFFIX.id}}(coll : UCollator, buffer : Uint8T*, capacity : Int32T, status : UErrorCode*) : Int32T + fun ucol_close = ucol_close{{SYMS_SUFFIX.id}}(coll : UCollator) + fun ucol_count_available = ucol_countAvailable{{SYMS_SUFFIX.id}} : Int32T + fun ucol_equal = ucol_equal{{SYMS_SUFFIX.id}}(coll : UCollator, source : UChar*, source_length : Int32T, target : UChar*, target_length : Int32T) : UBool + fun ucol_equals = ucol_equals{{SYMS_SUFFIX.id}}(source : UCollator, target : UCollator) : UBool + fun ucol_forget_uca = ucol_forgetUCA{{SYMS_SUFFIX.id}} + fun ucol_get_attribute = ucol_getAttribute{{SYMS_SUFFIX.id}}(coll : UCollator, attr : UColAttribute, status : UErrorCode*) : UColAttributeValue + fun ucol_get_attribute_or_default = ucol_getAttributeOrDefault{{SYMS_SUFFIX.id}}(coll : UCollator, attr : UColAttribute, status : UErrorCode*) : UColAttributeValue + fun ucol_get_available = ucol_getAvailable{{SYMS_SUFFIX.id}}(locale_index : Int32T) : LibC::Char* + fun ucol_get_bound = ucol_getBound{{SYMS_SUFFIX.id}}(source : Uint8T*, source_length : Int32T, bound_type : UColBoundMode, no_of_levels : Uint32T, result : Uint8T*, result_length : Int32T, status : UErrorCode*) : Int32T + fun ucol_get_contractions = ucol_getContractions{{SYMS_SUFFIX.id}}(coll : UCollator, conts : USet, status : UErrorCode*) : Int32T + fun ucol_get_contractions_and_expansions = ucol_getContractionsAndExpansions{{SYMS_SUFFIX.id}}(coll : UCollator, contractions : USet, expansions : USet, add_prefixes : UBool, status : UErrorCode*) + fun ucol_get_display_name = ucol_getDisplayName{{SYMS_SUFFIX.id}}(obj_loc : LibC::Char*, disp_loc : LibC::Char*, result : UChar*, result_length : Int32T, status : UErrorCode*) : Int32T + fun ucol_get_equivalent_reorder_codes = ucol_getEquivalentReorderCodes{{SYMS_SUFFIX.id}}(reorder_code : Int32T, dest : Int32T*, dest_capacity : Int32T, p_error_code : UErrorCode*) : Int32T + fun ucol_get_functional_equivalent = ucol_getFunctionalEquivalent{{SYMS_SUFFIX.id}}(result : LibC::Char*, result_capacity : Int32T, keyword : LibC::Char*, locale : LibC::Char*, is_available : UBool*, status : UErrorCode*) : Int32T + fun ucol_get_keyword_values = ucol_getKeywordValues{{SYMS_SUFFIX.id}}(keyword : LibC::Char*, status : UErrorCode*) : UEnumeration + fun ucol_get_keyword_values_for_locale = ucol_getKeywordValuesForLocale{{SYMS_SUFFIX.id}}(key : LibC::Char*, locale : LibC::Char*, commonly_used : UBool, status : UErrorCode*) : UEnumeration + fun ucol_get_keywords = ucol_getKeywords{{SYMS_SUFFIX.id}}(status : UErrorCode*) : UEnumeration + fun ucol_get_locale = ucol_getLocale{{SYMS_SUFFIX.id}}(coll : UCollator, type : ULocDataLocaleType, status : UErrorCode*) : LibC::Char* + fun ucol_get_locale_by_type = ucol_getLocaleByType{{SYMS_SUFFIX.id}}(coll : UCollator, type : ULocDataLocaleType, status : UErrorCode*) : LibC::Char* + fun ucol_get_reorder_codes = ucol_getReorderCodes{{SYMS_SUFFIX.id}}(coll : UCollator, dest : Int32T*, dest_capacity : Int32T, p_error_code : UErrorCode*) : Int32T + fun ucol_get_rules = ucol_getRules{{SYMS_SUFFIX.id}}(coll : UCollator, length : Int32T*) : UChar* + fun ucol_get_rules_ex = ucol_getRulesEx{{SYMS_SUFFIX.id}}(coll : UCollator, delta : UColRuleOption, buffer : UChar*, buffer_len : Int32T) : Int32T + fun ucol_get_short_definition_string = ucol_getShortDefinitionString{{SYMS_SUFFIX.id}}(coll : UCollator, locale : LibC::Char*, buffer : LibC::Char*, capacity : Int32T, status : UErrorCode*) : Int32T + fun ucol_get_sort_key = ucol_getSortKey{{SYMS_SUFFIX.id}}(coll : UCollator, source : UChar*, source_length : Int32T, result : Uint8T*, result_length : Int32T) : Int32T + fun ucol_get_strength = ucol_getStrength{{SYMS_SUFFIX.id}}(coll : UCollator) : UCollationStrength + fun ucol_get_tailored_set = ucol_getTailoredSet{{SYMS_SUFFIX.id}}(coll : UCollator, status : UErrorCode*) : USet + fun ucol_get_uca_version = ucol_getUCAVersion{{SYMS_SUFFIX.id}}(coll : UCollator, info : UVersionInfo) + fun ucol_get_unsafe_set = ucol_getUnsafeSet{{SYMS_SUFFIX.id}}(coll : UCollator, unsafe : USet, status : UErrorCode*) : Int32T + fun ucol_get_variable_top = ucol_getVariableTop{{SYMS_SUFFIX.id}}(coll : UCollator, status : UErrorCode*) : Uint32T + fun ucol_get_version = ucol_getVersion{{SYMS_SUFFIX.id}}(coll : UCollator, info : UVersionInfo) + fun ucol_greater = ucol_greater{{SYMS_SUFFIX.id}}(coll : UCollator, source : UChar*, source_length : Int32T, target : UChar*, target_length : Int32T) : UBool + fun ucol_greater_or_equal = ucol_greaterOrEqual{{SYMS_SUFFIX.id}}(coll : UCollator, source : UChar*, source_length : Int32T, target : UChar*, target_length : Int32T) : UBool + fun ucol_merge_sortkeys = ucol_mergeSortkeys{{SYMS_SUFFIX.id}}(src1 : Uint8T*, src1length : Int32T, src2 : Uint8T*, src2length : Int32T, dest : Uint8T*, dest_capacity : Int32T) : Int32T + fun ucol_next_sort_key_part = ucol_nextSortKeyPart{{SYMS_SUFFIX.id}}(coll : UCollator, iter : UCharIterator*, state : Uint32T[2], dest : Uint8T*, count : Int32T, status : UErrorCode*) : Int32T + fun ucol_normalize_short_definition_string = ucol_normalizeShortDefinitionString{{SYMS_SUFFIX.id}}(source : LibC::Char*, destination : LibC::Char*, capacity : Int32T, parse_error : UParseError*, status : UErrorCode*) : Int32T + fun ucol_open = ucol_open{{SYMS_SUFFIX.id}}(loc : LibC::Char*, status : UErrorCode*) : UCollator + fun ucol_open_available_locales = ucol_openAvailableLocales{{SYMS_SUFFIX.id}}(status : UErrorCode*) : UEnumeration + fun ucol_open_binary = ucol_openBinary{{SYMS_SUFFIX.id}}(bin : Uint8T*, length : Int32T, base : UCollator, status : UErrorCode*) : UCollator + fun ucol_open_from_short_string = ucol_openFromShortString{{SYMS_SUFFIX.id}}(definition : LibC::Char*, force_defaults : UBool, parse_error : UParseError*, status : UErrorCode*) : UCollator + fun ucol_open_rules = ucol_openRules{{SYMS_SUFFIX.id}}(rules : UChar*, rules_length : Int32T, normalization_mode : UColAttributeValue, strength : UCollationStrength, parse_error : UParseError*, status : UErrorCode*) : UCollator + fun ucol_prepare_short_string_open = ucol_prepareShortStringOpen{{SYMS_SUFFIX.id}}(definition : LibC::Char*, force_defaults : UBool, parse_error : UParseError*, status : UErrorCode*) + fun ucol_restore_variable_top = ucol_restoreVariableTop{{SYMS_SUFFIX.id}}(coll : UCollator, var_top : Uint32T, status : UErrorCode*) + fun ucol_safe_clone = ucol_safeClone{{SYMS_SUFFIX.id}}(coll : UCollator, stack_buffer : Void*, p_buffer_size : Int32T*, status : UErrorCode*) : UCollator + fun ucol_set_attribute = ucol_setAttribute{{SYMS_SUFFIX.id}}(coll : UCollator, attr : UColAttribute, value : UColAttributeValue, status : UErrorCode*) + fun ucol_set_reorder_codes = ucol_setReorderCodes{{SYMS_SUFFIX.id}}(coll : UCollator, reorder_codes : Int32T*, reorder_codes_length : Int32T, p_error_code : UErrorCode*) + fun ucol_set_strength = ucol_setStrength{{SYMS_SUFFIX.id}}(coll : UCollator, strength : UCollationStrength) + fun ucol_set_variable_top = ucol_setVariableTop{{SYMS_SUFFIX.id}}(coll : UCollator, var_top : UChar*, len : Int32T, status : UErrorCode*) : Uint32T + fun ucol_strcoll = ucol_strcoll{{SYMS_SUFFIX.id}}(coll : UCollator, source : UChar*, source_length : Int32T, target : UChar*, target_length : Int32T) : UCollationResult + fun ucol_strcoll_iter = ucol_strcollIter{{SYMS_SUFFIX.id}}(coll : UCollator, s_iter : UCharIterator*, t_iter : UCharIterator*, status : UErrorCode*) : UCollationResult + fun ucol_strcoll_ut_f8 = ucol_strcollUTF8{{SYMS_SUFFIX.id}}(coll : UCollator, source : LibC::Char*, source_length : Int32T, target : LibC::Char*, target_length : Int32T, status : UErrorCode*) : UCollationResult + {% end %} end diff --git a/src/lib_icu/ucsdet.cr b/src/lib_icu/ucsdet.cr index 73d002d..aaaf3e9 100644 --- a/src/lib_icu/ucsdet.cr +++ b/src/lib_icu/ucsdet.cr @@ -1,20 +1,22 @@ -@[Link(ldflags: "`command -v pkg-config > /dev/null && pkg-config --libs icu-uc icu-i18n icu-io icu-lx icu-le || printf %s '-licuio -licui18n -liculx -licule -licuuc -licudata'`")] +@[Link(ldflags: "`command -v pkg-config > /dev/null && pkg-config --libs icu-uc icu-i18n icu-io 2> /dev/null|| printf %s '-licuio -licui18n -licuuc -licudata'`")] lib LibICU - fun ucsdet_close = ucsdet_close_52(ucsd : UCharsetDetector) - fun ucsdet_detect = ucsdet_detect_52(ucsd : UCharsetDetector, status : UErrorCode*) : UCharsetMatch - fun ucsdet_detect_all = ucsdet_detectAll_52(ucsd : UCharsetDetector, matches_found : Int32T*, status : UErrorCode*) : UCharsetMatch* - fun ucsdet_enable_input_filter = ucsdet_enableInputFilter_52(ucsd : UCharsetDetector, filter : UBool) : UBool - fun ucsdet_get_all_detectable_charsets = ucsdet_getAllDetectableCharsets_52(ucsd : UCharsetDetector, status : UErrorCode*) : UEnumeration - fun ucsdet_get_confidence = ucsdet_getConfidence_52(ucsm : UCharsetMatch, status : UErrorCode*) : Int32T - fun ucsdet_get_detectable_charsets = ucsdet_getDetectableCharsets_52(ucsd : UCharsetDetector, status : UErrorCode*) : UEnumeration - fun ucsdet_get_language = ucsdet_getLanguage_52(ucsm : UCharsetMatch, status : UErrorCode*) : LibC::Char* - fun ucsdet_get_name = ucsdet_getName_52(ucsm : UCharsetMatch, status : UErrorCode*) : LibC::Char* - fun ucsdet_get_u_chars = ucsdet_getUChars_52(ucsm : UCharsetMatch, buf : UChar*, cap : Int32T, status : UErrorCode*) : Int32T - fun ucsdet_is_input_filter_enabled = ucsdet_isInputFilterEnabled_52(ucsd : UCharsetDetector) : UBool - fun ucsdet_open = ucsdet_open_52(status : UErrorCode*) : UCharsetDetector - fun ucsdet_set_declared_encoding = ucsdet_setDeclaredEncoding_52(ucsd : UCharsetDetector, encoding : LibC::Char*, length : Int32T, status : UErrorCode*) - fun ucsdet_set_detectable_charset = ucsdet_setDetectableCharset_52(ucsd : UCharsetDetector, encoding : LibC::Char*, enabled : UBool, status : UErrorCode*) - fun ucsdet_set_text = ucsdet_setText_52(ucsd : UCharsetDetector, text_in : LibC::Char*, len : Int32T, status : UErrorCode*) + {% begin %} + fun ucsdet_close = ucsdet_close{{SYMS_SUFFIX.id}}(ucsd : UCharsetDetector) + fun ucsdet_detect = ucsdet_detect{{SYMS_SUFFIX.id}}(ucsd : UCharsetDetector, status : UErrorCode*) : UCharsetMatch + fun ucsdet_detect_all = ucsdet_detectAll{{SYMS_SUFFIX.id}}(ucsd : UCharsetDetector, matches_found : Int32T*, status : UErrorCode*) : UCharsetMatch* + fun ucsdet_enable_input_filter = ucsdet_enableInputFilter{{SYMS_SUFFIX.id}}(ucsd : UCharsetDetector, filter : UBool) : UBool + fun ucsdet_get_all_detectable_charsets = ucsdet_getAllDetectableCharsets{{SYMS_SUFFIX.id}}(ucsd : UCharsetDetector, status : UErrorCode*) : UEnumeration + fun ucsdet_get_confidence = ucsdet_getConfidence{{SYMS_SUFFIX.id}}(ucsm : UCharsetMatch, status : UErrorCode*) : Int32T + fun ucsdet_get_detectable_charsets = ucsdet_getDetectableCharsets{{SYMS_SUFFIX.id}}(ucsd : UCharsetDetector, status : UErrorCode*) : UEnumeration + fun ucsdet_get_language = ucsdet_getLanguage{{SYMS_SUFFIX.id}}(ucsm : UCharsetMatch, status : UErrorCode*) : LibC::Char* + fun ucsdet_get_name = ucsdet_getName{{SYMS_SUFFIX.id}}(ucsm : UCharsetMatch, status : UErrorCode*) : LibC::Char* + fun ucsdet_get_u_chars = ucsdet_getUChars{{SYMS_SUFFIX.id}}(ucsm : UCharsetMatch, buf : UChar*, cap : Int32T, status : UErrorCode*) : Int32T + fun ucsdet_is_input_filter_enabled = ucsdet_isInputFilterEnabled{{SYMS_SUFFIX.id}}(ucsd : UCharsetDetector) : UBool + fun ucsdet_open = ucsdet_open{{SYMS_SUFFIX.id}}(status : UErrorCode*) : UCharsetDetector + fun ucsdet_set_declared_encoding = ucsdet_setDeclaredEncoding{{SYMS_SUFFIX.id}}(ucsd : UCharsetDetector, encoding : LibC::Char*, length : Int32T, status : UErrorCode*) + fun ucsdet_set_detectable_charset = ucsdet_setDetectableCharset{{SYMS_SUFFIX.id}}(ucsd : UCharsetDetector, encoding : LibC::Char*, enabled : UBool, status : UErrorCode*) + fun ucsdet_set_text = ucsdet_setText{{SYMS_SUFFIX.id}}(ucsd : UCharsetDetector, text_in : LibC::Char*, len : Int32T, status : UErrorCode*) type UCharsetDetector = Void* type UCharsetMatch = Void* + {% end %} end diff --git a/src/lib_icu/ucurr.cr b/src/lib_icu/ucurr.cr index 42bf40e..f73255d 100644 --- a/src/lib_icu/ucurr.cr +++ b/src/lib_icu/ucurr.cr @@ -1,21 +1,23 @@ -@[Link(ldflags: "`command -v pkg-config > /dev/null && pkg-config --libs icu-uc icu-i18n icu-io icu-lx icu-le || printf %s '-licuio -licui18n -liculx -licule -licuuc -licudata'`")] +@[Link(ldflags: "`command -v pkg-config > /dev/null && pkg-config --libs icu-uc icu-i18n icu-io 2> /dev/null|| printf %s '-licuio -licui18n -licuuc -licudata'`")] lib LibICU + {% begin %} alias UCurrRegistryKey = Void* enum UCurrNameStyle UcurrSymbolName = 0 UcurrLongName = 1 end - fun ucurr_count_currencies = ucurr_countCurrencies_52(locale : LibC::Char*, date : UDate, ec : UErrorCode*) : Int32T - fun ucurr_for_locale = ucurr_forLocale_52(locale : LibC::Char*, buff : UChar*, buff_capacity : Int32T, ec : UErrorCode*) : Int32T - fun ucurr_for_locale_and_date = ucurr_forLocaleAndDate_52(locale : LibC::Char*, date : UDate, index : Int32T, buff : UChar*, buff_capacity : Int32T, ec : UErrorCode*) : Int32T - fun ucurr_get_default_fraction_digits = ucurr_getDefaultFractionDigits_52(currency : UChar*, ec : UErrorCode*) : Int32T - fun ucurr_get_keyword_values_for_locale = ucurr_getKeywordValuesForLocale_52(key : LibC::Char*, locale : LibC::Char*, commonly_used : UBool, status : UErrorCode*) : UEnumeration - fun ucurr_get_name = ucurr_getName_52(currency : UChar*, locale : LibC::Char*, name_style : UCurrNameStyle, is_choice_format : UBool*, len : Int32T*, ec : UErrorCode*) : UChar* - fun ucurr_get_numeric_code = ucurr_getNumericCode_52(currency : UChar*) : Int32T - fun ucurr_get_plural_name = ucurr_getPluralName_52(currency : UChar*, locale : LibC::Char*, is_choice_format : UBool*, plural_count : LibC::Char*, len : Int32T*, ec : UErrorCode*) : UChar* - fun ucurr_get_rounding_increment = ucurr_getRoundingIncrement_52(currency : UChar*, ec : UErrorCode*) : LibC::Double - fun ucurr_is_available = ucurr_isAvailable_52(iso_code : UChar*, from : UDate, to : UDate, error_code : UErrorCode*) : UBool - fun ucurr_open_iso_currencies = ucurr_openISOCurrencies_52(curr_type : Uint32T, p_error_code : UErrorCode*) : UEnumeration - fun ucurr_register = ucurr_register_52(iso_code : UChar*, locale : LibC::Char*, status : UErrorCode*) : UCurrRegistryKey - fun ucurr_unregister = ucurr_unregister_52(key : UCurrRegistryKey, status : UErrorCode*) : UBool + fun ucurr_count_currencies = ucurr_countCurrencies{{SYMS_SUFFIX.id}}(locale : LibC::Char*, date : UDate, ec : UErrorCode*) : Int32T + fun ucurr_for_locale = ucurr_forLocale{{SYMS_SUFFIX.id}}(locale : LibC::Char*, buff : UChar*, buff_capacity : Int32T, ec : UErrorCode*) : Int32T + fun ucurr_for_locale_and_date = ucurr_forLocaleAndDate{{SYMS_SUFFIX.id}}(locale : LibC::Char*, date : UDate, index : Int32T, buff : UChar*, buff_capacity : Int32T, ec : UErrorCode*) : Int32T + fun ucurr_get_default_fraction_digits = ucurr_getDefaultFractionDigits{{SYMS_SUFFIX.id}}(currency : UChar*, ec : UErrorCode*) : Int32T + fun ucurr_get_keyword_values_for_locale = ucurr_getKeywordValuesForLocale{{SYMS_SUFFIX.id}}(key : LibC::Char*, locale : LibC::Char*, commonly_used : UBool, status : UErrorCode*) : UEnumeration + fun ucurr_get_name = ucurr_getName{{SYMS_SUFFIX.id}}(currency : UChar*, locale : LibC::Char*, name_style : UCurrNameStyle, is_choice_format : UBool*, len : Int32T*, ec : UErrorCode*) : UChar* + fun ucurr_get_numeric_code = ucurr_getNumericCode{{SYMS_SUFFIX.id}}(currency : UChar*) : Int32T + fun ucurr_get_plural_name = ucurr_getPluralName{{SYMS_SUFFIX.id}}(currency : UChar*, locale : LibC::Char*, is_choice_format : UBool*, plural_count : LibC::Char*, len : Int32T*, ec : UErrorCode*) : UChar* + fun ucurr_get_rounding_increment = ucurr_getRoundingIncrement{{SYMS_SUFFIX.id}}(currency : UChar*, ec : UErrorCode*) : LibC::Double + fun ucurr_is_available = ucurr_isAvailable{{SYMS_SUFFIX.id}}(iso_code : UChar*, from : UDate, to : UDate, error_code : UErrorCode*) : UBool + fun ucurr_open_iso_currencies = ucurr_openISOCurrencies{{SYMS_SUFFIX.id}}(curr_type : Uint32T, p_error_code : UErrorCode*) : UEnumeration + fun ucurr_register = ucurr_register{{SYMS_SUFFIX.id}}(iso_code : UChar*, locale : LibC::Char*, status : UErrorCode*) : UCurrRegistryKey + fun ucurr_unregister = ucurr_unregister{{SYMS_SUFFIX.id}}(key : UCurrRegistryKey, status : UErrorCode*) : UBool + {% end %} end diff --git a/src/lib_icu/udat.cr b/src/lib_icu/udat.cr index 191b727..8ab8645 100644 --- a/src/lib_icu/udat.cr +++ b/src/lib_icu/udat.cr @@ -1,5 +1,6 @@ -@[Link(ldflags: "`command -v pkg-config > /dev/null && pkg-config --libs icu-uc icu-i18n icu-io icu-lx icu-le || printf %s '-licuio -licui18n -liculx -licule -licuuc -licudata'`")] +@[Link(ldflags: "`command -v pkg-config > /dev/null && pkg-config --libs icu-uc icu-i18n icu-io 2> /dev/null|| printf %s '-licuio -licui18n -licuuc -licudata'`")] lib LibICU + {% begin %} alias UDateFormat = Void* alias UDateFormatOpener = (UDateFormatStyle, UDateFormatStyle, LibC::Char*, UChar*, Int32T, UChar*, Int32T, UErrorCode* -> UDateFormat*) alias UDateTimePatternGenerator = Void* @@ -129,62 +130,63 @@ lib LibICU UdispctxTypeDialectHandling = 0 UdispctxTypeCapitalization = 1 end - fun udat_apply_pattern = udat_applyPattern_52(format : UDateFormat*, localized : UBool, pattern : UChar*, pattern_length : Int32T) - fun udat_apply_pattern_relative = udat_applyPatternRelative_52(format : UDateFormat*, date_pattern : UChar*, date_pattern_length : Int32T, time_pattern : UChar*, time_pattern_length : Int32T, status : UErrorCode*) - fun udat_clone = udat_clone_52(fmt : UDateFormat*, status : UErrorCode*) : UDateFormat* - fun udat_close = udat_close_52(format : UDateFormat*) - fun udat_count_available = udat_countAvailable_52 : Int32T - fun udat_count_symbols = udat_countSymbols_52(fmt : UDateFormat*, type : UDateFormatSymbolType) : Int32T - fun udat_format = udat_format_52(format : UDateFormat*, date_to_format : UDate, result : UChar*, result_length : Int32T, position : UFieldPosition*, status : UErrorCode*) : Int32T - fun udat_get2digit_year_start = udat_get2DigitYearStart_52(fmt : UDateFormat*, status : UErrorCode*) : UDate - fun udat_get_available = udat_getAvailable_52(locale_index : Int32T) : LibC::Char* - fun udat_get_boolean_attribute = udat_getBooleanAttribute(fmt : UDateFormat*, attr : UDateFormatBooleanAttribute, status : UErrorCode*) : UBool - fun udat_get_calendar = udat_getCalendar_52(fmt : UDateFormat*) : UCalendar* - fun udat_get_context = udat_getContext_52(fmt : UDateFormat*, type : UDisplayContextType, status : UErrorCode*) : UDisplayContext - fun udat_get_locale_by_type = udat_getLocaleByType_52(fmt : UDateFormat*, type : ULocDataLocaleType, status : UErrorCode*) : LibC::Char* - fun udat_get_number_format = udat_getNumberFormat_52(fmt : UDateFormat*) : UNumberFormat* - fun udat_get_symbols = udat_getSymbols_52(fmt : UDateFormat*, type : UDateFormatSymbolType, symbol_index : Int32T, result : UChar*, result_length : Int32T, status : UErrorCode*) : Int32T - fun udat_is_lenient = udat_isLenient_52(fmt : UDateFormat*) : UBool - fun udat_open = udat_open_52(time_style : UDateFormatStyle, date_style : UDateFormatStyle, locale : LibC::Char*, tz_id : UChar*, tz_id_length : Int32T, pattern : UChar*, pattern_length : Int32T, status : UErrorCode*) : UDateFormat* - fun udat_parse = udat_parse_52(format : UDateFormat*, text : UChar*, text_length : Int32T, parse_pos : Int32T*, status : UErrorCode*) : UDate - fun udat_parse_calendar = udat_parseCalendar_52(format : UDateFormat*, calendar : UCalendar*, text : UChar*, text_length : Int32T, parse_pos : Int32T*, status : UErrorCode*) - fun udat_register_opener = udat_registerOpener_52(opener : UDateFormatOpener, status : UErrorCode*) - fun udat_set2digit_year_start = udat_set2DigitYearStart_52(fmt : UDateFormat*, d : UDate, status : UErrorCode*) - fun udat_set_boolean_attribute = udat_setBooleanAttribute(fmt : UDateFormat*, attr : UDateFormatBooleanAttribute, x2 : UBool, status : UErrorCode*) - fun udat_set_calendar = udat_setCalendar_52(fmt : UDateFormat*, calendar_to_set : UCalendar*) - fun udat_set_context = udat_setContext_52(fmt : UDateFormat*, value : UDisplayContext, status : UErrorCode*) - fun udat_set_lenient = udat_setLenient_52(fmt : UDateFormat*, is_lenient : UBool) - fun udat_set_number_format = udat_setNumberFormat_52(fmt : UDateFormat*, number_format_to_set : UNumberFormat*) - fun udat_set_symbols = udat_setSymbols_52(format : UDateFormat*, type : UDateFormatSymbolType, symbol_index : Int32T, value : UChar*, value_length : Int32T, status : UErrorCode*) - fun udat_to_calendar_date_field = udat_toCalendarDateField_52(field : UDateFormatField) : UCalendarDateFields - fun udat_to_pattern = udat_toPattern_52(fmt : UDateFormat*, localized : UBool, result : UChar*, result_length : Int32T, status : UErrorCode*) : Int32T - fun udat_to_pattern_relative_date = udat_toPatternRelativeDate_52(fmt : UDateFormat*, result : UChar*, result_length : Int32T, status : UErrorCode*) : Int32T - fun udat_to_pattern_relative_time = udat_toPatternRelativeTime_52(fmt : UDateFormat*, result : UChar*, result_length : Int32T, status : UErrorCode*) : Int32T - fun udat_unregister_opener = udat_unregisterOpener_52(opener : UDateFormatOpener, status : UErrorCode*) : UDateFormatOpener - fun udatpg_add_pattern = udatpg_addPattern_52(dtpg : UDateTimePatternGenerator*, pattern : UChar*, pattern_length : Int32T, override : UBool, conflicting_pattern : UChar*, capacity : Int32T, p_length : Int32T*, p_error_code : UErrorCode*) : UDateTimePatternConflict - fun udatpg_clone = udatpg_clone_52(dtpg : UDateTimePatternGenerator*, p_error_code : UErrorCode*) : UDateTimePatternGenerator* - fun udatpg_close = udatpg_close_52(dtpg : UDateTimePatternGenerator*) - fun udatpg_get_append_item_format = udatpg_getAppendItemFormat_52(dtpg : UDateTimePatternGenerator*, field : UDateTimePatternField, p_length : Int32T*) : UChar* - fun udatpg_get_append_item_name = udatpg_getAppendItemName_52(dtpg : UDateTimePatternGenerator*, field : UDateTimePatternField, p_length : Int32T*) : UChar* - fun udatpg_get_base_skeleton = udatpg_getBaseSkeleton_52(dtpg : UDateTimePatternGenerator*, pattern : UChar*, length : Int32T, base_skeleton : UChar*, capacity : Int32T, p_error_code : UErrorCode*) : Int32T - fun udatpg_get_best_pattern = udatpg_getBestPattern_52(dtpg : UDateTimePatternGenerator*, skeleton : UChar*, length : Int32T, best_pattern : UChar*, capacity : Int32T, p_error_code : UErrorCode*) : Int32T - fun udatpg_get_best_pattern_with_options = udatpg_getBestPatternWithOptions_52(dtpg : UDateTimePatternGenerator*, skeleton : UChar*, length : Int32T, options : UDateTimePatternMatchOptions, best_pattern : UChar*, capacity : Int32T, p_error_code : UErrorCode*) : Int32T - fun udatpg_get_date_time_format = udatpg_getDateTimeFormat_52(dtpg : UDateTimePatternGenerator*, p_length : Int32T*) : UChar* - fun udatpg_get_decimal = udatpg_getDecimal_52(dtpg : UDateTimePatternGenerator*, p_length : Int32T*) : UChar* - fun udatpg_get_pattern_for_skeleton = udatpg_getPatternForSkeleton_52(dtpg : UDateTimePatternGenerator*, skeleton : UChar*, skeleton_length : Int32T, p_length : Int32T*) : UChar* - fun udatpg_get_skeleton = udatpg_getSkeleton_52(dtpg : UDateTimePatternGenerator*, pattern : UChar*, length : Int32T, skeleton : UChar*, capacity : Int32T, p_error_code : UErrorCode*) : Int32T - fun udatpg_open = udatpg_open_52(locale : LibC::Char*, p_error_code : UErrorCode*) : UDateTimePatternGenerator* - fun udatpg_open_base_skeletons = udatpg_openBaseSkeletons_52(dtpg : UDateTimePatternGenerator*, p_error_code : UErrorCode*) : UEnumeration - fun udatpg_open_empty = udatpg_openEmpty_52(p_error_code : UErrorCode*) : UDateTimePatternGenerator* - fun udatpg_open_skeletons = udatpg_openSkeletons_52(dtpg : UDateTimePatternGenerator*, p_error_code : UErrorCode*) : UEnumeration - fun udatpg_replace_field_types = udatpg_replaceFieldTypes_52(dtpg : UDateTimePatternGenerator*, pattern : UChar*, pattern_length : Int32T, skeleton : UChar*, skeleton_length : Int32T, dest : UChar*, dest_capacity : Int32T, p_error_code : UErrorCode*) : Int32T - fun udatpg_replace_field_types_with_options = udatpg_replaceFieldTypesWithOptions_52(dtpg : UDateTimePatternGenerator*, pattern : UChar*, pattern_length : Int32T, skeleton : UChar*, skeleton_length : Int32T, options : UDateTimePatternMatchOptions, dest : UChar*, dest_capacity : Int32T, p_error_code : UErrorCode*) : Int32T - fun udatpg_set_append_item_format = udatpg_setAppendItemFormat_52(dtpg : UDateTimePatternGenerator*, field : UDateTimePatternField, value : UChar*, length : Int32T) - fun udatpg_set_append_item_name = udatpg_setAppendItemName_52(dtpg : UDateTimePatternGenerator*, field : UDateTimePatternField, value : UChar*, length : Int32T) - fun udatpg_set_date_time_format = udatpg_setDateTimeFormat_52(dtpg : UDateTimePatternGenerator*, dt_format : UChar*, length : Int32T) - fun udatpg_set_decimal = udatpg_setDecimal_52(dtpg : UDateTimePatternGenerator*, decimal : UChar*, length : Int32T) - fun udtitvfmt_close = udtitvfmt_close_52(formatter : UDateIntervalFormat) - fun udtitvfmt_format = udtitvfmt_format_52(formatter : UDateIntervalFormat, from_date : UDate, to_date : UDate, result : UChar*, result_capacity : Int32T, position : UFieldPosition*, status : UErrorCode*) : Int32T - fun udtitvfmt_open = udtitvfmt_open_52(locale : LibC::Char*, skeleton : UChar*, skeleton_length : Int32T, tz_id : UChar*, tz_id_length : Int32T, status : UErrorCode*) : UDateIntervalFormat + fun udat_apply_pattern = udat_applyPattern{{SYMS_SUFFIX.id}}(format : UDateFormat*, localized : UBool, pattern : UChar*, pattern_length : Int32T) + fun udat_apply_pattern_relative = udat_applyPatternRelative{{SYMS_SUFFIX.id}}(format : UDateFormat*, date_pattern : UChar*, date_pattern_length : Int32T, time_pattern : UChar*, time_pattern_length : Int32T, status : UErrorCode*) + fun udat_clone = udat_clone{{SYMS_SUFFIX.id}}(fmt : UDateFormat*, status : UErrorCode*) : UDateFormat* + fun udat_close = udat_close{{SYMS_SUFFIX.id}}(format : UDateFormat*) + fun udat_count_available = udat_countAvailable{{SYMS_SUFFIX.id}} : Int32T + fun udat_count_symbols = udat_countSymbols{{SYMS_SUFFIX.id}}(fmt : UDateFormat*, type : UDateFormatSymbolType) : Int32T + fun udat_format = udat_format{{SYMS_SUFFIX.id}}(format : UDateFormat*, date_to_format : UDate, result : UChar*, result_length : Int32T, position : UFieldPosition*, status : UErrorCode*) : Int32T + fun udat_get2digit_year_start = udat_get2DigitYearStart{{SYMS_SUFFIX.id}}(fmt : UDateFormat*, status : UErrorCode*) : UDate + fun udat_get_available = udat_getAvailable{{SYMS_SUFFIX.id}}(locale_index : Int32T) : LibC::Char* + fun udat_get_boolean_attribute = udat_getBooleanAttribute{{SYMS_SUFFIX.id}}(fmt : UDateFormat*, attr : UDateFormatBooleanAttribute, status : UErrorCode*) : UBool + fun udat_get_calendar = udat_getCalendar{{SYMS_SUFFIX.id}}(fmt : UDateFormat*) : UCalendar* + fun udat_get_context = udat_getContext{{SYMS_SUFFIX.id}}(fmt : UDateFormat*, type : UDisplayContextType, status : UErrorCode*) : UDisplayContext + fun udat_get_locale_by_type = udat_getLocaleByType{{SYMS_SUFFIX.id}}(fmt : UDateFormat*, type : ULocDataLocaleType, status : UErrorCode*) : LibC::Char* + fun udat_get_number_format = udat_getNumberFormat{{SYMS_SUFFIX.id}}(fmt : UDateFormat*) : UNumberFormat* + fun udat_get_symbols = udat_getSymbols{{SYMS_SUFFIX.id}}(fmt : UDateFormat*, type : UDateFormatSymbolType, symbol_index : Int32T, result : UChar*, result_length : Int32T, status : UErrorCode*) : Int32T + fun udat_is_lenient = udat_isLenient{{SYMS_SUFFIX.id}}(fmt : UDateFormat*) : UBool + fun udat_open = udat_open{{SYMS_SUFFIX.id}}(time_style : UDateFormatStyle, date_style : UDateFormatStyle, locale : LibC::Char*, tz_id : UChar*, tz_id_length : Int32T, pattern : UChar*, pattern_length : Int32T, status : UErrorCode*) : UDateFormat* + fun udat_parse = udat_parse{{SYMS_SUFFIX.id}}(format : UDateFormat*, text : UChar*, text_length : Int32T, parse_pos : Int32T*, status : UErrorCode*) : UDate + fun udat_parse_calendar = udat_parseCalendar{{SYMS_SUFFIX.id}}(format : UDateFormat*, calendar : UCalendar*, text : UChar*, text_length : Int32T, parse_pos : Int32T*, status : UErrorCode*) + fun udat_register_opener = udat_registerOpener{{SYMS_SUFFIX.id}}(opener : UDateFormatOpener, status : UErrorCode*) + fun udat_set2digit_year_start = udat_set2DigitYearStart{{SYMS_SUFFIX.id}}(fmt : UDateFormat*, d : UDate, status : UErrorCode*) + fun udat_set_boolean_attribute = udat_setBooleanAttribute{{SYMS_SUFFIX.id}}(fmt : UDateFormat*, attr : UDateFormatBooleanAttribute, x2 : UBool, status : UErrorCode*) + fun udat_set_calendar = udat_setCalendar{{SYMS_SUFFIX.id}}(fmt : UDateFormat*, calendar_to_set : UCalendar*) + fun udat_set_context = udat_setContext{{SYMS_SUFFIX.id}}(fmt : UDateFormat*, value : UDisplayContext, status : UErrorCode*) + fun udat_set_lenient = udat_setLenient{{SYMS_SUFFIX.id}}(fmt : UDateFormat*, is_lenient : UBool) + fun udat_set_number_format = udat_setNumberFormat{{SYMS_SUFFIX.id}}(fmt : UDateFormat*, number_format_to_set : UNumberFormat*) + fun udat_set_symbols = udat_setSymbols{{SYMS_SUFFIX.id}}(format : UDateFormat*, type : UDateFormatSymbolType, symbol_index : Int32T, value : UChar*, value_length : Int32T, status : UErrorCode*) + fun udat_to_calendar_date_field = udat_toCalendarDateField{{SYMS_SUFFIX.id}}(field : UDateFormatField) : UCalendarDateFields + fun udat_to_pattern = udat_toPattern{{SYMS_SUFFIX.id}}(fmt : UDateFormat*, localized : UBool, result : UChar*, result_length : Int32T, status : UErrorCode*) : Int32T + fun udat_to_pattern_relative_date = udat_toPatternRelativeDate{{SYMS_SUFFIX.id}}(fmt : UDateFormat*, result : UChar*, result_length : Int32T, status : UErrorCode*) : Int32T + fun udat_to_pattern_relative_time = udat_toPatternRelativeTime{{SYMS_SUFFIX.id}}(fmt : UDateFormat*, result : UChar*, result_length : Int32T, status : UErrorCode*) : Int32T + fun udat_unregister_opener = udat_unregisterOpener{{SYMS_SUFFIX.id}}(opener : UDateFormatOpener, status : UErrorCode*) : UDateFormatOpener + fun udatpg_add_pattern = udatpg_addPattern{{SYMS_SUFFIX.id}}(dtpg : UDateTimePatternGenerator*, pattern : UChar*, pattern_length : Int32T, override : UBool, conflicting_pattern : UChar*, capacity : Int32T, p_length : Int32T*, p_error_code : UErrorCode*) : UDateTimePatternConflict + fun udatpg_clone = udatpg_clone{{SYMS_SUFFIX.id}}(dtpg : UDateTimePatternGenerator*, p_error_code : UErrorCode*) : UDateTimePatternGenerator* + fun udatpg_close = udatpg_close{{SYMS_SUFFIX.id}}(dtpg : UDateTimePatternGenerator*) + fun udatpg_get_append_item_format = udatpg_getAppendItemFormat{{SYMS_SUFFIX.id}}(dtpg : UDateTimePatternGenerator*, field : UDateTimePatternField, p_length : Int32T*) : UChar* + fun udatpg_get_append_item_name = udatpg_getAppendItemName{{SYMS_SUFFIX.id}}(dtpg : UDateTimePatternGenerator*, field : UDateTimePatternField, p_length : Int32T*) : UChar* + fun udatpg_get_base_skeleton = udatpg_getBaseSkeleton{{SYMS_SUFFIX.id}}(dtpg : UDateTimePatternGenerator*, pattern : UChar*, length : Int32T, base_skeleton : UChar*, capacity : Int32T, p_error_code : UErrorCode*) : Int32T + fun udatpg_get_best_pattern = udatpg_getBestPattern{{SYMS_SUFFIX.id}}(dtpg : UDateTimePatternGenerator*, skeleton : UChar*, length : Int32T, best_pattern : UChar*, capacity : Int32T, p_error_code : UErrorCode*) : Int32T + fun udatpg_get_best_pattern_with_options = udatpg_getBestPatternWithOptions{{SYMS_SUFFIX.id}}(dtpg : UDateTimePatternGenerator*, skeleton : UChar*, length : Int32T, options : UDateTimePatternMatchOptions, best_pattern : UChar*, capacity : Int32T, p_error_code : UErrorCode*) : Int32T + fun udatpg_get_date_time_format = udatpg_getDateTimeFormat{{SYMS_SUFFIX.id}}(dtpg : UDateTimePatternGenerator*, p_length : Int32T*) : UChar* + fun udatpg_get_decimal = udatpg_getDecimal{{SYMS_SUFFIX.id}}(dtpg : UDateTimePatternGenerator*, p_length : Int32T*) : UChar* + fun udatpg_get_pattern_for_skeleton = udatpg_getPatternForSkeleton{{SYMS_SUFFIX.id}}(dtpg : UDateTimePatternGenerator*, skeleton : UChar*, skeleton_length : Int32T, p_length : Int32T*) : UChar* + fun udatpg_get_skeleton = udatpg_getSkeleton{{SYMS_SUFFIX.id}}(dtpg : UDateTimePatternGenerator*, pattern : UChar*, length : Int32T, skeleton : UChar*, capacity : Int32T, p_error_code : UErrorCode*) : Int32T + fun udatpg_open = udatpg_open{{SYMS_SUFFIX.id}}(locale : LibC::Char*, p_error_code : UErrorCode*) : UDateTimePatternGenerator* + fun udatpg_open_base_skeletons = udatpg_openBaseSkeletons{{SYMS_SUFFIX.id}}(dtpg : UDateTimePatternGenerator*, p_error_code : UErrorCode*) : UEnumeration + fun udatpg_open_empty = udatpg_openEmpty{{SYMS_SUFFIX.id}}(p_error_code : UErrorCode*) : UDateTimePatternGenerator* + fun udatpg_open_skeletons = udatpg_openSkeletons{{SYMS_SUFFIX.id}}(dtpg : UDateTimePatternGenerator*, p_error_code : UErrorCode*) : UEnumeration + fun udatpg_replace_field_types = udatpg_replaceFieldTypes{{SYMS_SUFFIX.id}}(dtpg : UDateTimePatternGenerator*, pattern : UChar*, pattern_length : Int32T, skeleton : UChar*, skeleton_length : Int32T, dest : UChar*, dest_capacity : Int32T, p_error_code : UErrorCode*) : Int32T + fun udatpg_replace_field_types_with_options = udatpg_replaceFieldTypesWithOptions{{SYMS_SUFFIX.id}}(dtpg : UDateTimePatternGenerator*, pattern : UChar*, pattern_length : Int32T, skeleton : UChar*, skeleton_length : Int32T, options : UDateTimePatternMatchOptions, dest : UChar*, dest_capacity : Int32T, p_error_code : UErrorCode*) : Int32T + fun udatpg_set_append_item_format = udatpg_setAppendItemFormat{{SYMS_SUFFIX.id}}(dtpg : UDateTimePatternGenerator*, field : UDateTimePatternField, value : UChar*, length : Int32T) + fun udatpg_set_append_item_name = udatpg_setAppendItemName{{SYMS_SUFFIX.id}}(dtpg : UDateTimePatternGenerator*, field : UDateTimePatternField, value : UChar*, length : Int32T) + fun udatpg_set_date_time_format = udatpg_setDateTimeFormat{{SYMS_SUFFIX.id}}(dtpg : UDateTimePatternGenerator*, dt_format : UChar*, length : Int32T) + fun udatpg_set_decimal = udatpg_setDecimal{{SYMS_SUFFIX.id}}(dtpg : UDateTimePatternGenerator*, decimal : UChar*, length : Int32T) + fun udtitvfmt_close = udtitvfmt_close{{SYMS_SUFFIX.id}}(formatter : UDateIntervalFormat) + fun udtitvfmt_format = udtitvfmt_format{{SYMS_SUFFIX.id}}(formatter : UDateIntervalFormat, from_date : UDate, to_date : UDate, result : UChar*, result_capacity : Int32T, position : UFieldPosition*, status : UErrorCode*) : Int32T + fun udtitvfmt_open = udtitvfmt_open{{SYMS_SUFFIX.id}}(locale : LibC::Char*, skeleton : UChar*, skeleton_length : Int32T, tz_id : UChar*, tz_id_length : Int32T, status : UErrorCode*) : UDateIntervalFormat type UDateIntervalFormat = Void* + {% end %} end diff --git a/src/lib_icu/udata.cr b/src/lib_icu/udata.cr index 3604cb9..d2fe4ac 100644 --- a/src/lib_icu/udata.cr +++ b/src/lib_icu/udata.cr @@ -1,5 +1,6 @@ -@[Link(ldflags: "`command -v pkg-config > /dev/null && pkg-config --libs icu-uc icu-i18n icu-io icu-lx icu-le || printf %s '-licuio -licui18n -liculx -licule -licuuc -licudata'`")] +@[Link(ldflags: "`command -v pkg-config > /dev/null && pkg-config --libs icu-uc icu-i18n icu-io 2> /dev/null|| printf %s '-licuio -licui18n -licuuc -licudata'`")] lib LibICU + {% begin %} enum UDataFileAccess UdataFilesFirst = 0 UdataDefaultAccess = 0 @@ -8,14 +9,14 @@ lib LibICU UdataNoFiles = 3 UdataFileAccessCount = 4 end - fun udata_close = udata_close_52(p_data : UDataMemory) - fun udata_get_info = udata_getInfo_52(p_data : UDataMemory, p_info : UDataInfo*) - fun udata_get_memory = udata_getMemory_52(p_data : UDataMemory) : Void* - fun udata_open = udata_open_52(path : LibC::Char*, type : LibC::Char*, name : LibC::Char*, p_error_code : UErrorCode*) : UDataMemory - fun udata_open_choice = udata_openChoice_52(path : LibC::Char*, type : LibC::Char*, name : LibC::Char*, is_acceptable : (Void*, LibC::Char*, LibC::Char*, UDataInfo* -> UBool), context : Void*, p_error_code : UErrorCode*) : UDataMemory - fun udata_set_app_data = udata_setAppData_52(package_name : LibC::Char*, data : Void*, err : UErrorCode*) - fun udata_set_common_data = udata_setCommonData_52(data : Void*, err : UErrorCode*) - fun udata_set_file_access = udata_setFileAccess_52(access : UDataFileAccess, status : UErrorCode*) + fun udata_close = udata_close{{SYMS_SUFFIX.id}}(p_data : UDataMemory) + fun udata_get_info = udata_getInfo{{SYMS_SUFFIX.id}}(p_data : UDataMemory, p_info : UDataInfo*) + fun udata_get_memory = udata_getMemory{{SYMS_SUFFIX.id}}(p_data : UDataMemory) : Void* + fun udata_open = udata_open{{SYMS_SUFFIX.id}}(path : LibC::Char*, type : LibC::Char*, name : LibC::Char*, p_error_code : UErrorCode*) : UDataMemory + fun udata_open_choice = udata_openChoice{{SYMS_SUFFIX.id}}(path : LibC::Char*, type : LibC::Char*, name : LibC::Char*, is_acceptable : (Void*, LibC::Char*, LibC::Char*, UDataInfo* -> UBool), context : Void*, p_error_code : UErrorCode*) : UDataMemory + fun udata_set_app_data = udata_setAppData{{SYMS_SUFFIX.id}}(package_name : LibC::Char*, data : Void*, err : UErrorCode*) + fun udata_set_common_data = udata_setCommonData{{SYMS_SUFFIX.id}}(data : Void*, err : UErrorCode*) + fun udata_set_file_access = udata_setFileAccess{{SYMS_SUFFIX.id}}(access : UDataFileAccess, status : UErrorCode*) struct UDataInfo size : Uint16T @@ -30,4 +31,5 @@ lib LibICU end type UDataMemory = Void* + {% end %} end diff --git a/src/lib_icu/uenum.cr b/src/lib_icu/uenum.cr index 22e0bf7..2cd69f3 100644 --- a/src/lib_icu/uenum.cr +++ b/src/lib_icu/uenum.cr @@ -1,10 +1,12 @@ -@[Link(ldflags: "`command -v pkg-config > /dev/null && pkg-config --libs icu-uc icu-i18n icu-io icu-lx icu-le || printf %s '-licuio -licui18n -liculx -licule -licuuc -licudata'`")] +@[Link(ldflags: "`command -v pkg-config > /dev/null && pkg-config --libs icu-uc icu-i18n icu-io 2> /dev/null|| printf %s '-licuio -licui18n -licuuc -licudata'`")] lib LibICU - fun uenum_close = uenum_close_52(en : UEnumeration) - fun uenum_count = uenum_count_52(en : UEnumeration, status : UErrorCode*) : Int32T - fun uenum_next = uenum_next_52(en : UEnumeration, result_length : Int32T*, status : UErrorCode*) : LibC::Char* - fun uenum_open_char_strings_enumeration = uenum_openCharStringsEnumeration_52(strings : LibC::Char**, count : Int32T, ec : UErrorCode*) : UEnumeration - fun uenum_open_u_char_strings_enumeration = uenum_openUCharStringsEnumeration_52(strings : UChar**, count : Int32T, ec : UErrorCode*) : UEnumeration - fun uenum_reset = uenum_reset_52(en : UEnumeration, status : UErrorCode*) - fun uenum_unext = uenum_unext_52(en : UEnumeration, result_length : Int32T*, status : UErrorCode*) : UChar* + {% begin %} + fun uenum_close = uenum_close{{SYMS_SUFFIX.id}}(en : UEnumeration) + fun uenum_count = uenum_count{{SYMS_SUFFIX.id}}(en : UEnumeration, status : UErrorCode*) : Int32T + fun uenum_next = uenum_next{{SYMS_SUFFIX.id}}(en : UEnumeration, result_length : Int32T*, status : UErrorCode*) : LibC::Char* + fun uenum_open_char_strings_enumeration = uenum_openCharStringsEnumeration{{SYMS_SUFFIX.id}}(strings : LibC::Char**, count : Int32T, ec : UErrorCode*) : UEnumeration + fun uenum_open_u_char_strings_enumeration = uenum_openUCharStringsEnumeration{{SYMS_SUFFIX.id}}(strings : UChar**, count : Int32T, ec : UErrorCode*) : UEnumeration + fun uenum_reset = uenum_reset{{SYMS_SUFFIX.id}}(en : UEnumeration, status : UErrorCode*) + fun uenum_unext = uenum_unext{{SYMS_SUFFIX.id}}(en : UEnumeration, result_length : Int32T*, status : UErrorCode*) : UChar* + {% end %} end diff --git a/src/lib_icu/uidna.cr b/src/lib_icu/uidna.cr index 900f671..d8852f6 100644 --- a/src/lib_icu/uidna.cr +++ b/src/lib_icu/uidna.cr @@ -1,21 +1,22 @@ -@[Link(ldflags: "`command -v pkg-config > /dev/null && pkg-config --libs icu-uc icu-i18n icu-io icu-lx icu-le || printf %s '-licuio -licui18n -liculx -licule -licuuc -licudata'`")] +@[Link(ldflags: "`command -v pkg-config > /dev/null && pkg-config --libs icu-uc icu-i18n icu-io 2> /dev/null|| printf %s '-licuio -licui18n -licuuc -licudata'`")] lib LibICU + {% begin %} alias Int16T = LibC::Short - fun uidna_close = uidna_close_52(idna : Uidna) - fun uidna_compare = uidna_compare_52(s1 : UChar*, length1 : Int32T, s2 : UChar*, length2 : Int32T, options : Int32T, status : UErrorCode*) : Int32T - fun uidna_idn_to_ascii = uidna_IDNToASCII_52(src : UChar*, src_length : Int32T, dest : UChar*, dest_capacity : Int32T, options : Int32T, parse_error : UParseError*, status : UErrorCode*) : Int32T - fun uidna_idn_to_unicode = uidna_IDNToUnicode_52(src : UChar*, src_length : Int32T, dest : UChar*, dest_capacity : Int32T, options : Int32T, parse_error : UParseError*, status : UErrorCode*) : Int32T - fun uidna_label_to_ascii = uidna_labelToASCII_52(idna : Uidna, label : UChar*, length : Int32T, dest : UChar*, capacity : Int32T, p_info : UidnaInfo*, p_error_code : UErrorCode*) : Int32T - fun uidna_label_to_ascii_ut_f8 = uidna_labelToASCII_UTF8_52(idna : Uidna, label : LibC::Char*, length : Int32T, dest : LibC::Char*, capacity : Int32T, p_info : UidnaInfo*, p_error_code : UErrorCode*) : Int32T - fun uidna_label_to_unicode = uidna_labelToUnicode_52(idna : Uidna, label : UChar*, length : Int32T, dest : UChar*, capacity : Int32T, p_info : UidnaInfo*, p_error_code : UErrorCode*) : Int32T - fun uidna_label_to_unicode_ut_f8 = uidna_labelToUnicodeUTF8_52(idna : Uidna, label : LibC::Char*, length : Int32T, dest : LibC::Char*, capacity : Int32T, p_info : UidnaInfo*, p_error_code : UErrorCode*) : Int32T - fun uidna_name_to_ascii = uidna_nameToASCII_52(idna : Uidna, name : UChar*, length : Int32T, dest : UChar*, capacity : Int32T, p_info : UidnaInfo*, p_error_code : UErrorCode*) : Int32T - fun uidna_name_to_ascii_ut_f8 = uidna_nameToASCII_UTF8_52(idna : Uidna, name : LibC::Char*, length : Int32T, dest : LibC::Char*, capacity : Int32T, p_info : UidnaInfo*, p_error_code : UErrorCode*) : Int32T - fun uidna_name_to_unicode = uidna_nameToUnicode_52(idna : Uidna, name : UChar*, length : Int32T, dest : UChar*, capacity : Int32T, p_info : UidnaInfo*, p_error_code : UErrorCode*) : Int32T - fun uidna_name_to_unicode_ut_f8 = uidna_nameToUnicodeUTF8_52(idna : Uidna, name : LibC::Char*, length : Int32T, dest : LibC::Char*, capacity : Int32T, p_info : UidnaInfo*, p_error_code : UErrorCode*) : Int32T - fun uidna_open_ut_s46 = uidna_openUTS46_52(options : Uint32T, p_error_code : UErrorCode*) : Uidna - fun uidna_to_ascii = uidna_toASCII_52(src : UChar*, src_length : Int32T, dest : UChar*, dest_capacity : Int32T, options : Int32T, parse_error : UParseError*, status : UErrorCode*) : Int32T - fun uidna_to_unicode = uidna_toUnicode_52(src : UChar*, src_length : Int32T, dest : UChar*, dest_capacity : Int32T, options : Int32T, parse_error : UParseError*, status : UErrorCode*) : Int32T + fun uidna_close = uidna_close{{SYMS_SUFFIX.id}}(idna : Uidna) + fun uidna_compare = uidna_compare{{SYMS_SUFFIX.id}}(s1 : UChar*, length1 : Int32T, s2 : UChar*, length2 : Int32T, options : Int32T, status : UErrorCode*) : Int32T + fun uidna_idn_to_ascii = uidna_IDNToASCII{{SYMS_SUFFIX.id}}(src : UChar*, src_length : Int32T, dest : UChar*, dest_capacity : Int32T, options : Int32T, parse_error : UParseError*, status : UErrorCode*) : Int32T + fun uidna_idn_to_unicode = uidna_IDNToUnicode{{SYMS_SUFFIX.id}}(src : UChar*, src_length : Int32T, dest : UChar*, dest_capacity : Int32T, options : Int32T, parse_error : UParseError*, status : UErrorCode*) : Int32T + fun uidna_label_to_ascii = uidna_labelToASCII{{SYMS_SUFFIX.id}}(idna : Uidna, label : UChar*, length : Int32T, dest : UChar*, capacity : Int32T, p_info : UidnaInfo*, p_error_code : UErrorCode*) : Int32T + fun uidna_label_to_ascii_ut_f8 = uidna_labelToASCII_UTF8{{SYMS_SUFFIX.id}}(idna : Uidna, label : LibC::Char*, length : Int32T, dest : LibC::Char*, capacity : Int32T, p_info : UidnaInfo*, p_error_code : UErrorCode*) : Int32T + fun uidna_label_to_unicode = uidna_labelToUnicode{{SYMS_SUFFIX.id}}(idna : Uidna, label : UChar*, length : Int32T, dest : UChar*, capacity : Int32T, p_info : UidnaInfo*, p_error_code : UErrorCode*) : Int32T + fun uidna_label_to_unicode_ut_f8 = uidna_labelToUnicodeUTF8{{SYMS_SUFFIX.id}}(idna : Uidna, label : LibC::Char*, length : Int32T, dest : LibC::Char*, capacity : Int32T, p_info : UidnaInfo*, p_error_code : UErrorCode*) : Int32T + fun uidna_name_to_ascii = uidna_nameToASCII{{SYMS_SUFFIX.id}}(idna : Uidna, name : UChar*, length : Int32T, dest : UChar*, capacity : Int32T, p_info : UidnaInfo*, p_error_code : UErrorCode*) : Int32T + fun uidna_name_to_ascii_ut_f8 = uidna_nameToASCII_UTF8{{SYMS_SUFFIX.id}}(idna : Uidna, name : LibC::Char*, length : Int32T, dest : LibC::Char*, capacity : Int32T, p_info : UidnaInfo*, p_error_code : UErrorCode*) : Int32T + fun uidna_name_to_unicode = uidna_nameToUnicode{{SYMS_SUFFIX.id}}(idna : Uidna, name : UChar*, length : Int32T, dest : UChar*, capacity : Int32T, p_info : UidnaInfo*, p_error_code : UErrorCode*) : Int32T + fun uidna_name_to_unicode_ut_f8 = uidna_nameToUnicodeUTF8{{SYMS_SUFFIX.id}}(idna : Uidna, name : LibC::Char*, length : Int32T, dest : LibC::Char*, capacity : Int32T, p_info : UidnaInfo*, p_error_code : UErrorCode*) : Int32T + fun uidna_open_ut_s46 = uidna_openUTS46{{SYMS_SUFFIX.id}}(options : Uint32T, p_error_code : UErrorCode*) : Uidna + fun uidna_to_ascii = uidna_toASCII{{SYMS_SUFFIX.id}}(src : UChar*, src_length : Int32T, dest : UChar*, dest_capacity : Int32T, options : Int32T, parse_error : UParseError*, status : UErrorCode*) : Int32T + fun uidna_to_unicode = uidna_toUnicode{{SYMS_SUFFIX.id}}(src : UChar*, src_length : Int32T, dest : UChar*, dest_capacity : Int32T, options : Int32T, parse_error : UParseError*, status : UErrorCode*) : Int32T struct UidnaInfo size : Int16T @@ -27,4 +28,5 @@ lib LibICU end type Uidna = Void* + {% end %} end diff --git a/src/lib_icu/uloc.cr b/src/lib_icu/uloc.cr index 00dfc8e..972cd26 100644 --- a/src/lib_icu/uloc.cr +++ b/src/lib_icu/uloc.cr @@ -1,5 +1,6 @@ -@[Link(ldflags: "`command -v pkg-config > /dev/null && pkg-config --libs icu-uc icu-i18n icu-io icu-lx icu-le || printf %s '-licuio -licui18n -liculx -licule -licuuc -licudata'`")] +@[Link(ldflags: "`command -v pkg-config > /dev/null && pkg-config --libs icu-uc icu-i18n icu-io 2> /dev/null|| printf %s '-licuio -licui18n -licuuc -licudata'`")] lib LibICU + {% begin %} enum UAcceptResult UlocAcceptFailed = 0 UlocAcceptValid = 1 @@ -31,52 +32,53 @@ lib LibICU UmsUs = 1 UmsLimit = 2 end - fun uloc_accept_language = uloc_acceptLanguage_52(result : LibC::Char*, result_available : Int32T, out_result : UAcceptResult*, accept_list : LibC::Char**, accept_list_count : Int32T, available_locales : UEnumeration, status : UErrorCode*) : Int32T - fun uloc_accept_language_from_http = uloc_acceptLanguageFromHTTP_52(result : LibC::Char*, result_available : Int32T, out_result : UAcceptResult*, http_accept_language : LibC::Char*, available_locales : UEnumeration, status : UErrorCode*) : Int32T - fun uloc_add_likely_subtags = uloc_addLikelySubtags_52(locale_id : LibC::Char*, maximized_locale_id : LibC::Char*, maximized_locale_id_capacity : Int32T, err : UErrorCode*) : Int32T - fun uloc_canonicalize = uloc_canonicalize_52(locale_id : LibC::Char*, name : LibC::Char*, name_capacity : Int32T, err : UErrorCode*) : Int32T - fun uloc_count_available = uloc_countAvailable_52 : Int32T - fun uloc_for_language_tag = uloc_forLanguageTag_52(langtag : LibC::Char*, locale_id : LibC::Char*, locale_id_capacity : Int32T, parsed_length : Int32T*, err : UErrorCode*) : Int32T - fun uloc_get_available = uloc_getAvailable_52(n : Int32T) : LibC::Char* - fun uloc_get_base_name = uloc_getBaseName_52(locale_id : LibC::Char*, name : LibC::Char*, name_capacity : Int32T, err : UErrorCode*) : Int32T - fun uloc_get_character_orientation = uloc_getCharacterOrientation_52(locale_id : LibC::Char*, status : UErrorCode*) : ULayoutType - fun uloc_get_country = uloc_getCountry_52(locale_id : LibC::Char*, country : LibC::Char*, country_capacity : Int32T, err : UErrorCode*) : Int32T - fun uloc_get_default = uloc_getDefault_52 : LibC::Char* - fun uloc_get_display_country = uloc_getDisplayCountry_52(locale : LibC::Char*, display_locale : LibC::Char*, country : UChar*, country_capacity : Int32T, status : UErrorCode*) : Int32T - fun uloc_get_display_keyword = uloc_getDisplayKeyword_52(keyword : LibC::Char*, display_locale : LibC::Char*, dest : UChar*, dest_capacity : Int32T, status : UErrorCode*) : Int32T - fun uloc_get_display_keyword_value = uloc_getDisplayKeywordValue_52(locale : LibC::Char*, keyword : LibC::Char*, display_locale : LibC::Char*, dest : UChar*, dest_capacity : Int32T, status : UErrorCode*) : Int32T - fun uloc_get_display_language = uloc_getDisplayLanguage_52(locale : LibC::Char*, display_locale : LibC::Char*, language : UChar*, language_capacity : Int32T, status : UErrorCode*) : Int32T - fun uloc_get_display_name = uloc_getDisplayName_52(locale_id : LibC::Char*, in_locale_id : LibC::Char*, result : UChar*, max_result_size : Int32T, err : UErrorCode*) : Int32T - fun uloc_get_display_script = uloc_getDisplayScript_52(locale : LibC::Char*, display_locale : LibC::Char*, script : UChar*, script_capacity : Int32T, status : UErrorCode*) : Int32T - fun uloc_get_display_variant = uloc_getDisplayVariant_52(locale : LibC::Char*, display_locale : LibC::Char*, variant : UChar*, variant_capacity : Int32T, status : UErrorCode*) : Int32T - fun uloc_get_is_o3country = uloc_getISO3Country_52(locale_id : LibC::Char*) : LibC::Char* - fun uloc_get_is_o3language = uloc_getISO3Language_52(locale_id : LibC::Char*) : LibC::Char* - fun uloc_get_iso_countries = uloc_getISOCountries_52 : LibC::Char** - fun uloc_get_iso_languages = uloc_getISOLanguages_52 : LibC::Char** - fun uloc_get_keyword_value = uloc_getKeywordValue_52(locale_id : LibC::Char*, keyword_name : LibC::Char*, buffer : LibC::Char*, buffer_capacity : Int32T, status : UErrorCode*) : Int32T - fun uloc_get_language = uloc_getLanguage_52(locale_id : LibC::Char*, language : LibC::Char*, language_capacity : Int32T, err : UErrorCode*) : Int32T - fun uloc_get_lcid = uloc_getLCID_52(locale_id : LibC::Char*) : Uint32T - fun uloc_get_line_orientation = uloc_getLineOrientation_52(locale_id : LibC::Char*, status : UErrorCode*) : ULayoutType - fun uloc_get_locale_for_lcid = uloc_getLocaleForLCID_52(host_id : Uint32T, locale : LibC::Char*, locale_capacity : Int32T, status : UErrorCode*) : Int32T - fun uloc_get_name = uloc_getName_52(locale_id : LibC::Char*, name : LibC::Char*, name_capacity : Int32T, err : UErrorCode*) : Int32T - fun uloc_get_parent = uloc_getParent_52(locale_id : LibC::Char*, parent : LibC::Char*, parent_capacity : Int32T, err : UErrorCode*) : Int32T - fun uloc_get_script = uloc_getScript_52(locale_id : LibC::Char*, script : LibC::Char*, script_capacity : Int32T, err : UErrorCode*) : Int32T - fun uloc_get_variant = uloc_getVariant_52(locale_id : LibC::Char*, variant : LibC::Char*, variant_capacity : Int32T, err : UErrorCode*) : Int32T - fun uloc_minimize_subtags = uloc_minimizeSubtags_52(locale_id : LibC::Char*, minimized_locale_id : LibC::Char*, minimized_locale_id_capacity : Int32T, err : UErrorCode*) : Int32T - fun uloc_open_keywords = uloc_openKeywords_52(locale_id : LibC::Char*, status : UErrorCode*) : UEnumeration - fun uloc_set_default = uloc_setDefault_52(locale_id : LibC::Char*, status : UErrorCode*) - fun uloc_set_keyword_value = uloc_setKeywordValue_52(keyword_name : LibC::Char*, keyword_value : LibC::Char*, buffer : LibC::Char*, buffer_capacity : Int32T, status : UErrorCode*) : Int32T - fun uloc_to_language_tag = uloc_toLanguageTag_52(locale_id : LibC::Char*, langtag : LibC::Char*, langtag_capacity : Int32T, strict : UBool, err : UErrorCode*) : Int32T - fun ulocdata_close = ulocdata_close_52(uld : ULocaleData) - fun ulocdata_get_cldr_version = ulocdata_getCLDRVersion_52(version_array : UVersionInfo, status : UErrorCode*) - fun ulocdata_get_delimiter = ulocdata_getDelimiter_52(uld : ULocaleData, type : ULocaleDataDelimiterType, result : UChar*, result_length : Int32T, status : UErrorCode*) : Int32T - fun ulocdata_get_exemplar_set = ulocdata_getExemplarSet_52(uld : ULocaleData, fill_in : USet, options : Uint32T, extype : ULocaleDataExemplarSetType, status : UErrorCode*) : USet - fun ulocdata_get_locale_display_pattern = ulocdata_getLocaleDisplayPattern_52(uld : ULocaleData, pattern : UChar*, pattern_capacity : Int32T, status : UErrorCode*) : Int32T - fun ulocdata_get_locale_separator = ulocdata_getLocaleSeparator_52(uld : ULocaleData, separator : UChar*, separator_capacity : Int32T, status : UErrorCode*) : Int32T - fun ulocdata_get_measurement_system = ulocdata_getMeasurementSystem_52(locale_id : LibC::Char*, status : UErrorCode*) : UMeasurementSystem - fun ulocdata_get_no_substitute = ulocdata_getNoSubstitute_52(uld : ULocaleData) : UBool - fun ulocdata_get_paper_size = ulocdata_getPaperSize_52(locale_id : LibC::Char*, height : Int32T*, width : Int32T*, status : UErrorCode*) - fun ulocdata_open = ulocdata_open_52(locale_id : LibC::Char*, status : UErrorCode*) : ULocaleData - fun ulocdata_set_no_substitute = ulocdata_setNoSubstitute_52(uld : ULocaleData, setting : UBool) + fun uloc_accept_language = uloc_acceptLanguage{{SYMS_SUFFIX.id}}(result : LibC::Char*, result_available : Int32T, out_result : UAcceptResult*, accept_list : LibC::Char**, accept_list_count : Int32T, available_locales : UEnumeration, status : UErrorCode*) : Int32T + fun uloc_accept_language_from_http = uloc_acceptLanguageFromHTTP{{SYMS_SUFFIX.id}}(result : LibC::Char*, result_available : Int32T, out_result : UAcceptResult*, http_accept_language : LibC::Char*, available_locales : UEnumeration, status : UErrorCode*) : Int32T + fun uloc_add_likely_subtags = uloc_addLikelySubtags{{SYMS_SUFFIX.id}}(locale_id : LibC::Char*, maximized_locale_id : LibC::Char*, maximized_locale_id_capacity : Int32T, err : UErrorCode*) : Int32T + fun uloc_canonicalize = uloc_canonicalize{{SYMS_SUFFIX.id}}(locale_id : LibC::Char*, name : LibC::Char*, name_capacity : Int32T, err : UErrorCode*) : Int32T + fun uloc_count_available = uloc_countAvailable{{SYMS_SUFFIX.id}} : Int32T + fun uloc_for_language_tag = uloc_forLanguageTag{{SYMS_SUFFIX.id}}(langtag : LibC::Char*, locale_id : LibC::Char*, locale_id_capacity : Int32T, parsed_length : Int32T*, err : UErrorCode*) : Int32T + fun uloc_get_available = uloc_getAvailable{{SYMS_SUFFIX.id}}(n : Int32T) : LibC::Char* + fun uloc_get_base_name = uloc_getBaseName{{SYMS_SUFFIX.id}}(locale_id : LibC::Char*, name : LibC::Char*, name_capacity : Int32T, err : UErrorCode*) : Int32T + fun uloc_get_character_orientation = uloc_getCharacterOrientation{{SYMS_SUFFIX.id}}(locale_id : LibC::Char*, status : UErrorCode*) : ULayoutType + fun uloc_get_country = uloc_getCountry{{SYMS_SUFFIX.id}}(locale_id : LibC::Char*, country : LibC::Char*, country_capacity : Int32T, err : UErrorCode*) : Int32T + fun uloc_get_default = uloc_getDefault{{SYMS_SUFFIX.id}} : LibC::Char* + fun uloc_get_display_country = uloc_getDisplayCountry{{SYMS_SUFFIX.id}}(locale : LibC::Char*, display_locale : LibC::Char*, country : UChar*, country_capacity : Int32T, status : UErrorCode*) : Int32T + fun uloc_get_display_keyword = uloc_getDisplayKeyword{{SYMS_SUFFIX.id}}(keyword : LibC::Char*, display_locale : LibC::Char*, dest : UChar*, dest_capacity : Int32T, status : UErrorCode*) : Int32T + fun uloc_get_display_keyword_value = uloc_getDisplayKeywordValue{{SYMS_SUFFIX.id}}(locale : LibC::Char*, keyword : LibC::Char*, display_locale : LibC::Char*, dest : UChar*, dest_capacity : Int32T, status : UErrorCode*) : Int32T + fun uloc_get_display_language = uloc_getDisplayLanguage{{SYMS_SUFFIX.id}}(locale : LibC::Char*, display_locale : LibC::Char*, language : UChar*, language_capacity : Int32T, status : UErrorCode*) : Int32T + fun uloc_get_display_name = uloc_getDisplayName{{SYMS_SUFFIX.id}}(locale_id : LibC::Char*, in_locale_id : LibC::Char*, result : UChar*, max_result_size : Int32T, err : UErrorCode*) : Int32T + fun uloc_get_display_script = uloc_getDisplayScript{{SYMS_SUFFIX.id}}(locale : LibC::Char*, display_locale : LibC::Char*, script : UChar*, script_capacity : Int32T, status : UErrorCode*) : Int32T + fun uloc_get_display_variant = uloc_getDisplayVariant{{SYMS_SUFFIX.id}}(locale : LibC::Char*, display_locale : LibC::Char*, variant : UChar*, variant_capacity : Int32T, status : UErrorCode*) : Int32T + fun uloc_get_is_o3country = uloc_getISO3Country{{SYMS_SUFFIX.id}}(locale_id : LibC::Char*) : LibC::Char* + fun uloc_get_is_o3language = uloc_getISO3Language{{SYMS_SUFFIX.id}}(locale_id : LibC::Char*) : LibC::Char* + fun uloc_get_iso_countries = uloc_getISOCountries{{SYMS_SUFFIX.id}} : LibC::Char** + fun uloc_get_iso_languages = uloc_getISOLanguages{{SYMS_SUFFIX.id}} : LibC::Char** + fun uloc_get_keyword_value = uloc_getKeywordValue{{SYMS_SUFFIX.id}}(locale_id : LibC::Char*, keyword_name : LibC::Char*, buffer : LibC::Char*, buffer_capacity : Int32T, status : UErrorCode*) : Int32T + fun uloc_get_language = uloc_getLanguage{{SYMS_SUFFIX.id}}(locale_id : LibC::Char*, language : LibC::Char*, language_capacity : Int32T, err : UErrorCode*) : Int32T + fun uloc_get_lcid = uloc_getLCID{{SYMS_SUFFIX.id}}(locale_id : LibC::Char*) : Uint32T + fun uloc_get_line_orientation = uloc_getLineOrientation{{SYMS_SUFFIX.id}}(locale_id : LibC::Char*, status : UErrorCode*) : ULayoutType + fun uloc_get_locale_for_lcid = uloc_getLocaleForLCID{{SYMS_SUFFIX.id}}(host_id : Uint32T, locale : LibC::Char*, locale_capacity : Int32T, status : UErrorCode*) : Int32T + fun uloc_get_name = uloc_getName{{SYMS_SUFFIX.id}}(locale_id : LibC::Char*, name : LibC::Char*, name_capacity : Int32T, err : UErrorCode*) : Int32T + fun uloc_get_parent = uloc_getParent{{SYMS_SUFFIX.id}}(locale_id : LibC::Char*, parent : LibC::Char*, parent_capacity : Int32T, err : UErrorCode*) : Int32T + fun uloc_get_script = uloc_getScript{{SYMS_SUFFIX.id}}(locale_id : LibC::Char*, script : LibC::Char*, script_capacity : Int32T, err : UErrorCode*) : Int32T + fun uloc_get_variant = uloc_getVariant{{SYMS_SUFFIX.id}}(locale_id : LibC::Char*, variant : LibC::Char*, variant_capacity : Int32T, err : UErrorCode*) : Int32T + fun uloc_minimize_subtags = uloc_minimizeSubtags{{SYMS_SUFFIX.id}}(locale_id : LibC::Char*, minimized_locale_id : LibC::Char*, minimized_locale_id_capacity : Int32T, err : UErrorCode*) : Int32T + fun uloc_open_keywords = uloc_openKeywords{{SYMS_SUFFIX.id}}(locale_id : LibC::Char*, status : UErrorCode*) : UEnumeration + fun uloc_set_default = uloc_setDefault{{SYMS_SUFFIX.id}}(locale_id : LibC::Char*, status : UErrorCode*) + fun uloc_set_keyword_value = uloc_setKeywordValue{{SYMS_SUFFIX.id}}(keyword_name : LibC::Char*, keyword_value : LibC::Char*, buffer : LibC::Char*, buffer_capacity : Int32T, status : UErrorCode*) : Int32T + fun uloc_to_language_tag = uloc_toLanguageTag{{SYMS_SUFFIX.id}}(locale_id : LibC::Char*, langtag : LibC::Char*, langtag_capacity : Int32T, strict : UBool, err : UErrorCode*) : Int32T + fun ulocdata_close = ulocdata_close{{SYMS_SUFFIX.id}}(uld : ULocaleData) + fun ulocdata_get_cldr_version = ulocdata_getCLDRVersion{{SYMS_SUFFIX.id}}(version_array : UVersionInfo, status : UErrorCode*) + fun ulocdata_get_delimiter = ulocdata_getDelimiter{{SYMS_SUFFIX.id}}(uld : ULocaleData, type : ULocaleDataDelimiterType, result : UChar*, result_length : Int32T, status : UErrorCode*) : Int32T + fun ulocdata_get_exemplar_set = ulocdata_getExemplarSet{{SYMS_SUFFIX.id}}(uld : ULocaleData, fill_in : USet, options : Uint32T, extype : ULocaleDataExemplarSetType, status : UErrorCode*) : USet + fun ulocdata_get_locale_display_pattern = ulocdata_getLocaleDisplayPattern{{SYMS_SUFFIX.id}}(uld : ULocaleData, pattern : UChar*, pattern_capacity : Int32T, status : UErrorCode*) : Int32T + fun ulocdata_get_locale_separator = ulocdata_getLocaleSeparator{{SYMS_SUFFIX.id}}(uld : ULocaleData, separator : UChar*, separator_capacity : Int32T, status : UErrorCode*) : Int32T + fun ulocdata_get_measurement_system = ulocdata_getMeasurementSystem{{SYMS_SUFFIX.id}}(locale_id : LibC::Char*, status : UErrorCode*) : UMeasurementSystem + fun ulocdata_get_no_substitute = ulocdata_getNoSubstitute{{SYMS_SUFFIX.id}}(uld : ULocaleData) : UBool + fun ulocdata_get_paper_size = ulocdata_getPaperSize{{SYMS_SUFFIX.id}}(locale_id : LibC::Char*, height : Int32T*, width : Int32T*, status : UErrorCode*) + fun ulocdata_open = ulocdata_open{{SYMS_SUFFIX.id}}(locale_id : LibC::Char*, status : UErrorCode*) : ULocaleData + fun ulocdata_set_no_substitute = ulocdata_setNoSubstitute{{SYMS_SUFFIX.id}}(uld : ULocaleData, setting : UBool) type ULocaleData = Void* + {% end %} end diff --git a/src/lib_icu/unorm2.cr b/src/lib_icu/unorm2.cr index 98b09bc..da6baa0 100644 --- a/src/lib_icu/unorm2.cr +++ b/src/lib_icu/unorm2.cr @@ -1,5 +1,6 @@ -@[Link(ldflags: "`command -v pkg-config > /dev/null && pkg-config --libs icu-uc icu-i18n icu-io icu-lx icu-le || printf %s '-licuio -licui18n -liculx -licule -licuuc -licudata'`")] +@[Link(ldflags: "`command -v pkg-config > /dev/null && pkg-config --libs icu-uc icu-i18n icu-io 2> /dev/null|| printf %s '-licuio -licui18n -licuuc -licudata'`")] lib LibICU + {% begin %} enum UNormalization2mode UnorM2Compose = 0 UnorM2Decompose = 1 @@ -11,26 +12,27 @@ lib LibICU UnormYes = 1 UnormMaybe = 2 end - fun unorm2_append = unorm2_append_52(norm2 : UNormalizer2, first : UChar*, first_length : Int32T, first_capacity : Int32T, second : UChar*, second_length : Int32T, p_error_code : UErrorCode*) : Int32T - fun unorm2_close = unorm2_close_52(norm2 : UNormalizer2) - fun unorm2_compose_pair = unorm2_composePair_52(norm2 : UNormalizer2, a : UChar32, b : UChar32) : UChar32 - fun unorm2_get_combining_class = unorm2_getCombiningClass_52(norm2 : UNormalizer2, c : UChar32) : Uint8T - fun unorm2_get_decomposition = unorm2_getDecomposition_52(norm2 : UNormalizer2, c : UChar32, decomposition : UChar*, capacity : Int32T, p_error_code : UErrorCode*) : Int32T - fun unorm2_get_instance = unorm2_getInstance_52(package_name : LibC::Char*, name : LibC::Char*, mode : UNormalization2mode, p_error_code : UErrorCode*) : UNormalizer2 - fun unorm2_get_nfc_instance = unorm2_getNFCInstance_52(p_error_code : UErrorCode*) : UNormalizer2 - fun unorm2_get_nfd_instance = unorm2_getNFDInstance_52(p_error_code : UErrorCode*) : UNormalizer2 - fun unorm2_get_nfkc_casefold_instance = unorm2_getNFKCCasefoldInstance_52(p_error_code : UErrorCode*) : UNormalizer2 - fun unorm2_get_nfkc_instance = unorm2_getNFKCInstance_52(p_error_code : UErrorCode*) : UNormalizer2 - fun unorm2_get_nfkd_instance = unorm2_getNFKDInstance_52(p_error_code : UErrorCode*) : UNormalizer2 - fun unorm2_get_raw_decomposition = unorm2_getRawDecomposition_52(norm2 : UNormalizer2, c : UChar32, decomposition : UChar*, capacity : Int32T, p_error_code : UErrorCode*) : Int32T - fun unorm2_has_boundary_after = unorm2_hasBoundaryAfter_52(norm2 : UNormalizer2, c : UChar32) : UBool - fun unorm2_has_boundary_before = unorm2_hasBoundaryBefore_52(norm2 : UNormalizer2, c : UChar32) : UBool - fun unorm2_is_inert = unorm2_isInert_52(norm2 : UNormalizer2, c : UChar32) : UBool - fun unorm2_is_normalized = unorm2_isNormalized_52(norm2 : UNormalizer2, s : UChar*, length : Int32T, p_error_code : UErrorCode*) : UBool - fun unorm2_normalize = unorm2_normalize_52(norm2 : UNormalizer2, src : UChar*, length : Int32T, dest : UChar*, capacity : Int32T, p_error_code : UErrorCode*) : Int32T - fun unorm2_normalize_second_and_append = unorm2_normalizeSecondAndAppend_52(norm2 : UNormalizer2, first : UChar*, first_length : Int32T, first_capacity : Int32T, second : UChar*, second_length : Int32T, p_error_code : UErrorCode*) : Int32T - fun unorm2_open_filtered = unorm2_openFiltered_52(norm2 : UNormalizer2, filter_set : USet, p_error_code : UErrorCode*) : UNormalizer2 - fun unorm2_quick_check = unorm2_quickCheck_52(norm2 : UNormalizer2, s : UChar*, length : Int32T, p_error_code : UErrorCode*) : UNormalizationCheckResult - fun unorm2_span_quick_check_yes = unorm2_spanQuickCheckYes_52(norm2 : UNormalizer2, s : UChar*, length : Int32T, p_error_code : UErrorCode*) : Int32T + fun unorm2_append = unorm2_append{{SYMS_SUFFIX.id}}(norm2 : UNormalizer2, first : UChar*, first_length : Int32T, first_capacity : Int32T, second : UChar*, second_length : Int32T, p_error_code : UErrorCode*) : Int32T + fun unorm2_close = unorm2_close{{SYMS_SUFFIX.id}}(norm2 : UNormalizer2) + fun unorm2_compose_pair = unorm2_composePair{{SYMS_SUFFIX.id}}(norm2 : UNormalizer2, a : UChar32, b : UChar32) : UChar32 + fun unorm2_get_combining_class = unorm2_getCombiningClass{{SYMS_SUFFIX.id}}(norm2 : UNormalizer2, c : UChar32) : Uint8T + fun unorm2_get_decomposition = unorm2_getDecomposition{{SYMS_SUFFIX.id}}(norm2 : UNormalizer2, c : UChar32, decomposition : UChar*, capacity : Int32T, p_error_code : UErrorCode*) : Int32T + fun unorm2_get_instance = unorm2_getInstance{{SYMS_SUFFIX.id}}(package_name : LibC::Char*, name : LibC::Char*, mode : UNormalization2mode, p_error_code : UErrorCode*) : UNormalizer2 + fun unorm2_get_nfc_instance = unorm2_getNFCInstance{{SYMS_SUFFIX.id}}(p_error_code : UErrorCode*) : UNormalizer2 + fun unorm2_get_nfd_instance = unorm2_getNFDInstance{{SYMS_SUFFIX.id}}(p_error_code : UErrorCode*) : UNormalizer2 + fun unorm2_get_nfkc_casefold_instance = unorm2_getNFKCCasefoldInstance{{SYMS_SUFFIX.id}}(p_error_code : UErrorCode*) : UNormalizer2 + fun unorm2_get_nfkc_instance = unorm2_getNFKCInstance{{SYMS_SUFFIX.id}}(p_error_code : UErrorCode*) : UNormalizer2 + fun unorm2_get_nfkd_instance = unorm2_getNFKDInstance{{SYMS_SUFFIX.id}}(p_error_code : UErrorCode*) : UNormalizer2 + fun unorm2_get_raw_decomposition = unorm2_getRawDecomposition{{SYMS_SUFFIX.id}}(norm2 : UNormalizer2, c : UChar32, decomposition : UChar*, capacity : Int32T, p_error_code : UErrorCode*) : Int32T + fun unorm2_has_boundary_after = unorm2_hasBoundaryAfter{{SYMS_SUFFIX.id}}(norm2 : UNormalizer2, c : UChar32) : UBool + fun unorm2_has_boundary_before = unorm2_hasBoundaryBefore{{SYMS_SUFFIX.id}}(norm2 : UNormalizer2, c : UChar32) : UBool + fun unorm2_is_inert = unorm2_isInert{{SYMS_SUFFIX.id}}(norm2 : UNormalizer2, c : UChar32) : UBool + fun unorm2_is_normalized = unorm2_isNormalized{{SYMS_SUFFIX.id}}(norm2 : UNormalizer2, s : UChar*, length : Int32T, p_error_code : UErrorCode*) : UBool + fun unorm2_normalize = unorm2_normalize{{SYMS_SUFFIX.id}}(norm2 : UNormalizer2, src : UChar*, length : Int32T, dest : UChar*, capacity : Int32T, p_error_code : UErrorCode*) : Int32T + fun unorm2_normalize_second_and_append = unorm2_normalizeSecondAndAppend{{SYMS_SUFFIX.id}}(norm2 : UNormalizer2, first : UChar*, first_length : Int32T, first_capacity : Int32T, second : UChar*, second_length : Int32T, p_error_code : UErrorCode*) : Int32T + fun unorm2_open_filtered = unorm2_openFiltered{{SYMS_SUFFIX.id}}(norm2 : UNormalizer2, filter_set : USet, p_error_code : UErrorCode*) : UNormalizer2 + fun unorm2_quick_check = unorm2_quickCheck{{SYMS_SUFFIX.id}}(norm2 : UNormalizer2, s : UChar*, length : Int32T, p_error_code : UErrorCode*) : UNormalizationCheckResult + fun unorm2_span_quick_check_yes = unorm2_spanQuickCheckYes{{SYMS_SUFFIX.id}}(norm2 : UNormalizer2, s : UChar*, length : Int32T, p_error_code : UErrorCode*) : Int32T type UNormalizer2 = Void* + {% end %} end diff --git a/src/lib_icu/unum.cr b/src/lib_icu/unum.cr index 604255c..bfbca34 100644 --- a/src/lib_icu/unum.cr +++ b/src/lib_icu/unum.cr @@ -1,5 +1,6 @@ -@[Link(ldflags: "`command -v pkg-config > /dev/null && pkg-config --libs icu-uc icu-i18n icu-io icu-lx icu-le || printf %s '-licuio -licui18n -liculx -licule -licuuc -licudata'`")] +@[Link(ldflags: "`command -v pkg-config > /dev/null && pkg-config --libs icu-uc icu-i18n icu-io 2> /dev/null|| printf %s '-licuio -licui18n -licuuc -licudata'`")] lib LibICU + {% begin %} enum UNumberFormatAttribute UnumParseIntOnly = 0 UnumGroupingUsed = 1 @@ -86,32 +87,33 @@ lib LibICU UnumDefaultRuleset = 6 UnumPublicRulesets = 7 end - fun unum_apply_pattern = unum_applyPattern_52(format : UNumberFormat*, localized : UBool, pattern : UChar*, pattern_length : Int32T, parse_error : UParseError*, status : UErrorCode*) - fun unum_clone = unum_clone_52(fmt : UNumberFormat*, status : UErrorCode*) : UNumberFormat* - fun unum_close = unum_close_52(fmt : UNumberFormat*) - fun unum_count_available = unum_countAvailable_52 : Int32T - fun unum_format = unum_format_52(fmt : UNumberFormat*, number : Int32T, result : UChar*, result_length : Int32T, pos : UFieldPosition*, status : UErrorCode*) : Int32T - fun unum_format_decimal = unum_formatDecimal_52(fmt : UNumberFormat*, number : LibC::Char*, length : Int32T, result : UChar*, result_length : Int32T, pos : UFieldPosition*, status : UErrorCode*) : Int32T - fun unum_format_double = unum_formatDouble_52(fmt : UNumberFormat*, number : LibC::Double, result : UChar*, result_length : Int32T, pos : UFieldPosition*, status : UErrorCode*) : Int32T - fun unum_format_double_currency = unum_formatDoubleCurrency_52(fmt : UNumberFormat*, number : LibC::Double, currency : UChar*, result : UChar*, result_length : Int32T, pos : UFieldPosition*, status : UErrorCode*) : Int32T - fun unum_format_int64 = unum_formatInt64_52(fmt : UNumberFormat*, number : Int64T, result : UChar*, result_length : Int32T, pos : UFieldPosition*, status : UErrorCode*) : Int32T - fun unum_format_u_formattable = unum_formatUFormattable_52(fmt : UNumberFormat*, number : UFormattable*, result : UChar*, result_length : Int32T, pos : UFieldPosition*, status : UErrorCode*) : Int32T - fun unum_get_attribute = unum_getAttribute_52(fmt : UNumberFormat*, attr : UNumberFormatAttribute) : Int32T - fun unum_get_available = unum_getAvailable_52(locale_index : Int32T) : LibC::Char* - fun unum_get_double_attribute = unum_getDoubleAttribute_52(fmt : UNumberFormat*, attr : UNumberFormatAttribute) : LibC::Double - fun unum_get_locale_by_type = unum_getLocaleByType_52(fmt : UNumberFormat*, type : ULocDataLocaleType, status : UErrorCode*) : LibC::Char* - fun unum_get_symbol = unum_getSymbol_52(fmt : UNumberFormat*, symbol : UNumberFormatSymbol, buffer : UChar*, size : Int32T, status : UErrorCode*) : Int32T - fun unum_get_text_attribute = unum_getTextAttribute_52(fmt : UNumberFormat*, tag : UNumberFormatTextAttribute, result : UChar*, result_length : Int32T, status : UErrorCode*) : Int32T - fun unum_open = unum_open_52(style : UNumberFormatStyle, pattern : UChar*, pattern_length : Int32T, locale : LibC::Char*, parse_err : UParseError*, status : UErrorCode*) : UNumberFormat* - fun unum_parse = unum_parse_52(fmt : UNumberFormat*, text : UChar*, text_length : Int32T, parse_pos : Int32T*, status : UErrorCode*) : Int32T - fun unum_parse_decimal = unum_parseDecimal_52(fmt : UNumberFormat*, text : UChar*, text_length : Int32T, parse_pos : Int32T*, out_buf : LibC::Char*, out_buf_length : Int32T, status : UErrorCode*) : Int32T - fun unum_parse_double = unum_parseDouble_52(fmt : UNumberFormat*, text : UChar*, text_length : Int32T, parse_pos : Int32T*, status : UErrorCode*) : LibC::Double - fun unum_parse_double_currency = unum_parseDoubleCurrency_52(fmt : UNumberFormat*, text : UChar*, text_length : Int32T, parse_pos : Int32T*, currency : UChar*, status : UErrorCode*) : LibC::Double - fun unum_parse_int64 = unum_parseInt64_52(fmt : UNumberFormat*, text : UChar*, text_length : Int32T, parse_pos : Int32T*, status : UErrorCode*) : Int64T - fun unum_parse_to_u_formattable = unum_parseToUFormattable_52(fmt : UNumberFormat*, result : UFormattable*, text : UChar*, text_length : Int32T, parse_pos : Int32T*, status : UErrorCode*) : UFormattable* - fun unum_set_attribute = unum_setAttribute_52(fmt : UNumberFormat*, attr : UNumberFormatAttribute, new_value : Int32T) - fun unum_set_double_attribute = unum_setDoubleAttribute_52(fmt : UNumberFormat*, attr : UNumberFormatAttribute, new_value : LibC::Double) - fun unum_set_symbol = unum_setSymbol_52(fmt : UNumberFormat*, symbol : UNumberFormatSymbol, value : UChar*, length : Int32T, status : UErrorCode*) - fun unum_set_text_attribute = unum_setTextAttribute_52(fmt : UNumberFormat*, tag : UNumberFormatTextAttribute, new_value : UChar*, new_value_length : Int32T, status : UErrorCode*) - fun unum_to_pattern = unum_toPattern_52(fmt : UNumberFormat*, is_pattern_localized : UBool, result : UChar*, result_length : Int32T, status : UErrorCode*) : Int32T + fun unum_apply_pattern = unum_applyPattern{{SYMS_SUFFIX.id}}(format : UNumberFormat*, localized : UBool, pattern : UChar*, pattern_length : Int32T, parse_error : UParseError*, status : UErrorCode*) + fun unum_clone = unum_clone{{SYMS_SUFFIX.id}}(fmt : UNumberFormat*, status : UErrorCode*) : UNumberFormat* + fun unum_close = unum_close{{SYMS_SUFFIX.id}}(fmt : UNumberFormat*) + fun unum_count_available = unum_countAvailable{{SYMS_SUFFIX.id}} : Int32T + fun unum_format = unum_format{{SYMS_SUFFIX.id}}(fmt : UNumberFormat*, number : Int32T, result : UChar*, result_length : Int32T, pos : UFieldPosition*, status : UErrorCode*) : Int32T + fun unum_format_decimal = unum_formatDecimal{{SYMS_SUFFIX.id}}(fmt : UNumberFormat*, number : LibC::Char*, length : Int32T, result : UChar*, result_length : Int32T, pos : UFieldPosition*, status : UErrorCode*) : Int32T + fun unum_format_double = unum_formatDouble{{SYMS_SUFFIX.id}}(fmt : UNumberFormat*, number : LibC::Double, result : UChar*, result_length : Int32T, pos : UFieldPosition*, status : UErrorCode*) : Int32T + fun unum_format_double_currency = unum_formatDoubleCurrency{{SYMS_SUFFIX.id}}(fmt : UNumberFormat*, number : LibC::Double, currency : UChar*, result : UChar*, result_length : Int32T, pos : UFieldPosition*, status : UErrorCode*) : Int32T + fun unum_format_int64 = unum_formatInt64{{SYMS_SUFFIX.id}}(fmt : UNumberFormat*, number : Int64T, result : UChar*, result_length : Int32T, pos : UFieldPosition*, status : UErrorCode*) : Int32T + fun unum_format_u_formattable = unum_formatUFormattable{{SYMS_SUFFIX.id}}(fmt : UNumberFormat*, number : UFormattable*, result : UChar*, result_length : Int32T, pos : UFieldPosition*, status : UErrorCode*) : Int32T + fun unum_get_attribute = unum_getAttribute{{SYMS_SUFFIX.id}}(fmt : UNumberFormat*, attr : UNumberFormatAttribute) : Int32T + fun unum_get_available = unum_getAvailable{{SYMS_SUFFIX.id}}(locale_index : Int32T) : LibC::Char* + fun unum_get_double_attribute = unum_getDoubleAttribute{{SYMS_SUFFIX.id}}(fmt : UNumberFormat*, attr : UNumberFormatAttribute) : LibC::Double + fun unum_get_locale_by_type = unum_getLocaleByType{{SYMS_SUFFIX.id}}(fmt : UNumberFormat*, type : ULocDataLocaleType, status : UErrorCode*) : LibC::Char* + fun unum_get_symbol = unum_getSymbol{{SYMS_SUFFIX.id}}(fmt : UNumberFormat*, symbol : UNumberFormatSymbol, buffer : UChar*, size : Int32T, status : UErrorCode*) : Int32T + fun unum_get_text_attribute = unum_getTextAttribute{{SYMS_SUFFIX.id}}(fmt : UNumberFormat*, tag : UNumberFormatTextAttribute, result : UChar*, result_length : Int32T, status : UErrorCode*) : Int32T + fun unum_open = unum_open{{SYMS_SUFFIX.id}}(style : UNumberFormatStyle, pattern : UChar*, pattern_length : Int32T, locale : LibC::Char*, parse_err : UParseError*, status : UErrorCode*) : UNumberFormat* + fun unum_parse = unum_parse{{SYMS_SUFFIX.id}}(fmt : UNumberFormat*, text : UChar*, text_length : Int32T, parse_pos : Int32T*, status : UErrorCode*) : Int32T + fun unum_parse_decimal = unum_parseDecimal{{SYMS_SUFFIX.id}}(fmt : UNumberFormat*, text : UChar*, text_length : Int32T, parse_pos : Int32T*, out_buf : LibC::Char*, out_buf_length : Int32T, status : UErrorCode*) : Int32T + fun unum_parse_double = unum_parseDouble{{SYMS_SUFFIX.id}}(fmt : UNumberFormat*, text : UChar*, text_length : Int32T, parse_pos : Int32T*, status : UErrorCode*) : LibC::Double + fun unum_parse_double_currency = unum_parseDoubleCurrency{{SYMS_SUFFIX.id}}(fmt : UNumberFormat*, text : UChar*, text_length : Int32T, parse_pos : Int32T*, currency : UChar*, status : UErrorCode*) : LibC::Double + fun unum_parse_int64 = unum_parseInt64{{SYMS_SUFFIX.id}}(fmt : UNumberFormat*, text : UChar*, text_length : Int32T, parse_pos : Int32T*, status : UErrorCode*) : Int64T + fun unum_parse_to_u_formattable = unum_parseToUFormattable{{SYMS_SUFFIX.id}}(fmt : UNumberFormat*, result : UFormattable*, text : UChar*, text_length : Int32T, parse_pos : Int32T*, status : UErrorCode*) : UFormattable* + fun unum_set_attribute = unum_setAttribute{{SYMS_SUFFIX.id}}(fmt : UNumberFormat*, attr : UNumberFormatAttribute, new_value : Int32T) + fun unum_set_double_attribute = unum_setDoubleAttribute{{SYMS_SUFFIX.id}}(fmt : UNumberFormat*, attr : UNumberFormatAttribute, new_value : LibC::Double) + fun unum_set_symbol = unum_setSymbol{{SYMS_SUFFIX.id}}(fmt : UNumberFormat*, symbol : UNumberFormatSymbol, value : UChar*, length : Int32T, status : UErrorCode*) + fun unum_set_text_attribute = unum_setTextAttribute{{SYMS_SUFFIX.id}}(fmt : UNumberFormat*, tag : UNumberFormatTextAttribute, new_value : UChar*, new_value_length : Int32T, status : UErrorCode*) + fun unum_to_pattern = unum_toPattern{{SYMS_SUFFIX.id}}(fmt : UNumberFormat*, is_pattern_localized : UBool, result : UChar*, result_length : Int32T, status : UErrorCode*) : Int32T + {% end %} end diff --git a/src/lib_icu/upluralrules.cr b/src/lib_icu/upluralrules.cr index 021cc74..f236f0f 100644 --- a/src/lib_icu/upluralrules.cr +++ b/src/lib_icu/upluralrules.cr @@ -1,13 +1,15 @@ -@[Link(ldflags: "`command -v pkg-config > /dev/null && pkg-config --libs icu-uc icu-i18n icu-io icu-lx icu-le || printf %s '-licuio -licui18n -liculx -licule -licuuc -licudata'`")] +@[Link(ldflags: "`command -v pkg-config > /dev/null && pkg-config --libs icu-uc icu-i18n icu-io 2> /dev/null|| printf %s '-licuio -licui18n -licuuc -licudata'`")] lib LibICU + {% begin %} enum UPluralType UpluralTypeCardinal = 0 UpluralTypeOrdinal = 1 UpluralTypeCount = 2 end - fun uplrules_close = uplrules_close_52(uplrules : UPluralRules) - fun uplrules_open = uplrules_open_52(locale : LibC::Char*, status : UErrorCode*) : UPluralRules - fun uplrules_open_for_type = uplrules_openForType_52(locale : LibC::Char*, type : UPluralType, status : UErrorCode*) : UPluralRules - fun uplrules_select = uplrules_select_52(uplrules : UPluralRules, number : LibC::Double, keyword : UChar*, capacity : Int32T, status : UErrorCode*) : Int32T + fun uplrules_close = uplrules_close{{SYMS_SUFFIX.id}}(uplrules : UPluralRules) + fun uplrules_open = uplrules_open{{SYMS_SUFFIX.id}}(locale : LibC::Char*, status : UErrorCode*) : UPluralRules + fun uplrules_open_for_type = uplrules_openForType{{SYMS_SUFFIX.id}}(locale : LibC::Char*, type : UPluralType, status : UErrorCode*) : UPluralRules + fun uplrules_select = uplrules_select{{SYMS_SUFFIX.id}}(uplrules : UPluralRules, number : LibC::Double, keyword : UChar*, capacity : Int32T, status : UErrorCode*) : Int32T type UPluralRules = Void* + {% end %} end diff --git a/src/lib_icu/uregex.cr b/src/lib_icu/uregex.cr index f339ec5..93e2307 100644 --- a/src/lib_icu/uregex.cr +++ b/src/lib_icu/uregex.cr @@ -1,65 +1,67 @@ -@[Link(ldflags: "`command -v pkg-config > /dev/null && pkg-config --libs icu-uc icu-i18n icu-io icu-lx icu-le || printf %s '-licuio -licui18n -liculx -licule -licuuc -licudata'`")] +@[Link(ldflags: "`command -v pkg-config > /dev/null && pkg-config --libs icu-uc icu-i18n icu-io 2> /dev/null|| printf %s '-licuio -licui18n -licuuc -licudata'`")] lib LibICU - fun uregex_append_replacement = uregex_appendReplacement_52(regexp : URegularExpression, replacement_text : UChar*, replacement_length : Int32T, dest_buf : UChar**, dest_capacity : Int32T*, status : UErrorCode*) : Int32T - fun uregex_append_replacement_u_text = uregex_appendReplacementUText_52(regexp : URegularExpression, replacement_text : UText*, dest : UText*, status : UErrorCode*) - fun uregex_append_tail = uregex_appendTail_52(regexp : URegularExpression, dest_buf : UChar**, dest_capacity : Int32T*, status : UErrorCode*) : Int32T - fun uregex_append_tail_u_text = uregex_appendTailUText_52(regexp : URegularExpression, dest : UText*, status : UErrorCode*) : UText* - fun uregex_clone = uregex_clone_52(regexp : URegularExpression, status : UErrorCode*) : URegularExpression - fun uregex_close = uregex_close_52(regexp : URegularExpression) - fun uregex_end64 = uregex_end64_52(regexp : URegularExpression, group_num : Int32T, status : UErrorCode*) : Int64T - fun uregex_end = uregex_end_52(regexp : URegularExpression, group_num : Int32T, status : UErrorCode*) : Int32T - fun uregex_find64 = uregex_find64_52(regexp : URegularExpression, start_index : Int64T, status : UErrorCode*) : UBool - fun uregex_find = uregex_find_52(regexp : URegularExpression, start_index : Int32T, status : UErrorCode*) : UBool - fun uregex_find_next = uregex_findNext_52(regexp : URegularExpression, status : UErrorCode*) : UBool - fun uregex_flags = uregex_flags_52(regexp : URegularExpression, status : UErrorCode*) : Int32T - fun uregex_get_find_progress_callback = uregex_getFindProgressCallback_52(regexp : URegularExpression, callback : (Void*, Int64T -> UBool)*, context : Void**, status : UErrorCode*) - fun uregex_get_match_callback = uregex_getMatchCallback_52(regexp : URegularExpression, callback : (Void*, Int32T -> UBool)*, context : Void**, status : UErrorCode*) - fun uregex_get_stack_limit = uregex_getStackLimit_52(regexp : URegularExpression, status : UErrorCode*) : Int32T - fun uregex_get_text = uregex_getText_52(regexp : URegularExpression, text_length : Int32T*, status : UErrorCode*) : UChar* - fun uregex_get_time_limit = uregex_getTimeLimit_52(regexp : URegularExpression, status : UErrorCode*) : Int32T - fun uregex_get_u_text = uregex_getUText_52(regexp : URegularExpression, dest : UText*, status : UErrorCode*) : UText* - fun uregex_group = uregex_group_52(regexp : URegularExpression, group_num : Int32T, dest : UChar*, dest_capacity : Int32T, status : UErrorCode*) : Int32T - fun uregex_group_count = uregex_groupCount_52(regexp : URegularExpression, status : UErrorCode*) : Int32T - fun uregex_group_u_text = uregex_groupUText_52(regexp : URegularExpression, group_num : Int32T, dest : UText*, group_length : Int64T*, status : UErrorCode*) : UText* - fun uregex_group_u_text_deep = uregex_groupUTextDeep_52(regexp : URegularExpression, group_num : Int32T, dest : UText*, status : UErrorCode*) : UText* - fun uregex_has_anchoring_bounds = uregex_hasAnchoringBounds_52(regexp : URegularExpression, status : UErrorCode*) : UBool - fun uregex_has_transparent_bounds = uregex_hasTransparentBounds_52(regexp : URegularExpression, status : UErrorCode*) : UBool - fun uregex_hit_end = uregex_hitEnd_52(regexp : URegularExpression, status : UErrorCode*) : UBool - fun uregex_looking_at64 = uregex_lookingAt64_52(regexp : URegularExpression, start_index : Int64T, status : UErrorCode*) : UBool - fun uregex_looking_at = uregex_lookingAt_52(regexp : URegularExpression, start_index : Int32T, status : UErrorCode*) : UBool - fun uregex_matches64 = uregex_matches64_52(regexp : URegularExpression, start_index : Int64T, status : UErrorCode*) : UBool - fun uregex_matches = uregex_matches_52(regexp : URegularExpression, start_index : Int32T, status : UErrorCode*) : UBool - fun uregex_open = uregex_open_52(pattern : UChar*, pattern_length : Int32T, flags : Uint32T, pe : UParseError*, status : UErrorCode*) : URegularExpression - fun uregex_open_c = uregex_openC_52(pattern : LibC::Char*, flags : Uint32T, pe : UParseError*, status : UErrorCode*) : URegularExpression - fun uregex_open_u_text = uregex_openUText_52(pattern : UText*, flags : Uint32T, pe : UParseError*, status : UErrorCode*) : URegularExpression - fun uregex_pattern = uregex_pattern_52(regexp : URegularExpression, pat_length : Int32T*, status : UErrorCode*) : UChar* - fun uregex_pattern_u_text = uregex_patternUText_52(regexp : URegularExpression, status : UErrorCode*) : UText* - fun uregex_refresh_u_text = uregex_refreshUText_52(regexp : URegularExpression, text : UText*, status : UErrorCode*) - fun uregex_region_end64 = uregex_regionEnd64_52(regexp : URegularExpression, status : UErrorCode*) : Int64T - fun uregex_region_end = uregex_regionEnd_52(regexp : URegularExpression, status : UErrorCode*) : Int32T - fun uregex_region_start64 = uregex_regionStart64_52(regexp : URegularExpression, status : UErrorCode*) : Int64T - fun uregex_region_start = uregex_regionStart_52(regexp : URegularExpression, status : UErrorCode*) : Int32T - fun uregex_replace_all = uregex_replaceAll_52(regexp : URegularExpression, replacement_text : UChar*, replacement_length : Int32T, dest_buf : UChar*, dest_capacity : Int32T, status : UErrorCode*) : Int32T - fun uregex_replace_all_u_text = uregex_replaceAllUText_52(regexp : URegularExpression, replacement : UText*, dest : UText*, status : UErrorCode*) : UText* - fun uregex_replace_first = uregex_replaceFirst_52(regexp : URegularExpression, replacement_text : UChar*, replacement_length : Int32T, dest_buf : UChar*, dest_capacity : Int32T, status : UErrorCode*) : Int32T - fun uregex_replace_first_u_text = uregex_replaceFirstUText_52(regexp : URegularExpression, replacement : UText*, dest : UText*, status : UErrorCode*) : UText* - fun uregex_require_end = uregex_requireEnd_52(regexp : URegularExpression, status : UErrorCode*) : UBool - fun uregex_reset64 = uregex_reset64_52(regexp : URegularExpression, index : Int64T, status : UErrorCode*) - fun uregex_reset = uregex_reset_52(regexp : URegularExpression, index : Int32T, status : UErrorCode*) - fun uregex_set_find_progress_callback = uregex_setFindProgressCallback_52(regexp : URegularExpression, callback : (Void*, Int64T -> UBool), context : Void*, status : UErrorCode*) - fun uregex_set_match_callback = uregex_setMatchCallback_52(regexp : URegularExpression, callback : (Void*, Int32T -> UBool), context : Void*, status : UErrorCode*) - fun uregex_set_region64 = uregex_setRegion64_52(regexp : URegularExpression, region_start : Int64T, region_limit : Int64T, status : UErrorCode*) - fun uregex_set_region = uregex_setRegion_52(regexp : URegularExpression, region_start : Int32T, region_limit : Int32T, status : UErrorCode*) - fun uregex_set_region_and_start = uregex_setRegionAndStart_52(regexp : URegularExpression, region_start : Int64T, region_limit : Int64T, start_index : Int64T, status : UErrorCode*) - fun uregex_set_stack_limit = uregex_setStackLimit_52(regexp : URegularExpression, limit : Int32T, status : UErrorCode*) - fun uregex_set_text = uregex_setText_52(regexp : URegularExpression, text : UChar*, text_length : Int32T, status : UErrorCode*) - fun uregex_set_time_limit = uregex_setTimeLimit_52(regexp : URegularExpression, limit : Int32T, status : UErrorCode*) - fun uregex_set_u_text = uregex_setUText_52(regexp : URegularExpression, text : UText*, status : UErrorCode*) - fun uregex_split = uregex_split_52(regexp : URegularExpression, dest_buf : UChar*, dest_capacity : Int32T, required_capacity : Int32T*, dest_fields : UChar**, dest_fields_capacity : Int32T, status : UErrorCode*) : Int32T - fun uregex_split_u_text = uregex_splitUText_52(regexp : URegularExpression, dest_fields : UText**, dest_fields_capacity : Int32T, status : UErrorCode*) : Int32T - fun uregex_start64 = uregex_start64_52(regexp : URegularExpression, group_num : Int32T, status : UErrorCode*) : Int64T - fun uregex_start = uregex_start_52(regexp : URegularExpression, group_num : Int32T, status : UErrorCode*) : Int32T - fun uregex_use_anchoring_bounds = uregex_useAnchoringBounds_52(regexp : URegularExpression, b : UBool, status : UErrorCode*) - fun uregex_use_transparent_bounds = uregex_useTransparentBounds_52(regexp : URegularExpression, b : UBool, status : UErrorCode*) + {% begin %} + fun uregex_append_replacement = uregex_appendReplacement{{SYMS_SUFFIX.id}}(regexp : URegularExpression, replacement_text : UChar*, replacement_length : Int32T, dest_buf : UChar**, dest_capacity : Int32T*, status : UErrorCode*) : Int32T + fun uregex_append_replacement_u_text = uregex_appendReplacementUText{{SYMS_SUFFIX.id}}(regexp : URegularExpression, replacement_text : UText*, dest : UText*, status : UErrorCode*) + fun uregex_append_tail = uregex_appendTail{{SYMS_SUFFIX.id}}(regexp : URegularExpression, dest_buf : UChar**, dest_capacity : Int32T*, status : UErrorCode*) : Int32T + fun uregex_append_tail_u_text = uregex_appendTailUText{{SYMS_SUFFIX.id}}(regexp : URegularExpression, dest : UText*, status : UErrorCode*) : UText* + fun uregex_clone = uregex_clone{{SYMS_SUFFIX.id}}(regexp : URegularExpression, status : UErrorCode*) : URegularExpression + fun uregex_close = uregex_close{{SYMS_SUFFIX.id}}(regexp : URegularExpression) + fun uregex_end64 = uregex_end64{{SYMS_SUFFIX.id}}(regexp : URegularExpression, group_num : Int32T, status : UErrorCode*) : Int64T + fun uregex_end = uregex_end{{SYMS_SUFFIX.id}}(regexp : URegularExpression, group_num : Int32T, status : UErrorCode*) : Int32T + fun uregex_find64 = uregex_find64{{SYMS_SUFFIX.id}}(regexp : URegularExpression, start_index : Int64T, status : UErrorCode*) : UBool + fun uregex_find = uregex_find{{SYMS_SUFFIX.id}}(regexp : URegularExpression, start_index : Int32T, status : UErrorCode*) : UBool + fun uregex_find_next = uregex_findNext{{SYMS_SUFFIX.id}}(regexp : URegularExpression, status : UErrorCode*) : UBool + fun uregex_flags = uregex_flags{{SYMS_SUFFIX.id}}(regexp : URegularExpression, status : UErrorCode*) : Int32T + fun uregex_get_find_progress_callback = uregex_getFindProgressCallback{{SYMS_SUFFIX.id}}(regexp : URegularExpression, callback : (Void*, Int64T -> UBool)*, context : Void**, status : UErrorCode*) + fun uregex_get_match_callback = uregex_getMatchCallback{{SYMS_SUFFIX.id}}(regexp : URegularExpression, callback : (Void*, Int32T -> UBool)*, context : Void**, status : UErrorCode*) + fun uregex_get_stack_limit = uregex_getStackLimit{{SYMS_SUFFIX.id}}(regexp : URegularExpression, status : UErrorCode*) : Int32T + fun uregex_get_text = uregex_getText{{SYMS_SUFFIX.id}}(regexp : URegularExpression, text_length : Int32T*, status : UErrorCode*) : UChar* + fun uregex_get_time_limit = uregex_getTimeLimit{{SYMS_SUFFIX.id}}(regexp : URegularExpression, status : UErrorCode*) : Int32T + fun uregex_get_u_text = uregex_getUText{{SYMS_SUFFIX.id}}(regexp : URegularExpression, dest : UText*, status : UErrorCode*) : UText* + fun uregex_group = uregex_group{{SYMS_SUFFIX.id}}(regexp : URegularExpression, group_num : Int32T, dest : UChar*, dest_capacity : Int32T, status : UErrorCode*) : Int32T + fun uregex_group_count = uregex_groupCount{{SYMS_SUFFIX.id}}(regexp : URegularExpression, status : UErrorCode*) : Int32T + fun uregex_group_u_text = uregex_groupUText{{SYMS_SUFFIX.id}}(regexp : URegularExpression, group_num : Int32T, dest : UText*, group_length : Int64T*, status : UErrorCode*) : UText* + fun uregex_group_u_text_deep = uregex_groupUTextDeep{{SYMS_SUFFIX.id}}(regexp : URegularExpression, group_num : Int32T, dest : UText*, status : UErrorCode*) : UText* + fun uregex_has_anchoring_bounds = uregex_hasAnchoringBounds{{SYMS_SUFFIX.id}}(regexp : URegularExpression, status : UErrorCode*) : UBool + fun uregex_has_transparent_bounds = uregex_hasTransparentBounds{{SYMS_SUFFIX.id}}(regexp : URegularExpression, status : UErrorCode*) : UBool + fun uregex_hit_end = uregex_hitEnd{{SYMS_SUFFIX.id}}(regexp : URegularExpression, status : UErrorCode*) : UBool + fun uregex_looking_at64 = uregex_lookingAt64{{SYMS_SUFFIX.id}}(regexp : URegularExpression, start_index : Int64T, status : UErrorCode*) : UBool + fun uregex_looking_at = uregex_lookingAt{{SYMS_SUFFIX.id}}(regexp : URegularExpression, start_index : Int32T, status : UErrorCode*) : UBool + fun uregex_matches64 = uregex_matches64{{SYMS_SUFFIX.id}}(regexp : URegularExpression, start_index : Int64T, status : UErrorCode*) : UBool + fun uregex_matches = uregex_matches{{SYMS_SUFFIX.id}}(regexp : URegularExpression, start_index : Int32T, status : UErrorCode*) : UBool + fun uregex_open = uregex_open{{SYMS_SUFFIX.id}}(pattern : UChar*, pattern_length : Int32T, flags : Uint32T, pe : UParseError*, status : UErrorCode*) : URegularExpression + fun uregex_open_c = uregex_openC{{SYMS_SUFFIX.id}}(pattern : LibC::Char*, flags : Uint32T, pe : UParseError*, status : UErrorCode*) : URegularExpression + fun uregex_open_u_text = uregex_openUText{{SYMS_SUFFIX.id}}(pattern : UText*, flags : Uint32T, pe : UParseError*, status : UErrorCode*) : URegularExpression + fun uregex_pattern = uregex_pattern{{SYMS_SUFFIX.id}}(regexp : URegularExpression, pat_length : Int32T*, status : UErrorCode*) : UChar* + fun uregex_pattern_u_text = uregex_patternUText{{SYMS_SUFFIX.id}}(regexp : URegularExpression, status : UErrorCode*) : UText* + fun uregex_refresh_u_text = uregex_refreshUText{{SYMS_SUFFIX.id}}(regexp : URegularExpression, text : UText*, status : UErrorCode*) + fun uregex_region_end64 = uregex_regionEnd64{{SYMS_SUFFIX.id}}(regexp : URegularExpression, status : UErrorCode*) : Int64T + fun uregex_region_end = uregex_regionEnd{{SYMS_SUFFIX.id}}(regexp : URegularExpression, status : UErrorCode*) : Int32T + fun uregex_region_start64 = uregex_regionStart64{{SYMS_SUFFIX.id}}(regexp : URegularExpression, status : UErrorCode*) : Int64T + fun uregex_region_start = uregex_regionStart{{SYMS_SUFFIX.id}}(regexp : URegularExpression, status : UErrorCode*) : Int32T + fun uregex_replace_all = uregex_replaceAll{{SYMS_SUFFIX.id}}(regexp : URegularExpression, replacement_text : UChar*, replacement_length : Int32T, dest_buf : UChar*, dest_capacity : Int32T, status : UErrorCode*) : Int32T + fun uregex_replace_all_u_text = uregex_replaceAllUText{{SYMS_SUFFIX.id}}(regexp : URegularExpression, replacement : UText*, dest : UText*, status : UErrorCode*) : UText* + fun uregex_replace_first = uregex_replaceFirst{{SYMS_SUFFIX.id}}(regexp : URegularExpression, replacement_text : UChar*, replacement_length : Int32T, dest_buf : UChar*, dest_capacity : Int32T, status : UErrorCode*) : Int32T + fun uregex_replace_first_u_text = uregex_replaceFirstUText{{SYMS_SUFFIX.id}}(regexp : URegularExpression, replacement : UText*, dest : UText*, status : UErrorCode*) : UText* + fun uregex_require_end = uregex_requireEnd{{SYMS_SUFFIX.id}}(regexp : URegularExpression, status : UErrorCode*) : UBool + fun uregex_reset64 = uregex_reset64{{SYMS_SUFFIX.id}}(regexp : URegularExpression, index : Int64T, status : UErrorCode*) + fun uregex_reset = uregex_reset{{SYMS_SUFFIX.id}}(regexp : URegularExpression, index : Int32T, status : UErrorCode*) + fun uregex_set_find_progress_callback = uregex_setFindProgressCallback{{SYMS_SUFFIX.id}}(regexp : URegularExpression, callback : (Void*, Int64T -> UBool), context : Void*, status : UErrorCode*) + fun uregex_set_match_callback = uregex_setMatchCallback{{SYMS_SUFFIX.id}}(regexp : URegularExpression, callback : (Void*, Int32T -> UBool), context : Void*, status : UErrorCode*) + fun uregex_set_region64 = uregex_setRegion64{{SYMS_SUFFIX.id}}(regexp : URegularExpression, region_start : Int64T, region_limit : Int64T, status : UErrorCode*) + fun uregex_set_region = uregex_setRegion{{SYMS_SUFFIX.id}}(regexp : URegularExpression, region_start : Int32T, region_limit : Int32T, status : UErrorCode*) + fun uregex_set_region_and_start = uregex_setRegionAndStart{{SYMS_SUFFIX.id}}(regexp : URegularExpression, region_start : Int64T, region_limit : Int64T, start_index : Int64T, status : UErrorCode*) + fun uregex_set_stack_limit = uregex_setStackLimit{{SYMS_SUFFIX.id}}(regexp : URegularExpression, limit : Int32T, status : UErrorCode*) + fun uregex_set_text = uregex_setText{{SYMS_SUFFIX.id}}(regexp : URegularExpression, text : UChar*, text_length : Int32T, status : UErrorCode*) + fun uregex_set_time_limit = uregex_setTimeLimit{{SYMS_SUFFIX.id}}(regexp : URegularExpression, limit : Int32T, status : UErrorCode*) + fun uregex_set_u_text = uregex_setUText{{SYMS_SUFFIX.id}}(regexp : URegularExpression, text : UText*, status : UErrorCode*) + fun uregex_split = uregex_split{{SYMS_SUFFIX.id}}(regexp : URegularExpression, dest_buf : UChar*, dest_capacity : Int32T, required_capacity : Int32T*, dest_fields : UChar**, dest_fields_capacity : Int32T, status : UErrorCode*) : Int32T + fun uregex_split_u_text = uregex_splitUText{{SYMS_SUFFIX.id}}(regexp : URegularExpression, dest_fields : UText**, dest_fields_capacity : Int32T, status : UErrorCode*) : Int32T + fun uregex_start64 = uregex_start64{{SYMS_SUFFIX.id}}(regexp : URegularExpression, group_num : Int32T, status : UErrorCode*) : Int64T + fun uregex_start = uregex_start{{SYMS_SUFFIX.id}}(regexp : URegularExpression, group_num : Int32T, status : UErrorCode*) : Int32T + fun uregex_use_anchoring_bounds = uregex_useAnchoringBounds{{SYMS_SUFFIX.id}}(regexp : URegularExpression, b : UBool, status : UErrorCode*) + fun uregex_use_transparent_bounds = uregex_useTransparentBounds{{SYMS_SUFFIX.id}}(regexp : URegularExpression, b : UBool, status : UErrorCode*) type URegularExpression = Void* + {% end %} end diff --git a/src/lib_icu/uregion.cr b/src/lib_icu/uregion.cr index dc66820..73b4f9e 100644 --- a/src/lib_icu/uregion.cr +++ b/src/lib_icu/uregion.cr @@ -1,5 +1,6 @@ -@[Link(ldflags: "`command -v pkg-config > /dev/null && pkg-config --libs icu-uc icu-i18n icu-io icu-lx icu-le || printf %s '-licuio -licui18n -liculx -licule -licuuc -licudata'`")] +@[Link(ldflags: "`command -v pkg-config > /dev/null && pkg-config --libs icu-uc icu-i18n icu-io 2> /dev/null|| printf %s '-licuio -licui18n -licuuc -licudata'`")] lib LibICU + {% begin %} enum URegionType UrgnUnknown = 0 UrgnTerritory = 1 @@ -10,18 +11,19 @@ lib LibICU UrgnDeprecated = 6 UrgnLimit = 7 end - fun uregion_are_equal = uregion_areEqual_52(uregion : URegion, other_region : URegion) : UBool - fun uregion_contains = uregion_contains_52(uregion : URegion, other_region : URegion) : UBool - fun uregion_get_available = uregion_getAvailable_52(type : URegionType, status : UErrorCode*) : UEnumeration - fun uregion_get_contained_regions = uregion_getContainedRegions_52(uregion : URegion, status : UErrorCode*) : UEnumeration - fun uregion_get_contained_regions_of_type = uregion_getContainedRegionsOfType_52(uregion : URegion, type : URegionType, status : UErrorCode*) : UEnumeration - fun uregion_get_containing_region = uregion_getContainingRegion_52(uregion : URegion) : URegion - fun uregion_get_containing_region_of_type = uregion_getContainingRegionOfType_52(uregion : URegion, type : URegionType) : URegion - fun uregion_get_numeric_code = uregion_getNumericCode_52(uregion : URegion) : Int32T - fun uregion_get_preferred_values = uregion_getPreferredValues_52(uregion : URegion, status : UErrorCode*) : UEnumeration - fun uregion_get_region_code = uregion_getRegionCode_52(uregion : URegion) : LibC::Char* - fun uregion_get_region_from_code = uregion_getRegionFromCode_52(region_code : LibC::Char*, status : UErrorCode*) : URegion - fun uregion_get_region_from_numeric_code = uregion_getRegionFromNumericCode_52(code : Int32T, status : UErrorCode*) : URegion - fun uregion_get_type = uregion_getType_52(uregion : URegion) : URegionType + fun uregion_are_equal = uregion_areEqual{{SYMS_SUFFIX.id}}(uregion : URegion, other_region : URegion) : UBool + fun uregion_contains = uregion_contains{{SYMS_SUFFIX.id}}(uregion : URegion, other_region : URegion) : UBool + fun uregion_get_available = uregion_getAvailable{{SYMS_SUFFIX.id}}(type : URegionType, status : UErrorCode*) : UEnumeration + fun uregion_get_contained_regions = uregion_getContainedRegions{{SYMS_SUFFIX.id}}(uregion : URegion, status : UErrorCode*) : UEnumeration + fun uregion_get_contained_regions_of_type = uregion_getContainedRegionsOfType{{SYMS_SUFFIX.id}}(uregion : URegion, type : URegionType, status : UErrorCode*) : UEnumeration + fun uregion_get_containing_region = uregion_getContainingRegion{{SYMS_SUFFIX.id}}(uregion : URegion) : URegion + fun uregion_get_containing_region_of_type = uregion_getContainingRegionOfType{{SYMS_SUFFIX.id}}(uregion : URegion, type : URegionType) : URegion + fun uregion_get_numeric_code = uregion_getNumericCode{{SYMS_SUFFIX.id}}(uregion : URegion) : Int32T + fun uregion_get_preferred_values = uregion_getPreferredValues{{SYMS_SUFFIX.id}}(uregion : URegion, status : UErrorCode*) : UEnumeration + fun uregion_get_region_code = uregion_getRegionCode{{SYMS_SUFFIX.id}}(uregion : URegion) : LibC::Char* + fun uregion_get_region_from_code = uregion_getRegionFromCode{{SYMS_SUFFIX.id}}(region_code : LibC::Char*, status : UErrorCode*) : URegion + fun uregion_get_region_from_numeric_code = uregion_getRegionFromNumericCode{{SYMS_SUFFIX.id}}(code : Int32T, status : UErrorCode*) : URegion + fun uregion_get_type = uregion_getType{{SYMS_SUFFIX.id}}(uregion : URegion) : URegionType type URegion = Void* + {% end %} end diff --git a/src/lib_icu/ures.cr b/src/lib_icu/ures.cr index 4904957..c1de812 100644 --- a/src/lib_icu/ures.cr +++ b/src/lib_icu/ures.cr @@ -1,5 +1,6 @@ -@[Link(ldflags: "`command -v pkg-config > /dev/null && pkg-config --libs icu-uc icu-i18n icu-io icu-lx icu-le || printf %s '-licuio -licui18n -liculx -licule -licuuc -licudata'`")] +@[Link(ldflags: "`command -v pkg-config > /dev/null && pkg-config --libs icu-uc icu-i18n icu-io 2> /dev/null|| printf %s '-licuio -licui18n -licuuc -licudata'`")] lib LibICU + {% begin %} enum UResType UresNone = -1 UresString = 0 @@ -20,35 +21,36 @@ lib LibICU ResReserved = 15 UresLimit = 16 end - fun ures_close = ures_close_52(resource_bundle : UResourceBundle) - fun ures_count_array_items = ures_countArrayItems_52(resource_bundle : UResourceBundle, resource_key : LibC::Char*, err : UErrorCode*) : Int32T - fun ures_get_binary = ures_getBinary_52(resource_bundle : UResourceBundle, len : Int32T*, status : UErrorCode*) : Uint8T* - fun ures_get_by_index = ures_getByIndex_52(resource_bundle : UResourceBundle, index_r : Int32T, fill_in : UResourceBundle, status : UErrorCode*) : UResourceBundle - fun ures_get_by_key = ures_getByKey_52(resource_bundle : UResourceBundle, key : LibC::Char*, fill_in : UResourceBundle, status : UErrorCode*) : UResourceBundle - fun ures_get_int = ures_getInt_52(resource_bundle : UResourceBundle, status : UErrorCode*) : Int32T - fun ures_get_int_vector = ures_getIntVector_52(resource_bundle : UResourceBundle, len : Int32T*, status : UErrorCode*) : Int32T* - fun ures_get_key = ures_getKey_52(resource_bundle : UResourceBundle) : LibC::Char* - fun ures_get_locale = ures_getLocale_52(resource_bundle : UResourceBundle, status : UErrorCode*) : LibC::Char* - fun ures_get_locale_by_type = ures_getLocaleByType_52(resource_bundle : UResourceBundle, type : ULocDataLocaleType, status : UErrorCode*) : LibC::Char* - fun ures_get_next_resource = ures_getNextResource_52(resource_bundle : UResourceBundle, fill_in : UResourceBundle, status : UErrorCode*) : UResourceBundle - fun ures_get_next_string = ures_getNextString_52(resource_bundle : UResourceBundle, len : Int32T*, key : LibC::Char**, status : UErrorCode*) : UChar* - fun ures_get_size = ures_getSize_52(resource_bundle : UResourceBundle) : Int32T - fun ures_get_string = ures_getString_52(resource_bundle : UResourceBundle, len : Int32T*, status : UErrorCode*) : UChar* - fun ures_get_string_by_index = ures_getStringByIndex_52(resource_bundle : UResourceBundle, index_s : Int32T, len : Int32T*, status : UErrorCode*) : UChar* - fun ures_get_string_by_key = ures_getStringByKey_52(res_b : UResourceBundle, key : LibC::Char*, len : Int32T*, status : UErrorCode*) : UChar* - fun ures_get_type = ures_getType_52(resource_bundle : UResourceBundle) : UResType - fun ures_get_u_int = ures_getUInt_52(resource_bundle : UResourceBundle, status : UErrorCode*) : Uint32T - fun ures_get_ut_f8string = ures_getUTF8String_52(res_b : UResourceBundle, dest : LibC::Char*, length : Int32T*, force_copy : UBool, status : UErrorCode*) : LibC::Char* - fun ures_get_ut_f8string_by_index = ures_getUTF8StringByIndex_52(res_b : UResourceBundle, string_index : Int32T, dest : LibC::Char*, p_length : Int32T*, force_copy : UBool, status : UErrorCode*) : LibC::Char* - fun ures_get_ut_f8string_by_key = ures_getUTF8StringByKey_52(res_b : UResourceBundle, key : LibC::Char*, dest : LibC::Char*, p_length : Int32T*, force_copy : UBool, status : UErrorCode*) : LibC::Char* - fun ures_get_version = ures_getVersion_52(res_b : UResourceBundle, version_info : UVersionInfo) - fun ures_get_version_number = ures_getVersionNumber_52(resource_bundle : UResourceBundle) : LibC::Char* - fun ures_has_next = ures_hasNext_52(resource_bundle : UResourceBundle) : UBool - fun ures_open = ures_open_52(package_name : LibC::Char*, locale : LibC::Char*, status : UErrorCode*) : UResourceBundle - fun ures_open_available_locales = ures_openAvailableLocales_52(package_name : LibC::Char*, status : UErrorCode*) : UEnumeration - fun ures_open_direct = ures_openDirect_52(package_name : LibC::Char*, locale : LibC::Char*, status : UErrorCode*) : UResourceBundle - fun ures_open_fill_in = ures_openFillIn_52(r : UResourceBundle, package_name : LibC::Char*, locale_id : LibC::Char*, status : UErrorCode*) - fun ures_open_u = ures_openU_52(package_name : UChar*, locale : LibC::Char*, status : UErrorCode*) : UResourceBundle - fun ures_reset_iterator = ures_resetIterator_52(resource_bundle : UResourceBundle) + fun ures_close = ures_close{{SYMS_SUFFIX.id}}(resource_bundle : UResourceBundle) + fun ures_count_array_items = ures_countArrayItems{{SYMS_SUFFIX.id}}(resource_bundle : UResourceBundle, resource_key : LibC::Char*, err : UErrorCode*) : Int32T + fun ures_get_binary = ures_getBinary{{SYMS_SUFFIX.id}}(resource_bundle : UResourceBundle, len : Int32T*, status : UErrorCode*) : Uint8T* + fun ures_get_by_index = ures_getByIndex{{SYMS_SUFFIX.id}}(resource_bundle : UResourceBundle, index_r : Int32T, fill_in : UResourceBundle, status : UErrorCode*) : UResourceBundle + fun ures_get_by_key = ures_getByKey{{SYMS_SUFFIX.id}}(resource_bundle : UResourceBundle, key : LibC::Char*, fill_in : UResourceBundle, status : UErrorCode*) : UResourceBundle + fun ures_get_int = ures_getInt{{SYMS_SUFFIX.id}}(resource_bundle : UResourceBundle, status : UErrorCode*) : Int32T + fun ures_get_int_vector = ures_getIntVector{{SYMS_SUFFIX.id}}(resource_bundle : UResourceBundle, len : Int32T*, status : UErrorCode*) : Int32T* + fun ures_get_key = ures_getKey{{SYMS_SUFFIX.id}}(resource_bundle : UResourceBundle) : LibC::Char* + fun ures_get_locale = ures_getLocale{{SYMS_SUFFIX.id}}(resource_bundle : UResourceBundle, status : UErrorCode*) : LibC::Char* + fun ures_get_locale_by_type = ures_getLocaleByType{{SYMS_SUFFIX.id}}(resource_bundle : UResourceBundle, type : ULocDataLocaleType, status : UErrorCode*) : LibC::Char* + fun ures_get_next_resource = ures_getNextResource{{SYMS_SUFFIX.id}}(resource_bundle : UResourceBundle, fill_in : UResourceBundle, status : UErrorCode*) : UResourceBundle + fun ures_get_next_string = ures_getNextString{{SYMS_SUFFIX.id}}(resource_bundle : UResourceBundle, len : Int32T*, key : LibC::Char**, status : UErrorCode*) : UChar* + fun ures_get_size = ures_getSize{{SYMS_SUFFIX.id}}(resource_bundle : UResourceBundle) : Int32T + fun ures_get_string = ures_getString{{SYMS_SUFFIX.id}}(resource_bundle : UResourceBundle, len : Int32T*, status : UErrorCode*) : UChar* + fun ures_get_string_by_index = ures_getStringByIndex{{SYMS_SUFFIX.id}}(resource_bundle : UResourceBundle, index_s : Int32T, len : Int32T*, status : UErrorCode*) : UChar* + fun ures_get_string_by_key = ures_getStringByKey{{SYMS_SUFFIX.id}}(res_b : UResourceBundle, key : LibC::Char*, len : Int32T*, status : UErrorCode*) : UChar* + fun ures_get_type = ures_getType{{SYMS_SUFFIX.id}}(resource_bundle : UResourceBundle) : UResType + fun ures_get_u_int = ures_getUInt{{SYMS_SUFFIX.id}}(resource_bundle : UResourceBundle, status : UErrorCode*) : Uint32T + fun ures_get_ut_f8string = ures_getUTF8String{{SYMS_SUFFIX.id}}(res_b : UResourceBundle, dest : LibC::Char*, length : Int32T*, force_copy : UBool, status : UErrorCode*) : LibC::Char* + fun ures_get_ut_f8string_by_index = ures_getUTF8StringByIndex{{SYMS_SUFFIX.id}}(res_b : UResourceBundle, string_index : Int32T, dest : LibC::Char*, p_length : Int32T*, force_copy : UBool, status : UErrorCode*) : LibC::Char* + fun ures_get_ut_f8string_by_key = ures_getUTF8StringByKey{{SYMS_SUFFIX.id}}(res_b : UResourceBundle, key : LibC::Char*, dest : LibC::Char*, p_length : Int32T*, force_copy : UBool, status : UErrorCode*) : LibC::Char* + fun ures_get_version = ures_getVersion{{SYMS_SUFFIX.id}}(res_b : UResourceBundle, version_info : UVersionInfo) + fun ures_get_version_number = ures_getVersionNumber{{SYMS_SUFFIX.id}}(resource_bundle : UResourceBundle) : LibC::Char* + fun ures_has_next = ures_hasNext{{SYMS_SUFFIX.id}}(resource_bundle : UResourceBundle) : UBool + fun ures_open = ures_open{{SYMS_SUFFIX.id}}(package_name : LibC::Char*, locale : LibC::Char*, status : UErrorCode*) : UResourceBundle + fun ures_open_available_locales = ures_openAvailableLocales{{SYMS_SUFFIX.id}}(package_name : LibC::Char*, status : UErrorCode*) : UEnumeration + fun ures_open_direct = ures_openDirect{{SYMS_SUFFIX.id}}(package_name : LibC::Char*, locale : LibC::Char*, status : UErrorCode*) : UResourceBundle + fun ures_open_fill_in = ures_openFillIn{{SYMS_SUFFIX.id}}(r : UResourceBundle, package_name : LibC::Char*, locale_id : LibC::Char*, status : UErrorCode*) + fun ures_open_u = ures_openU{{SYMS_SUFFIX.id}}(package_name : UChar*, locale : LibC::Char*, status : UErrorCode*) : UResourceBundle + fun ures_reset_iterator = ures_resetIterator{{SYMS_SUFFIX.id}}(resource_bundle : UResourceBundle) type UResourceBundle = Void* + {% end %} end diff --git a/src/lib_icu/usearch.cr b/src/lib_icu/usearch.cr index eda2049..17061d9 100644 --- a/src/lib_icu/usearch.cr +++ b/src/lib_icu/usearch.cr @@ -1,5 +1,6 @@ -@[Link(ldflags: "`command -v pkg-config > /dev/null && pkg-config --libs icu-uc icu-i18n icu-io icu-lx icu-le || printf %s '-licuio -licui18n -liculx -licule -licuuc -licudata'`")] +@[Link(ldflags: "`command -v pkg-config > /dev/null && pkg-config --libs icu-uc icu-i18n icu-io 2> /dev/null|| printf %s '-licuio -licui18n -licuuc -licudata'`")] lib LibICU + {% begin %} enum USearchAttribute UsearchOverlap = 0 UsearchCanonicalMatch = 1 @@ -15,32 +16,33 @@ lib LibICU UsearchAnyBaseWeightIsWildcard = 4 UsearchAttributeValueCount = 5 end - fun usearch_close = usearch_close_52(searchiter : UStringSearch) - fun usearch_first = usearch_first_52(strsrch : UStringSearch, status : UErrorCode*) : Int32T - fun usearch_following = usearch_following_52(strsrch : UStringSearch, position : Int32T, status : UErrorCode*) : Int32T - fun usearch_get_attribute = usearch_getAttribute_52(strsrch : UStringSearch, attribute : USearchAttribute) : USearchAttributeValue - fun usearch_get_break_iterator = usearch_getBreakIterator_52(strsrch : UStringSearch) : UBreakIterator - fun usearch_get_collator = usearch_getCollator_52(strsrch : UStringSearch) : UCollator - fun usearch_get_matched_length = usearch_getMatchedLength_52(strsrch : UStringSearch) : Int32T - fun usearch_get_matched_start = usearch_getMatchedStart_52(strsrch : UStringSearch) : Int32T - fun usearch_get_matched_text = usearch_getMatchedText_52(strsrch : UStringSearch, result : UChar*, result_capacity : Int32T, status : UErrorCode*) : Int32T - fun usearch_get_offset = usearch_getOffset_52(strsrch : UStringSearch) : Int32T - fun usearch_get_pattern = usearch_getPattern_52(strsrch : UStringSearch, length : Int32T*) : UChar* - fun usearch_get_text = usearch_getText_52(strsrch : UStringSearch, length : Int32T*) : UChar* - fun usearch_last = usearch_last_52(strsrch : UStringSearch, status : UErrorCode*) : Int32T - fun usearch_next = usearch_next_52(strsrch : UStringSearch, status : UErrorCode*) : Int32T - fun usearch_open = usearch_open_52(pattern : UChar*, patternlength : Int32T, text : UChar*, textlength : Int32T, locale : LibC::Char*, breakiter : UBreakIterator, status : UErrorCode*) : UStringSearch - fun usearch_open_from_collator = usearch_openFromCollator_52(pattern : UChar*, patternlength : Int32T, text : UChar*, textlength : Int32T, collator : UCollator, breakiter : UBreakIterator, status : UErrorCode*) : UStringSearch - fun usearch_preceding = usearch_preceding_52(strsrch : UStringSearch, position : Int32T, status : UErrorCode*) : Int32T - fun usearch_previous = usearch_previous_52(strsrch : UStringSearch, status : UErrorCode*) : Int32T - fun usearch_reset = usearch_reset_52(strsrch : UStringSearch) - fun usearch_search = usearch_search_52(strsrch : UStringSearch, start_idx : Int32T, match_start : Int32T*, match_limit : Int32T*, status : UErrorCode*) : UBool - fun usearch_search_backwards = usearch_searchBackwards_52(strsrch : UStringSearch, start_idx : Int32T, match_start : Int32T*, match_limit : Int32T*, status : UErrorCode*) : UBool - fun usearch_set_attribute = usearch_setAttribute_52(strsrch : UStringSearch, attribute : USearchAttribute, value : USearchAttributeValue, status : UErrorCode*) - fun usearch_set_break_iterator = usearch_setBreakIterator_52(strsrch : UStringSearch, breakiter : UBreakIterator, status : UErrorCode*) - fun usearch_set_collator = usearch_setCollator_52(strsrch : UStringSearch, collator : UCollator, status : UErrorCode*) - fun usearch_set_offset = usearch_setOffset_52(strsrch : UStringSearch, position : Int32T, status : UErrorCode*) - fun usearch_set_pattern = usearch_setPattern_52(strsrch : UStringSearch, pattern : UChar*, patternlength : Int32T, status : UErrorCode*) - fun usearch_set_text = usearch_setText_52(strsrch : UStringSearch, text : UChar*, textlength : Int32T, status : UErrorCode*) + fun usearch_close = usearch_close{{SYMS_SUFFIX.id}}(searchiter : UStringSearch) + fun usearch_first = usearch_first{{SYMS_SUFFIX.id}}(strsrch : UStringSearch, status : UErrorCode*) : Int32T + fun usearch_following = usearch_following{{SYMS_SUFFIX.id}}(strsrch : UStringSearch, position : Int32T, status : UErrorCode*) : Int32T + fun usearch_get_attribute = usearch_getAttribute{{SYMS_SUFFIX.id}}(strsrch : UStringSearch, attribute : USearchAttribute) : USearchAttributeValue + fun usearch_get_break_iterator = usearch_getBreakIterator{{SYMS_SUFFIX.id}}(strsrch : UStringSearch) : UBreakIterator + fun usearch_get_collator = usearch_getCollator{{SYMS_SUFFIX.id}}(strsrch : UStringSearch) : UCollator + fun usearch_get_matched_length = usearch_getMatchedLength{{SYMS_SUFFIX.id}}(strsrch : UStringSearch) : Int32T + fun usearch_get_matched_start = usearch_getMatchedStart{{SYMS_SUFFIX.id}}(strsrch : UStringSearch) : Int32T + fun usearch_get_matched_text = usearch_getMatchedText{{SYMS_SUFFIX.id}}(strsrch : UStringSearch, result : UChar*, result_capacity : Int32T, status : UErrorCode*) : Int32T + fun usearch_get_offset = usearch_getOffset{{SYMS_SUFFIX.id}}(strsrch : UStringSearch) : Int32T + fun usearch_get_pattern = usearch_getPattern{{SYMS_SUFFIX.id}}(strsrch : UStringSearch, length : Int32T*) : UChar* + fun usearch_get_text = usearch_getText{{SYMS_SUFFIX.id}}(strsrch : UStringSearch, length : Int32T*) : UChar* + fun usearch_last = usearch_last{{SYMS_SUFFIX.id}}(strsrch : UStringSearch, status : UErrorCode*) : Int32T + fun usearch_next = usearch_next{{SYMS_SUFFIX.id}}(strsrch : UStringSearch, status : UErrorCode*) : Int32T + fun usearch_open = usearch_open{{SYMS_SUFFIX.id}}(pattern : UChar*, patternlength : Int32T, text : UChar*, textlength : Int32T, locale : LibC::Char*, breakiter : UBreakIterator, status : UErrorCode*) : UStringSearch + fun usearch_open_from_collator = usearch_openFromCollator{{SYMS_SUFFIX.id}}(pattern : UChar*, patternlength : Int32T, text : UChar*, textlength : Int32T, collator : UCollator, breakiter : UBreakIterator, status : UErrorCode*) : UStringSearch + fun usearch_preceding = usearch_preceding{{SYMS_SUFFIX.id}}(strsrch : UStringSearch, position : Int32T, status : UErrorCode*) : Int32T + fun usearch_previous = usearch_previous{{SYMS_SUFFIX.id}}(strsrch : UStringSearch, status : UErrorCode*) : Int32T + fun usearch_reset = usearch_reset{{SYMS_SUFFIX.id}}(strsrch : UStringSearch) + fun usearch_search = usearch_search{{SYMS_SUFFIX.id}}(strsrch : UStringSearch, start_idx : Int32T, match_start : Int32T*, match_limit : Int32T*, status : UErrorCode*) : UBool + fun usearch_search_backwards = usearch_searchBackwards{{SYMS_SUFFIX.id}}(strsrch : UStringSearch, start_idx : Int32T, match_start : Int32T*, match_limit : Int32T*, status : UErrorCode*) : UBool + fun usearch_set_attribute = usearch_setAttribute{{SYMS_SUFFIX.id}}(strsrch : UStringSearch, attribute : USearchAttribute, value : USearchAttributeValue, status : UErrorCode*) + fun usearch_set_break_iterator = usearch_setBreakIterator{{SYMS_SUFFIX.id}}(strsrch : UStringSearch, breakiter : UBreakIterator, status : UErrorCode*) + fun usearch_set_collator = usearch_setCollator{{SYMS_SUFFIX.id}}(strsrch : UStringSearch, collator : UCollator, status : UErrorCode*) + fun usearch_set_offset = usearch_setOffset{{SYMS_SUFFIX.id}}(strsrch : UStringSearch, position : Int32T, status : UErrorCode*) + fun usearch_set_pattern = usearch_setPattern{{SYMS_SUFFIX.id}}(strsrch : UStringSearch, pattern : UChar*, patternlength : Int32T, status : UErrorCode*) + fun usearch_set_text = usearch_setText{{SYMS_SUFFIX.id}}(strsrch : UStringSearch, text : UChar*, textlength : Int32T, status : UErrorCode*) type UStringSearch = Void* + {% end %} end diff --git a/src/lib_icu/uset.cr b/src/lib_icu/uset.cr index 77be2ef..c85abcf 100644 --- a/src/lib_icu/uset.cr +++ b/src/lib_icu/uset.cr @@ -1,67 +1,68 @@ -@[Link(ldflags: "`command -v pkg-config > /dev/null && pkg-config --libs icu-uc icu-i18n icu-io icu-lx icu-le || printf %s '-licuio -licui18n -liculx -licule -licuuc -licudata'`")] +@[Link(ldflags: "`command -v pkg-config > /dev/null && pkg-config --libs icu-uc icu-i18n icu-io 2> /dev/null|| printf %s '-licuio -licui18n -licuuc -licudata'`")] lib LibICU + {% begin %} enum USetSpanCondition UsetSpanNotContained = 0 UsetSpanContained = 1 UsetSpanSimple = 2 UsetSpanConditionCount = 3 end - fun uset_add = uset_add_52(set : USet, c : UChar32) - fun uset_add_all = uset_addAll_52(set : USet, additional_set : USet) - fun uset_add_all_code_points = uset_addAllCodePoints_52(set : USet, str : UChar*, str_len : Int32T) - fun uset_add_range = uset_addRange_52(set : USet, start : UChar32, _end : UChar32) - fun uset_add_string = uset_addString_52(set : USet, str : UChar*, str_len : Int32T) - fun uset_apply_int_property_value = uset_applyIntPropertyValue_52(set : USet, prop : UProperty, value : Int32T, ec : UErrorCode*) - fun uset_apply_pattern = uset_applyPattern_52(set : USet, pattern : UChar*, pattern_length : Int32T, options : Uint32T, status : UErrorCode*) : Int32T - fun uset_apply_property_alias = uset_applyPropertyAlias_52(set : USet, prop : UChar*, prop_length : Int32T, value : UChar*, value_length : Int32T, ec : UErrorCode*) - fun uset_char_at = uset_charAt_52(set : USet, char_index : Int32T) : UChar32 - fun uset_clear = uset_clear_52(set : USet) - fun uset_clone = uset_clone_52(set : USet) : USet - fun uset_clone_as_thawed = uset_cloneAsThawed_52(set : USet) : USet - fun uset_close = uset_close_52(set : USet) - fun uset_close_over = uset_closeOver_52(set : USet, attributes : Int32T) - fun uset_compact = uset_compact_52(set : USet) - fun uset_complement = uset_complement_52(set : USet) - fun uset_complement_all = uset_complementAll_52(set : USet, complement : USet) - fun uset_contains = uset_contains_52(set : USet, c : UChar32) : UBool - fun uset_contains_all = uset_containsAll_52(set1 : USet, set2 : USet) : UBool - fun uset_contains_all_code_points = uset_containsAllCodePoints_52(set : USet, str : UChar*, str_len : Int32T) : UBool - fun uset_contains_none = uset_containsNone_52(set1 : USet, set2 : USet) : UBool - fun uset_contains_range = uset_containsRange_52(set : USet, start : UChar32, _end : UChar32) : UBool - fun uset_contains_some = uset_containsSome_52(set1 : USet, set2 : USet) : UBool - fun uset_contains_string = uset_containsString_52(set : USet, str : UChar*, str_len : Int32T) : UBool - fun uset_equals = uset_equals_52(set1 : USet, set2 : USet) : UBool - fun uset_freeze = uset_freeze_52(set : USet) - fun uset_get_item = uset_getItem_52(set : USet, item_index : Int32T, start : UChar32*, _end : UChar32*, str : UChar*, str_capacity : Int32T, ec : UErrorCode*) : Int32T - fun uset_get_item_count = uset_getItemCount_52(set : USet) : Int32T - fun uset_get_serialized_range = uset_getSerializedRange_52(set : USerializedSet*, range_index : Int32T, p_start : UChar32*, p_end : UChar32*) : UBool - fun uset_get_serialized_range_count = uset_getSerializedRangeCount_52(set : USerializedSet*) : Int32T - fun uset_get_serialized_set = uset_getSerializedSet_52(fill_set : USerializedSet*, src : Uint16T*, src_length : Int32T) : UBool - fun uset_index_of = uset_indexOf_52(set : USet, c : UChar32) : Int32T - fun uset_is_empty = uset_isEmpty_52(set : USet) : UBool - fun uset_is_frozen = uset_isFrozen_52(set : USet) : UBool - fun uset_open = uset_open_52(start : UChar32, _end : UChar32) : USet - fun uset_open_empty = uset_openEmpty_52 : USet - fun uset_open_pattern = uset_openPattern_52(pattern : UChar*, pattern_length : Int32T, ec : UErrorCode*) : USet - fun uset_open_pattern_options = uset_openPatternOptions_52(pattern : UChar*, pattern_length : Int32T, options : Uint32T, ec : UErrorCode*) : USet - fun uset_remove = uset_remove_52(set : USet, c : UChar32) - fun uset_remove_all = uset_removeAll_52(set : USet, remove_set : USet) - fun uset_remove_all_strings = uset_removeAllStrings_52(set : USet) - fun uset_remove_range = uset_removeRange_52(set : USet, start : UChar32, _end : UChar32) - fun uset_remove_string = uset_removeString_52(set : USet, str : UChar*, str_len : Int32T) - fun uset_resembles_pattern = uset_resemblesPattern_52(pattern : UChar*, pattern_length : Int32T, pos : Int32T) : UBool - fun uset_retain = uset_retain_52(set : USet, start : UChar32, _end : UChar32) - fun uset_retain_all = uset_retainAll_52(set : USet, retain : USet) - fun uset_serialize = uset_serialize_52(set : USet, dest : Uint16T*, dest_capacity : Int32T, p_error_code : UErrorCode*) : Int32T - fun uset_serialized_contains = uset_serializedContains_52(set : USerializedSet*, c : UChar32) : UBool - fun uset_set = uset_set_52(set : USet, start : UChar32, _end : UChar32) - fun uset_set_serialized_to_one = uset_setSerializedToOne_52(fill_set : USerializedSet*, c : UChar32) - fun uset_size = uset_size_52(set : USet) : Int32T - fun uset_span = uset_span_52(set : USet, s : UChar*, length : Int32T, span_condition : USetSpanCondition) : Int32T - fun uset_span_back = uset_spanBack_52(set : USet, s : UChar*, length : Int32T, span_condition : USetSpanCondition) : Int32T - fun uset_span_back_ut_f8 = uset_spanBackUTF8_52(set : USet, s : LibC::Char*, length : Int32T, span_condition : USetSpanCondition) : Int32T - fun uset_span_ut_f8 = uset_spanUTF8_52(set : USet, s : LibC::Char*, length : Int32T, span_condition : USetSpanCondition) : Int32T - fun uset_to_pattern = uset_toPattern_52(set : USet, result : UChar*, result_capacity : Int32T, escape_unprintable : UBool, ec : UErrorCode*) : Int32T + fun uset_add = uset_add{{SYMS_SUFFIX.id}}(set : USet, c : UChar32) + fun uset_add_all = uset_addAll{{SYMS_SUFFIX.id}}(set : USet, additional_set : USet) + fun uset_add_all_code_points = uset_addAllCodePoints{{SYMS_SUFFIX.id}}(set : USet, str : UChar*, str_len : Int32T) + fun uset_add_range = uset_addRange{{SYMS_SUFFIX.id}}(set : USet, start : UChar32, _end : UChar32) + fun uset_add_string = uset_addString{{SYMS_SUFFIX.id}}(set : USet, str : UChar*, str_len : Int32T) + fun uset_apply_int_property_value = uset_applyIntPropertyValue{{SYMS_SUFFIX.id}}(set : USet, prop : UProperty, value : Int32T, ec : UErrorCode*) + fun uset_apply_pattern = uset_applyPattern{{SYMS_SUFFIX.id}}(set : USet, pattern : UChar*, pattern_length : Int32T, options : Uint32T, status : UErrorCode*) : Int32T + fun uset_apply_property_alias = uset_applyPropertyAlias{{SYMS_SUFFIX.id}}(set : USet, prop : UChar*, prop_length : Int32T, value : UChar*, value_length : Int32T, ec : UErrorCode*) + fun uset_char_at = uset_charAt{{SYMS_SUFFIX.id}}(set : USet, char_index : Int32T) : UChar32 + fun uset_clear = uset_clear{{SYMS_SUFFIX.id}}(set : USet) + fun uset_clone = uset_clone{{SYMS_SUFFIX.id}}(set : USet) : USet + fun uset_clone_as_thawed = uset_cloneAsThawed{{SYMS_SUFFIX.id}}(set : USet) : USet + fun uset_close = uset_close{{SYMS_SUFFIX.id}}(set : USet) + fun uset_close_over = uset_closeOver{{SYMS_SUFFIX.id}}(set : USet, attributes : Int32T) + fun uset_compact = uset_compact{{SYMS_SUFFIX.id}}(set : USet) + fun uset_complement = uset_complement{{SYMS_SUFFIX.id}}(set : USet) + fun uset_complement_all = uset_complementAll{{SYMS_SUFFIX.id}}(set : USet, complement : USet) + fun uset_contains = uset_contains{{SYMS_SUFFIX.id}}(set : USet, c : UChar32) : UBool + fun uset_contains_all = uset_containsAll{{SYMS_SUFFIX.id}}(set1 : USet, set2 : USet) : UBool + fun uset_contains_all_code_points = uset_containsAllCodePoints{{SYMS_SUFFIX.id}}(set : USet, str : UChar*, str_len : Int32T) : UBool + fun uset_contains_none = uset_containsNone{{SYMS_SUFFIX.id}}(set1 : USet, set2 : USet) : UBool + fun uset_contains_range = uset_containsRange{{SYMS_SUFFIX.id}}(set : USet, start : UChar32, _end : UChar32) : UBool + fun uset_contains_some = uset_containsSome{{SYMS_SUFFIX.id}}(set1 : USet, set2 : USet) : UBool + fun uset_contains_string = uset_containsString{{SYMS_SUFFIX.id}}(set : USet, str : UChar*, str_len : Int32T) : UBool + fun uset_equals = uset_equals{{SYMS_SUFFIX.id}}(set1 : USet, set2 : USet) : UBool + fun uset_freeze = uset_freeze{{SYMS_SUFFIX.id}}(set : USet) + fun uset_get_item = uset_getItem{{SYMS_SUFFIX.id}}(set : USet, item_index : Int32T, start : UChar32*, _end : UChar32*, str : UChar*, str_capacity : Int32T, ec : UErrorCode*) : Int32T + fun uset_get_item_count = uset_getItemCount{{SYMS_SUFFIX.id}}(set : USet) : Int32T + fun uset_get_serialized_range = uset_getSerializedRange{{SYMS_SUFFIX.id}}(set : USerializedSet*, range_index : Int32T, p_start : UChar32*, p_end : UChar32*) : UBool + fun uset_get_serialized_range_count = uset_getSerializedRangeCount{{SYMS_SUFFIX.id}}(set : USerializedSet*) : Int32T + fun uset_get_serialized_set = uset_getSerializedSet{{SYMS_SUFFIX.id}}(fill_set : USerializedSet*, src : Uint16T*, src_length : Int32T) : UBool + fun uset_index_of = uset_indexOf{{SYMS_SUFFIX.id}}(set : USet, c : UChar32) : Int32T + fun uset_is_empty = uset_isEmpty{{SYMS_SUFFIX.id}}(set : USet) : UBool + fun uset_is_frozen = uset_isFrozen{{SYMS_SUFFIX.id}}(set : USet) : UBool + fun uset_open = uset_open{{SYMS_SUFFIX.id}}(start : UChar32, _end : UChar32) : USet + fun uset_open_empty = uset_openEmpty{{SYMS_SUFFIX.id}} : USet + fun uset_open_pattern = uset_openPattern{{SYMS_SUFFIX.id}}(pattern : UChar*, pattern_length : Int32T, ec : UErrorCode*) : USet + fun uset_open_pattern_options = uset_openPatternOptions{{SYMS_SUFFIX.id}}(pattern : UChar*, pattern_length : Int32T, options : Uint32T, ec : UErrorCode*) : USet + fun uset_remove = uset_remove{{SYMS_SUFFIX.id}}(set : USet, c : UChar32) + fun uset_remove_all = uset_removeAll{{SYMS_SUFFIX.id}}(set : USet, remove_set : USet) + fun uset_remove_all_strings = uset_removeAllStrings{{SYMS_SUFFIX.id}}(set : USet) + fun uset_remove_range = uset_removeRange{{SYMS_SUFFIX.id}}(set : USet, start : UChar32, _end : UChar32) + fun uset_remove_string = uset_removeString{{SYMS_SUFFIX.id}}(set : USet, str : UChar*, str_len : Int32T) + fun uset_resembles_pattern = uset_resemblesPattern{{SYMS_SUFFIX.id}}(pattern : UChar*, pattern_length : Int32T, pos : Int32T) : UBool + fun uset_retain = uset_retain{{SYMS_SUFFIX.id}}(set : USet, start : UChar32, _end : UChar32) + fun uset_retain_all = uset_retainAll{{SYMS_SUFFIX.id}}(set : USet, retain : USet) + fun uset_serialize = uset_serialize{{SYMS_SUFFIX.id}}(set : USet, dest : Uint16T*, dest_capacity : Int32T, p_error_code : UErrorCode*) : Int32T + fun uset_serialized_contains = uset_serializedContains{{SYMS_SUFFIX.id}}(set : USerializedSet*, c : UChar32) : UBool + fun uset_set = uset_set{{SYMS_SUFFIX.id}}(set : USet, start : UChar32, _end : UChar32) + fun uset_set_serialized_to_one = uset_setSerializedToOne{{SYMS_SUFFIX.id}}(fill_set : USerializedSet*, c : UChar32) + fun uset_size = uset_size{{SYMS_SUFFIX.id}}(set : USet) : Int32T + fun uset_span = uset_span{{SYMS_SUFFIX.id}}(set : USet, s : UChar*, length : Int32T, span_condition : USetSpanCondition) : Int32T + fun uset_span_back = uset_spanBack{{SYMS_SUFFIX.id}}(set : USet, s : UChar*, length : Int32T, span_condition : USetSpanCondition) : Int32T + fun uset_span_back_ut_f8 = uset_spanBackUTF8{{SYMS_SUFFIX.id}}(set : USet, s : LibC::Char*, length : Int32T, span_condition : USetSpanCondition) : Int32T + fun uset_span_ut_f8 = uset_spanUTF8{{SYMS_SUFFIX.id}}(set : USet, s : LibC::Char*, length : Int32T, span_condition : USetSpanCondition) : Int32T + fun uset_to_pattern = uset_toPattern{{SYMS_SUFFIX.id}}(set : USet, result : UChar*, result_capacity : Int32T, escape_unprintable : UBool, ec : UErrorCode*) : Int32T struct USerializedSet array : Uint16T* @@ -69,4 +70,5 @@ lib LibICU length : Int32T static_array : Uint16T[8] end + {% end %} end diff --git a/src/lib_icu/uspoof.cr b/src/lib_icu/uspoof.cr index 57e62e9..4eabcbd 100644 --- a/src/lib_icu/uspoof.cr +++ b/src/lib_icu/uspoof.cr @@ -1,5 +1,6 @@ -@[Link(ldflags: "`command -v pkg-config > /dev/null && pkg-config --libs icu-uc icu-i18n icu-io icu-lx icu-le || printf %s '-licuio -licui18n -liculx -licule -licuuc -licudata'`")] +@[Link(ldflags: "`command -v pkg-config > /dev/null && pkg-config --libs icu-uc icu-i18n icu-io 2> /dev/null|| printf %s '-licuio -licui18n -licuuc -licudata'`")] lib LibICU + {% begin %} enum URestrictionLevel UspoofAscii = 268435456 UspoofHighlyRestrictive = 536870912 @@ -7,27 +8,28 @@ lib LibICU UspoofMinimallyRestrictive = 1073741824 UspoofUnrestrictive = 1342177280 end - fun uspoof_are_confusable = uspoof_areConfusable_52(sc : USpoofChecker, id1 : UChar*, length1 : Int32T, id2 : UChar*, length2 : Int32T, status : UErrorCode*) : Int32T - fun uspoof_are_confusable_ut_f8 = uspoof_areConfusableUTF8_52(sc : USpoofChecker, id1 : LibC::Char*, length1 : Int32T, id2 : LibC::Char*, length2 : Int32T, status : UErrorCode*) : Int32T - fun uspoof_check = uspoof_check_52(sc : USpoofChecker, id : UChar*, length : Int32T, position : Int32T*, status : UErrorCode*) : Int32T - fun uspoof_check_ut_f8 = uspoof_checkUTF8_52(sc : USpoofChecker, id : LibC::Char*, length : Int32T, position : Int32T*, status : UErrorCode*) : Int32T - fun uspoof_clone = uspoof_clone_52(sc : USpoofChecker, status : UErrorCode*) : USpoofChecker - fun uspoof_close = uspoof_close_52(sc : USpoofChecker) - fun uspoof_get_allowed_chars = uspoof_getAllowedChars_52(sc : USpoofChecker, status : UErrorCode*) : USet - fun uspoof_get_allowed_locales = uspoof_getAllowedLocales_52(sc : USpoofChecker, status : UErrorCode*) : LibC::Char* - fun uspoof_get_checks = uspoof_getChecks_52(sc : USpoofChecker, status : UErrorCode*) : Int32T - fun uspoof_get_inclusion_set = uspoof_getInclusionSet_52(status : UErrorCode*) : USet - fun uspoof_get_recommended_set = uspoof_getRecommendedSet_52(status : UErrorCode*) : USet - fun uspoof_get_restriction_level = uspoof_getRestrictionLevel_52(sc : USpoofChecker) : URestrictionLevel - fun uspoof_get_skeleton = uspoof_getSkeleton_52(sc : USpoofChecker, type : Uint32T, id : UChar*, length : Int32T, dest : UChar*, dest_capacity : Int32T, status : UErrorCode*) : Int32T - fun uspoof_get_skeleton_ut_f8 = uspoof_getSkeletonUTF8_52(sc : USpoofChecker, type : Uint32T, id : LibC::Char*, length : Int32T, dest : LibC::Char*, dest_capacity : Int32T, status : UErrorCode*) : Int32T - fun uspoof_open = uspoof_open_52(status : UErrorCode*) : USpoofChecker - fun uspoof_open_from_serialized = uspoof_openFromSerialized_52(data : Void*, length : Int32T, p_actual_length : Int32T*, p_error_code : UErrorCode*) : USpoofChecker - fun uspoof_open_from_source = uspoof_openFromSource_52(confusables : LibC::Char*, confusables_len : Int32T, confusables_whole_script : LibC::Char*, confusables_whole_script_len : Int32T, err_type : Int32T*, pe : UParseError*, status : UErrorCode*) : USpoofChecker - fun uspoof_serialize = uspoof_serialize_52(sc : USpoofChecker, data : Void*, capacity : Int32T, status : UErrorCode*) : Int32T - fun uspoof_set_allowed_chars = uspoof_setAllowedChars_52(sc : USpoofChecker, chars : USet, status : UErrorCode*) - fun uspoof_set_allowed_locales = uspoof_setAllowedLocales_52(sc : USpoofChecker, locales_list : LibC::Char*, status : UErrorCode*) - fun uspoof_set_checks = uspoof_setChecks_52(sc : USpoofChecker, checks : Int32T, status : UErrorCode*) - fun uspoof_set_restriction_level = uspoof_setRestrictionLevel_52(sc : USpoofChecker, restriction_level : URestrictionLevel) + fun uspoof_are_confusable = uspoof_areConfusable{{SYMS_SUFFIX.id}}(sc : USpoofChecker, id1 : UChar*, length1 : Int32T, id2 : UChar*, length2 : Int32T, status : UErrorCode*) : Int32T + fun uspoof_are_confusable_ut_f8 = uspoof_areConfusableUTF8{{SYMS_SUFFIX.id}}(sc : USpoofChecker, id1 : LibC::Char*, length1 : Int32T, id2 : LibC::Char*, length2 : Int32T, status : UErrorCode*) : Int32T + fun uspoof_check = uspoof_check{{SYMS_SUFFIX.id}}(sc : USpoofChecker, id : UChar*, length : Int32T, position : Int32T*, status : UErrorCode*) : Int32T + fun uspoof_check_ut_f8 = uspoof_checkUTF8{{SYMS_SUFFIX.id}}(sc : USpoofChecker, id : LibC::Char*, length : Int32T, position : Int32T*, status : UErrorCode*) : Int32T + fun uspoof_clone = uspoof_clone{{SYMS_SUFFIX.id}}(sc : USpoofChecker, status : UErrorCode*) : USpoofChecker + fun uspoof_close = uspoof_close{{SYMS_SUFFIX.id}}(sc : USpoofChecker) + fun uspoof_get_allowed_chars = uspoof_getAllowedChars{{SYMS_SUFFIX.id}}(sc : USpoofChecker, status : UErrorCode*) : USet + fun uspoof_get_allowed_locales = uspoof_getAllowedLocales{{SYMS_SUFFIX.id}}(sc : USpoofChecker, status : UErrorCode*) : LibC::Char* + fun uspoof_get_checks = uspoof_getChecks{{SYMS_SUFFIX.id}}(sc : USpoofChecker, status : UErrorCode*) : Int32T + fun uspoof_get_inclusion_set = uspoof_getInclusionSet{{SYMS_SUFFIX.id}}(status : UErrorCode*) : USet + fun uspoof_get_recommended_set = uspoof_getRecommendedSet{{SYMS_SUFFIX.id}}(status : UErrorCode*) : USet + fun uspoof_get_restriction_level = uspoof_getRestrictionLevel{{SYMS_SUFFIX.id}}(sc : USpoofChecker) : URestrictionLevel + fun uspoof_get_skeleton = uspoof_getSkeleton{{SYMS_SUFFIX.id}}(sc : USpoofChecker, type : Uint32T, id : UChar*, length : Int32T, dest : UChar*, dest_capacity : Int32T, status : UErrorCode*) : Int32T + fun uspoof_get_skeleton_ut_f8 = uspoof_getSkeletonUTF8{{SYMS_SUFFIX.id}}(sc : USpoofChecker, type : Uint32T, id : LibC::Char*, length : Int32T, dest : LibC::Char*, dest_capacity : Int32T, status : UErrorCode*) : Int32T + fun uspoof_open = uspoof_open{{SYMS_SUFFIX.id}}(status : UErrorCode*) : USpoofChecker + fun uspoof_open_from_serialized = uspoof_openFromSerialized{{SYMS_SUFFIX.id}}(data : Void*, length : Int32T, p_actual_length : Int32T*, p_error_code : UErrorCode*) : USpoofChecker + fun uspoof_open_from_source = uspoof_openFromSource{{SYMS_SUFFIX.id}}(confusables : LibC::Char*, confusables_len : Int32T, confusables_whole_script : LibC::Char*, confusables_whole_script_len : Int32T, err_type : Int32T*, pe : UParseError*, status : UErrorCode*) : USpoofChecker + fun uspoof_serialize = uspoof_serialize{{SYMS_SUFFIX.id}}(sc : USpoofChecker, data : Void*, capacity : Int32T, status : UErrorCode*) : Int32T + fun uspoof_set_allowed_chars = uspoof_setAllowedChars{{SYMS_SUFFIX.id}}(sc : USpoofChecker, chars : USet, status : UErrorCode*) + fun uspoof_set_allowed_locales = uspoof_setAllowedLocales{{SYMS_SUFFIX.id}}(sc : USpoofChecker, locales_list : LibC::Char*, status : UErrorCode*) + fun uspoof_set_checks = uspoof_setChecks{{SYMS_SUFFIX.id}}(sc : USpoofChecker, checks : Int32T, status : UErrorCode*) + fun uspoof_set_restriction_level = uspoof_setRestrictionLevel{{SYMS_SUFFIX.id}}(sc : USpoofChecker, restriction_level : URestrictionLevel) type USpoofChecker = Void* + {% end %} end diff --git a/src/lib_icu/usprep.cr b/src/lib_icu/usprep.cr index fd8abf5..3a86b3e 100644 --- a/src/lib_icu/usprep.cr +++ b/src/lib_icu/usprep.cr @@ -1,5 +1,6 @@ -@[Link(ldflags: "`command -v pkg-config > /dev/null && pkg-config --libs icu-uc icu-i18n icu-io icu-lx icu-le || printf %s '-licuio -licui18n -liculx -licule -licuuc -licudata'`")] +@[Link(ldflags: "`command -v pkg-config > /dev/null && pkg-config --libs icu-uc icu-i18n icu-io 2> /dev/null|| printf %s '-licuio -licui18n -licuuc -licudata'`")] lib LibICU + {% begin %} enum UStringPrepProfileType UsprepRfC3491Nameprep = 0 UsprepRfC3530NfS4CsPrep = 1 @@ -16,9 +17,10 @@ lib LibICU UsprepRfC4518Ldap = 12 UsprepRfC4518LdapCi = 13 end - fun usprep_close = usprep_close_52(profile : UStringPrepProfile) - fun usprep_open = usprep_open_52(path : LibC::Char*, file_name : LibC::Char*, status : UErrorCode*) : UStringPrepProfile - fun usprep_open_by_type = usprep_openByType_52(type : UStringPrepProfileType, status : UErrorCode*) : UStringPrepProfile - fun usprep_prepare = usprep_prepare_52(prep : UStringPrepProfile, src : UChar*, src_length : Int32T, dest : UChar*, dest_capacity : Int32T, options : Int32T, parse_error : UParseError*, status : UErrorCode*) : Int32T + fun usprep_close = usprep_close{{SYMS_SUFFIX.id}}(profile : UStringPrepProfile) + fun usprep_open = usprep_open{{SYMS_SUFFIX.id}}(path : LibC::Char*, file_name : LibC::Char*, status : UErrorCode*) : UStringPrepProfile + fun usprep_open_by_type = usprep_openByType{{SYMS_SUFFIX.id}}(type : UStringPrepProfileType, status : UErrorCode*) : UStringPrepProfile + fun usprep_prepare = usprep_prepare{{SYMS_SUFFIX.id}}(prep : UStringPrepProfile, src : UChar*, src_length : Int32T, dest : UChar*, dest_capacity : Int32T, options : Int32T, parse_error : UParseError*, status : UErrorCode*) : Int32T type UStringPrepProfile = Void* + {% end %} end diff --git a/src/lib_icu/ustring.cr b/src/lib_icu/ustring.cr index 1acb9b8..9b8506d 100644 --- a/src/lib_icu/ustring.cr +++ b/src/lib_icu/ustring.cr @@ -1,58 +1,60 @@ -@[Link(ldflags: "`command -v pkg-config > /dev/null && pkg-config --libs icu-uc icu-i18n icu-io icu-lx icu-le || printf %s '-licuio -licui18n -liculx -licule -licuuc -licudata'`")] +@[Link(ldflags: "`command -v pkg-config > /dev/null && pkg-config --libs icu-uc icu-i18n icu-io 2> /dev/null|| printf %s '-licuio -licui18n -licuuc -licudata'`")] lib LibICU + {% begin %} alias WcharT = LibC::Int - fun u_memcasecmp = u_memcasecmp_52(s1 : UChar*, s2 : UChar*, length : Int32T, options : Uint32T) : Int32T - fun u_memchr32 = u_memchr32_52(s : UChar*, c : UChar32, count : Int32T) : UChar* - fun u_memchr = u_memchr_52(s : UChar*, c : UChar, count : Int32T) : UChar* - fun u_memcmp = u_memcmp_52(buf1 : UChar*, buf2 : UChar*, count : Int32T) : Int32T - fun u_memcmp_code_point_order = u_memcmpCodePointOrder_52(s1 : UChar*, s2 : UChar*, count : Int32T) : Int32T - fun u_memcpy = u_memcpy_52(dest : UChar*, src : UChar*, count : Int32T) : UChar* - fun u_memmove = u_memmove_52(dest : UChar*, src : UChar*, count : Int32T) : UChar* - fun u_memrchr32 = u_memrchr32_52(s : UChar*, c : UChar32, count : Int32T) : UChar* - fun u_memrchr = u_memrchr_52(s : UChar*, c : UChar, count : Int32T) : UChar* - fun u_memset = u_memset_52(dest : UChar*, c : UChar, count : Int32T) : UChar* - fun u_str_case_compare = u_strCaseCompare_52(s1 : UChar*, length1 : Int32T, s2 : UChar*, length2 : Int32T, options : Uint32T, p_error_code : UErrorCode*) : Int32T - fun u_str_compare = u_strCompare_52(s1 : UChar*, length1 : Int32T, s2 : UChar*, length2 : Int32T, code_point_order : UBool) : Int32T - fun u_str_compare_iter = u_strCompareIter_52(iter1 : UCharIterator*, iter2 : UCharIterator*, code_point_order : UBool) : Int32T - fun u_str_find_first = u_strFindFirst_52(s : UChar*, length : Int32T, substring : UChar*, sub_length : Int32T) : UChar* - fun u_str_find_last = u_strFindLast_52(s : UChar*, length : Int32T, substring : UChar*, sub_length : Int32T) : UChar* - fun u_str_fold_case = u_strFoldCase_52(dest : UChar*, dest_capacity : Int32T, src : UChar*, src_length : Int32T, options : Uint32T, p_error_code : UErrorCode*) : Int32T - fun u_str_from_java_modified_ut_f8with_sub = u_strFromJavaModifiedUTF8WithSub_52(dest : UChar*, dest_capacity : Int32T, p_dest_length : Int32T*, src : LibC::Char*, src_length : Int32T, subchar : UChar32, p_num_substitutions : Int32T*, p_error_code : UErrorCode*) : UChar* - fun u_str_from_ut_f32 = u_strFromUTF32_52(dest : UChar*, dest_capacity : Int32T, p_dest_length : Int32T*, src : UChar32*, src_length : Int32T, p_error_code : UErrorCode*) : UChar* - fun u_str_from_ut_f32with_sub = u_strFromUTF32WithSub_52(dest : UChar*, dest_capacity : Int32T, p_dest_length : Int32T*, src : UChar32*, src_length : Int32T, subchar : UChar32, p_num_substitutions : Int32T*, p_error_code : UErrorCode*) : UChar* - fun u_str_from_ut_f8 = u_strFromUTF8_52(dest : UChar*, dest_capacity : Int32T, p_dest_length : Int32T*, src : LibC::Char*, src_length : Int32T, p_error_code : UErrorCode*) : UChar* - fun u_str_from_ut_f8lenient = u_strFromUTF8Lenient_52(dest : UChar*, dest_capacity : Int32T, p_dest_length : Int32T*, src : LibC::Char*, src_length : Int32T, p_error_code : UErrorCode*) : UChar* - fun u_str_from_ut_f8with_sub = u_strFromUTF8WithSub_52(dest : UChar*, dest_capacity : Int32T, p_dest_length : Int32T*, src : LibC::Char*, src_length : Int32T, subchar : UChar32, p_num_substitutions : Int32T*, p_error_code : UErrorCode*) : UChar* - fun u_str_from_wcs = u_strFromWCS_52(dest : UChar*, dest_capacity : Int32T, p_dest_length : Int32T*, src : WcharT*, src_length : Int32T, p_error_code : UErrorCode*) : UChar* - fun u_str_has_more_char32than = u_strHasMoreChar32Than_52(s : UChar*, length : Int32T, number : Int32T) : UBool - fun u_str_to_java_modified_ut_f8 = u_strToJavaModifiedUTF8_52(dest : LibC::Char*, dest_capacity : Int32T, p_dest_length : Int32T*, src : UChar*, src_length : Int32T, p_error_code : UErrorCode*) : LibC::Char* - fun u_str_to_lower = u_strToLower_52(dest : UChar*, dest_capacity : Int32T, src : UChar*, src_length : Int32T, locale : LibC::Char*, p_error_code : UErrorCode*) : Int32T - fun u_str_to_title = u_strToTitle_52(dest : UChar*, dest_capacity : Int32T, src : UChar*, src_length : Int32T, title_iter : UBreakIterator, locale : LibC::Char*, p_error_code : UErrorCode*) : Int32T - fun u_str_to_upper = u_strToUpper_52(dest : UChar*, dest_capacity : Int32T, src : UChar*, src_length : Int32T, locale : LibC::Char*, p_error_code : UErrorCode*) : Int32T - fun u_str_to_ut_f32 = u_strToUTF32_52(dest : UChar32*, dest_capacity : Int32T, p_dest_length : Int32T*, src : UChar*, src_length : Int32T, p_error_code : UErrorCode*) : UChar32* - fun u_str_to_ut_f32with_sub = u_strToUTF32WithSub_52(dest : UChar32*, dest_capacity : Int32T, p_dest_length : Int32T*, src : UChar*, src_length : Int32T, subchar : UChar32, p_num_substitutions : Int32T*, p_error_code : UErrorCode*) : UChar32* - fun u_str_to_ut_f8 = u_strToUTF8_52(dest : LibC::Char*, dest_capacity : Int32T, p_dest_length : Int32T*, src : UChar*, src_length : Int32T, p_error_code : UErrorCode*) : LibC::Char* - fun u_str_to_ut_f8with_sub = u_strToUTF8WithSub_52(dest : LibC::Char*, dest_capacity : Int32T, p_dest_length : Int32T*, src : UChar*, src_length : Int32T, subchar : UChar32, p_num_substitutions : Int32T*, p_error_code : UErrorCode*) : LibC::Char* - fun u_str_to_wcs = u_strToWCS_52(dest : WcharT*, dest_capacity : Int32T, p_dest_length : Int32T*, src : UChar*, src_length : Int32T, p_error_code : UErrorCode*) : WcharT* - fun u_strcasecmp = u_strcasecmp_52(s1 : UChar*, s2 : UChar*, options : Uint32T) : Int32T - fun u_strcat = u_strcat_52(dst : UChar*, src : UChar*) : UChar* - fun u_strchr32 = u_strchr32_52(s : UChar*, c : UChar32) : UChar* - fun u_strchr = u_strchr_52(s : UChar*, c : UChar) : UChar* - fun u_strcmp = u_strcmp_52(s1 : UChar*, s2 : UChar*) : Int32T - fun u_strcmp_code_point_order = u_strcmpCodePointOrder_52(s1 : UChar*, s2 : UChar*) : Int32T - fun u_strcpy = u_strcpy_52(dst : UChar*, src : UChar*) : UChar* - fun u_strcspn = u_strcspn_52(string : UChar*, match_set : UChar*) : Int32T - fun u_strlen = u_strlen_52(s : UChar*) : Int32T - fun u_strncasecmp = u_strncasecmp_52(s1 : UChar*, s2 : UChar*, n : Int32T, options : Uint32T) : Int32T - fun u_strncat = u_strncat_52(dst : UChar*, src : UChar*, n : Int32T) : UChar* - fun u_strncmp = u_strncmp_52(ucs1 : UChar*, ucs2 : UChar*, n : Int32T) : Int32T - fun u_strncmp_code_point_order = u_strncmpCodePointOrder_52(s1 : UChar*, s2 : UChar*, n : Int32T) : Int32T - fun u_strncpy = u_strncpy_52(dst : UChar*, src : UChar*, n : Int32T) : UChar* - fun u_strpbrk = u_strpbrk_52(string : UChar*, match_set : UChar*) : UChar* - fun u_strrchr32 = u_strrchr32_52(s : UChar*, c : UChar32) : UChar* - fun u_strrchr = u_strrchr_52(s : UChar*, c : UChar) : UChar* - fun u_strrstr = u_strrstr_52(s : UChar*, substring : UChar*) : UChar* - fun u_strspn = u_strspn_52(string : UChar*, match_set : UChar*) : Int32T - fun u_strstr = u_strstr_52(s : UChar*, substring : UChar*) : UChar* - fun u_strtok_r = u_strtok_r_52(src : UChar*, delim : UChar*, save_state : UChar**) : UChar* + fun u_memcasecmp = u_memcasecmp{{SYMS_SUFFIX.id}}(s1 : UChar*, s2 : UChar*, length : Int32T, options : Uint32T) : Int32T + fun u_memchr32 = u_memchr32{{SYMS_SUFFIX.id}}(s : UChar*, c : UChar32, count : Int32T) : UChar* + fun u_memchr = u_memchr{{SYMS_SUFFIX.id}}(s : UChar*, c : UChar, count : Int32T) : UChar* + fun u_memcmp = u_memcmp{{SYMS_SUFFIX.id}}(buf1 : UChar*, buf2 : UChar*, count : Int32T) : Int32T + fun u_memcmp_code_point_order = u_memcmpCodePointOrder{{SYMS_SUFFIX.id}}(s1 : UChar*, s2 : UChar*, count : Int32T) : Int32T + fun u_memcpy = u_memcpy{{SYMS_SUFFIX.id}}(dest : UChar*, src : UChar*, count : Int32T) : UChar* + fun u_memmove = u_memmove{{SYMS_SUFFIX.id}}(dest : UChar*, src : UChar*, count : Int32T) : UChar* + fun u_memrchr32 = u_memrchr32{{SYMS_SUFFIX.id}}(s : UChar*, c : UChar32, count : Int32T) : UChar* + fun u_memrchr = u_memrchr{{SYMS_SUFFIX.id}}(s : UChar*, c : UChar, count : Int32T) : UChar* + fun u_memset = u_memset{{SYMS_SUFFIX.id}}(dest : UChar*, c : UChar, count : Int32T) : UChar* + fun u_str_case_compare = u_strCaseCompare{{SYMS_SUFFIX.id}}(s1 : UChar*, length1 : Int32T, s2 : UChar*, length2 : Int32T, options : Uint32T, p_error_code : UErrorCode*) : Int32T + fun u_str_compare = u_strCompare{{SYMS_SUFFIX.id}}(s1 : UChar*, length1 : Int32T, s2 : UChar*, length2 : Int32T, code_point_order : UBool) : Int32T + fun u_str_compare_iter = u_strCompareIter{{SYMS_SUFFIX.id}}(iter1 : UCharIterator*, iter2 : UCharIterator*, code_point_order : UBool) : Int32T + fun u_str_find_first = u_strFindFirst{{SYMS_SUFFIX.id}}(s : UChar*, length : Int32T, substring : UChar*, sub_length : Int32T) : UChar* + fun u_str_find_last = u_strFindLast{{SYMS_SUFFIX.id}}(s : UChar*, length : Int32T, substring : UChar*, sub_length : Int32T) : UChar* + fun u_str_fold_case = u_strFoldCase{{SYMS_SUFFIX.id}}(dest : UChar*, dest_capacity : Int32T, src : UChar*, src_length : Int32T, options : Uint32T, p_error_code : UErrorCode*) : Int32T + fun u_str_from_java_modified_ut_f8with_sub = u_strFromJavaModifiedUTF8WithSub{{SYMS_SUFFIX.id}}(dest : UChar*, dest_capacity : Int32T, p_dest_length : Int32T*, src : LibC::Char*, src_length : Int32T, subchar : UChar32, p_num_substitutions : Int32T*, p_error_code : UErrorCode*) : UChar* + fun u_str_from_ut_f32 = u_strFromUTF32{{SYMS_SUFFIX.id}}(dest : UChar*, dest_capacity : Int32T, p_dest_length : Int32T*, src : UChar32*, src_length : Int32T, p_error_code : UErrorCode*) : UChar* + fun u_str_from_ut_f32with_sub = u_strFromUTF32WithSub{{SYMS_SUFFIX.id}}(dest : UChar*, dest_capacity : Int32T, p_dest_length : Int32T*, src : UChar32*, src_length : Int32T, subchar : UChar32, p_num_substitutions : Int32T*, p_error_code : UErrorCode*) : UChar* + fun u_str_from_ut_f8 = u_strFromUTF8{{SYMS_SUFFIX.id}}(dest : UChar*, dest_capacity : Int32T, p_dest_length : Int32T*, src : LibC::Char*, src_length : Int32T, p_error_code : UErrorCode*) : UChar* + fun u_str_from_ut_f8lenient = u_strFromUTF8Lenient{{SYMS_SUFFIX.id}}(dest : UChar*, dest_capacity : Int32T, p_dest_length : Int32T*, src : LibC::Char*, src_length : Int32T, p_error_code : UErrorCode*) : UChar* + fun u_str_from_ut_f8with_sub = u_strFromUTF8WithSub{{SYMS_SUFFIX.id}}(dest : UChar*, dest_capacity : Int32T, p_dest_length : Int32T*, src : LibC::Char*, src_length : Int32T, subchar : UChar32, p_num_substitutions : Int32T*, p_error_code : UErrorCode*) : UChar* + fun u_str_from_wcs = u_strFromWCS{{SYMS_SUFFIX.id}}(dest : UChar*, dest_capacity : Int32T, p_dest_length : Int32T*, src : WcharT*, src_length : Int32T, p_error_code : UErrorCode*) : UChar* + fun u_str_has_more_char32than = u_strHasMoreChar32Than{{SYMS_SUFFIX.id}}(s : UChar*, length : Int32T, number : Int32T) : UBool + fun u_str_to_java_modified_ut_f8 = u_strToJavaModifiedUTF8{{SYMS_SUFFIX.id}}(dest : LibC::Char*, dest_capacity : Int32T, p_dest_length : Int32T*, src : UChar*, src_length : Int32T, p_error_code : UErrorCode*) : LibC::Char* + fun u_str_to_lower = u_strToLower{{SYMS_SUFFIX.id}}(dest : UChar*, dest_capacity : Int32T, src : UChar*, src_length : Int32T, locale : LibC::Char*, p_error_code : UErrorCode*) : Int32T + fun u_str_to_title = u_strToTitle{{SYMS_SUFFIX.id}}(dest : UChar*, dest_capacity : Int32T, src : UChar*, src_length : Int32T, title_iter : UBreakIterator, locale : LibC::Char*, p_error_code : UErrorCode*) : Int32T + fun u_str_to_upper = u_strToUpper{{SYMS_SUFFIX.id}}(dest : UChar*, dest_capacity : Int32T, src : UChar*, src_length : Int32T, locale : LibC::Char*, p_error_code : UErrorCode*) : Int32T + fun u_str_to_ut_f32 = u_strToUTF32{{SYMS_SUFFIX.id}}(dest : UChar32*, dest_capacity : Int32T, p_dest_length : Int32T*, src : UChar*, src_length : Int32T, p_error_code : UErrorCode*) : UChar32* + fun u_str_to_ut_f32with_sub = u_strToUTF32WithSub{{SYMS_SUFFIX.id}}(dest : UChar32*, dest_capacity : Int32T, p_dest_length : Int32T*, src : UChar*, src_length : Int32T, subchar : UChar32, p_num_substitutions : Int32T*, p_error_code : UErrorCode*) : UChar32* + fun u_str_to_ut_f8 = u_strToUTF8{{SYMS_SUFFIX.id}}(dest : LibC::Char*, dest_capacity : Int32T, p_dest_length : Int32T*, src : UChar*, src_length : Int32T, p_error_code : UErrorCode*) : LibC::Char* + fun u_str_to_ut_f8with_sub = u_strToUTF8WithSub{{SYMS_SUFFIX.id}}(dest : LibC::Char*, dest_capacity : Int32T, p_dest_length : Int32T*, src : UChar*, src_length : Int32T, subchar : UChar32, p_num_substitutions : Int32T*, p_error_code : UErrorCode*) : LibC::Char* + fun u_str_to_wcs = u_strToWCS{{SYMS_SUFFIX.id}}(dest : WcharT*, dest_capacity : Int32T, p_dest_length : Int32T*, src : UChar*, src_length : Int32T, p_error_code : UErrorCode*) : WcharT* + fun u_strcasecmp = u_strcasecmp{{SYMS_SUFFIX.id}}(s1 : UChar*, s2 : UChar*, options : Uint32T) : Int32T + fun u_strcat = u_strcat{{SYMS_SUFFIX.id}}(dst : UChar*, src : UChar*) : UChar* + fun u_strchr32 = u_strchr32{{SYMS_SUFFIX.id}}(s : UChar*, c : UChar32) : UChar* + fun u_strchr = u_strchr{{SYMS_SUFFIX.id}}(s : UChar*, c : UChar) : UChar* + fun u_strcmp = u_strcmp{{SYMS_SUFFIX.id}}(s1 : UChar*, s2 : UChar*) : Int32T + fun u_strcmp_code_point_order = u_strcmpCodePointOrder{{SYMS_SUFFIX.id}}(s1 : UChar*, s2 : UChar*) : Int32T + fun u_strcpy = u_strcpy{{SYMS_SUFFIX.id}}(dst : UChar*, src : UChar*) : UChar* + fun u_strcspn = u_strcspn{{SYMS_SUFFIX.id}}(string : UChar*, match_set : UChar*) : Int32T + fun u_strlen = u_strlen{{SYMS_SUFFIX.id}}(s : UChar*) : Int32T + fun u_strncasecmp = u_strncasecmp{{SYMS_SUFFIX.id}}(s1 : UChar*, s2 : UChar*, n : Int32T, options : Uint32T) : Int32T + fun u_strncat = u_strncat{{SYMS_SUFFIX.id}}(dst : UChar*, src : UChar*, n : Int32T) : UChar* + fun u_strncmp = u_strncmp{{SYMS_SUFFIX.id}}(ucs1 : UChar*, ucs2 : UChar*, n : Int32T) : Int32T + fun u_strncmp_code_point_order = u_strncmpCodePointOrder{{SYMS_SUFFIX.id}}(s1 : UChar*, s2 : UChar*, n : Int32T) : Int32T + fun u_strncpy = u_strncpy{{SYMS_SUFFIX.id}}(dst : UChar*, src : UChar*, n : Int32T) : UChar* + fun u_strpbrk = u_strpbrk{{SYMS_SUFFIX.id}}(string : UChar*, match_set : UChar*) : UChar* + fun u_strrchr32 = u_strrchr32{{SYMS_SUFFIX.id}}(s : UChar*, c : UChar32) : UChar* + fun u_strrchr = u_strrchr{{SYMS_SUFFIX.id}}(s : UChar*, c : UChar) : UChar* + fun u_strrstr = u_strrstr{{SYMS_SUFFIX.id}}(s : UChar*, substring : UChar*) : UChar* + fun u_strspn = u_strspn{{SYMS_SUFFIX.id}}(string : UChar*, match_set : UChar*) : Int32T + fun u_strstr = u_strstr{{SYMS_SUFFIX.id}}(s : UChar*, substring : UChar*) : UChar* + fun u_strtok_r = u_strtok_r{{SYMS_SUFFIX.id}}(src : UChar*, delim : UChar*, save_state : UChar**) : UChar* + {% end %} end diff --git a/src/lib_icu/utext.cr b/src/lib_icu/utext.cr index 9141968..3725398 100644 --- a/src/lib_icu/utext.cr +++ b/src/lib_icu/utext.cr @@ -1,27 +1,29 @@ -@[Link(ldflags: "`command -v pkg-config > /dev/null && pkg-config --libs icu-uc icu-i18n icu-io icu-lx icu-le || printf %s '-licuio -licui18n -liculx -licule -licuuc -licudata'`")] +@[Link(ldflags: "`command -v pkg-config > /dev/null && pkg-config --libs icu-uc icu-i18n icu-io 2> /dev/null|| printf %s '-licuio -licui18n -licuuc -licudata'`")] lib LibICU - fun utext_char32at = utext_char32At_52(ut : UText*, native_index : Int64T) : UChar32 - fun utext_clone = utext_clone_52(dest : UText*, src : UText*, deep : UBool, read_only : UBool, status : UErrorCode*) : UText* - fun utext_close = utext_close_52(ut : UText*) : UText* - fun utext_copy = utext_copy_52(ut : UText*, native_start : Int64T, native_limit : Int64T, dest_index : Int64T, move : UBool, status : UErrorCode*) - fun utext_current32 = utext_current32_52(ut : UText*) : UChar32 - fun utext_equals = utext_equals_52(a : UText*, b : UText*) : UBool - fun utext_extract = utext_extract_52(ut : UText*, native_start : Int64T, native_limit : Int64T, dest : UChar*, dest_capacity : Int32T, status : UErrorCode*) : Int32T - fun utext_freeze = utext_freeze_52(ut : UText*) - fun utext_get_native_index = utext_getNativeIndex_52(ut : UText*) : Int64T - fun utext_get_previous_native_index = utext_getPreviousNativeIndex_52(ut : UText*) : Int64T - fun utext_has_meta_data = utext_hasMetaData_52(ut : UText*) : UBool - fun utext_is_length_expensive = utext_isLengthExpensive_52(ut : UText*) : UBool - fun utext_is_writable = utext_isWritable_52(ut : UText*) : UBool - fun utext_move_index32 = utext_moveIndex32_52(ut : UText*, delta : Int32T) : UBool - fun utext_native_length = utext_nativeLength_52(ut : UText*) : Int64T - fun utext_next32 = utext_next32_52(ut : UText*) : UChar32 - fun utext_next32from = utext_next32From_52(ut : UText*, native_index : Int64T) : UChar32 - fun utext_open_u_chars = utext_openUChars_52(ut : UText*, s : UChar*, length : Int64T, status : UErrorCode*) : UText* - fun utext_open_ut_f8 = utext_openUTF8_52(ut : UText*, s : LibC::Char*, length : Int64T, status : UErrorCode*) : UText* - fun utext_previous32 = utext_previous32_52(ut : UText*) : UChar32 - fun utext_previous32from = utext_previous32From_52(ut : UText*, native_index : Int64T) : UChar32 - fun utext_replace = utext_replace_52(ut : UText*, native_start : Int64T, native_limit : Int64T, replacement_text : UChar*, replacement_length : Int32T, status : UErrorCode*) : Int32T - fun utext_set_native_index = utext_setNativeIndex_52(ut : UText*, native_index : Int64T) - fun utext_setup = utext_setup_52(ut : UText*, extra_space : Int32T, status : UErrorCode*) : UText* + {% begin %} + fun utext_char32at = utext_char32At{{SYMS_SUFFIX.id}}(ut : UText*, native_index : Int64T) : UChar32 + fun utext_clone = utext_clone{{SYMS_SUFFIX.id}}(dest : UText*, src : UText*, deep : UBool, read_only : UBool, status : UErrorCode*) : UText* + fun utext_close = utext_close{{SYMS_SUFFIX.id}}(ut : UText*) : UText* + fun utext_copy = utext_copy{{SYMS_SUFFIX.id}}(ut : UText*, native_start : Int64T, native_limit : Int64T, dest_index : Int64T, move : UBool, status : UErrorCode*) + fun utext_current32 = utext_current32{{SYMS_SUFFIX.id}}(ut : UText*) : UChar32 + fun utext_equals = utext_equals{{SYMS_SUFFIX.id}}(a : UText*, b : UText*) : UBool + fun utext_extract = utext_extract{{SYMS_SUFFIX.id}}(ut : UText*, native_start : Int64T, native_limit : Int64T, dest : UChar*, dest_capacity : Int32T, status : UErrorCode*) : Int32T + fun utext_freeze = utext_freeze{{SYMS_SUFFIX.id}}(ut : UText*) + fun utext_get_native_index = utext_getNativeIndex{{SYMS_SUFFIX.id}}(ut : UText*) : Int64T + fun utext_get_previous_native_index = utext_getPreviousNativeIndex{{SYMS_SUFFIX.id}}(ut : UText*) : Int64T + fun utext_has_meta_data = utext_hasMetaData{{SYMS_SUFFIX.id}}(ut : UText*) : UBool + fun utext_is_length_expensive = utext_isLengthExpensive{{SYMS_SUFFIX.id}}(ut : UText*) : UBool + fun utext_is_writable = utext_isWritable{{SYMS_SUFFIX.id}}(ut : UText*) : UBool + fun utext_move_index32 = utext_moveIndex32{{SYMS_SUFFIX.id}}(ut : UText*, delta : Int32T) : UBool + fun utext_native_length = utext_nativeLength{{SYMS_SUFFIX.id}}(ut : UText*) : Int64T + fun utext_next32 = utext_next32{{SYMS_SUFFIX.id}}(ut : UText*) : UChar32 + fun utext_next32from = utext_next32From{{SYMS_SUFFIX.id}}(ut : UText*, native_index : Int64T) : UChar32 + fun utext_open_u_chars = utext_openUChars{{SYMS_SUFFIX.id}}(ut : UText*, s : UChar*, length : Int64T, status : UErrorCode*) : UText* + fun utext_open_ut_f8 = utext_openUTF8{{SYMS_SUFFIX.id}}(ut : UText*, s : LibC::Char*, length : Int64T, status : UErrorCode*) : UText* + fun utext_previous32 = utext_previous32{{SYMS_SUFFIX.id}}(ut : UText*) : UChar32 + fun utext_previous32from = utext_previous32From{{SYMS_SUFFIX.id}}(ut : UText*, native_index : Int64T) : UChar32 + fun utext_replace = utext_replace{{SYMS_SUFFIX.id}}(ut : UText*, native_start : Int64T, native_limit : Int64T, replacement_text : UChar*, replacement_length : Int32T, status : UErrorCode*) : Int32T + fun utext_set_native_index = utext_setNativeIndex{{SYMS_SUFFIX.id}}(ut : UText*, native_index : Int64T) + fun utext_setup = utext_setup{{SYMS_SUFFIX.id}}(ut : UText*, extra_space : Int32T, status : UErrorCode*) : UText* + {% end %} end diff --git a/src/lib_icu/utmscale.cr b/src/lib_icu/utmscale.cr index de33136..256b0d0 100644 --- a/src/lib_icu/utmscale.cr +++ b/src/lib_icu/utmscale.cr @@ -1,5 +1,6 @@ -@[Link(ldflags: "`command -v pkg-config > /dev/null && pkg-config --libs icu-uc icu-i18n icu-io icu-lx icu-le || printf %s '-licuio -licui18n -liculx -licule -licuuc -licudata'`")] +@[Link(ldflags: "`command -v pkg-config > /dev/null && pkg-config --libs icu-uc icu-i18n icu-io 2> /dev/null|| printf %s '-licuio -licui18n -licuuc -licudata'`")] lib LibICU + {% begin %} enum UDateTimeScale UdtsJavaTime = 0 UdtsUnixTime = 1 @@ -27,7 +28,8 @@ lib LibICU UtsvMaxRoundValue = 10 UtsvMaxScaleValue = 11 end - fun utmscale_from_int64 = utmscale_fromInt64_52(other_time : Int64T, time_scale : UDateTimeScale, status : UErrorCode*) : Int64T - fun utmscale_get_time_scale_value = utmscale_getTimeScaleValue_52(time_scale : UDateTimeScale, value : UTimeScaleValue, status : UErrorCode*) : Int64T - fun utmscale_to_int64 = utmscale_toInt64_52(universal_time : Int64T, time_scale : UDateTimeScale, status : UErrorCode*) : Int64T + fun utmscale_from_int64 = utmscale_fromInt64{{SYMS_SUFFIX.id}}(other_time : Int64T, time_scale : UDateTimeScale, status : UErrorCode*) : Int64T + fun utmscale_get_time_scale_value = utmscale_getTimeScaleValue{{SYMS_SUFFIX.id}}(time_scale : UDateTimeScale, value : UTimeScaleValue, status : UErrorCode*) : Int64T + fun utmscale_to_int64 = utmscale_toInt64{{SYMS_SUFFIX.id}}(universal_time : Int64T, time_scale : UDateTimeScale, status : UErrorCode*) : Int64T + {% end %} end diff --git a/src/lib_icu/utrans.cr b/src/lib_icu/utrans.cr index fcd6cd3..2758edc 100644 --- a/src/lib_icu/utrans.cr +++ b/src/lib_icu/utrans.cr @@ -1,29 +1,30 @@ -@[Link(ldflags: "`command -v pkg-config > /dev/null && pkg-config --libs icu-uc icu-i18n icu-io icu-lx icu-le || printf %s '-licuio -licui18n -liculx -licule -licuuc -licudata'`")] +@[Link(ldflags: "`command -v pkg-config > /dev/null && pkg-config --libs icu-uc icu-i18n icu-io 2> /dev/null|| printf %s '-licuio -licui18n -licuuc -licudata'`")] lib LibICU + {% begin %} alias UReplaceable = Void* alias UTransliterator = Void* enum UTransDirection UtransForward = 0 UtransReverse = 1 end - fun utrans_clone = utrans_clone_52(trans : UTransliterator*, status : UErrorCode*) : UTransliterator* - fun utrans_close = utrans_close_52(trans : UTransliterator*) - fun utrans_count_available_i_ds = utrans_countAvailableIDs_52 : Int32T - fun utrans_get_available_id = utrans_getAvailableID_52(index : Int32T, buf : LibC::Char*, buf_capacity : Int32T) : Int32T - fun utrans_get_id = utrans_getID_52(trans : UTransliterator*, buf : LibC::Char*, buf_capacity : Int32T) : Int32T - fun utrans_get_unicode_id = utrans_getUnicodeID_52(trans : UTransliterator*, result_length : Int32T*) : UChar* - fun utrans_open = utrans_open_52(id : LibC::Char*, dir : UTransDirection, rules : UChar*, rules_length : Int32T, parse_error : UParseError*, status : UErrorCode*) : UTransliterator* - fun utrans_open_i_ds = utrans_openIDs_52(p_error_code : UErrorCode*) : UEnumeration - fun utrans_open_inverse = utrans_openInverse_52(trans : UTransliterator*, status : UErrorCode*) : UTransliterator* - fun utrans_open_u = utrans_openU_52(id : UChar*, id_length : Int32T, dir : UTransDirection, rules : UChar*, rules_length : Int32T, parse_error : UParseError*, p_error_code : UErrorCode*) : UTransliterator* - fun utrans_register = utrans_register_52(adopted_trans : UTransliterator*, status : UErrorCode*) - fun utrans_set_filter = utrans_setFilter_52(trans : UTransliterator*, filter_pattern : UChar*, filter_pattern_len : Int32T, status : UErrorCode*) - fun utrans_trans = utrans_trans_52(trans : UTransliterator*, rep : UReplaceable*, rep_func : UReplaceableCallbacks*, start : Int32T, limit : Int32T*, status : UErrorCode*) - fun utrans_trans_incremental = utrans_transIncremental_52(trans : UTransliterator*, rep : UReplaceable*, rep_func : UReplaceableCallbacks*, pos : UTransPosition*, status : UErrorCode*) - fun utrans_trans_incremental_u_chars = utrans_transIncrementalUChars_52(trans : UTransliterator*, text : UChar*, text_length : Int32T*, text_capacity : Int32T, pos : UTransPosition*, status : UErrorCode*) - fun utrans_trans_u_chars = utrans_transUChars_52(trans : UTransliterator*, text : UChar*, text_length : Int32T*, text_capacity : Int32T, start : Int32T, limit : Int32T*, status : UErrorCode*) - fun utrans_unregister = utrans_unregister_52(id : LibC::Char*) - fun utrans_unregister_id = utrans_unregisterID_52(id : UChar*, id_length : Int32T) + fun utrans_clone = utrans_clone{{SYMS_SUFFIX.id}}(trans : UTransliterator*, status : UErrorCode*) : UTransliterator* + fun utrans_close = utrans_close{{SYMS_SUFFIX.id}}(trans : UTransliterator*) + fun utrans_count_available_i_ds = utrans_countAvailableIDs{{SYMS_SUFFIX.id}} : Int32T + fun utrans_get_available_id = utrans_getAvailableID{{SYMS_SUFFIX.id}}(index : Int32T, buf : LibC::Char*, buf_capacity : Int32T) : Int32T + fun utrans_get_id = utrans_getID{{SYMS_SUFFIX.id}}(trans : UTransliterator*, buf : LibC::Char*, buf_capacity : Int32T) : Int32T + fun utrans_get_unicode_id = utrans_getUnicodeID{{SYMS_SUFFIX.id}}(trans : UTransliterator*, result_length : Int32T*) : UChar* + fun utrans_open = utrans_open{{SYMS_SUFFIX.id}}(id : LibC::Char*, dir : UTransDirection, rules : UChar*, rules_length : Int32T, parse_error : UParseError*, status : UErrorCode*) : UTransliterator* + fun utrans_open_i_ds = utrans_openIDs{{SYMS_SUFFIX.id}}(p_error_code : UErrorCode*) : UEnumeration + fun utrans_open_inverse = utrans_openInverse{{SYMS_SUFFIX.id}}(trans : UTransliterator*, status : UErrorCode*) : UTransliterator* + fun utrans_open_u = utrans_openU{{SYMS_SUFFIX.id}}(id : UChar*, id_length : Int32T, dir : UTransDirection, rules : UChar*, rules_length : Int32T, parse_error : UParseError*, p_error_code : UErrorCode*) : UTransliterator* + fun utrans_register = utrans_register{{SYMS_SUFFIX.id}}(adopted_trans : UTransliterator*, status : UErrorCode*) + fun utrans_set_filter = utrans_setFilter{{SYMS_SUFFIX.id}}(trans : UTransliterator*, filter_pattern : UChar*, filter_pattern_len : Int32T, status : UErrorCode*) + fun utrans_trans = utrans_trans{{SYMS_SUFFIX.id}}(trans : UTransliterator*, rep : UReplaceable*, rep_func : UReplaceableCallbacks*, start : Int32T, limit : Int32T*, status : UErrorCode*) + fun utrans_trans_incremental = utrans_transIncremental{{SYMS_SUFFIX.id}}(trans : UTransliterator*, rep : UReplaceable*, rep_func : UReplaceableCallbacks*, pos : UTransPosition*, status : UErrorCode*) + fun utrans_trans_incremental_u_chars = utrans_transIncrementalUChars{{SYMS_SUFFIX.id}}(trans : UTransliterator*, text : UChar*, text_length : Int32T*, text_capacity : Int32T, pos : UTransPosition*, status : UErrorCode*) + fun utrans_trans_u_chars = utrans_transUChars{{SYMS_SUFFIX.id}}(trans : UTransliterator*, text : UChar*, text_length : Int32T*, text_capacity : Int32T, start : Int32T, limit : Int32T*, status : UErrorCode*) + fun utrans_unregister = utrans_unregister{{SYMS_SUFFIX.id}}(id : LibC::Char*) + fun utrans_unregister_id = utrans_unregisterID{{SYMS_SUFFIX.id}}(id : UChar*, id_length : Int32T) struct UReplaceableCallbacks length : (UReplaceable* -> Int32T) @@ -40,4 +41,5 @@ lib LibICU start : Int32T limit : Int32T end + {% end %} end From e7acda758c0906bc79d36f26dba5a756dc3f1bcb Mon Sep 17 00:00:00 2001 From: Luc Sarzyniec Date: Thu, 4 May 2017 17:52:09 +0200 Subject: [PATCH 6/9] Select the code to load at compile-time depending on the ICU lib's version --- spec/currencies_spec.cr | 2 ++ spec/region_spec.cr | 2 ++ src/icu/currencies.cr | 2 ++ src/icu/region.cr | 2 ++ 4 files changed, 8 insertions(+) diff --git a/spec/currencies_spec.cr b/spec/currencies_spec.cr index 6c785be..955c3e5 100644 --- a/spec/currencies_spec.cr +++ b/spec/currencies_spec.cr @@ -13,6 +13,7 @@ describe "ICU::Currencies" do end end + {% if compare_versions(LibICU::VERSION, "49.0.0") >= 0 %} describe "numeric_code" do it "returns the code associated to a currency" do ICU::Currencies.numeric_code("EUR").should eq(978) @@ -24,4 +25,5 @@ describe "ICU::Currencies" do end end end + {% end %} end diff --git a/spec/region_spec.cr b/spec/region_spec.cr index 22ecdd0..78f1aab 100644 --- a/spec/region_spec.cr +++ b/spec/region_spec.cr @@ -1,5 +1,6 @@ require "./spec_helper" +{% if compare_versions(LibICU::VERSION, "52.0.0") >= 0 %} describe "ICU::Region" do describe "initialize" do it "creates a new region from a code" do @@ -57,3 +58,4 @@ describe "ICU::Region" do end end end +{% end %} diff --git a/src/icu/currencies.cr b/src/icu/currencies.cr index 71337d3..37c3ace 100644 --- a/src/icu/currencies.cr +++ b/src/icu/currencies.cr @@ -16,9 +16,11 @@ class ICU::Currencies ICU.uchars_to_string(buff, len) end + {% if compare_versions(LibICU::VERSION, "49.0.0") >= 0 %} def self.numeric_code(currency : String) : Int32 num = LibICU.ucurr_get_numeric_code(ICU.string_to_uchars(currency)) raise ICU::Error.new(%(Unknown currency "#{currency}")) if num == 0 num end + {% end %} end diff --git a/src/icu/region.cr b/src/icu/region.cr index eaaa403..123d18d 100644 --- a/src/icu/region.cr +++ b/src/icu/region.cr @@ -1,3 +1,4 @@ +{% if compare_versions(LibICU::VERSION, "52.0.0") >= 0 %} class ICU::Region @uregion : LibICU::URegion @code : String? @@ -47,3 +48,4 @@ class ICU::Region regions.map { |r| self.class.new(r) } end end +{% end %} From 6fae16d5bbda0cf25f2b0084e1d37cacb710ea7e Mon Sep 17 00:00:00 2001 From: Luc Sarzyniec Date: Thu, 4 May 2017 17:54:51 +0200 Subject: [PATCH 7/9] Add libgen to the devel deps and specify the version of lib ICU in shard.yml --- shard.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/shard.yml b/shard.yml index 90c0084..64c9ce6 100644 --- a/shard.yml +++ b/shard.yml @@ -10,6 +10,11 @@ description: | A binding to the ICU library libraries: - libicu: "~> 52.0" # FIXME: see https://github.com/olbat/icu.cr/issues/1 + libicu: ">= 4.8" + +development_dependencies: + libgen: + github: olbat/libgen + #version: ~> 0.1 license: GPLv3 From d8a159a4196f40407f01f32be084ccab711ad32f Mon Sep 17 00:00:00 2001 From: Luc Sarzyniec Date: Thu, 4 May 2017 17:56:29 +0200 Subject: [PATCH 8/9] Add CI test that runs on different OS/versions Fixes #1 --- .travis.yml | 57 ++++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 52 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index f22caf5..f9db72c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,12 +1,59 @@ --- language: crystal -dist: trusty sudo: required -before_install: -- sudo apt-get -qq update -- sudo apt-get install -y pkg-config libicu52 +matrix: + include: + # Linux + - os: linux + dist: precise + - os: linux + dist: trusty + - os: linux + dist: xenial + - os: linux + dist: trusty + env: GENERATE_LIB=1 # regenerate the binding + # OSX + - os: osx + osx_image: xcode8.3 + - os: osx + osx_image: xcode8.3 + env: GENERATE_LIB=1 # regenerate the binding + +before_install: | + case $TRAVIS_OS_NAME in + linux) + sudo apt-get -qq update + if [[ -n $GENERATE_LIB ]]; then + sudo apt-get install -y llvm-3.5-dev libclang-3.5-dev + fi + sudo apt-get install -y libicu-dev + ;; + osx) + brew update + + # FIXME: ugly fix for the CI's image, crystal-lang should not be reinstalled + rm -f /usr/local/bin/shards + brew install crystal-lang + + if [[ -n $GENERATE_LIB ]]; then + # install LLVM and Clang 3.7 + brew install llvm@3.7 + # FIXME: ugly fix since the libclang.dylib is not symlinked correctly + brew list --verbose llvm@3.7 | grep "\.dylib$" | xargs -n1 -I{} ln -sf {} $(brew --prefix)/lib + fi + + brew install icu4c + brew link --force icu4c + ;; + *) + exit 1;; + esac + +before_script: +- "[ -z $GENERATE_LIB ] || make" script: -- crystal tool format --check +- crystal tool format --check src spec - crystal spec From f0966a363134f7a15304c05e7a5c7fa23898d26e Mon Sep 17 00:00:00 2001 From: Luc Sarzyniec Date: Thu, 4 May 2017 18:28:17 +0200 Subject: [PATCH 9/9] Allow CI's failures on macOS builds (temporary) #2 --- .travis.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.travis.yml b/.travis.yml index f9db72c..b6a2902 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,6 +3,8 @@ language: crystal sudo: required matrix: + allow_failures: # FIXME: temporary fix, see https://github.com/olbat/icu.cr/issues/2 + - os: osx include: # Linux - os: linux