Length-Fixed string operations
[MiniGUI-Processes specific functions]

Functions


Detailed Description

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);


Function Documentation

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).

Note:
You can change the content of the string, but do not change the length of this string (shorter is valid) via strcat function or other equivalent functions or operations.
Parameters:
len The length of the string.
Returns:
The pointer to the buffer on success, otherwise NULL.
See also:
FreeFixStr
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.

Note:
You can change the content of the string, but do not change the length of this string (shorter is valid) via strcat function or other equivalent functions or operations.
Parameters:
str The pointer to the string will be duplicated.
Returns:
The pointer to the buffer on success, otherwise NULL.
See also:
FreeFixStr
void GUIAPI FreeFixStr ( char *  str  ) 

Frees a length-fixed string.

This function frees the buffer used by the length-fixed string str.

Parameters:
str The length-fixed string.
Note:
Do not use free to free the length-fixed string.
See also:
FixStrAlloc
Generated on Thu Apr 7 15:55:37 2011 for MiniGUI V3.0.12 API Reference by  doxygen 1.6.3