MCPcopy Create free account
hub / github.com/GJDuck/e9patch / fgetc_unlocked

Function fgetc_unlocked

examples/stdlib.c:3596–3615  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3594}
3595
3596static int fgetc_unlocked(FILE *stream)
3597{
3598 if (stdio_stream_read_init(stream) < 0)
3599 return EOF;
3600 if (stream->unget != EOF)
3601 {
3602 int c = stream->unget;
3603 stream->unget = EOF;
3604 return c;
3605 }
3606 if (stream->read_ptr == NULL)
3607 {
3608 char buf[1];
3609 if (stdio_stream_read_buf(stream, buf, buf+1) < 0)
3610 return EOF;
3611 return (int)buf[0];
3612 }
3613 char c = *stream->read_ptr++;
3614 return (int)c;
3615}
3616
3617static int fgetc(FILE *stream)
3618{

Callers 6

fgetcFunction · 0.85
fgets_unlockedFunction · 0.85
getc_unlockedFunction · 0.85
getchar_unlockedFunction · 0.85
fread_unlockedFunction · 0.85
scanf_get_charFunction · 0.85

Calls 2

stdio_stream_read_initFunction · 0.85
stdio_stream_read_bufFunction · 0.85

Tested by

no test coverage detected