MiniGUI maintains a private heap for length-fixed strings, and allocates length-fixed strings from this heap for window caption, menu item text, and so on. You can also use this private heap to allocate length-fixed strings.
char * buffer = FixStrAlloc (strlen ("Hello, world!")); if (buffer) strcpy (buffer, "Hello, world!"); ... FreeFixStr (buffer);
char *GUIAPI FixStrAlloc | ( | int | len | ) |
Allocates a buffer for a length-fixed string.
This function allocates a buffer from the length-fixed string heap for a string which is len bytes long (does not include the null character of the string).
len | The length of the string. |
char *GUIAPI FixStrDup | ( | const char * | str | ) |
Duplicates a length-fixed string.
This function allocates a buffer from the length-fixed string heap and copy the string str to the buffer.
str | The pointer to the string will be duplicated. |
void GUIAPI FreeFixStr | ( | char * | str | ) |
Frees a length-fixed string.
This function frees the buffer used by the length-fixed string str.
str | The length-fixed string. |