instead of stuffing all of the i/o stuff into the "kio" library, i've decided to rework i/o to be a generic handler that takes in a function pointer for putc, and does the rest of the logic onto that pointer. That way, you can pass any function that can take in characters and move them to buffers. I'll do a writeup on this at some point to document it.
18 lines
481 B
C
18 lines
481 B
C
/* io.h
|
|
* In/Out
|
|
*
|
|
* Common library for handling user i/o. Aims to be mechanic agnostic, and instead
|
|
* focus on implementing generic functions to format and manipulate data.
|
|
*/
|
|
#ifndef IO_H
|
|
#define IO_H
|
|
#include <stdint.h>
|
|
|
|
int putc(int (*)(char), char);
|
|
int print(int (*)(char), const char*);
|
|
int println(int (*)(char), const char*);
|
|
int printhex(int (*)(char), uint32_t);
|
|
int prindec(int (*)(char), uint32_t out);
|
|
int printf(int (*)(char), const char* fmt, ...);
|
|
|
|
#endif
|