home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 2 BBS / 02-BBS.zip / XGRP_000.SZH / FFPRINTF.C < prev    next >
C/C++ Source or Header  |  1991-07-15  |  688b  |  43 lines

  1. #define INCL_DOS
  2.  
  3. #include <stddef.h>
  4. #include <stdarg.h>
  5. #include <stdio.h>
  6. #include <string.h>
  7. #include <malloc.h>
  8. #include <io.h>
  9. #include <process.h>
  10. #ifdef TSC
  11.   #define _cdecl cdecl
  12.   #include <os2kernl.h>
  13. #else
  14.   #include <os2.h>
  15. #endif
  16. #include "nofast.h"
  17.  
  18.  
  19. #define MAX_BUFFER_LENGTH 1024
  20.  
  21.  
  22.  
  23.  
  24.  
  25.  
  26. /* An fprintf() for DosWrite() */
  27.  
  28. unsigned int _cdecl ffprintf (unsigned int handle,char *string,...) {
  29.  
  30.     unsigned int x,y;
  31.     char buffer[MAX_BUFFER_LENGTH];
  32.     va_list pArguments;
  33.  
  34.  
  35.     va_start(pArguments,string);
  36.     x = vsprintf(buffer,string,pArguments);
  37.     va_end(pArguments);
  38.  
  39.     DosWrite(handle,buffer,x,&y);
  40.  
  41.     return y;
  42. }
  43.