1: /*
   2:  * Copyright (c) 1984 Regents of the University of California.
   3:  * All rights reserved.  The Berkeley software License Agreement
   4:  * specifies the terms and conditions for redistribution.
   5:  */
   6: 
   7: #if defined(LIBC_SCCS) && !defined(lint)
   8: static char sccsid[] = "@(#)fputs.c	5.2 (Berkeley) 3/9/86";
   9: #endif LIBC_SCCS and not lint
  10: 
  11: #include    <stdio.h>
  12: 
  13: fputs(s, iop)
  14: register char *s;
  15: register FILE *iop;
  16: {
  17:     register r = 0;
  18:     register c;
  19:     int unbuffered;
  20:     char localbuf[BUFSIZ];
  21: 
  22:     unbuffered = iop->_flag & _IONBF;
  23:     if (unbuffered) {
  24:         iop->_flag &= ~_IONBF;
  25:         iop->_ptr = iop->_base = localbuf;
  26:         iop->_bufsiz = BUFSIZ;
  27:     }
  28: 
  29:     while (c = *s++)
  30:         r = putc(c, iop);
  31: 
  32:     if (unbuffered) {
  33:         fflush(iop);
  34:         iop->_flag |= _IONBF;
  35:         iop->_base = NULL;
  36:         iop->_bufsiz = NULL;
  37:         iop->_cnt = 0;
  38:     }
  39: 
  40:     return(r);
  41: }

Defined functions

fputs defined in line 13; used 435 times

Defined variables

sccsid defined in line 8; never used
Last modified: 1986-03-10
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 3137
Valid CSS Valid XHTML 1.0 Strict