UnicodeUtilities.pas 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541
  1. {
  2. File: UnicodeUtilities.p
  3. Contains: Types, constants, prototypes for Unicode Utilities (Unicode input and text utils)
  4. Version: Technology: Mac OS 9.0
  5. Release: Universal Interfaces 3.4.2
  6. Copyright: © 1997-2002 by Apple Computer, Inc., all rights reserved.
  7. Bugs?: For bug reports, consult the following page on
  8. the World Wide Web:
  9. http://www.freepascal.org/bugs.html
  10. }
  11. {
  12. Modified for use with Free Pascal
  13. Version 200
  14. Please report any bugs to <[email protected]>
  15. }
  16. {$mode macpas}
  17. {$packenum 1}
  18. {$macro on}
  19. {$inline on}
  20. {$CALLING MWPASCAL}
  21. unit UnicodeUtilities;
  22. interface
  23. {$setc UNIVERSAL_INTERFACES_VERSION := $0342}
  24. {$setc GAP_INTERFACES_VERSION := $0200}
  25. {$ifc not defined USE_CFSTR_CONSTANT_MACROS}
  26. {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
  27. {$endc}
  28. {$ifc defined CPUPOWERPC and defined CPUI386}
  29. {$error Conflicting initial definitions for CPUPOWERPC and CPUI386}
  30. {$endc}
  31. {$ifc defined FPC_BIG_ENDIAN and defined FPC_LITTLE_ENDIAN}
  32. {$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
  33. {$endc}
  34. {$ifc not defined __ppc__ and defined CPUPOWERPC}
  35. {$setc __ppc__ := 1}
  36. {$elsec}
  37. {$setc __ppc__ := 0}
  38. {$endc}
  39. {$ifc not defined __i386__ and defined CPUI386}
  40. {$setc __i386__ := 1}
  41. {$elsec}
  42. {$setc __i386__ := 0}
  43. {$endc}
  44. {$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
  45. {$error Conflicting definitions for __ppc__ and __i386__}
  46. {$endc}
  47. {$ifc defined __ppc__ and __ppc__}
  48. {$setc TARGET_CPU_PPC := TRUE}
  49. {$setc TARGET_CPU_X86 := FALSE}
  50. {$elifc defined __i386__ and __i386__}
  51. {$setc TARGET_CPU_PPC := FALSE}
  52. {$setc TARGET_CPU_X86 := TRUE}
  53. {$elsec}
  54. {$error Neither __ppc__ nor __i386__ is defined.}
  55. {$endc}
  56. {$setc TARGET_CPU_PPC_64 := FALSE}
  57. {$ifc defined FPC_BIG_ENDIAN}
  58. {$setc TARGET_RT_BIG_ENDIAN := TRUE}
  59. {$setc TARGET_RT_LITTLE_ENDIAN := FALSE}
  60. {$elifc defined FPC_LITTLE_ENDIAN}
  61. {$setc TARGET_RT_BIG_ENDIAN := FALSE}
  62. {$setc TARGET_RT_LITTLE_ENDIAN := TRUE}
  63. {$elsec}
  64. {$error Neither FPC_BIG_ENDIAN nor FPC_LITTLE_ENDIAN are defined.}
  65. {$endc}
  66. {$setc ACCESSOR_CALLS_ARE_FUNCTIONS := TRUE}
  67. {$setc CALL_NOT_IN_CARBON := FALSE}
  68. {$setc OLDROUTINENAMES := FALSE}
  69. {$setc OPAQUE_TOOLBOX_STRUCTS := TRUE}
  70. {$setc OPAQUE_UPP_TYPES := TRUE}
  71. {$setc OTCARBONAPPLICATION := TRUE}
  72. {$setc OTKERNEL := FALSE}
  73. {$setc PM_USE_SESSION_APIS := TRUE}
  74. {$setc TARGET_API_MAC_CARBON := TRUE}
  75. {$setc TARGET_API_MAC_OS8 := FALSE}
  76. {$setc TARGET_API_MAC_OSX := TRUE}
  77. {$setc TARGET_CARBON := TRUE}
  78. {$setc TARGET_CPU_68K := FALSE}
  79. {$setc TARGET_CPU_MIPS := FALSE}
  80. {$setc TARGET_CPU_SPARC := FALSE}
  81. {$setc TARGET_OS_MAC := TRUE}
  82. {$setc TARGET_OS_UNIX := FALSE}
  83. {$setc TARGET_OS_WIN32 := FALSE}
  84. {$setc TARGET_RT_MAC_68881 := FALSE}
  85. {$setc TARGET_RT_MAC_CFM := FALSE}
  86. {$setc TARGET_RT_MAC_MACHO := TRUE}
  87. {$setc TYPED_FUNCTION_POINTERS := TRUE}
  88. {$setc TYPE_BOOL := FALSE}
  89. {$setc TYPE_EXTENDED := FALSE}
  90. {$setc TYPE_LONGLONG := TRUE}
  91. uses MacTypes,MacLocales,TextCommon;
  92. {$ALIGN MAC68K}
  93. {
  94. -------------------------------------------------------------------------------------------------
  95. CONSTANTS & DATA STRUCTURES for UCKeyTranslate & UCKeyboardLayout ('uchr' resource)
  96. -------------------------------------------------------------------------------------------------
  97. }
  98. {
  99. -------------------------------------------------------------------------------------------------
  100. UCKeyOutput & related stuff
  101. The interpretation of UCKeyOutput depends on bits 15-14.
  102. If they are 01, then bits 0-13 are an index in UCKeyStateRecordsIndex (resource-wide list).
  103. If they are 10, then bits 0-13 are an index in UCKeySequenceDataIndex (resource-wide list),
  104. or if UCKeySequenceDataIndex is not present or the index is beyond the end of the list,
  105. then bits 0-15 are a single Unicode character.
  106. Otherwise, bits 0-15 are a single Unicode character; a value of 0xFFFE-0xFFFF means no character
  107. output.
  108. UCKeyCharSeq is similar, but does not support indices in UCKeyStateRecordsIndex. For bits 15-14:
  109. If they are 10, then bits 0-13 are an index in UCKeySequenceDataIndex (resource-wide list),
  110. or if UCKeySequenceDataIndex is not present or the index is beyond the end of the list,
  111. then bits 0-15 are a single Unicode character.
  112. Otherwise, bits 0-15 are a single Unicode character; a value of 0xFFFE-0xFFFF means no character
  113. output.
  114. -------------------------------------------------------------------------------------------------
  115. }
  116. type
  117. UCKeyOutput = UInt16;
  118. UCKeyCharSeq = UInt16;
  119. const
  120. kUCKeyOutputStateIndexMask = $4000;
  121. kUCKeyOutputSequenceIndexMask = $8000;
  122. kUCKeyOutputTestForIndexMask = $C000; { test bits 14-15 }
  123. kUCKeyOutputGetIndexMask = $3FFF; { get bits 0-13 }
  124. {
  125. -------------------------------------------------------------------------------------------------
  126. UCKeyStateRecord & related stuff
  127. The UCKeyStateRecord information is used as follows. If the current state is zero,
  128. output stateZeroCharData and set the state to stateZeroNextState. If the current state
  129. is non-zero and there is an entry for it in stateEntryData, then output the corresponding
  130. charData and set the state to nextState. Otherwise, output the state terminator from
  131. UCKeyStateTerminators for the current state (or nothing if there is no UCKeyStateTerminators
  132. table or it has no entry for the current state), then output stateZeroCharData and set the
  133. state to stateZeroNextState.
  134. -------------------------------------------------------------------------------------------------
  135. }
  136. type
  137. UCKeyStateRecordPtr = ^UCKeyStateRecord;
  138. UCKeyStateRecord = record
  139. stateZeroCharData: UCKeyCharSeq;
  140. stateZeroNextState: UInt16;
  141. stateEntryCount: UInt16;
  142. stateEntryFormat: UInt16;
  143. { This is followed by an array of stateEntryCount elements }
  144. { in the specified format. Here we just show a dummy array. }
  145. stateEntryData: array [0..0] of UInt32;
  146. end;
  147. {
  148. Here are the codes for entry formats currently defined.
  149. Each entry maps from curState to charData and nextState.
  150. }
  151. const
  152. kUCKeyStateEntryTerminalFormat = $0001;
  153. kUCKeyStateEntryRangeFormat = $0002;
  154. {
  155. For UCKeyStateEntryTerminal -
  156. nextState is always 0, so we don't have a field for it
  157. }
  158. type
  159. UCKeyStateEntryTerminalPtr = ^UCKeyStateEntryTerminal;
  160. UCKeyStateEntryTerminal = record
  161. curState: UInt16;
  162. charData: UCKeyCharSeq;
  163. end;
  164. {
  165. For UCKeyStateEntryRange -
  166. If curState >= curStateStart and curState <= curStateStart+curStateRange,
  167. then it matches the entry, and we transform charData and nextState as follows:
  168. If charData < 0xFFFE, then charData += (curState-curStateStart)*deltaMultiplier
  169. If nextState != 0, then nextState += (curState-curStateStart)*deltaMultiplier
  170. }
  171. UCKeyStateEntryRangePtr = ^UCKeyStateEntryRange;
  172. UCKeyStateEntryRange = record
  173. curStateStart: UInt16;
  174. curStateRange: SInt8;
  175. deltaMultiplier: SInt8;
  176. charData: UCKeyCharSeq;
  177. nextState: UInt16;
  178. end;
  179. {
  180. -------------------------------------------------------------------------------------------------
  181. UCKeyboardLayout & related stuff
  182. The UCKeyboardLayout struct given here is only for the resource header. It specifies
  183. offsets to the various subtables which each have their own structs, given below.
  184. The keyboardTypeHeadList array selects table offsets that depend on keyboardType. The
  185. first entry in keyboardTypeHeadList is the default entry, which will be used if the
  186. keyboardType passed to UCKeyTranslate does not match any other entry - i.e. does not fall
  187. within the range keyboardTypeFirst..keyboardTypeLast for some entry. The first entry
  188. should have keyboardTypeFirst = keyboardTypeLast = 0.
  189. -------------------------------------------------------------------------------------------------
  190. }
  191. UCKeyboardTypeHeaderPtr = ^UCKeyboardTypeHeader;
  192. UCKeyboardTypeHeader = record
  193. keyboardTypeFirst: UInt32; { first keyboardType in this entry }
  194. keyboardTypeLast: UInt32; { last keyboardType in this entry }
  195. keyModifiersToTableNumOffset: ByteOffset; { required }
  196. keyToCharTableIndexOffset: ByteOffset; { required }
  197. keyStateRecordsIndexOffset: ByteOffset; { 0 => no table }
  198. keyStateTerminatorsOffset: ByteOffset; { 0 => no table }
  199. keySequenceDataIndexOffset: ByteOffset; { 0 => no table }
  200. end;
  201. UCKeyboardLayoutPtr = ^UCKeyboardLayout;
  202. UCKeyboardLayout = record
  203. { header only; other tables accessed via offsets }
  204. keyLayoutHeaderFormat: UInt16; { =kUCKeyLayoutHeaderFormat }
  205. keyLayoutDataVersion: UInt16; { 0x0100 = 1.0, 0x0110 = 1.1, etc. }
  206. keyLayoutFeatureInfoOffset: ByteOffset; { may be 0 }
  207. keyboardTypeCount: ItemCount; { Dimension for keyboardTypeHeadList[] }
  208. keyboardTypeList: array [0..0] of UCKeyboardTypeHeader;
  209. end;
  210. { ------------------------------------------------------------------------------------------------- }
  211. UCKeyLayoutFeatureInfoPtr = ^UCKeyLayoutFeatureInfo;
  212. UCKeyLayoutFeatureInfo = record
  213. keyLayoutFeatureInfoFormat: UInt16; { =kUCKeyLayoutFeatureInfoFormat }
  214. reserved: UInt16;
  215. maxOutputStringLength: UniCharCount; { longest possible output string }
  216. end;
  217. { ------------------------------------------------------------------------------------------------- }
  218. UCKeyModifiersToTableNumPtr = ^UCKeyModifiersToTableNum;
  219. UCKeyModifiersToTableNum = record
  220. keyModifiersToTableNumFormat: UInt16; { =kUCKeyModifiersToTableNumFormat }
  221. defaultTableNum: UInt16; { For modifier combos not in tableNum[] }
  222. modifiersCount: ItemCount; { Dimension for tableNum[] }
  223. tableNum: SInt8;
  224. { Then there is padding to a 4-byte boundary with bytes containing 0, if necessary. }
  225. end;
  226. { ------------------------------------------------------------------------------------------------- }
  227. UCKeyToCharTableIndexPtr = ^UCKeyToCharTableIndex;
  228. UCKeyToCharTableIndex = record
  229. keyToCharTableIndexFormat: UInt16; { =kUCKeyToCharTableIndexFormat }
  230. keyToCharTableSize: UInt16; { Max keyCode (128 for ADB keyboards) }
  231. keyToCharTableCount: ItemCount; { Dimension for keyToCharTableOffsets[] (usually 6 to 12 tables) }
  232. keyToCharTableOffsets: array [0..0] of ByteOffset;
  233. { Each offset in keyToCharTableOffsets is from the beginning of the resource to a }
  234. { table as follows: }
  235. { UCKeyOutput keyToCharData[keyToCharTableSize]; }
  236. { These tables follow the UCKeyToCharTableIndex. }
  237. { Then there is padding to a 4-byte boundary with bytes containing 0, if necessary. }
  238. end;
  239. { ------------------------------------------------------------------------------------------------- }
  240. UCKeyStateRecordsIndexPtr = ^UCKeyStateRecordsIndex;
  241. UCKeyStateRecordsIndex = record
  242. keyStateRecordsIndexFormat: UInt16; { =kUCKeyStateRecordsIndexFormat }
  243. keyStateRecordCount: UInt16; { Dimension for keyStateRecordOffsets[] }
  244. keyStateRecordOffsets: array [0..0] of ByteOffset;
  245. { Each offset in keyStateRecordOffsets is from the beginning of the resource to a }
  246. { UCKeyStateRecord. These UCKeyStateRecords follow the keyStateRecordOffsets[] array. }
  247. { Then there is padding to a 4-byte boundary with bytes containing 0, if necessary. }
  248. end;
  249. { ------------------------------------------------------------------------------------------------- }
  250. UCKeyStateTerminatorsPtr = ^UCKeyStateTerminators;
  251. UCKeyStateTerminators = record
  252. keyStateTerminatorsFormat: UInt16; { =kUCKeyStateTerminatorsFormat }
  253. keyStateTerminatorCount: UInt16; { Dimension for keyStateTerminators[] (# of nonzero states) }
  254. keyStateTerminators: array [0..0] of UCKeyCharSeq;
  255. { Note: keyStateTerminators[0] is terminator for state 1, etc. }
  256. { Then there is padding to a 4-byte boundary with bytes containing 0, if necessary. }
  257. end;
  258. { ------------------------------------------------------------------------------------------------- }
  259. UCKeySequenceDataIndexPtr = ^UCKeySequenceDataIndex;
  260. UCKeySequenceDataIndex = record
  261. keySequenceDataIndexFormat: UInt16; { =kUCKeySequenceDataIndexFormat }
  262. charSequenceCount: UInt16; { Dimension of charSequenceOffsets[] is charSequenceCount+1 }
  263. charSequenceOffsets: array [0..0] of UInt16;
  264. { Each offset in charSequenceOffsets is in bytes, from the beginning of }
  265. { UCKeySequenceDataIndex to a sequence of UniChars; the next offset indicates the }
  266. { end of the sequence. The UniChar sequences follow the UCKeySequenceDataIndex. }
  267. { Then there is padding to a 4-byte boundary with bytes containing 0, if necessary. }
  268. end;
  269. { ------------------------------------------------------------------------------------------------- }
  270. { Current format codes for the various tables (bits 12-15 indicate which table) }
  271. const
  272. kUCKeyLayoutHeaderFormat = $1002;
  273. kUCKeyLayoutFeatureInfoFormat = $2001;
  274. kUCKeyModifiersToTableNumFormat = $3001;
  275. kUCKeyToCharTableIndexFormat = $4001;
  276. kUCKeyStateRecordsIndexFormat = $5001;
  277. kUCKeyStateTerminatorsFormat = $6001;
  278. kUCKeySequenceDataIndexFormat = $7001;
  279. {
  280. -------------------------------------------------------------------------------------------------
  281. Constants for keyAction parameter in UCKeyTranslate()
  282. -------------------------------------------------------------------------------------------------
  283. }
  284. kUCKeyActionDown = 0; { key is going down }
  285. kUCKeyActionUp = 1; { key is going up }
  286. kUCKeyActionAutoKey = 2; { auto-key down }
  287. kUCKeyActionDisplay = 3; { get information for key display (as in Key Caps) }
  288. {
  289. -------------------------------------------------------------------------------------------------
  290. Bit assignments & masks for keyTranslateOptions parameter in UCKeyTranslate()
  291. -------------------------------------------------------------------------------------------------
  292. }
  293. kUCKeyTranslateNoDeadKeysBit = 0; { Prevents setting any new dead-key states }
  294. kUCKeyTranslateNoDeadKeysMask = $00000001;
  295. {
  296. -------------------------------------------------------------------------------------------------
  297. CONSTANTS & DATA STRUCTURES for Unicode Collation
  298. -------------------------------------------------------------------------------------------------
  299. }
  300. { constant for LocaleOperationClass }
  301. kUnicodeCollationClass = $75636F6C (* 'ucol' *);
  302. type
  303. CollatorRef = ^SInt32; { an opaque 32-bit type }
  304. CollatorRefPtr = ^CollatorRef; { when a var xx:CollatorRef parameter can be nil, it is changed to xx: CollatorRefPtr }
  305. UCCollateOptions = UInt32;
  306. const
  307. { Sensitivity options }
  308. kUCCollateComposeInsensitiveMask = $00000002;
  309. kUCCollateWidthInsensitiveMask = $00000004;
  310. kUCCollateCaseInsensitiveMask = $00000008;
  311. kUCCollateDiacritInsensitiveMask = $00000010; { Other general options }
  312. kUCCollatePunctuationSignificantMask = $00008000; { Number-handling options }
  313. kUCCollateDigitsOverrideMask = $00010000;
  314. kUCCollateDigitsAsNumberMask = $00020000;
  315. kUCCollateStandardOptions = $00000006;
  316. {
  317. Special values to specify various invariant orders for UCCompareTextNoLocale.
  318. These values use the high 8 bits of UCCollateOptions.
  319. }
  320. kUCCollateTypeHFSExtended = 1;
  321. { These constants are used for masking and shifting the invariant order type. }
  322. kUCCollateTypeSourceMask = $000000FF;
  323. kUCCollateTypeShiftBits = 24;
  324. kUCCollateTypeMask = $FF000000;
  325. type
  326. UCCollationValue = UInt32;
  327. UCCollationValuePtr = ^UCCollationValue;
  328. {
  329. -------------------------------------------------------------------------------------------------
  330. CONSTANTS & DATA STRUCTURES for Unicode TextBreak
  331. -------------------------------------------------------------------------------------------------
  332. }
  333. { constant for LocaleOperationClass }
  334. const
  335. kUnicodeTextBreakClass = $7562726B (* 'ubrk' *);
  336. type
  337. TextBreakLocatorRef = ^SInt32; { an opaque 32-bit type }
  338. TextBreakLocatorRefPtr = ^TextBreakLocatorRef; { when a var xx:TextBreakLocatorRef parameter can be nil, it is changed to xx: TextBreakLocatorRefPtr }
  339. UCTextBreakType = UInt32;
  340. const
  341. kUCTextBreakCharMask = $00000001;
  342. kUCTextBreakClusterMask = $00000004;
  343. kUCTextBreakWordMask = $00000010;
  344. kUCTextBreakLineMask = $00000040;
  345. type
  346. UCTextBreakOptions = UInt32;
  347. const
  348. kUCTextBreakLeadingEdgeMask = $00000001;
  349. kUCTextBreakGoBackwardsMask = $00000002;
  350. kUCTextBreakIterateMask = $00000004;
  351. {
  352. -------------------------------------------------------------------------------------------------
  353. function PROTOTYPES
  354. -------------------------------------------------------------------------------------------------
  355. }
  356. {
  357. * UCKeyTranslate()
  358. *
  359. * Availability:
  360. * Non-Carbon CFM: in UnicodeUtilitiesCoreLib 8.5 and later
  361. * CarbonLib: in CarbonLib 1.0 and later
  362. * Mac OS X: in version 10.0 and later
  363. }
  364. function UCKeyTranslate(const (*var*) keyLayoutPtr: UCKeyboardLayout; virtualKeyCode: UInt16; keyAction: UInt16; modifierKeyState: UInt32; keyboardType: UInt32; keyTranslateOptions: OptionBits; var deadKeyState: UInt32; maxStringLength: UniCharCount; var actualStringLength: UniCharCount; unicodeString: UniCharPtr): OSStatus; external name '_UCKeyTranslate';
  365. { Standard collation functions }
  366. {
  367. * UCCreateCollator()
  368. *
  369. * Availability:
  370. * Non-Carbon CFM: in UnicodeUtilitiesLib 8.6 and later
  371. * CarbonLib: in CarbonLib 1.0 and later
  372. * Mac OS X: in version 10.0 and later
  373. }
  374. function UCCreateCollator(locale: LocaleRef; opVariant: LocaleOperationVariant; options: UCCollateOptions; var collatorRef_: CollatorRef): OSStatus; external name '_UCCreateCollator';
  375. {
  376. * UCGetCollationKey()
  377. *
  378. * Availability:
  379. * Non-Carbon CFM: in UnicodeUtilitiesLib 8.6 and later
  380. * CarbonLib: in CarbonLib 1.0 and later
  381. * Mac OS X: in version 10.0 and later
  382. }
  383. function UCGetCollationKey(collatorRef_: CollatorRef; textPtr: ConstUniCharPtr; textLength: UniCharCount; maxKeySize: ItemCount; var actualKeySize: ItemCount; collationKey: UCCollationValuePtr): OSStatus; external name '_UCGetCollationKey';
  384. {
  385. * UCCompareCollationKeys()
  386. *
  387. * Availability:
  388. * Non-Carbon CFM: in UnicodeUtilitiesCoreLib 8.6 and later
  389. * CarbonLib: in CarbonLib 1.0 and later
  390. * Mac OS X: in version 10.0 and later
  391. }
  392. function UCCompareCollationKeys(key1Ptr: UCCollationValuePtr; key1Length: ItemCount; key2Ptr: UCCollationValuePtr; key2Length: ItemCount; var equivalent: boolean; var order: SInt32): OSStatus; external name '_UCCompareCollationKeys';
  393. {
  394. * UCCompareText()
  395. *
  396. * Availability:
  397. * Non-Carbon CFM: in UnicodeUtilitiesLib 8.6 and later
  398. * CarbonLib: in CarbonLib 1.0 and later
  399. * Mac OS X: in version 10.0 and later
  400. }
  401. function UCCompareText(collatorRef_: CollatorRef; text1Ptr: ConstUniCharPtr; text1Length: UniCharCount; text2Ptr: ConstUniCharPtr; text2Length: UniCharCount; var equivalent: boolean; var order: SInt32): OSStatus; external name '_UCCompareText';
  402. {
  403. * UCDisposeCollator()
  404. *
  405. * Availability:
  406. * Non-Carbon CFM: in UnicodeUtilitiesLib 8.6 and later
  407. * CarbonLib: in CarbonLib 1.0 and later
  408. * Mac OS X: in version 10.0 and later
  409. }
  410. function UCDisposeCollator(var collatorRef_: CollatorRef): OSStatus; external name '_UCDisposeCollator';
  411. { Simple collation using default locale }
  412. {
  413. * UCCompareTextDefault()
  414. *
  415. * Availability:
  416. * Non-Carbon CFM: in UnicodeUtilitiesLib 8.6 and later
  417. * CarbonLib: in CarbonLib 1.0 and later
  418. * Mac OS X: in version 10.0 and later
  419. }
  420. function UCCompareTextDefault(options: UCCollateOptions; text1Ptr: ConstUniCharPtr; text1Length: UniCharCount; text2Ptr: ConstUniCharPtr; text2Length: UniCharCount; var equivalent: boolean; var order: SInt32): OSStatus; external name '_UCCompareTextDefault';
  421. { Simple locale-independent collation }
  422. {
  423. * UCCompareTextNoLocale()
  424. *
  425. * Availability:
  426. * Non-Carbon CFM: in UnicodeUtilitiesCoreLib 8.6 and later
  427. * CarbonLib: in CarbonLib 1.0 and later
  428. * Mac OS X: in version 10.0 and later
  429. }
  430. function UCCompareTextNoLocale(options: UCCollateOptions; text1Ptr: ConstUniCharPtr; text1Length: UniCharCount; text2Ptr: ConstUniCharPtr; text2Length: UniCharCount; var equivalent: boolean; var order: SInt32): OSStatus; external name '_UCCompareTextNoLocale';
  431. { Standard text break (text boundary) functions }
  432. {
  433. * UCCreateTextBreakLocator()
  434. *
  435. * Availability:
  436. * Non-Carbon CFM: in UnicodeUtilitiesLib 9.0 and later
  437. * CarbonLib: in CarbonLib 1.0 and later
  438. * Mac OS X: in version 10.0 and later
  439. }
  440. function UCCreateTextBreakLocator(locale: LocaleRef; opVariant: LocaleOperationVariant; breakTypes: UCTextBreakType; var breakRef: TextBreakLocatorRef): OSStatus; external name '_UCCreateTextBreakLocator';
  441. {
  442. * UCFindTextBreak()
  443. *
  444. * Availability:
  445. * Non-Carbon CFM: in UnicodeUtilitiesLib 9.0 and later
  446. * CarbonLib: in CarbonLib 1.0 and later
  447. * Mac OS X: in version 10.0 and later
  448. }
  449. function UCFindTextBreak(breakRef: TextBreakLocatorRef; breakType: UCTextBreakType; options: UCTextBreakOptions; textPtr: ConstUniCharPtr; textLength: UniCharCount; startOffset: UniCharArrayOffset; var breakOffset: UniCharArrayOffset): OSStatus; external name '_UCFindTextBreak';
  450. {
  451. * UCDisposeTextBreakLocator()
  452. *
  453. * Availability:
  454. * Non-Carbon CFM: in UnicodeUtilitiesLib 9.0 and later
  455. * CarbonLib: in CarbonLib 1.0 and later
  456. * Mac OS X: in version 10.0 and later
  457. }
  458. function UCDisposeTextBreakLocator(var breakRef: TextBreakLocatorRef): OSStatus; external name '_UCDisposeTextBreakLocator';
  459. {$ALIGN MAC68K}
  460. end.