xref: /third_party/musl/porting/linux/user/src/stdio/vsscanf.c
  • Home
  • History
  • Annotate Annotate
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
  • only in /third_party/musl/porting/linux/user/src/stdio/
1570af302Sopenharmony_ci#include "stdio_impl.h"
2570af302Sopenharmony_ci#include <string.h>
3570af302Sopenharmony_ci
4570af302Sopenharmony_ci// Empty implementation because vfscanf operates rpos directly.
5570af302Sopenharmony_cistatic size_t string_read(FILE *f, unsigned char *buf, size_t len)
6570af302Sopenharmony_ci{
7570af302Sopenharmony_ci	return 0;
8570af302Sopenharmony_ci}
9570af302Sopenharmony_ci
10570af302Sopenharmony_ciint vsscanf(const char *restrict s, const char *restrict fmt, va_list ap)
11570af302Sopenharmony_ci{
12570af302Sopenharmony_ci	size_t s_len = strlen(s);
13570af302Sopenharmony_ci	FILE f = {
14570af302Sopenharmony_ci		.buf = (void *)s, .cookie = (void *)s,
15570af302Sopenharmony_ci		.read = string_read, .lock = -1,
16570af302Sopenharmony_ci		.buf_size = s_len, .rpos = s, .rend = s + s_len,
17570af302Sopenharmony_ci	};
18570af302Sopenharmony_ci	return vfscanf(&f, fmt, ap);
19570af302Sopenharmony_ci}
20570af302Sopenharmony_ci
21570af302Sopenharmony_ciweak_alias(vsscanf,__isoc99_vsscanf);
22

Indexes created Thu Nov 07 10:32:03 CST 2024