home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / vol_100 / 163_01 / fprintf.c < prev    next >
Text File  |  1988-01-31  |  768b  |  19 lines

  1. /*
  2. ** fprintf(stream, format [,arg] ... ) -- formatted print
  3. **        operates as described by Kernighan & Ritchie
  4. **        only d, o, x, c, s, and u specs are supported.
  5. */
  6.  
  7. #define FILE int
  8. extern int CCARGC(), fputc(), _format();
  9.  
  10. fprintf(args) int args; {
  11.   int argc, *argv, *ctl;
  12.   FILE *stream;
  13.   argc = CCARGC() - 1; /* fetch arg count from CX reg */
  14.   argv = &args; /* address of first argument */
  15.   stream = argv[argc--]; /* get address of stream */
  16.   ctl = argv[argc]; /* get address of format string */
  17.   _format(ctl, argc, argv, fputc, stream);
  18.   }
  19.