aboutsummaryrefslogtreecommitdiff
path: root/system/lib/libc/musl/src/internal/shgetc.h
diff options
context:
space:
mode:
Diffstat (limited to 'system/lib/libc/musl/src/internal/shgetc.h')
-rw-r--r--system/lib/libc/musl/src/internal/shgetc.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/system/lib/libc/musl/src/internal/shgetc.h b/system/lib/libc/musl/src/internal/shgetc.h
new file mode 100644
index 00000000..7beb8ce6
--- /dev/null
+++ b/system/lib/libc/musl/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)