rework langinfo code for ABI compat and for use by time code
[musl] / src / internal / shgetc.h
1 #include "stdio_impl.h"
2
3 void __shlim(FILE *, off_t);
4 int __shgetc(FILE *);
5
6 #define shcnt(f) ((f)->shcnt + ((f)->rpos - (f)->rend))
7 #define shlim(f, lim) __shlim((f), (lim))
8 #define shgetc(f) (((f)->rpos < (f)->shend) ? *(f)->rpos++ : __shgetc(f))
9 #define shunget(f) ((f)->shend ? (void)(f)->rpos-- : (void)0)