MATLAB COMPILER RELEASE NOTES Guida Utente Pagina 163

  • Scaricare
  • Aggiungi ai miei manuali
  • Stampa
Vedere la pagina 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.
Vedere la pagina 162
1 2 ... 158 159 160 161 162 163 164 165 166 167 168 ... 263 264

Commenti su questo manuale

Nessun commento