Skip to content

Commit 63c7570

Browse files
committed
[klibc] add rt_sscanf
cherry-pick from: https://github.com/PetteriAimonen/Baselibc/blob/master/src/vsscanf.c BSD license
1 parent 13e0671 commit 63c7570

File tree

5 files changed

+496
-1
lines changed

5 files changed

+496
-1
lines changed

include/klibc/kerrno.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#define __RT_KERRNO_H__
1313

1414
#include <rtconfig.h>
15+
#include <rttypes.h>
1516

1617
#ifdef __cplusplus
1718
extern "C" {

include/klibc/kstdio.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@
1111
#ifndef __RT_KSTDIO_H__
1212
#define __RT_KSTDIO_H__
1313

14+
#include <rttypes.h>
15+
#include <stdarg.h>
16+
1417
#ifdef __cplusplus
1518
extern "C" {
1619
#endif
@@ -19,6 +22,8 @@ int rt_vsprintf(char *dest, const char *format, va_list arg_ptr);
1922
int rt_vsnprintf(char *buf, rt_size_t size, const char *fmt, va_list args);
2023
int rt_sprintf(char *buf, const char *format, ...);
2124
int rt_snprintf(char *buf, rt_size_t size, const char *format, ...);
25+
int rt_sscanf(const char *str, const char *format, ...);
26+
int rt_vsscanf(const char *buffer, const char *format, va_list ap);
2227

2328
#ifdef __cplusplus
2429
}

include/klibc/kstring.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
#ifndef __RT_KSTRING_H__
1212
#define __RT_KSTRING_H__
1313

14+
#include <rttypes.h>
15+
1416
#ifdef __cplusplus
1517
extern "C" {
1618
#endif
@@ -19,6 +21,7 @@ void *rt_memset(void *src, int c, rt_ubase_t n);
1921
void *rt_memcpy(void *dest, const void *src, rt_ubase_t n);
2022
void *rt_memmove(void *dest, const void *src, rt_size_t n);
2123
rt_int32_t rt_memcmp(const void *cs, const void *ct, rt_size_t count);
24+
2225
char *rt_strdup(const char *s);
2326
rt_size_t rt_strnlen(const char *s, rt_ubase_t maxlen);
2427
char *rt_strstr(const char *str1, const char *str2);

0 commit comments

Comments
 (0)