Implemented simple IO for getting keyboard input.
This commit is contained in:
@@ -8,8 +8,16 @@
|
||||
#include <stddef.h>
|
||||
#include "./detail/common.h"
|
||||
|
||||
#define stdin __stdin
|
||||
|
||||
BA_EXTERN_C_BEGIN
|
||||
|
||||
typedef struct __file FILE;
|
||||
|
||||
extern FILE* __stdin;
|
||||
|
||||
static int EOF = -1;
|
||||
|
||||
int putchar(int chr) BA_CXX_NOEXCEPT;
|
||||
int puts(const char* str) BA_CXX_NOEXCEPT;
|
||||
int printf(const char* format, ...) BA_CXX_NOEXCEPT __attribute__((format(printf, 1, 2)));
|
||||
@@ -17,6 +25,11 @@ int vprintf(const char* format, va_list vlist) BA_CXX_NOEXCEPT;
|
||||
int snprintf(char* buffer, size_t bufferSize, const char* format, ...) BA_CXX_NOEXCEPT __attribute__((format(printf, 3, 4)));
|
||||
int vsnprintf(char* buffer, size_t bufferSize, const char* format, va_list vlist) BA_CXX_NOEXCEPT;
|
||||
|
||||
int fgetc(FILE* stream) BA_CXX_NOEXCEPT;
|
||||
char* fgets(char* buffer, int count, FILE* stream) BA_CXX_NOEXCEPT;
|
||||
inline int getc(FILE* stream) BA_CXX_NOEXCEPT { return fgetc(stream); }
|
||||
inline int getchar() BA_CXX_NOEXCEPT { return fgetc(stdin); }
|
||||
|
||||
BA_EXTERN_C_END
|
||||
|
||||
#endif // !defined(BAD_APPLE_OS_STDIO_H_INCLUDED)
|
||||
|
||||
Reference in New Issue
Block a user