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

##### Functions

    ftell             X

       1: #if defined(LIBC_SCCS) && !defined(lint)
       2: static char sccsid[] = "@(#)ftell.c	5.2 (Berkeley) 3/9/86";
       3: #endif LIBC_SCCS and not lint
       4:
       5: /*
       6:  * Return file offset.
       7:  * Coordinates with buffering.
       8:  */
       9:
      10: #include    <stdio.h>
      11: long    lseek();
      12:
      13:
      14: long ftell(iop)
      15: register FILE *iop;
      16: {
      17:     register long tres;
      18:     register adjust;
      19:
      20:     if (iop->_cnt < 0)
      21:         iop->_cnt = 0;
      22:     if (iop->_flag&_IOREAD)
      23:         adjust = - iop->_cnt;
      24:     else if (iop->_flag&(_IOWRT|_IORW)) {
      25:         adjust = 0;
      26:         if (iop->_flag&_IOWRT && iop->_base && (iop->_flag&_IONBF)==0)
      27:             adjust = iop->_ptr - iop->_base;
      28:     } else
      29:         return(-1);
      30:     tres = lseek(fileno(iop), 0L, 1);
      31:     if (tres<0)
      32:         return(tres);
      33:     tres += adjust;
      34:     return(tres);
      35: }

#### Defined functions

ftell defined in line 14; used 114 times

- in /usr/include/stdio.h line 72
- in /usr/src/bin/diff/diffreg.c line 809
- in /usr/src/bin/mail.c line 479, 500, 627
- in /usr/src/bin/nm/nm.c line 30, 122
- in /usr/src/bin/tcsh/mkprstr.c line 21, 267
- in /usr/src/games/battlestar/mkstr.c line 27, 262
- in /usr/src/games/fortune/strfile.c line 76, 146, 153-154(2)
- in /usr/src/games/hack/alloc.c line 14
- in /usr/src/games/monop/initdeck.c line 24, 111, 126
- in /usr/src/games/phantasia/func1.c line 176
- in /usr/src/games/phantasia/phant.h line 148
- in /usr/src/games/sail/sync.c line 188
- in /usr/src/include/stdio.h line 59
- in /usr/src/lib/ccom/c1.h line 148, 166
- in /usr/src/lib/ccom/c11.c line 980
- in /usr/src/libexec/popper/pop_dropinfo.c line 86
- in /usr/src/new/PORT/B/src/bint/b3err.c line 72, 87
- in /usr/src/new/PORT/B/src/bint/b3fil.c line 168-170(2)
- in /usr/src/new/PORT/perl.1.0.0/arg.c line 483
- in /usr/src/new/PORT/perl.1.0.10/arg.c line 495
- in /usr/src/new/PORT/perl.1.0.16/arg.c line 514
- in /usr/src/new/nntp/server/newnews.c line 270, 297
- in /usr/src/new/nntp/support/mkgrdates.c line 84
- in /usr/src/new/notes/src/bnewshead.c line 151
- in /usr/src/new/notes/src/newsinput.c line 305-307(2)
- in /usr/src/new/rn/art.c line 211, 485, 659
- in /usr/src/new/rn/cheat.c line 125
- in /usr/src/new/rn/common.h line 761
- in /usr/src/new/rn/head.c line 130, 165, 340
- in /usr/src/new/rn/ngdata.c line 172, 180
- in /usr/src/sbin/dump/dumpdir.c line 173, 348
- in /usr/src/sbin/mkpasswd/mkpasswd.c line 196
- in /usr/src/ucb/Mail/def.h line 268
- in /usr/src/ucb/Mail/edit.c line 110
- in /usr/src/ucb/PORT/pascal/utilities/pc3.c line 214, 788
- in /usr/src/ucb/ctags.c line 46, 337, 434, 643, 942, 961
- in /usr/src/ucb/mkstr.c line 21, 251
- in /usr/src/ucb/msgs/msgs.c line 108, 651, 698, 768, 809
- in /usr/src/ucb/sendbug/unixtomh.c line 177
- in /usr/src/ucb/strcompact.c line 154
- in /usr/src/ucb/strings.c line 104
- in /usr/src/ucb/symcompact.c line 254
- in /usr/src/ucb/symorder.c line 195
- in /usr/src/usr.bin/join.c line 32, 104-109(2), 117
- in /usr/src/usr.bin/learn/copy.c line 93
- in /usr/src/usr.bin/look.c line 20, 61, 88
- in /usr/src/usr.bin/patch/pch.c line 232, 398, 431, 456, 560, 727, 1082
- in /usr/src/usr.bin/refer/inv2.c line 18, 27
- in /usr/src/usr.bin/refer/mkey2.c line 97
- in /usr/src/usr.bin/refer/sortbib.c line 64-69(2), 113
- in /usr/src/usr.bin/struct/1.line.c line 15, 95
- in /usr/src/usr.bin/uucp/acucntrl.c line 123
- in /usr/src/usr.bin/uucp/anlwrk.c line 79, 94
- in /usr/src/usr.lib/libI77/backspace.c line 39
- in /usr/src/usr.lib/libI77/c_dfe.c line 49
- in /usr/src/usr.lib/libI77/close.c line 82
- in /usr/src/usr.lib/libI77/err.c line 103
- in /usr/src/usr.lib/libI77/inquire.c line 114
- in /usr/src/usr.lib/libI77/sue.c line 43, 75
- in /usr/src/usr.lib/libI77/util.c line 38, 73
- in /usr/src/usr.lib/libU77/ftell_.c line 34
- in /usr/src/usr.sbin/cron/crontab.c line 499
- in /usr/src/usr.sbin/cron/env.c line 121
- in /usr/src/usr.sbin/cron/misc.c line 281

#### Defined variables

sccsid defined in line 2; never used

Last modified: 1986-03-10 Generated: 2016-12-26 | Generated by src2html V0.67 page hit count: 505 |