home *** CD-ROM | disk | FTP | other *** search
/ Kyūkyoku!! X68000 Emulator / X68000Book.dat / mac / OLS / X68000 / Ko-Window / kow142s.lzh / corlib / ConsolePrintf.c < prev    next >
C/C++ Source or Header  |  1994-11-29  |  558b  |  39 lines

  1. /* 1992 H.Ogasawara (COR.) */
  2.  
  3. #ifdef XC
  4.  
  5. asm("
  6.     .xdef    _ConsolePrintf
  7.     .xref    _ConsoleChar
  8.     .xref    __fmtout
  9.  
  10. _ConsolePrintf:
  11.     move.l    4(sp),d0    * format
  12.     pea    8(sp)        * arglist ptr
  13.     move.l    d0,-(sp)    * format
  14.     clr.l    -(sp)
  15.     pea    _ConsoleChar
  16.     jsr    __fmtout
  17.     lea    16(sp),sp
  18.     rts
  19. ");
  20.  
  21. #else
  22.  
  23. #include    "corlib.h"
  24. #include    <stdarg.h>
  25. #define        CBUFSIZE    1024
  26.  
  27. void
  28. ConsolePrintf( char *format, ... )
  29. {
  30.     char    buf[CBUFSIZE];
  31.     va_list    ap;
  32.     va_start( ap, format );
  33.     vsprintf( buf, format, ap );
  34.     ConsolePrint( buf );
  35.     va_end( ap );
  36. }
  37. #endif
  38.  
  39.