PLStringFuncs.pas 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775
  1. {
  2. File: CarbonCore/PLStringFuncs.h
  3. Contains: Pascal string manipulation routines that parallel ANSI C string.h
  4. The contents of this header file are deprecated.
  5. Copyright: © 1999-2011 by Apple Inc. All rights reserved.
  6. }
  7. {
  8. Modified for use with Free Pascal
  9. Version 308
  10. Please report any bugs to <[email protected]>
  11. }
  12. {$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
  13. {$mode macpas}
  14. {$modeswitch cblocks}
  15. {$packenum 1}
  16. {$macro on}
  17. {$inline on}
  18. {$calling mwpascal}
  19. unit PLStringFuncs;
  20. interface
  21. {$setc UNIVERSAL_INTERFACES_VERSION := $0400}
  22. {$setc GAP_INTERFACES_VERSION := $0308}
  23. {$ifc not defined USE_CFSTR_CONSTANT_MACROS}
  24. {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
  25. {$endc}
  26. {$ifc defined CPUPOWERPC and defined CPUI386}
  27. {$error Conflicting initial definitions for CPUPOWERPC and CPUI386}
  28. {$endc}
  29. {$ifc defined FPC_BIG_ENDIAN and defined FPC_LITTLE_ENDIAN}
  30. {$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
  31. {$endc}
  32. {$ifc not defined __ppc__ and defined CPUPOWERPC32}
  33. {$setc __ppc__ := 1}
  34. {$elsec}
  35. {$setc __ppc__ := 0}
  36. {$endc}
  37. {$ifc not defined __ppc64__ and defined CPUPOWERPC64}
  38. {$setc __ppc64__ := 1}
  39. {$elsec}
  40. {$setc __ppc64__ := 0}
  41. {$endc}
  42. {$ifc not defined __i386__ and defined CPUI386}
  43. {$setc __i386__ := 1}
  44. {$elsec}
  45. {$setc __i386__ := 0}
  46. {$endc}
  47. {$ifc not defined __x86_64__ and defined CPUX86_64}
  48. {$setc __x86_64__ := 1}
  49. {$elsec}
  50. {$setc __x86_64__ := 0}
  51. {$endc}
  52. {$ifc not defined __arm__ and defined CPUARM}
  53. {$setc __arm__ := 1}
  54. {$elsec}
  55. {$setc __arm__ := 0}
  56. {$endc}
  57. {$ifc not defined __arm64__ and defined CPUAARCH64}
  58. {$setc __arm64__ := 1}
  59. {$elsec}
  60. {$setc __arm64__ := 0}
  61. {$endc}
  62. {$ifc defined cpu64}
  63. {$setc __LP64__ := 1}
  64. {$elsec}
  65. {$setc __LP64__ := 0}
  66. {$endc}
  67. {$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
  68. {$error Conflicting definitions for __ppc__ and __i386__}
  69. {$endc}
  70. {$ifc defined __ppc__ and __ppc__}
  71. {$setc TARGET_CPU_PPC := TRUE}
  72. {$setc TARGET_CPU_PPC64 := FALSE}
  73. {$setc TARGET_CPU_X86 := FALSE}
  74. {$setc TARGET_CPU_X86_64 := FALSE}
  75. {$setc TARGET_CPU_ARM := FALSE}
  76. {$setc TARGET_CPU_ARM64 := FALSE}
  77. {$setc TARGET_OS_MAC := TRUE}
  78. {$setc TARGET_OS_IPHONE := FALSE}
  79. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  80. {$setc TARGET_OS_EMBEDDED := FALSE}
  81. {$elifc defined __ppc64__ and __ppc64__}
  82. {$setc TARGET_CPU_PPC := FALSE}
  83. {$setc TARGET_CPU_PPC64 := TRUE}
  84. {$setc TARGET_CPU_X86 := FALSE}
  85. {$setc TARGET_CPU_X86_64 := FALSE}
  86. {$setc TARGET_CPU_ARM := FALSE}
  87. {$setc TARGET_CPU_ARM64 := FALSE}
  88. {$setc TARGET_OS_MAC := TRUE}
  89. {$setc TARGET_OS_IPHONE := FALSE}
  90. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  91. {$setc TARGET_OS_EMBEDDED := FALSE}
  92. {$elifc defined __i386__ and __i386__}
  93. {$setc TARGET_CPU_PPC := FALSE}
  94. {$setc TARGET_CPU_PPC64 := FALSE}
  95. {$setc TARGET_CPU_X86 := TRUE}
  96. {$setc TARGET_CPU_X86_64 := FALSE}
  97. {$setc TARGET_CPU_ARM := FALSE}
  98. {$setc TARGET_CPU_ARM64 := FALSE}
  99. {$ifc defined iphonesim}
  100. {$setc TARGET_OS_MAC := FALSE}
  101. {$setc TARGET_OS_IPHONE := TRUE}
  102. {$setc TARGET_IPHONE_SIMULATOR := TRUE}
  103. {$elsec}
  104. {$setc TARGET_OS_MAC := TRUE}
  105. {$setc TARGET_OS_IPHONE := FALSE}
  106. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  107. {$endc}
  108. {$setc TARGET_OS_EMBEDDED := FALSE}
  109. {$elifc defined __x86_64__ and __x86_64__}
  110. {$setc TARGET_CPU_PPC := FALSE}
  111. {$setc TARGET_CPU_PPC64 := FALSE}
  112. {$setc TARGET_CPU_X86 := FALSE}
  113. {$setc TARGET_CPU_X86_64 := TRUE}
  114. {$setc TARGET_CPU_ARM := FALSE}
  115. {$setc TARGET_CPU_ARM64 := FALSE}
  116. {$ifc defined iphonesim}
  117. {$setc TARGET_OS_MAC := FALSE}
  118. {$setc TARGET_OS_IPHONE := TRUE}
  119. {$setc TARGET_IPHONE_SIMULATOR := TRUE}
  120. {$elsec}
  121. {$setc TARGET_OS_MAC := TRUE}
  122. {$setc TARGET_OS_IPHONE := FALSE}
  123. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  124. {$endc}
  125. {$setc TARGET_OS_EMBEDDED := FALSE}
  126. {$elifc defined __arm__ and __arm__}
  127. {$setc TARGET_CPU_PPC := FALSE}
  128. {$setc TARGET_CPU_PPC64 := FALSE}
  129. {$setc TARGET_CPU_X86 := FALSE}
  130. {$setc TARGET_CPU_X86_64 := FALSE}
  131. {$setc TARGET_CPU_ARM := TRUE}
  132. {$setc TARGET_CPU_ARM64 := FALSE}
  133. {$setc TARGET_OS_MAC := FALSE}
  134. {$setc TARGET_OS_IPHONE := TRUE}
  135. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  136. {$setc TARGET_OS_EMBEDDED := TRUE}
  137. {$elifc defined __arm64__ and __arm64__}
  138. {$setc TARGET_CPU_PPC := FALSE}
  139. {$setc TARGET_CPU_PPC64 := FALSE}
  140. {$setc TARGET_CPU_X86 := FALSE}
  141. {$setc TARGET_CPU_X86_64 := FALSE}
  142. {$setc TARGET_CPU_ARM := FALSE}
  143. {$setc TARGET_CPU_ARM64 := TRUE}
  144. {$ifc defined ios}
  145. {$setc TARGET_OS_MAC := FALSE}
  146. {$setc TARGET_OS_IPHONE := TRUE}
  147. {$setc TARGET_OS_EMBEDDED := TRUE}
  148. {$elsec}
  149. {$setc TARGET_OS_MAC := TRUE}
  150. {$setc TARGET_OS_IPHONE := FALSE}
  151. {$setc TARGET_OS_EMBEDDED := FALSE}
  152. {$endc}
  153. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  154. {$elsec}
  155. {$error __ppc__ nor __ppc64__ nor __i386__ nor __x86_64__ nor __arm__ nor __arm64__ is defined.}
  156. {$endc}
  157. {$ifc defined __LP64__ and __LP64__ }
  158. {$setc TARGET_CPU_64 := TRUE}
  159. {$elsec}
  160. {$setc TARGET_CPU_64 := FALSE}
  161. {$endc}
  162. {$ifc defined FPC_BIG_ENDIAN}
  163. {$setc TARGET_RT_BIG_ENDIAN := TRUE}
  164. {$setc TARGET_RT_LITTLE_ENDIAN := FALSE}
  165. {$elifc defined FPC_LITTLE_ENDIAN}
  166. {$setc TARGET_RT_BIG_ENDIAN := FALSE}
  167. {$setc TARGET_RT_LITTLE_ENDIAN := TRUE}
  168. {$elsec}
  169. {$error Neither FPC_BIG_ENDIAN nor FPC_LITTLE_ENDIAN are defined.}
  170. {$endc}
  171. {$setc ACCESSOR_CALLS_ARE_FUNCTIONS := TRUE}
  172. {$setc CALL_NOT_IN_CARBON := FALSE}
  173. {$setc OLDROUTINENAMES := FALSE}
  174. {$setc OPAQUE_TOOLBOX_STRUCTS := TRUE}
  175. {$setc OPAQUE_UPP_TYPES := TRUE}
  176. {$setc OTCARBONAPPLICATION := TRUE}
  177. {$setc OTKERNEL := FALSE}
  178. {$setc PM_USE_SESSION_APIS := TRUE}
  179. {$setc TARGET_API_MAC_CARBON := TRUE}
  180. {$setc TARGET_API_MAC_OS8 := FALSE}
  181. {$setc TARGET_API_MAC_OSX := TRUE}
  182. {$setc TARGET_CARBON := TRUE}
  183. {$setc TARGET_CPU_68K := FALSE}
  184. {$setc TARGET_CPU_MIPS := FALSE}
  185. {$setc TARGET_CPU_SPARC := FALSE}
  186. {$setc TARGET_OS_UNIX := FALSE}
  187. {$setc TARGET_OS_WIN32 := FALSE}
  188. {$setc TARGET_RT_MAC_68881 := FALSE}
  189. {$setc TARGET_RT_MAC_CFM := FALSE}
  190. {$setc TARGET_RT_MAC_MACHO := TRUE}
  191. {$setc TYPED_FUNCTION_POINTERS := TRUE}
  192. {$setc TYPE_BOOL := FALSE}
  193. {$setc TYPE_EXTENDED := FALSE}
  194. {$setc TYPE_LONGLONG := TRUE}
  195. uses MacTypes;
  196. {$endc} {not MACOSALLINCLUDE}
  197. {$ifc TARGET_OS_MAC}
  198. {
  199. * PLstrcmp() *** DEPRECATED ***
  200. *
  201. * Deprecated:
  202. * use CFString instead.
  203. *
  204. * Summary:
  205. * Compare two pascal strings
  206. *
  207. * Discussion:
  208. * This function compares two pascal strings, and returns a value <
  209. * 0 if the first string is lexicographically less than the second
  210. * string, or 0 if the two strings are identical, or a value > 0 if
  211. * the first string is lexicographically greater than the second.
  212. * This function should be deprecated since pascal strings are
  213. * obsolete on MacOSX and CFString should be used instead.
  214. *
  215. * Mac OS X threading:
  216. * Thread safe
  217. * Thread safe provided no other thread is modifying str1 or str2.
  218. *
  219. * Parameters:
  220. *
  221. * str1:
  222. * the first pascal string
  223. *
  224. * str2:
  225. * the second pascal string
  226. *
  227. * Result:
  228. * This function returns an integer greater than, equal to, or less
  229. * than 0, according as the string str1 is greater than, equal to,
  230. * or less than the string str2. The comparison is done using
  231. * unsigned characters, so that `\200' is greater than `\0'.
  232. *
  233. * Availability:
  234. * Mac OS X: in version 10.0 and later in CoreServices.framework but deprecated in 10.4
  235. * CarbonLib: in CarbonLib 1.0 and later
  236. * Non-Carbon CFM: not available
  237. }
  238. function PLstrcmp( const (*var*) str1: Str255; const (*var*) str2: Str255 ): SInt16; external name '_PLstrcmp';
  239. (* __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_4, __IPHONE_NA, __IPHONE_NA) *)
  240. {
  241. * PLstrncmp() *** DEPRECATED ***
  242. *
  243. * Deprecated:
  244. * use CFString instead.
  245. *
  246. * Summary:
  247. * Compare two pascal strings
  248. *
  249. * Discussion:
  250. * This function compares two pascal strings, and returns a value <
  251. * 0 if the first string is lexicographically less than the second
  252. * string, or 0 if the two strings are identical, or a value > 0 if
  253. * the first string is lexicographically greater than the second.
  254. * This function compares not more than num characters of either
  255. * string, even if their lengths are greater than num. Two strings
  256. * whose first num characters are identical will return 0 when
  257. * compared. This function should be deprecated since pascal strings
  258. * are obsolete on MacOSX and CFString should be used instead.
  259. *
  260. * Mac OS X threading:
  261. * Thread safe
  262. * Thread safe provided no other thread is modifying str1 or str2.
  263. *
  264. * Parameters:
  265. *
  266. * str1:
  267. * the first pascal string
  268. *
  269. * str2:
  270. * the second pascal string
  271. *
  272. * num:
  273. * the maximum number of characters to compare
  274. *
  275. * Result:
  276. * This function returns an integer greater than, equal to, or less
  277. * than 0, according as the string str1 is greater than, equal to,
  278. * or less than the string str2. The comparison is done using
  279. * unsigned characters, so that `\200' is greater than `\0'.
  280. *
  281. * Availability:
  282. * Mac OS X: in version 10.0 and later in CoreServices.framework but deprecated in 10.4
  283. * CarbonLib: in CarbonLib 1.0 and later
  284. * Non-Carbon CFM: not available
  285. }
  286. function PLstrncmp( const (*var*) str1: Str255; const (*var*) str2: Str255; num: SInt16 ): SInt16; external name '_PLstrncmp';
  287. (* __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_4, __IPHONE_NA, __IPHONE_NA) *)
  288. {
  289. * PLstrcpy() *** DEPRECATED ***
  290. *
  291. * Deprecated:
  292. * use CFString instead.
  293. *
  294. * Summary:
  295. * Copy a pascal string
  296. *
  297. * Discussion:
  298. * This function copies the string source to dest (including the
  299. * initial length byte ). The caller must ensure that neither source
  300. * or dest are NULL, and that dest is large enough to hold the
  301. * entire contents of source. This function should be deprecated
  302. * since pascal strings are obsolete on MacOSX and CFString should
  303. * be used instead.
  304. *
  305. * Mac OS X threading:
  306. * Thread safe
  307. *
  308. * Parameters:
  309. *
  310. * dest:
  311. * the destination pascal string
  312. *
  313. * source:
  314. * the source pascal string
  315. *
  316. * Result:
  317. * This function returns dest.
  318. *
  319. * Availability:
  320. * Mac OS X: in version 10.0 and later in CoreServices.framework but deprecated in 10.4
  321. * CarbonLib: in CarbonLib 1.0 and later
  322. * Non-Carbon CFM: not available
  323. }
  324. function PLstrcpy( dest: StringPtr; const (*var*) source: Str255 ): StringPtr; external name '_PLstrcpy';
  325. (* __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_4, __IPHONE_NA, __IPHONE_NA) *)
  326. {
  327. * PLstrncpy() *** DEPRECATED ***
  328. *
  329. * Deprecated:
  330. * use CFString instead.
  331. *
  332. * Summary:
  333. * Copy a pascal string
  334. *
  335. * Discussion:
  336. * This function copies the string source to dest (including the
  337. * initial length byte ), provided the length of source is <= num.
  338. * If the length of source is > num, then the first num characters
  339. * of source are copied into dest, and the length of dest is set to
  340. * num. The caller must ensure that neither source or dest are
  341. * NULL, and that dest is large enough to hold the entire contents
  342. * of source. This function should be deprecated since pascal
  343. * strings are obsolete on MacOSX and CFString should be used
  344. * instead.
  345. *
  346. * Mac OS X threading:
  347. * Thread safe
  348. * Thread safe provided no other thread is modifying source.
  349. *
  350. * Parameters:
  351. *
  352. * dest:
  353. * the destination pascal string
  354. *
  355. * source:
  356. * the source pascal string
  357. *
  358. * num:
  359. * the maximum number of bytes to copy
  360. *
  361. * Result:
  362. * This function returns dest.
  363. *
  364. * Availability:
  365. * Mac OS X: in version 10.0 and later in CoreServices.framework but deprecated in 10.4
  366. * CarbonLib: in CarbonLib 1.0 and later
  367. * Non-Carbon CFM: not available
  368. }
  369. function PLstrncpy( dest: StringPtr; const (*var*) source: Str255; num: SInt16 ): StringPtr; external name '_PLstrncpy';
  370. (* __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_4, __IPHONE_NA, __IPHONE_NA) *)
  371. {
  372. * PLstrcat() *** DEPRECATED ***
  373. *
  374. * Deprecated:
  375. * use CFString instead.
  376. *
  377. * Summary:
  378. * Append a pascal string to another pascal string
  379. *
  380. * Discussion:
  381. * This function append a copy of the pascal string append to the
  382. * end of the pascal string str. If the length of str plus the
  383. * length of append is greater than 255 ( the maximum size of a
  384. * pascal string ) then only enough characters are copied to str to
  385. * reach the 255 character limit, and the length of str is set to
  386. * 255. The caller must ensure that neither str nor append are
  387. * NULL, and that str is large enough to hold the entire contents of
  388. * append. This function should be deprecated since pascal strings
  389. * are obsolete on MacOSX and CFString should be used instead.
  390. *
  391. * Mac OS X threading:
  392. * Thread safe
  393. * Thread safe provided no other thread is modifying str or append.
  394. *
  395. * Parameters:
  396. *
  397. * str:
  398. * the destination pascal string
  399. *
  400. * append:
  401. * the pascal string to append
  402. *
  403. * Result:
  404. * This function returns s.
  405. *
  406. * Availability:
  407. * Mac OS X: in version 10.0 and later in CoreServices.framework but deprecated in 10.4
  408. * CarbonLib: in CarbonLib 1.0 and later
  409. * Non-Carbon CFM: not available
  410. }
  411. function PLstrcat( str: StringPtr; const (*var*) append: Str255 ): StringPtr; external name '_PLstrcat';
  412. (* __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_4, __IPHONE_NA, __IPHONE_NA) *)
  413. {
  414. * PLstrncat() *** DEPRECATED ***
  415. *
  416. * Deprecated:
  417. * use CFString instead.
  418. *
  419. * Summary:
  420. * Append up to num bytes of a pascal string to another pascal string
  421. *
  422. * Discussion:
  423. * This function append up to the first num bytes of the pascal
  424. * string append to the end of the pascal string s. If the length
  425. * of str plus the length of append is greater than 255 ( the
  426. * maximum size of a pascal string ) then only enough characters are
  427. * copied to str to reach the 255 character limit, and the length of
  428. * str is set to 255. The caller must ensure that neither str nor
  429. * append are NULL, and that str is large enough to hold the entire
  430. * contents of append. This function should be deprecated since
  431. * pascal strings are obsolete on MacOSX and CFString should be used
  432. * instead.
  433. *
  434. * Mac OS X threading:
  435. * Thread safe
  436. * Thread safe provided no other thread is modifying str1 or append.
  437. *
  438. * Parameters:
  439. *
  440. * str1:
  441. * the destination pascal string
  442. *
  443. * append:
  444. * the pascal string to append
  445. *
  446. * num:
  447. * the maximum number of bytes of append to append onto s
  448. *
  449. * Result:
  450. * This function returns str.
  451. *
  452. * Availability:
  453. * Mac OS X: in version 10.0 and later in CoreServices.framework but deprecated in 10.4
  454. * CarbonLib: in CarbonLib 1.0 and later
  455. * Non-Carbon CFM: not available
  456. }
  457. function PLstrncat( str1: StringPtr; const (*var*) append: Str255; num: SInt16 ): StringPtr; external name '_PLstrncat';
  458. (* __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_4, __IPHONE_NA, __IPHONE_NA) *)
  459. {
  460. * PLstrchr() *** DEPRECATED ***
  461. *
  462. * Deprecated:
  463. * use CFString instead.
  464. *
  465. * Summary:
  466. * Return a pointer to the first occurrence of ch1 in str.
  467. *
  468. * Discussion:
  469. * The PLstrrchr() function locates the first occurrence of ch1
  470. * (converted to an unsigned char) in the string s. If ch1 does not
  471. * occur in the string, this returns NULL. This function should be
  472. * deprecated since pascal strings are obsolete on MacOSX and
  473. * CFString should be used instead.
  474. *
  475. * Mac OS X threading:
  476. * Thread safe
  477. * Thread safe provided no other thread is modifying str1.
  478. *
  479. * Parameters:
  480. *
  481. * str1:
  482. * the pascal string
  483. *
  484. * ch1:
  485. * the character to find
  486. *
  487. * Result:
  488. * A pointer to the first occurrence of ch1 in str1, or NULL.
  489. *
  490. * Availability:
  491. * Mac OS X: in version 10.0 and later in CoreServices.framework but deprecated in 10.4
  492. * CarbonLib: in CarbonLib 1.0 and later
  493. * Non-Carbon CFM: not available
  494. }
  495. function PLstrchr( const (*var*) str1: Str255; ch1: SInt16 ): Ptr; external name '_PLstrchr';
  496. (* __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_4, __IPHONE_NA, __IPHONE_NA) *)
  497. {
  498. * PLstrrchr() *** DEPRECATED ***
  499. *
  500. * Deprecated:
  501. * use CFString instead.
  502. *
  503. * Summary:
  504. * Return a pointer to the last occurrence of ch1 in str.
  505. *
  506. * Discussion:
  507. * The PLstrrchr() function locates the last occurrence of ch1
  508. * (converted to an unsigned char) in the string s. If ch1 does not
  509. * occur in the string, this returns NULL. This function should be
  510. * deprecated since pascal strings are obsolete on MacOSX and
  511. * CFString should be used instead.
  512. *
  513. * Mac OS X threading:
  514. * Thread safe
  515. * Thread safe provided no other thread is modifying str1.
  516. *
  517. * Parameters:
  518. *
  519. * str1:
  520. * the pascal string
  521. *
  522. * ch1:
  523. * the character to find
  524. *
  525. * Result:
  526. * A pointer to the last occurrence of ch1 in str1, or NULL.
  527. *
  528. * Availability:
  529. * Mac OS X: in version 10.0 and later in CoreServices.framework but deprecated in 10.4
  530. * CarbonLib: in CarbonLib 1.0 and later
  531. * Non-Carbon CFM: not available
  532. }
  533. function PLstrrchr( const (*var*) str1: Str255; ch1: SInt16 ): Ptr; external name '_PLstrrchr';
  534. (* __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_4, __IPHONE_NA, __IPHONE_NA) *)
  535. {
  536. * PLstrpbrk() *** DEPRECATED ***
  537. *
  538. * Deprecated:
  539. * use CFString instead.
  540. *
  541. * Summary:
  542. * Return a pointer to the first occurrence in str of any character
  543. * in charSet.
  544. *
  545. * Discussion:
  546. * The PLstrpbrk() function returns a pointer to the first
  547. * occurrence in str of any character in searchStr. If none of the
  548. * characters in searchStr can be found in str, then NULL is
  549. * returned. This function should be deprecated since pascal strings
  550. * are obsolete on MacOSX and CFString should be used instead.
  551. *
  552. * Mac OS X threading:
  553. * Thread safe
  554. * Thread safe provided no other thread is modifying str1 or charSet.
  555. *
  556. * Parameters:
  557. *
  558. * str1:
  559. * the pascal string
  560. *
  561. * charSet:
  562. * the character to find
  563. *
  564. * Result:
  565. * A pointer to the first occurrence of any character in charSet in
  566. * str1, or NULL.
  567. *
  568. * Availability:
  569. * Mac OS X: in version 10.0 and later in CoreServices.framework but deprecated in 10.4
  570. * CarbonLib: in CarbonLib 1.0 and later
  571. * Non-Carbon CFM: not available
  572. }
  573. function PLstrpbrk( const (*var*) str1: Str255; const (*var*) charSet: Str255 ): Ptr; external name '_PLstrpbrk';
  574. (* __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_4, __IPHONE_NA, __IPHONE_NA) *)
  575. {
  576. * PLstrspn() *** DEPRECATED ***
  577. *
  578. * Deprecated:
  579. * use CFString instead.
  580. *
  581. * Summary:
  582. * Spans the initial part of str1 as long as the characters from
  583. * str1 occur in string charset
  584. *
  585. * Discussion:
  586. * The PLstrspn() function spans the initial part of the pascal
  587. * string str1 as long as the characters from s occur in string
  588. * charset. In effect, this returns a count of the number of
  589. * characters at the beginning of the pascal string str1 which are
  590. * in charset. This function should be deprecated since pascal
  591. * strings are obsolete on MacOSX and CFString should be used
  592. * instead.
  593. *
  594. * Mac OS X threading:
  595. * Thread safe
  596. * Thread safe provided no other thread is modifying str1 or charSet.
  597. *
  598. * Parameters:
  599. *
  600. * str1:
  601. * the pascal string
  602. *
  603. * charSet:
  604. * the character to find
  605. *
  606. * Result:
  607. * The count of characters at the beginning of str1 which are in
  608. * charSet.
  609. *
  610. * Availability:
  611. * Mac OS X: in version 10.0 and later in CoreServices.framework but deprecated in 10.4
  612. * CarbonLib: in CarbonLib 1.0 and later
  613. * Non-Carbon CFM: not available
  614. }
  615. function PLstrspn( const (*var*) str1: Str255; const (*var*) charSet: Str255 ): SInt16; external name '_PLstrspn';
  616. (* __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_4, __IPHONE_NA, __IPHONE_NA) *)
  617. {
  618. * PLstrstr() *** DEPRECATED ***
  619. *
  620. * Deprecated:
  621. * use CFString instead.
  622. *
  623. * Summary:
  624. * Returns a pointer to the first occurrence of searchStr in str1
  625. *
  626. * Discussion:
  627. * The PLstrstr() function returns a pointer to the first occurrence
  628. * of searchStr in str1, or NULL if searchStr does not exist in
  629. * str1. This function should be deprecated since pascal strings are
  630. * obsolete on MacOSX and CFString should be used instead.
  631. *
  632. * Mac OS X threading:
  633. * Thread safe
  634. * Thread safe provided no other thread is modifying str1 or
  635. * searchStr.
  636. *
  637. * Parameters:
  638. *
  639. * str1:
  640. * the pascal string
  641. *
  642. * searchStr:
  643. * the string to find
  644. *
  645. * Result:
  646. * The count of characters at the beginning of str1 which are in
  647. * charSet.
  648. *
  649. * Availability:
  650. * Mac OS X: in version 10.0 and later in CoreServices.framework but deprecated in 10.4
  651. * CarbonLib: in CarbonLib 1.0 and later
  652. * Non-Carbon CFM: not available
  653. }
  654. function PLstrstr( const (*var*) str1: Str255; const (*var*) searchStr: Str255 ): Ptr; external name '_PLstrstr';
  655. (* __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_4, __IPHONE_NA, __IPHONE_NA) *)
  656. {
  657. * PLstrlen() *** DEPRECATED ***
  658. *
  659. * Deprecated:
  660. * use CFString instead.
  661. *
  662. * Summary:
  663. * Returns the length of the pascal string
  664. *
  665. * Discussion:
  666. * The PLstrlen() function returns the length of the pascal string
  667. * str. This function should be deprecated since pascal strings are
  668. * obsolete on MacOSX and CFString should be used instead.
  669. *
  670. * Mac OS X threading:
  671. * Thread safe
  672. * Thread safe provided no other thread is modifying str.
  673. *
  674. * Parameters:
  675. *
  676. * str:
  677. * the pascal string
  678. *
  679. * Result:
  680. * The length of the pascal string str.
  681. *
  682. * Availability:
  683. * Mac OS X: in version 10.0 and later in CoreServices.framework but deprecated in 10.4
  684. * CarbonLib: in CarbonLib 1.0 and later
  685. * Non-Carbon CFM: not available
  686. }
  687. function PLstrlen( const (*var*) str: Str255 ): SInt16; external name '_PLstrlen';
  688. (* __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_4, __IPHONE_NA, __IPHONE_NA) *)
  689. {
  690. * PLpos() *** DEPRECATED ***
  691. *
  692. * Deprecated:
  693. * use CFString instead.
  694. *
  695. * Summary:
  696. * Returns the offset to the first occurrence of searchStr in str1
  697. *
  698. * Discussion:
  699. * The PLpos() function returns the offset of the string searchStr
  700. * in str1, or 0 if searchStr does not occur in str1. For example,
  701. * if str1 is "\pHello World" and searchStr is "\pWorld", then this
  702. * function will return the value 7. This function should be
  703. * deprecated since pascal strings are obsolete on MacOSX and
  704. * CFString should be used instead.
  705. *
  706. * Mac OS X threading:
  707. * Thread safe
  708. * Thread safe provided no other thread is modifying str1 or
  709. * searchStr.
  710. *
  711. * Parameters:
  712. *
  713. * str1:
  714. * the pascal string
  715. *
  716. * searchStr:
  717. * the string to find
  718. *
  719. * Result:
  720. * The count of characters at the beginning of str1 which are in
  721. * charSet.
  722. *
  723. * Availability:
  724. * Mac OS X: in version 10.0 and later in CoreServices.framework but deprecated in 10.4
  725. * CarbonLib: in CarbonLib 1.0 and later
  726. * Non-Carbon CFM: not available
  727. }
  728. function PLpos( const (*var*) str1: Str255; const (*var*) searchStr: Str255 ): SInt16; external name '_PLpos';
  729. (* __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_4, __IPHONE_NA, __IPHONE_NA) *)
  730. {$endc} {TARGET_OS_MAC}
  731. {$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
  732. end.
  733. {$endc} {not MACOSALLINCLUDE}