diff options
| author | Meco Man <[email protected]> | 2024-11-25 00:43:12 -0500 |
|---|---|---|
| committer | Rbb666 <[email protected]> | 2024-11-25 14:28:36 +0800 |
| commit | 9afe6a51826fb84de229de220dab2077aa5734b2 (patch) | |
| tree | 9d1b4a03e269c391d71dfc26f0bcc14375ffd8b1 /src/klibc/kstdio.c | |
| parent | f849afb5ca40f4843d86d6bd55253b2db57a7ad4 (diff) | |
[klibc] separate klibc Kconfig
Diffstat (limited to 'src/klibc/kstdio.c')
| -rw-r--r-- | src/klibc/kstdio.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/klibc/kstdio.c b/src/klibc/kstdio.c index ceb891f325..df73eab49b 100644 --- a/src/klibc/kstdio.c +++ b/src/klibc/kstdio.c @@ -9,6 +9,10 @@ */ #include <rtthread.h> +#if defined(RT_KLIBC_USING_LIBC_VSSCANF) || \ + defined(RT_KLIBC_USING_LIBC_VSNPRINTF) +#include <stdio.h> +#endif /** * @brief This function will fill a formatted string to buffer. @@ -73,6 +77,22 @@ int rt_sprintf(char *buf, const char *format, ...) } RTM_EXPORT(rt_sprintf); +#ifdef RT_KLIBC_USING_LIBC_VSNPRINTF +int rt_vsnprintf(char *buf, rt_size_t size, const char *fmt, va_list args) +{ + return vsnprintf(buf, size, fmt, args); +} +#endif /* RT_KLIBC_USING_LIBC_VSNPRINTF */ +RTM_EXPORT(rt_vsnprintf); + +#ifdef RT_KLIBC_USING_LIBC_VSSCANF +int rt_vsscanf(const char *buffer, const char *format, va_list ap) +{ + return vsscanf(buffer, format, ap); +} +#endif /* RT_KLIBC_USING_LIBC_VSSCANF */ +RTM_EXPORT(rt_vsscanf); + /** * @brief This function parses a formatted string from the input string. * |
