.\" This manpage is Copyright (C) 2000 Wei Yongming .\" 2000 BluePoint Software .\" .\" Permission is granted to make and distribute verbatim copies of this .\" manual provided the copyright notice and this permission notice are .\" preserved on all copies. .\" .\" Permission is granted to copy and distribute modified versions of this .\" manual under the conditions for verbatim copying, provided that the .\" entire resulting derived work is distributed under the terms of a .\" permission notice identical to this one .\" .\" Since MiniGUI is constantly changing, this .\" manual page may be incorrect or out-of-date. The author(s) assume no .\" responsibility for errors or omissions, or for damages resulting from .\" the use of the information contained herein. The author(s) may not .\" have taken the same level of care in the production of this manual, .\" which is licensed free of charge, as they might when working .\" professionally. .\" .\" Formatted or processed versions of this manual, if unaccompanied by .\" the source, must acknowledge the copyright and authors of this work. .TH "FixStr" "3" "July 2000" "MiniGUI" .SH "NAME" FixStr \- the functions allocating/freeing length-fixed string in MiniGUI. .SH "SYNOPSIS" .B #include .PP .BI "char* GUIAPI FixStrAlloc" "(int len);" .br .BI "void GUIAPI FreeFixStr" "(char* str);" .SH "DESCRIPTION" .PP \fBFixStrAlloc\fP function allocates memory in MiniGUI's length-fixed string heap. The result memory should accommondate a null-terminated string with length of \fBlen\fP, that is, the memory is with \fB(len + 1)\fP long. .PP \fBFreeFixStr\fP function frees the memory allocated by \fBFixStrAlloc\fP. .SH "RETURN VALUE" \fBFixStrAlloc\fP function returns the pointer to the memory allocated. When error occurred, this function will return NULL. .SH "NOTES" There are many length-fixed strings in MiniGUI, such as captions of windows. MiniGUI has an internal heap for allocating/freeing length-fixed strings efficiently. You can allocate memory from this heap by using \fBFixStrAlloc\fP. However, you should avoid doing \fBstrcat\fP on the memory allocated by \fBFixStrAlloc\fP. .PP When there is no free space in MiniGUI's internal heap, MiniGUI will try to allocate memory from system heap by using \fBmalloc\fP. You can safely free the memory actually returned by \fBmalloc\fP with \fBFreeFixStr\fP. .SH "SEE ALSO" .BR strcat "(3), " malloc "(3), " free (3) .SH "AUTHOR" .PP This manual page was edited by WEI Yongming . If you have any problems, comments or found some bugs, please send messages to me.