Skip to content

Commit a113dfa

Browse files
committed
[klibc] add rt_sscanf
1 parent 13e0671 commit a113dfa

File tree

6 files changed

+528
-1
lines changed

6 files changed

+528
-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: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@
1111
#ifndef __RT_KSTRING_H__
1212
#define __RT_KSTRING_H__
1313

14+
#include <stdint.h>
15+
#include <rttypes.h>
16+
1417
#ifdef __cplusplus
1518
extern "C" {
1619
#endif
@@ -19,6 +22,7 @@ void *rt_memset(void *src, int c, rt_ubase_t n);
1922
void *rt_memcpy(void *dest, const void *src, rt_ubase_t n);
2023
void *rt_memmove(void *dest, const void *src, rt_size_t n);
2124
rt_int32_t rt_memcmp(const void *cs, const void *ct, rt_size_t count);
25+
2226
char *rt_strdup(const char *s);
2327
rt_size_t rt_strnlen(const char *s, rt_ubase_t maxlen);
2428
char *rt_strstr(const char *str1, const char *str2);
@@ -29,6 +33,8 @@ rt_int32_t rt_strncmp(const char *cs, const char *ct, rt_size_t count);
2933
rt_int32_t rt_strcmp(const char *cs, const char *ct);
3034
rt_size_t rt_strlen(const char *src);
3135

36+
uintmax_t rt_strntoumax(const char *nptr, char **endptr, int base, size_t n);
37+
3238
#ifdef __cplusplus
3339
}
3440
#endif

0 commit comments

Comments
 (0)