summaryrefslogtreecommitdiff
path: root/src/stdio/fgetc.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/stdio/fgetc.c')
-rw-r--r--src/stdio/fgetc.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/stdio/fgetc.c b/src/stdio/fgetc.c
new file mode 100644
index 00000000..8c682c39
--- /dev/null
+++ b/src/stdio/fgetc.c
@@ -0,0 +1,24 @@
+#include <stdio.h>
+#include "nonstd/io.h"
+
+/** read a character from a file stream **/
+int fgetc(FILE *stream)
+{
+ flockfile(stream);
+ char c = getc_unlocked(stream);
+ funlockfile(stream);
+ /*
+ RETURN_SUCCESS(the next character);
+ RETURN_FAILURE(CONSTANT(EOF));
+ */
+ return c;
+}
+
+/***
+reads the next character from ARGUMENT(stream) as an
+TYPE(unsigned char) converted to an TYPE(int). The file position indicator
+of ARGUMENT(stream) is advanced.
+***/
+/*
+STDC(1)
+*/