|
Mac OS 9
|
Text Utilities Interfaces. More...
#include <MacTypes.h>#include <NumberFormatting.h>#include <StringCompare.h>#include <DateTimeUtils.h>Go to the source code of this file.
Data Structures | |
| struct | ScriptRunStatus |
| struct | BreakTable |
| struct | NBreakTable |
Macros | |
| #define | C2PStr(a) (StringPtr) c2pstr((Ptr)(a)) |
| #define | P2CStr(a) (Ptr) p2cstr(a) |
| #define | CopyPascalStringToC(src, dst) p2cstrcpy(dst, src) |
| #define | CopyCStringToPascal(src, dst) c2pstrcpy(dst, src) |
| #define | C2PStr(a) (StringPtr) c2pstr((Ptr)(a)) |
| #define | P2CStr(a) (Ptr) p2cstr(a) |
Typedefs | |
| typedef struct ScriptRunStatus | ScriptRunStatus |
| typedef struct BreakTable | BreakTable |
| typedef BreakTable * | BreakTablePtr |
| typedef struct NBreakTable | NBreakTable |
| typedef NBreakTable * | NBreakTablePtr |
Functions | |
| long | Munger (Handle h, long offset, const void *ptr1, long len1, const void *ptr2, long len2) |
| StringHandle | NewString (ConstStr255Param theString) |
| void | SetString (StringHandle theString, ConstStr255Param strNew) |
| StringHandle | GetString (short stringID) |
| void | GetIndString (Str255 theString, short strListID, short index) |
| void | setstring (StringHandle theString, const char *strNew) |
| StringHandle | newstring (const char *theString) |
| void | getindstring (char *theString, short strListID, short index) |
| void | FindWordBreaks (Ptr textPtr, short textLength, short offset, Boolean leadingEdge, BreakTablePtr breaks, OffsetTable offsets, ScriptCode script) |
| void | LowercaseText (Ptr textPtr, short len, ScriptCode script) |
| void | UppercaseText (Ptr textPtr, short len, ScriptCode script) |
| void | StripDiacritics (Ptr textPtr, short len, ScriptCode script) |
| void | UppercaseStripDiacritics (Ptr textPtr, short len, ScriptCode script) |
| ScriptRunStatus | FindScriptRun (Ptr textPtr, long textLen, long *lenUsed) |
| void | FindWord (Ptr textPtr, short textLength, short offset, Boolean leadingEdge, BreakTablePtr breaks, OffsetTable offsets) |
| void | NFindWord (Ptr textPtr, short textLength, short offset, Boolean leadingEdge, NBreakTablePtr nbreaks, OffsetTable offsets) |
| void | LwrText (Ptr textPtr, short len) |
| void | LowerText (Ptr textPtr, short len) |
| void | StripText (Ptr textPtr, short len) |
| void | UpperText (Ptr textPtr, short len) |
| void | StripUpperText (Ptr textPtr, short len) |
| void | UpperString (Str255 theString, Boolean diacSensitive) |
| void | upperstring (char *theString, Boolean diacSensitive) |
| void | UprText (Ptr textPtr, short len) |
| Provide non-localizable uppercasing. More... | |
| void | c2pstrcpy (Str255 dst, const char *src) |
| void | p2cstrcpy (char *dst, ConstStr255Param src) |
| void | CopyPascalStringToC (ConstStr255Param src, char *dst) |
| void | CopyCStringToPascal (const char *src, Str255 dst) |
| StringPtr | c2pstr (char *aStr) |
| StringPtr | C2PStr (Ptr cString) |
| char * | p2cstr (StringPtr aStr) |
| Ptr | P2CStr (StringPtr pString) |
Text Utilities Interfaces.
For bug reports, consult the following page on the World Wide Web:
http://developer.apple.com/bugreporter/
| StringPtr c2pstr | ( | char * | aStr | ) |
| StringPtr C2PStr | ( | Ptr | cString | ) |
| void c2pstrcpy | ( | Str255 | dst, |
| const char * | src | ||
| ) |
CALL_NOT_IN_CARBON Functions for converting between C and Pascal Strings (Previously in Strings.h)
Note: CopyPascalStringToC, CopyCStringToPascal, c2pstrcpy, and p2cstrcpy are written to allow inplace conversion. That is, the src and dst parameters can point to the memory location. These functions are available in CarbonLib and CarbonAccessors.o.
Note: c2pstr, C2PStr, p2cstr, and P2CStr are all deprecated. These functions only do inplace conversion and often require casts to call them. This can cause bugs because you can easily cast away a const and change the contents of a read-only buffer. These functions are available in InterfaceLib, or when building for Carbon if you #define OLDP2C, then they are available as a macro. c2pstrcpy()
| void CopyCStringToPascal | ( | const char * | src, |
| Str255 | dst | ||
| ) |
| void CopyPascalStringToC | ( | ConstStr255Param | src, |
| char * | dst | ||
| ) |
| ScriptRunStatus FindScriptRun | ( | Ptr | textPtr, |
| long | textLen, | ||
| long * | lenUsed | ||
| ) |
| void FindWord | ( | Ptr | textPtr, |
| short | textLength, | ||
| short | offset, | ||
| Boolean | leadingEdge, | ||
| BreakTablePtr | breaks, | ||
| OffsetTable | offsets | ||
| ) |
The following functions are old names, but are required for PowerPC builds because InterfaceLib exports these names, instead of the new ones. FindWord()
| void FindWordBreaks | ( | Ptr | textPtr, |
| short | textLength, | ||
| short | offset, | ||
| Boolean | leadingEdge, | ||
| BreakTablePtr | breaks, | ||
| OffsetTable | offsets, | ||
| ScriptCode | script | ||
| ) |
CALL_NOT_IN_CARBON FindWordBreaks()
| void getindstring | ( | char * | theString, |
| short | strListID, | ||
| short | index | ||
| ) |
| void GetIndString | ( | Str255 | theString, |
| short | strListID, | ||
| short | index | ||
| ) |
| StringHandle GetString | ( | short | stringID | ) |
| void LowercaseText | ( | Ptr | textPtr, |
| short | len, | ||
| ScriptCode | script | ||
| ) |
| void LowerText | ( | Ptr | textPtr, |
| short | len | ||
| ) |
| void LwrText | ( | Ptr | textPtr, |
| short | len | ||
| ) |
On 68K machines, LwrText, LowerText, StripText, UpperText and StripUpperText return an error code in register D0, but System 7 PowerMacs do not emulate this properly, so checking D0 is unreliable. LwrText()
| long Munger | ( | Handle | h, |
| long | offset, | ||
| const void * | ptr1, | ||
| long | len1, | ||
| const void * | ptr2, | ||
| long | len2 | ||
| ) |
The following functions are new names that work on 68k and PowerPC Munger()
| StringHandle newstring | ( | const char * | theString | ) |
| StringHandle NewString | ( | ConstStr255Param | theString | ) |
| void NFindWord | ( | Ptr | textPtr, |
| short | textLength, | ||
| short | offset, | ||
| Boolean | leadingEdge, | ||
| NBreakTablePtr | nbreaks, | ||
| OffsetTable | offsets | ||
| ) |
| char* p2cstr | ( | StringPtr | aStr | ) |
| Ptr P2CStr | ( | StringPtr | pString | ) |
| void p2cstrcpy | ( | char * | dst, |
| ConstStr255Param | src | ||
| ) |
| void setstring | ( | StringHandle | theString, |
| const char * | strNew | ||
| ) |
| void SetString | ( | StringHandle | theString, |
| ConstStr255Param | strNew | ||
| ) |
| void StripDiacritics | ( | Ptr | textPtr, |
| short | len, | ||
| ScriptCode | script | ||
| ) |
| void StripText | ( | Ptr | textPtr, |
| short | len | ||
| ) |
| void StripUpperText | ( | Ptr | textPtr, |
| short | len | ||
| ) |
| void UppercaseStripDiacritics | ( | Ptr | textPtr, |
| short | len, | ||
| ScriptCode | script | ||
| ) |
| void UppercaseText | ( | Ptr | textPtr, |
| short | len, | ||
| ScriptCode | script | ||
| ) |
| void upperstring | ( | char * | theString, |
| Boolean | diacSensitive | ||
| ) |
| void UpperString | ( | Str255 | theString, |
| Boolean | diacSensitive | ||
| ) |
The following are new names which are exported by InterfaceLib CALL_NOT_IN_CARBON UpperString()
| void UpperText | ( | Ptr | textPtr, |
| short | len | ||
| ) |
| void UprText | ( | Ptr | textPtr, |
| short | len | ||
| ) |
Provide non-localizable uppercasing.
The following are macros which map old names to the names exported by InterfaceLib OLDROUTINENAMES Old routine name but no new names are mapped to it:
| textPtr | a pointer to the text to be upper cased @par Non-Carbon CFM: in InterfaceLib 7.1 and later |