stdio: add vsnprintf and change printf to kprintf
This commit is contained in:
parent
05c528f64c
commit
0395b65ad8
21 changed files with 102 additions and 186 deletions
|
|
@ -3,12 +3,12 @@
|
|||
#define _ASSERT_H_
|
||||
|
||||
#ifdef KDEBUG
|
||||
#define assert(expr) \
|
||||
do { \
|
||||
if (!(expr)) { \
|
||||
printf(LOG_ERROR "assertion failed: %s, file %s, line %d\n", #expr, __FILE__, __LINE__); \
|
||||
yield(); \
|
||||
} \
|
||||
#define assert(expr) \
|
||||
do { \
|
||||
if (!(expr)) { \
|
||||
kprintf(LOG_ERROR "assertion failed: %s, file %s, line %d\n", #expr, __FILE__, __LINE__); \
|
||||
yield(); \
|
||||
} \
|
||||
} while (0)
|
||||
#else
|
||||
#define assert(expr) ((void)0)
|
||||
|
|
|
|||
8
include/fs/fat32.h
Normal file
8
include/fs/fat32.h
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||
#ifndef _FAT32_H_
|
||||
#define _FAT32_H_
|
||||
|
||||
#include <kernel/common.h>
|
||||
#include <kernel/block.h>
|
||||
|
||||
#endif /* _FAT32_H_ */
|
||||
|
|
@ -15,7 +15,11 @@
|
|||
#define LOG_SUCCESS "[" COL_GREEN_BLACK "RDY" COL_RESET "] "
|
||||
#define LOG_INFO "[LOG] "
|
||||
|
||||
int printf(const char *restrict fmt, ...);
|
||||
#include <stddef.h>
|
||||
#include <stdarg.h>
|
||||
|
||||
int kprintf(const char *restrict fmt, ...);
|
||||
int snprintf(char *str, const char *restrict fmt, size_t size, ...);
|
||||
int vsnprintf(char *str, const char *restrict fmt, size_t size, va_list args);
|
||||
|
||||
#endif /* _SDTIO_H_ */
|
||||
|
|
|
|||
Loading…
Reference in a new issue