parent
c09f8dfa79
commit
a78b0a4321
|
@ -2,6 +2,7 @@
|
||||||
#define __STDIO_H
|
#define __STDIO_H
|
||||||
|
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
|
#include <console.h>
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* STDIO based functions (can always be used)
|
* STDIO based functions (can always be used)
|
||||||
|
@ -11,24 +12,33 @@
|
||||||
void serial_printf (const char *fmt, ...);
|
void serial_printf (const char *fmt, ...);
|
||||||
|
|
||||||
/* stdin */
|
/* stdin */
|
||||||
int getc(void);
|
|
||||||
int tstc(void);
|
int tstc(void);
|
||||||
|
|
||||||
/* stdout */
|
/* stdout */
|
||||||
void putc(const char c);
|
void console_putc(unsigned int ch, const char c);
|
||||||
void puts(const char *s);
|
int getc(void);
|
||||||
|
void console_puts(unsigned int ch, const char *s);
|
||||||
|
|
||||||
|
static inline void puts(const char *s) {
|
||||||
|
return console_puts(CONSOLE_STDOUT, s);
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline void putc(char c) {
|
||||||
|
console_putc(CONSOLE_STDOUT, c);
|
||||||
|
}
|
||||||
|
|
||||||
void printf(const char *fmt, ...);
|
void printf(const char *fmt, ...);
|
||||||
void vprintf(const char *fmt, va_list args);
|
void vprintf(const char *fmt, va_list args);
|
||||||
int sprintf(char * buf, const char *fmt, ...);
|
int sprintf(char * buf, const char *fmt, ...);
|
||||||
int vsprintf(char *buf, const char *fmt, va_list args);
|
int vsprintf(char *buf, const char *fmt, va_list args);
|
||||||
|
|
||||||
/* stderr */
|
/* stderr */
|
||||||
#define eputc(c) fputc(stderr, c)
|
#define eputc(c) console_putc(CONSOLE_STDERR, c)
|
||||||
#define eputs(s) fputs(stderr, s)
|
#define eputs(s) console_puts(CONSOLE_STDERR, s)
|
||||||
#define eprintf(fmt,args...) fprintf(stderr,fmt ,##args)
|
#define eprintf(fmt,args...) fprintf(stderr,fmt ,##args)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* FILE based functions (can only be used AFTER relocation!)
|
* FILE based functions
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define stdin 0
|
#define stdin 0
|
||||||
|
@ -37,8 +47,8 @@ int vsprintf(char *buf, const char *fmt, va_list args);
|
||||||
#define MAX_FILES 16
|
#define MAX_FILES 16
|
||||||
|
|
||||||
void fprintf(int file, const char *fmt, ...);
|
void fprintf(int file, const char *fmt, ...);
|
||||||
void fputs(int file, const char *s);
|
int fputs(int file, const char *s);
|
||||||
void fputc(int file, const char c);
|
int fputc(int file, const char c);
|
||||||
int ftstc(int file);
|
int ftstc(int file);
|
||||||
int fgetc(int file);
|
int fgetc(int file);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue