diff options
author | H. Peter Anvin <hpa@zytor.com> | 2002-08-09 23:36:40 +0000 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2002-08-09 23:36:40 +0000 |
commit | 3a957ffcb0c2a0fe39fac7770606fba85597e9a9 (patch) | |
tree | c87aa3fad813f77ea0b1c7264bf92b836d11581b | |
parent | c51c17701c881be01070085a622b9feb31bbff12 (diff) | |
download | klibc-3a957ffcb0c2a0fe39fac7770606fba85597e9a9.tar.gz |
Add sscan(); add sscanf() and vsscanf() to <stdio.h>klibc-0.5
-rw-r--r-- | include/stdio.h | 3 | ||||
-rw-r--r-- | klibc/Makefile | 2 | ||||
-rw-r--r-- | klibc/include/stdio.h | 3 | ||||
-rw-r--r-- | klibc/sscanf.c | 17 | ||||
-rw-r--r-- | sscanf.c | 17 |
5 files changed, 41 insertions, 1 deletions
diff --git a/include/stdio.h b/include/stdio.h index f8631e4bfe59e..9ffda494e4ebe 100644 --- a/include/stdio.h +++ b/include/stdio.h @@ -29,4 +29,7 @@ __extern int vsprintf(char *, const char *, va_list); __extern int snprintf(char *, size_t n, const char *, ...); __extern int vsnprintf(char *, size_t n, const char *, va_list); +__extern int sscanf(const char *, const char *, ...); +__extern int vsscanf(const char *, const char *, va_list); + #endif /* _STDIO_H */ diff --git a/klibc/Makefile b/klibc/Makefile index f05ef1a9f8652..ea68b318ea5fe 100644 --- a/klibc/Makefile +++ b/klibc/Makefile @@ -12,7 +12,7 @@ PERL = perl TESTS = testvsnp hello minihello microhello getenvtest \ getopttest malloctest LIBOBJS = vsnprintf.o snprintf.o vsprintf.o sprintf.o \ - vsscanf.o ctypes.o \ + vsscanf.o sscanf.o ctypes.o \ strntoumax.o strntoimax.o \ atoi.o atol.o atoll.o \ strtol.o strtoll.o strtoul.o strtoull.o \ diff --git a/klibc/include/stdio.h b/klibc/include/stdio.h index f8631e4bfe59e..9ffda494e4ebe 100644 --- a/klibc/include/stdio.h +++ b/klibc/include/stdio.h @@ -29,4 +29,7 @@ __extern int vsprintf(char *, const char *, va_list); __extern int snprintf(char *, size_t n, const char *, ...); __extern int vsnprintf(char *, size_t n, const char *, va_list); +__extern int sscanf(const char *, const char *, ...); +__extern int vsscanf(const char *, const char *, va_list); + #endif /* _STDIO_H */ diff --git a/klibc/sscanf.c b/klibc/sscanf.c new file mode 100644 index 0000000000000..81aab9e05b311 --- /dev/null +++ b/klibc/sscanf.c @@ -0,0 +1,17 @@ +/* + * sscanf() + */ + +#include <stdio.h> + +int sscanf(const char *str, const char *format, ...) +{ + va_list ap; + int rv; + + va_start(ap, format); + rv = vsscanf(str, format, ap); + va_end(ap); + + return rv; +} diff --git a/sscanf.c b/sscanf.c new file mode 100644 index 0000000000000..81aab9e05b311 --- /dev/null +++ b/sscanf.c @@ -0,0 +1,17 @@ +/* + * sscanf() + */ + +#include <stdio.h> + +int sscanf(const char *str, const char *format, ...) +{ + va_list ap; + int rv; + + va_start(ap, format); + rv = vsscanf(str, format, ap); + va_end(ap); + + return rv; +} |