The C-String library can be used when you need to exchange strings
with program parts that is not written in BETA, eg. system-calls.
A C-string is a null-terminated array of chars.
The strings can be exchanged both ways, that is, you can create
strings (texts) in BETA and give the to a C-function or you can create
a string in C and use it later in BETA.
The C-String pattern has the following attributes:
The charPtr attribute can also be changed/updated by using the enter and
exit parts of the cstring pattern.
- charptr: an integer, which value points to the string
- init: allocates space for this string. Default is 256 bytes
- set: if necessary expands the string and copies the chars from a
BETA text object
- get: creates a BETA text object, and copies the c-string.
- getChars: returns the string as a char repetition.
- length: returns length (zero terminated)
- inxPut: puts a char at a specific position
- inxGet: receives a char
- toLocal: converts all newlines to system standard.
- fromLocal: conterts system standard end-of-line to newlines
- free: frees the allocated space. Must be used if init is called twice.
In addition, the library contains declarations for standard C-routines
to manipulate strings. Note that cstring.charptr can be used as argument to these C-routines.
|System Utilities - Reference Manual
||© 1994-2002 Mjølner Informatics
[Modified: Friday September 29th 2000 at 23:36]