Index: fusl/src/internal/shgetc.h |
diff --git a/fusl/src/internal/shgetc.h b/fusl/src/internal/shgetc.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..7beb8ce62182b64bb6f7349640b6f2d833b113c3 |
--- /dev/null |
+++ b/fusl/src/internal/shgetc.h |
@@ -0,0 +1,9 @@ |
+#include "stdio_impl.h" |
+ |
+void __shlim(FILE *, off_t); |
+int __shgetc(FILE *); |
+ |
+#define shcnt(f) ((f)->shcnt + ((f)->rpos - (f)->rend)) |
+#define shlim(f, lim) __shlim((f), (lim)) |
+#define shgetc(f) (((f)->rpos < (f)->shend) ? *(f)->rpos++ : __shgetc(f)) |
+#define shunget(f) ((f)->shend ? (void)(f)->rpos-- : (void)0) |