@[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
  alias Int32T = X__Int32T
  alias Int8T = X__Int8T
  alias UBool = Int8T
  alias UChar = LibC::Int
  alias UChar32 = Int32T
  alias UDate = LibC::Double
  alias UVersionInfo = Uint8T[4]
  alias Uint32T = X__Uint32T
  alias Uint8T = X__Uint8T
  alias X__Int32T = LibC::Int
  alias X__Int8T = LibC::Char
  alias X__Uint32T = LibC::UInt
  alias X__Uint8T = UInt8
  enum UCharCategory
    UUnassigned           =  0
    UGeneralOtherTypes    =  0
    UUppercaseLetter      =  1
    ULowercaseLetter      =  2
    UTitlecaseLetter      =  3
    UModifierLetter       =  4
    UOtherLetter          =  5
    UNonSpacingMark       =  6
    UEnclosingMark        =  7
    UCombiningSpacingMark =  8
    UDecimalDigitNumber   =  9
    ULetterNumber         = 10
    UOtherNumber          = 11
    USpaceSeparator       = 12
    ULineSeparator        = 13
    UParagraphSeparator   = 14
    UControlChar          = 15
    UFormatChar           = 16
    UPrivateUseChar       = 17
    USurrogate            = 18
    UDashPunctuation      = 19
    UStartPunctuation     = 20
    UEndPunctuation       = 21
    UConnectorPunctuation = 22
    UOtherPunctuation     = 23
    UMathSymbol           = 24
    UCurrencySymbol       = 25
    UModifierSymbol       = 26
    UOtherSymbol          = 27
    UInitialPunctuation   = 28
    UFinalPunctuation     = 29
    UCharCategoryCount    = 30
  end
  enum UCharDirection
    ULeftToRight              =  0
    URightToLeft              =  1
    UEuropeanNumber           =  2
    UEuropeanNumberSeparator  =  3
    UEuropeanNumberTerminator =  4
    UArabicNumber             =  5
    UCommonNumberSeparator    =  6
    UBlockSeparator           =  7
    USegmentSeparator         =  8
    UWhiteSpaceNeutral        =  9
    UOtherNeutral             = 10
    ULeftToRightEmbedding     = 11
    ULeftToRightOverride      = 12
    URightToLeftArabic        = 13
    URightToLeftEmbedding     = 14
    URightToLeftOverride      = 15
    UPopDirectionalFormat     = 16
    UDirNonSpacingMark        = 17
    UBoundaryNeutral          = 18
    UFirstStrongIsolate       = 19
    ULeftToRightIsolate       = 20
    URightToLeftIsolate       = 21
    UPopDirectionalIsolate    = 22
    UCharDirectionCount       = 23
  end
  enum UCharNameChoice
    UUnicodeCharName     = 0
    UUnicode10CharName   = 1
    UExtendedCharName    = 2
    UCharNameAlias       = 3
    UCharNameChoiceCount = 4
  end
  enum UErrorCode
    UUsingFallbackWarning         =  -128
    UErrorWarningStart            =  -128
    UUsingDefaultWarning          =  -127
    USafecloneAllocatedWarning    =  -126
    UStateOldWarning              =  -125
    UStringNotTerminatedWarning   =  -124
    USortKeyTooShortWarning       =  -123
    UAmbiguousAliasWarning        =  -122
    UDifferentUcaVersion          =  -121
    UPluginChangedLevelWarning    =  -120
    UErrorWarningLimit            =  -119
    UZeroError                    =     0
    UIllegalArgumentError         =     1
    UMissingResourceError         =     2
    UInvalidFormatError           =     3
    UFileAccessError              =     4
    UInternalProgramError         =     5
    UMessageParseError            =     6
    UMemoryAllocationError        =     7
    UIndexOutofboundsError        =     8
    UParseError                   =     9
    UInvalidCharFound             =    10
    UTruncatedCharFound           =    11
    UIllegalCharFound             =    12
    UInvalidTableFormat           =    13
    UInvalidTableFile             =    14
    UBufferOverflowError          =    15
    UUnsupportedError             =    16
    UResourceTypeMismatch         =    17
    UIllegalEscapeSequence        =    18
    UUnsupportedEscapeSequence    =    19
    UNoSpaceAvailable             =    20
    UCeNotFoundError              =    21
    UPrimaryTooLongError          =    22
    UStateTooOldError             =    23
    UTooManyAliasesError          =    24
    UEnumOutOfSyncError           =    25
    UInvariantConversionError     =    26
    UInvalidStateError            =    27
    UCollatorVersionMismatch      =    28
    UUselessCollatorError         =    29
    UNoWritePermission            =    30
    UStandardErrorLimit           =    31
    UBadVariableDefinition        = 65536
    UParseErrorStart              = 65536
    UMalformedRule                = 65537
    UMalformedSet                 = 65538
    UMalformedSymbolReference     = 65539
    UMalformedUnicodeEscape       = 65540
    UMalformedVariableDefinition  = 65541
    UMalformedVariableReference   = 65542
    UMismatchedSegmentDelimiters  = 65543
    UMisplacedAnchorStart         = 65544
    UMisplacedCursorOffset        = 65545
    UMisplacedQuantifier          = 65546
    UMissingOperator              = 65547
    UMissingSegmentClose          = 65548
    UMultipleAnteContexts         = 65549
    UMultipleCursors              = 65550
    UMultiplePostContexts         = 65551
    UTrailingBackslash            = 65552
    UUndefinedSegmentReference    = 65553
    UUndefinedVariable            = 65554
    UUnquotedSpecial              = 65555
    UUnterminatedQuote            = 65556
    URuleMaskError                = 65557
    UMisplacedCompoundFilter      = 65558
    UMultipleCompoundFilters      = 65559
    UInvalidRbtSyntax             = 65560
    UInvalidPropertyPattern       = 65561
    UMalformedPragma              = 65562
    UUnclosedSegment              = 65563
    UIllegalCharInSegment         = 65564
    UVariableRangeExhausted       = 65565
    UVariableRangeOverlap         = 65566
    UIllegalCharacter             = 65567
    UInternalTransliteratorError  = 65568
    UInvalidId                    = 65569
    UInvalidFunction              = 65570
    UParseErrorLimit              = 65571
    UUnexpectedToken              = 65792
    UFmtParseErrorStart           = 65792
    UMultipleDecimalSeparators    = 65793
    UMultipleDecimalSeperators    = 65793
    UMultipleExponentialSymbols   = 65794
    UMalformedExponentialPattern  = 65795
    UMultiplePercentSymbols       = 65796
    UMultiplePermillSymbols       = 65797
    UMultiplePadSpecifiers        = 65798
    UPatternSyntaxError           = 65799
    UIllegalPadPosition           = 65800
    UUnmatchedBraces              = 65801
    UUnsupportedProperty          = 65802
    UUnsupportedAttribute         = 65803
    UArgumentTypeMismatch         = 65804
    UDuplicateKeyword             = 65805
    UUndefinedKeyword             = 65806
    UDefaultKeywordMissing        = 65807
    UDecimalNumberSyntaxError     = 65808
    UFormatInexactError           = 65809
    UNumberArgOutofboundsError    = 65810
    UNumberSkeletonSyntaxError    = 65811
    UFmtParseErrorLimit           = 65812
    UBrkInternalError             = 66048
    UBrkErrorStart                = 66048
    UBrkHexDigitsExpected         = 66049
    UBrkSemicolonExpected         = 66050
    UBrkRuleSyntax                = 66051
    UBrkUnclosedSet               = 66052
    UBrkAssignError               = 66053
    UBrkVariableRedfinition       = 66054
    UBrkMismatchedParen           = 66055
    UBrkNewLineInQuotedString     = 66056
    UBrkUndefinedVariable         = 66057
    UBrkInitError                 = 66058
    UBrkRuleEmptySet              = 66059
    UBrkUnrecognizedOption        = 66060
    UBrkMalformedRuleTag          = 66061
    UBrkErrorLimit                = 66062
    URegexInternalError           = 66304
    URegexErrorStart              = 66304
    URegexRuleSyntax              = 66305
    URegexInvalidState            = 66306
    URegexBadEscapeSequence       = 66307
    URegexPropertySyntax          = 66308
    URegexUnimplemented           = 66309
    URegexMismatchedParen         = 66310
    URegexNumberTooBig            = 66311
    URegexBadInterval             = 66312
    URegexMaxLtMin                = 66313
    URegexInvalidBackRef          = 66314
    URegexInvalidFlag             = 66315
    URegexLookBehindLimit         = 66316
    URegexSetContainsString       = 66317
    URegexOctalTooBig             = 66318
    URegexMissingCloseBracket     = 66319
    URegexInvalidRange            = 66320
    URegexStackOverflow           = 66321
    URegexTimeOut                 = 66322
    URegexStoppedByCaller         = 66323
    URegexPatternTooBig           = 66324
    URegexInvalidCaptureGroupName = 66325
    URegexErrorLimit              = 66326
    UIdnaProhibitedError          = 66560
    UIdnaErrorStart               = 66560
    UIdnaUnassignedError          = 66561
    UIdnaCheckBidiError           = 66562
    UIdnaStd3AsciiRulesError      = 66563
    UIdnaAcePrefixError           = 66564
    UIdnaVerificationError        = 66565
    UIdnaLabelTooLongError        = 66566
    UIdnaZeroLengthLabelError     = 66567
    UIdnaDomainNameTooLongError   = 66568
    UIdnaErrorLimit               = 66569
    UStringprepProhibitedError    = 66560
    UStringprepUnassignedError    = 66561
    UStringprepCheckBidiError     = 66562
    UPluginErrorStart             = 66816
    UPluginTooHigh                = 66816
    UPluginDidntSetLevel          = 66817
    UPluginErrorLimit             = 66818
    UErrorLimit                   = 66818
  end
  enum ULocDataLocaleType
    UlocActualLocale        = 0
    UlocValidLocale         = 1
    UlocRequestedLocale     = 2
    UlocDataLocaleTypeLimit = 3
  end
  enum UProperty
    UcharAlphabetic                   =     0
    UcharBinaryStart                  =     0
    UcharAsciiHexDigit                =     1
    UcharBidiControl                  =     2
    UcharBidiMirrored                 =     3
    UcharDash                         =     4
    UcharDefaultIgnorableCodePoint    =     5
    UcharDeprecated                   =     6
    UcharDiacritic                    =     7
    UcharExtender                     =     8
    UcharFullCompositionExclusion     =     9
    UcharGraphemeBase                 =    10
    UcharGraphemeExtend               =    11
    UcharGraphemeLink                 =    12
    UcharHexDigit                     =    13
    UcharHyphen                       =    14
    UcharIdContinue                   =    15
    UcharIdStart                      =    16
    UcharIdeographic                  =    17
    UcharIdsBinaryOperator            =    18
    UcharIdsTrinaryOperator           =    19
    UcharJoinControl                  =    20
    UcharLogicalOrderException        =    21
    UcharLowercase                    =    22
    UcharMath                         =    23
    UcharNoncharacterCodePoint        =    24
    UcharQuotationMark                =    25
    UcharRadical                      =    26
    UcharSoftDotted                   =    27
    UcharTerminalPunctuation          =    28
    UcharUnifiedIdeograph             =    29
    UcharUppercase                    =    30
    UcharWhiteSpace                   =    31
    UcharXidContinue                  =    32
    UcharXidStart                     =    33
    UcharCaseSensitive                =    34
    UcharSTerm                        =    35
    UcharVariationSelector            =    36
    UcharNfdInert                     =    37
    UcharNfkdInert                    =    38
    UcharNfcInert                     =    39
    UcharNfkcInert                    =    40
    UcharSegmentStarter               =    41
    UcharPatternSyntax                =    42
    UcharPatternWhiteSpace            =    43
    UcharPosixAlnum                   =    44
    UcharPosixBlank                   =    45
    UcharPosixGraph                   =    46
    UcharPosixPrint                   =    47
    UcharPosixXdigit                  =    48
    UcharCased                        =    49
    UcharCaseIgnorable                =    50
    UcharChangesWhenLowercased        =    51
    UcharChangesWhenUppercased        =    52
    UcharChangesWhenTitlecased        =    53
    UcharChangesWhenCasefolded        =    54
    UcharChangesWhenCasemapped        =    55
    UcharChangesWhenNfkcCasefolded    =    56
    UcharEmoji                        =    57
    UcharEmojiPresentation            =    58
    UcharEmojiModifier                =    59
    UcharEmojiModifierBase            =    60
    UcharEmojiComponent               =    61
    UcharRegionalIndicator            =    62
    UcharPrependedConcatenationMark   =    63
    UcharExtendedPictographic         =    64
    UcharBinaryLimit                  =    65
    UcharBidiClass                    =  4096
    UcharIntStart                     =  4096
    UcharBlock                        =  4097
    UcharCanonicalCombiningClass      =  4098
    UcharDecompositionType            =  4099
    UcharEastAsianWidth               =  4100
    UcharGeneralCategory              =  4101
    UcharJoiningGroup                 =  4102
    UcharJoiningType                  =  4103
    UcharLineBreak                    =  4104
    UcharNumericType                  =  4105
    UcharScript                       =  4106
    UcharHangulSyllableType           =  4107
    UcharNfdQuickCheck                =  4108
    UcharNfkdQuickCheck               =  4109
    UcharNfcQuickCheck                =  4110
    UcharNfkcQuickCheck               =  4111
    UcharLeadCanonicalCombiningClass  =  4112
    UcharTrailCanonicalCombiningClass =  4113
    UcharGraphemeClusterBreak         =  4114
    UcharSentenceBreak                =  4115
    UcharWordBreak                    =  4116
    UcharBidiPairedBracketType        =  4117
    UcharIndicPositionalCategory      =  4118
    UcharIndicSyllabicCategory        =  4119
    UcharVerticalOrientation          =  4120
    UcharIntLimit                     =  4121
    UcharGeneralCategoryMask          =  8192
    UcharMaskStart                    =  8192
    UcharMaskLimit                    =  8193
    UcharNumericValue                 = 12288
    UcharDoubleStart                  = 12288
    UcharDoubleLimit                  = 12289
    UcharAge                          = 16384
    UcharStringStart                  = 16384
    UcharBidiMirroringGlyph           = 16385
    UcharCaseFolding                  = 16386
    UcharIsoComment                   = 16387
    UcharLowercaseMapping             = 16388
    UcharName                         = 16389
    UcharSimpleCaseFolding            = 16390
    UcharSimpleLowercaseMapping       = 16391
    UcharSimpleTitlecaseMapping       = 16392
    UcharSimpleUppercaseMapping       = 16393
    UcharTitlecaseMapping             = 16394
    UcharUnicode1Name                 = 16395
    UcharUppercaseMapping             = 16396
    UcharBidiPairedBracket            = 16397
    UcharStringLimit                  = 16398
    UcharScriptExtensions             = 28672
    UcharOtherPropertyStart           = 28672
    UcharOtherPropertyLimit           = 28673
    UcharInvalidCode                  =    -1
  end
  enum UPropertyNameChoice
    UShortPropertyName       = 0
    ULongPropertyName        = 1
    UPropertyNameChoiceCount = 2
  end
  fun u_char_age = u_charAge_66(c : UChar32, version_array : UVersionInfo)
  fun u_char_digit_value = u_charDigitValue_66(c : UChar32) : Int32T
  fun u_char_direction = u_charDirection_66(c : UChar32) : UCharDirection
  fun u_char_from_name = u_charFromName_66(name_choice : UCharNameChoice, name : LibC::Char*, p_error_code : UErrorCode*) : UChar32
  fun u_char_mirror = u_charMirror_66(c : UChar32) : UChar32
  fun u_char_name = u_charName_66(code : UChar32, name_choice : UCharNameChoice, buffer : LibC::Char*, buffer_length : Int32T, p_error_code : UErrorCode*) : Int32T
  fun u_char_type = u_charType_66(c : UChar32) : Int8T
  fun u_digit = u_digit_66(ch : UChar32, radix : Int8T) : Int32T
  fun u_enum_char_names = u_enumCharNames_66(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_66(enum_range : (Void*, UChar32, UChar32, UCharCategory -> UBool), context : Void*)
  fun u_error_name = u_errorName_66(code : UErrorCode) : LibC::Char*
  fun u_fold_case = u_foldCase_66(c : UChar32, options : Uint32T) : UChar32
  fun u_for_digit = u_forDigit_66(digit : Int32T, radix : Int8T) : UChar32
  fun u_get_bidi_paired_bracket = u_getBidiPairedBracket_66(c : UChar32) : UChar32
  fun u_get_binary_property_set = u_getBinaryPropertySet_66(property : UProperty, p_error_code : UErrorCode*) : USet
  fun u_get_combining_class = u_getCombiningClass_66(c : UChar32) : Uint8T
  fun u_get_fc_nfkc_closure = u_getFC_NFKC_Closure_66(c : UChar32, dest : UChar*, dest_capacity : Int32T, p_error_code : UErrorCode*) : Int32T
  fun u_get_int_property_map = u_getIntPropertyMap_66(property : UProperty, p_error_code : UErrorCode*) : UcpMap
  fun u_get_int_property_max_value = u_getIntPropertyMaxValue_66(which : UProperty) : Int32T
  fun u_get_int_property_min_value = u_getIntPropertyMinValue_66(which : UProperty) : Int32T
  fun u_get_int_property_value = u_getIntPropertyValue_66(c : UChar32, which : UProperty) : Int32T
  fun u_get_iso_comment = u_getISOComment_66(c : UChar32, dest : LibC::Char*, dest_capacity : Int32T, p_error_code : UErrorCode*) : Int32T
  fun u_get_numeric_value = u_getNumericValue_66(c : UChar32) : LibC::Double
  fun u_get_property_enum = u_getPropertyEnum_66(alias : LibC::Char*) : UProperty
  fun u_get_property_name = u_getPropertyName_66(property : UProperty, name_choice : UPropertyNameChoice) : LibC::Char*
  fun u_get_property_value_enum = u_getPropertyValueEnum_66(property : UProperty, alias : LibC::Char*) : Int32T
  fun u_get_property_value_name = u_getPropertyValueName_66(property : UProperty, value : Int32T, name_choice : UPropertyNameChoice) : LibC::Char*
  fun u_get_unicode_version = u_getUnicodeVersion_66(version_array : UVersionInfo)
  fun u_get_version = u_getVersion_66(version_array : UVersionInfo)
  fun u_has_binary_property = u_hasBinaryProperty_66(c : UChar32, which : UProperty) : UBool
  fun u_is_id_ignorable = u_isIDIgnorable_66(c : UChar32) : UBool
  fun u_is_id_part = u_isIDPart_66(c : UChar32) : UBool
  fun u_is_id_start = u_isIDStart_66(c : UChar32) : UBool
  fun u_is_iso_control = u_isISOControl_66(c : UChar32) : UBool
  fun u_is_java_id_part = u_isJavaIDPart_66(c : UChar32) : UBool
  fun u_is_java_id_start = u_isJavaIDStart_66(c : UChar32) : UBool
  fun u_is_java_space_char = u_isJavaSpaceChar_66(c : UChar32) : UBool
  fun u_is_mirrored = u_isMirrored_66(c : UChar32) : UBool
  fun u_is_u_alphabetic = u_isUAlphabetic_66(c : UChar32) : UBool
  fun u_is_u_lowercase = u_isULowercase_66(c : UChar32) : UBool
  fun u_is_u_uppercase = u_isUUppercase_66(c : UChar32) : UBool
  fun u_is_u_white_space = u_isUWhiteSpace_66(c : UChar32) : UBool
  fun u_is_whitespace = u_isWhitespace_66(c : UChar32) : UBool
  fun u_isalnum = u_isalnum_66(c : UChar32) : UBool
  fun u_isalpha = u_isalpha_66(c : UChar32) : UBool
  fun u_isbase = u_isbase_66(c : UChar32) : UBool
  fun u_isblank = u_isblank_66(c : UChar32) : UBool
  fun u_iscntrl = u_iscntrl_66(c : UChar32) : UBool
  fun u_isdefined = u_isdefined_66(c : UChar32) : UBool
  fun u_isdigit = u_isdigit_66(c : UChar32) : UBool
  fun u_isgraph = u_isgraph_66(c : UChar32) : UBool
  fun u_islower = u_islower_66(c : UChar32) : UBool
  fun u_isprint = u_isprint_66(c : UChar32) : UBool
  fun u_ispunct = u_ispunct_66(c : UChar32) : UBool
  fun u_isspace = u_isspace_66(c : UChar32) : UBool
  fun u_istitle = u_istitle_66(c : UChar32) : UBool
  fun u_isupper = u_isupper_66(c : UChar32) : UBool
  fun u_isxdigit = u_isxdigit_66(c : UChar32) : UBool
  fun u_tolower = u_tolower_66(c : UChar32) : UChar32
  fun u_totitle = u_totitle_66(c : UChar32) : UChar32
  fun u_toupper = u_toupper_66(c : UChar32) : UChar32
  fun u_version_from_string = u_versionFromString_66(version_array : UVersionInfo, version_string : LibC::Char*)
  fun u_version_from_u_string = u_versionFromUString_66(version_array : UVersionInfo, version_string : UChar*)
  fun u_version_to_string = u_versionToString_66(version_array : UVersionInfo, version_string : LibC::Char*)
  type UEnumeration = Void*
  type USet = Void*
  type UcpMap = Void*
end

require "./ubrk.cr"
require "./ucsdet.cr"
require "./ucurr.cr"
require "./udat.cr"
