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