about summary refs log tree commit diff
path: root/src/stdio/ext2.c
blob: 34162780131849adc93b4508516e0a4450bc07ed (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#include "stdio_impl.h"
#include <stdio_ext.h>

size_t __freadahead(FILE *f)
{
	return f->rend ? f->rend - f->rpos : 0;
}

const char *__freadptr(FILE *f, size_t *sizep)
{
	if (f->rpos == f->rend) return 0;
	*sizep = f->rend - f->rpos;
	return (const char *)f->rpos;
}

void __freadptrinc(FILE *f, size_t inc)
{
	f->rpos += inc;
}

void __fseterr(FILE *f)
{
	f->flags |= F_ERR;
}