| Line | |
|---|
| 1 | /*
|
|---|
| 2 | * sscanf - read formatted output from a string
|
|---|
| 3 | */
|
|---|
| 4 | /* $Header: /cvsup/minix/src/lib/stdio/sscanf.c,v 1.1.1.1 2005/04/21 14:56:36 beng Exp $ */
|
|---|
| 5 |
|
|---|
| 6 | #include <stdio.h>
|
|---|
| 7 | #include <stdarg.h>
|
|---|
| 8 | #include <string.h>
|
|---|
| 9 | #include "loc_incl.h"
|
|---|
| 10 |
|
|---|
| 11 | int sscanf(const char *s, const char *format, ...)
|
|---|
| 12 | {
|
|---|
| 13 | va_list ap;
|
|---|
| 14 | int retval;
|
|---|
| 15 | FILE tmp_stream;
|
|---|
| 16 |
|
|---|
| 17 | va_start(ap, format);
|
|---|
| 18 |
|
|---|
| 19 | tmp_stream._fd = -1;
|
|---|
| 20 | tmp_stream._flags = _IOREAD + _IONBF + _IOREADING;
|
|---|
| 21 | tmp_stream._buf = (unsigned char *) s;
|
|---|
| 22 | tmp_stream._ptr = (unsigned char *) s;
|
|---|
| 23 | tmp_stream._count = strlen(s);
|
|---|
| 24 |
|
|---|
| 25 | retval = _doscan(&tmp_stream, format, ap);
|
|---|
| 26 |
|
|---|
| 27 | va_end(ap);
|
|---|
| 28 |
|
|---|
| 29 | return retval;
|
|---|
| 30 | }
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.