# 2.11BSD#431 - /usr/src/lib/libc/stdio/fwrite.c

##### Functions

    fwrite            X

       1: /*
       2:  * Copyright (c) 1980 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[] = "@(#)fwrite.c	5.2 (Berkeley) 3/9/86";
       9: #endif LIBC_SCCS and not lint
      10:
      11: #include    <stdio.h>
      12:
      13: fwrite(ptr, size, count, iop)
      14:     register char *ptr;
      15:     unsigned size, count;
      16:     register FILE *iop;
      17: {
      18:     register unsigned s;
      19:
      20:     s = size * count;
      21:     if (iop->_flag & _IOLBF)
      22:         while (s > 0) {
      23:             if (--iop->_cnt > -iop->_bufsiz && *ptr != '\n')
      24:                 *iop->_ptr++ = *ptr++;
      25:             else if (_flsbuf(*(unsigned char *)ptr++, iop) == EOF)
      26:                 break;
      27:             s--;
      28:         }
      29:     else while (s > 0) {
      30:         if (iop->_cnt < s) {
      31:             if (iop->_cnt > 0) {
      32:                 bcopy(ptr, iop->_ptr, iop->_cnt);
      33:                 ptr += iop->_cnt;
      34:                 iop->_ptr += iop->_cnt;
      35:                 s -= iop->_cnt;
      36:             }
      37:             if (_flsbuf(*(unsigned char *)ptr++, iop) == EOF)
      38:                 break;
      39:             s--;
      40:         }
      41:         if (iop->_cnt >= s) {
      42:             bcopy(ptr, iop->_ptr, s);
      43:             iop->_ptr += s;
      44:             iop->_cnt -= s;
      45:             return (count);
      46:         }
      47:     }
      48:     return (size != 0 ? count - ((s + size - 1) / size) : 0);
      49: }

#### Defined functions

fwrite defined in line 13; used 244 times

- in /usr/ingres/source/dbu/copy.c line 300
- in /usr/ingres/source/dbu/ksort.c line 229, 282
- in /usr/ingres/source/dbu/modify.c line 750
- in /usr/ingres/source/iutil/printup.c line 104, 153
- in /usr/src/bin/ld/ld.c line 1223-1225(2), 1351, 1509, 1564-1567(2), 1588-1591(2), 1605, 1618, 1675
- in /usr/src/bin/ps.c line 724-730(7)
- in /usr/src/bin/tcsh/mkprstr.c line 269-270(2)
- in /usr/src/games/battlestar/mkstr.c line 264-265(2)
- in /usr/src/games/battlestar/save.c line 85-119(32)
- in /usr/src/games/fortune/fortune.c line 94
- in /usr/src/games/fortune/strfile.c line 192-193(2)
- in /usr/src/games/hunt/playit.c line 348, 379-383(2)
- in /usr/src/games/monop/initdeck.c line 51-60(6)
- in /usr/src/games/phantasia/func0.c line 59
- in /usr/src/games/phantasia/func1.c line 49, 227, 532
- in /usr/src/games/phantasia/func2.c line 66, 214, 519, 826
- in /usr/src/games/phantasia/setfiles.c line 71, 82
- in /usr/src/games/rogue/save.c line 349
- in /usr/src/games/rogue/score.c line 265-267(2)
- in /usr/src/games/sail/misc.c line 188, 195-197(2)
- in /usr/src/games/sail/sync.c line 183
- in /usr/src/lib/mip/fort.c line 100
- in /usr/src/libexec/acctd/acctd.c line 203, 284
- in /usr/src/libexec/identd/src/idecrypt.c line 66, 74
- in /usr/src/local/mtools/file_read.c line 53, 61
- in /usr/src/new/OLD/apl/src/aplcvt.c line 205, 224, 240, 249, 299-304(2), 340-341(2), 364, 381, 390, 439-445(3)
- in /usr/src/new/OLD/buildcore.c line 92, 106
- in /usr/src/new/PORT/apl/src/aplcvt.c line 205, 224, 240, 249, 299-304(2), 340-341(2), 364, 381, 390, 439-445(3)
- in /usr/src/new/ansi/ansitape.c line 597-598(2), 627-628(2)
- in /usr/src/new/l11/pass2.c line 96
- in /usr/src/new/notes/src/access.c line 112
- in /usr/src/new/notes/src/acssort.c line 116
- in /usr/src/new/notes/src/cursor.c line 218
- in /usr/src/new/notes/src/limindx.c line 136
- in /usr/src/new/notes/src/prtind.c line 80
- in /usr/src/old/512dumpdir.c line 412
- in /usr/src/old/dump/dumpdir.c line 324
- in /usr/src/sbin/dump/dumpdir.c line 334, 346
- in /usr/src/sbin/quotacheck/quotacheck.c line 331
- in /usr/src/share/zoneinfo/zic.c line 1029, 1037
- in /usr/src/ucb/Mail/fio.c line 93, 151, 227
- in /usr/src/ucb/Mail/send.c line 177-179(2), 203-205(2), 215, 545
- in /usr/src/ucb/PORT/pascal/pdx/defs.h line 76
- in /usr/src/ucb/PORT/pascal/pdx/library.c line 60
- in /usr/src/ucb/PORT/pascal/px/interp.c line 1444
- in /usr/src/ucb/PORT/pascal/px/utilities.c line 55
- in /usr/src/ucb/PORT/pascal/src/savenl.c line 227, 284, 301
- in /usr/src/ucb/compress/compress.c line 962, 991, 1246, 1266
- in /usr/src/ucb/error/errortouch.c line 562, 639
- in /usr/src/ucb/indent/io.c line 225-227(2)
- in /usr/src/ucb/mkstr.c line 253-254(2)
- in /usr/src/ucb/msgs/msgs.c line 734
- in /usr/src/ucb/rdist/docmd.c line 517
- in /usr/src/ucb/rdist/server.c line 565, 1133, 1480
- in /usr/src/ucb/script.c line 144
- in /usr/src/ucb/sendbug/bugfiler.c line 772-777(2)
- in /usr/src/ucb/strcompact.c line 122, 129, 152, 161
- in /usr/src/ucb/symcompact.c line 236, 260-265(2), 276
- in /usr/src/ucb/symorder.c line 178-180(2), 208-209(2), 221-222(2), 230, 241
- in /usr/src/ucb/tn3270/tn3270.c line 1382
- in /usr/src/ucb/xstr.c line 338
- in /usr/src/usr.bin/diction/diction.c line 192, 278, 324
- in /usr/src/usr.bin/diff3/diff3.c line 449
- in /usr/src/usr.bin/find/code.c line 55
- in /usr/src/usr.bin/lint/lint.c line 257, 313, 790-796(3), 1018-1021(2)
- in /usr/src/usr.bin/prof/prof.c line 479-490(4)
- in /usr/src/usr.bin/ranlib/build.c line 229-234(2), 249-259(3), 267
- in /usr/src/usr.bin/refer/inv6.c line 64-67(4)
- in /usr/src/usr.bin/refer/sortbib.c line 159
- in /usr/src/usr.bin/spell/spellin.c line 38
- in /usr/src/usr.bin/tip/tipout.c line 118
- in /usr/src/usr.bin/uucp/fio.c line 271
- in /usr/src/usr.bin/uucp/uux.c line 196
- in /usr/src/usr.lib/libI77/douio.c line 36, 61
- in /usr/src/usr.lib/libI77/due.c line 73
- in /usr/src/usr.lib/libI77/sue.c line 74-77(2)
- in /usr/src/usr.sbin/htable/htable.c line 336
- in /usr/src/usr.sbin/lpr/cmds.c line 690
- in /usr/src/usr.sbin/lpr/displayq.c line 143, 165, 210
- in /usr/src/usr.sbin/lpr/filters/vpsf.c line 256
- in /usr/src/usr.sbin/lpr/rmjob.c line 278
- in /usr/src/usr.sbin/lpr/startdaemon.c line 78
- in /usr/src/usr.sbin/named/named/ns_req.c line 585-586(2)
- in /usr/src/usr.sbin/sa/sa.c line 432-435(2), 444

#### Defined variables

sccsid defined in line 8; never used

Last modified: 1987-03-15 Generated: 2016-12-26 | Generated by src2html V0.67 page hit count: 520 |