MATLAB COMPILER RELEASE NOTES User's Guide Page 163

  • Download
  • Add to my manuals
  • Print
  • Page
    / 264
  • Table of contents
  • TROUBLESHOOTING
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 162
Print Handlers
5-47
The print handler routine itself that deposits the text passed to it in an
output buffer
void WinPrint( char *text)
{
int cnt;
/* Allocate a buffer for the output */
if (firsttime) {
OutputBuffer = (char *)mxCalloc(1028, 1);
upperlim += 1028;
firsttime = 0;
}
/* Make sure there’s enough room in the buffer */
cnt = strlen(text);
while (totalcnt + cnt >= upperlim) {
char *TmpOut;
upperlim += 1028;
TmpOut = (char *)mxRealloc(OutputBuffer, upperlim);
if (TmpOut != NULL)
OutputBuffer = TmpOut;
}
/* Concatenate the next line of text */
strncat(OutputBuffer, text, cnt);
/* Update the number of characters stored in the buffer */
totalcnt += cnt;
}
The related function WinFlush that actually displays the text from the
output buffer in a Windows message box.
void WinFlush(void)
{
MessageBox(NULL, OutputBuffer, "MRANK", MB_OK);
mxFree(OutputBuffer);
}
For more details on mlfPrintMatrix,seetheMATLAB C Math Library User’s
Guide.
Page view 162
1 2 ... 158 159 160 161 162 163 164 165 166 167 168 ... 263 264

Comments to this Manuals

No comments