ungetc.c\stdio\src - musl - musl - an implementation of the standard library for Linux-based systems

index : musl
musl - an implementation of the standard library for Linux-based systems
summary refs log tree commit diff
path: root/src/stdio/ungetc.c
blob: 7f56f8d5f07b79dba384f9ef02fe2b8c160b6467 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#include "stdio_impl.h"
int ungetc(int c, FILE *f)
{
	if (c == EOF) return c;
	FLOCK(f);
	if ((!f->rend && __toread(f)) || f->rpos <= f->buf - UNGET) {
		FUNLOCK(f);
		return EOF;
	}
	*--f->rpos = c;
	f->flags &= ~F_EOF;
	FUNLOCK(f);
	return c;
}
generated by cgit v1.2.1 (git 2.18.0) at 2025年09月24日 20:39:16 +0000

AltStyle によって変換されたページ (->オリジナル) /