반응형
int
sscanf(const char *str, const char *fmt, ...)
#include <stdio.h< #include <string.h< #include <stdarg.h< #include "local.h" /* ARGSUSED */ static int eofread(void *cookie, char *buf, int len) { return (0); } int sscanf(const char *str, const char *fmt, ...) { int ret; va_list ap; FILE f; struct __sfileext fext; _FILEEXT_SETUP(&f, &fext); f._flags = __SRD; f._bf._base = f._p = (unsigned char *)str; f._bf._size = f._r = strlen(str); f._read = eofread; f._lb._base = NULL; va_start(ap, fmt); ret = vfscanf(&f, fmt, ap); va_end(ap); return (ret); }
반응형