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 182 times
- in /usr/include/stdio.h line
59
- in /usr/src/bin/diff/diffreg.c line
807
- in /usr/src/bin/mail.c line
53,
496,
517,
665
- in /usr/src/bin/nm.c line
29,
160,
291
- in /usr/src/etc/dump/dumpitime.c line
152
- in /usr/src/etc/restore/dirs.c line
339
- in /usr/src/games/fortune/strfile.c line
76,
146,
153-154(2)
- in /usr/src/games/monop/initdeck.c line
24,
111,
126
- in /usr/src/games/sail/sync.c line
188
- in /usr/src/include/stdio.h line
59
- in /usr/src/new/B/src/bint/b3err.c line
72,
87
- in /usr/src/new/B/src/bint/b3fil.c line
168-170(2)
- in /usr/src/new/X/xdvi/dv.c line
731,
848,
1420
- in /usr/src/new/bib/src/alpha.seek.c line
59
- in /usr/src/new/bib/src/invert.c line
80
- in /usr/src/new/bib/src/locate.c line
77
- in /usr/src/new/bib/src/streams.c line
62,
91,
110
- in /usr/src/new/dipress/src/bin/ipmetrics/execute.c line
181
- in /usr/src/new/dipress/src/bin/ipmetrics/parse.c line
59
- in /usr/src/new/dipress/src/bin/restotext/parse.c line
50
- in /usr/src/new/dipress/src/bin/stackres/execute.c line
361,
520,
575
- in /usr/src/new/dipress/src/bin/stackres/parse.c line
50
- in /usr/src/new/emacs/etc/etags.c line
87,
844
- in /usr/src/new/emacs/etc/yow.c line
53
- in /usr/src/new/icon/pifuncs/seek.c line
25,
39
- in /usr/src/new/mh/miscellany/patch/patch.c line
641,
1209,
1342,
1367,
1452,
1465,
1573
- in /usr/src/new/mh/sbr/m_getfld.c line
437,
522
- in /usr/src/new/mh/uip/inc.c line
508-511(2),
517
- in /usr/src/new/mh/uip/msh.c line
932,
940
- in /usr/src/new/mh/uip/mshcmds.c line
343,
1441,
2312,
2644,
2668
- in /usr/src/new/mh/uip/scansbr.c line
232
- in /usr/src/new/mh/zotnet/mf/mmdfI/src/uucp/rmail.c line
568,
613
- in /usr/src/new/news/src/digest.c line
241,
248,
265
- in /usr/src/new/news/src/expire.c line
615,
1001
- in /usr/src/new/news/src/header.c line
160
- in /usr/src/new/news/src/ifuncs.c line
547
- in /usr/src/new/news/src/inews.c line
475
- in /usr/src/new/news/src/readr.c line
136
- in /usr/src/new/news/src/rfuncs.c line
37,
511-515(2)
- in /usr/src/new/news/src/rfuncs2.c line
315
- in /usr/src/new/news/src/visual.c line
694,
1170,
2446
- in /usr/src/new/nntp/rrn/art.c line
206,
480,
652
- in /usr/src/new/nntp/rrn/cheat.c line
125
- in /usr/src/new/nntp/rrn/common.h line
754
- in /usr/src/new/nntp/rrn/head.c line
130,
165,
307
- in /usr/src/new/nntp/rrn/ngdata.c line
152,
160
- in /usr/src/new/nntp/server/newnews.c line
196,
223
- in /usr/src/new/nntp/support/mkgrdates.c line
72
- in /usr/src/new/nntp/xmit/rfc822.c line
106
- in /usr/src/new/notes/src/bnewshead.c line
148
- in /usr/src/new/notes/src/newsinput.c line
247-249(2)
- in /usr/src/new/patch/patch.c line
655,
1223,
1356,
1381,
1483,
1620
- 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
730
- in /usr/src/new/rn/head.c line
129,
164,
283
- in /usr/src/new/rn/ngdata.c line
115,
123
- in /usr/src/new/spms/src/bin/plog/Plog.c line
360,
366
- in /usr/src/new/sunrpc/xdr_stdio.c line
159
- in /usr/src/new/xns/compiler/code.c line
170
- in /usr/src/old/berknet/v6mail.c line
555
- in /usr/src/old/fed/io.c line
303-307(2)
- in /usr/src/ucb/Mail/aux.c line
249
- in /usr/src/ucb/Mail/def.h line
265
- in /usr/src/ucb/ctags.c line
48,
337,
434,
643,
1002,
1021
- in /usr/src/ucb/lisp/franz/lam8.c line
170
- in /usr/src/ucb/mkstr.c line
21,
254
- in /usr/src/ucb/msgs/msgs.c line
108,
651,
698,
768,
809
- in /usr/src/ucb/pascal/utilities/pc3.c line
214,
788
- in /usr/src/ucb/sendbug/unixtomh.c line
177
- in /usr/src/ucb/strings.c line
22,
107
- in /usr/src/ucb/sysline/sysline.c line
947
- in /usr/src/undoc/v6mail.c line
338
- in /usr/src/usr.bin/f77/src/f77pass1/putpcc.c line
153,
200
- 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
59,
86
- in /usr/src/usr.bin/ranlib.c line
32,
137,
231
- in /usr/src/usr.bin/refer/inv2.c line
18,
27
- in /usr/src/usr.bin/refer/mkey2.c line
95
- 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
117
- in /usr/src/usr.bin/uucp/anlwrk.c line
20,
80,
95
- 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
109
- in /usr/src/usr.lib/libI77/fio.h line
25
- 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.lib/libpc/TELL.c line
21
Defined variables
sccsid
defined in line
2;
never used