|
|
1.1 ! root 1: /* ! 2: * pANS stdio -- sscanf ! 3: */ ! 4: #include "iolib.h" ! 5: int sscanf(const char *s, const char *fmt, ...){ ! 6: int n; ! 7: va_list args; ! 8: #ifdef V10 ! 9: FILE _strbuf; ! 10: ! 11: _strbuf._flag = _IOREAD|_IOSTRG; ! 12: _strbuf._ptr = _strbuf._base = (unsigned char *) s; ! 13: _strbuf._cnt = 0; ! 14: while (*s++) ! 15: _strbuf._cnt++; ! 16: #define f &_strbuf ! 17: #define sclose(x) ! 18: #else ! 19: FILE *f=sopenr(s); ! 20: #endif ! 21: va_start(args, fmt); ! 22: n=vfscanf(f, fmt, args); ! 23: va_end(args); ! 24: sclose(f); ! 25: return n; ! 26: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.