Max's string object is a simple wrapper for c-strings, useful when working with Max's t_dictionary, t_linklist, or t_hashtab.
More...
Detailed Description
Max's string object is a simple wrapper for c-strings, useful when working with Max's t_dictionary, t_linklist, or t_hashtab.
- See also:
- Dictionary
Function Documentation
void string_append |
( |
t_string * |
x, |
|
|
const char * |
s |
|
) |
| |
Append a C-string onto the existing string maintained by a t_string object.
Memory allocation for the string will grow as needed to hold the concatenated string.
- Parameters:
-
x | The string object instance. |
s | A string to append/concatenate with the existing string. |
void string_chop |
( |
t_string * |
x, |
|
|
long |
numchars |
|
) |
| |
Shorten a string by eliminating N characters from the end.
- Parameters:
-
x | The string object instance. |
numchars | The number of characters to chop from the end of the string. |
const char* string_getptr |
( |
t_string * |
x | ) |
|
Fetch a pointer to a string object's internal C-string.
- Parameters:
-
x | The string object instance. |
- Returns:
- A pointer to the internally maintained C-string.
t_string* string_new |
( |
const char * |
psz | ) |
|
Create a new string object.
- Parameters:
-
psz | Pointer to a C-string that will be copied to memory internal to this string object instance. |
- Returns:
- The new string object instance pointer.
void string_reserve |
( |
t_string * |
x, |
|
|
long |
numbytes |
|
) |
| |
Reserve additional memory for future string growth.
- Parameters:
-
x | The string object instance. |
numbytes | The total number of bytes to allocate for this string object. |