home *** CD-ROM | disk | FTP | other *** search
/ GEMini Atari / GEMini_Atari_CD-ROM_Walnut_Creek_December_1993.iso / zip / gnu / gawk213s.lzh / GAWK213S / VPRINTF.C < prev   
C/C++ Source or Header  |  1993-07-29  |  752b  |  48 lines

  1. #if 0
  2. #include <varargs.h>
  3. #endif
  4.  
  5. int
  6. vsprintf(str, fmt, ap)
  7.     char *str, *fmt;
  8.     va_list ap;
  9. {
  10.     FILE f;
  11.     int len;
  12.  
  13.     f._flag = _IOWRT+_IOSTRG;
  14.     f._ptr = (char *)str;    /* My copy of BSD stdio.h has this as (char *)
  15.                  * with a comment that it should be
  16.                  * (unsigned char *).  Since this code is
  17.                  * intended for use on a vanilla BSD system,
  18.                  * we'll stick with (char *) for now.
  19.                  */
  20.     f._cnt = 32767;
  21.     len = _doprnt(fmt, ap, &f);
  22.     *f._ptr = 0;
  23.     return (len);
  24. }
  25.  
  26. int
  27. vfprintf(iop, fmt, ap)
  28.     FILE *iop;
  29.     char *fmt;
  30.     va_list ap;
  31. {
  32.     int len;
  33.  
  34.     len = _doprnt(fmt, ap, iop);
  35.     return (ferror(iop) ? EOF : len);
  36. }
  37.  
  38. int
  39. vprintf(fmt, ap)
  40.     char *fmt;
  41.     va_list ap;
  42. {
  43.     int len;
  44.  
  45.     len = _doprnt(fmt, ap, stdout);
  46.     return (ferror(stdout) ? EOF : len);
  47. }
  48.