Warning: Attempt to read property "date" on null in /usr/local/www/websvn.planix.org/blame.php on line 247

Warning: Attempt to read property "msg" on null in /usr/local/www/websvn.planix.org/blame.php on line 247
WebSVN – planix.SVN – Blame – /os/branches/feature_fixcpp/sys/src/libstdio/ftell.c – Rev 2

Subversion Repositories planix.SVN

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
2 - 1
/*
2
 * pANS stdio -- ftell
3
 */
4
#include "iolib.h"
5
long ftell(FILE *f){
6
	long seekp=seek(f->fd, 0L, 1);
7
	if(seekp<0) return -1;		/* enter error state? */
8
	switch(f->state){
9
	default:
10
		return seekp;
11
	case RD:
12
		return seekp-(f->wp-f->rp);
13
	case WR:
14
		return (f->flags&LINEBUF?f->lp:f->wp)-f->buf+seekp;
15
	}
16
}