Untitled_Kernel/include/io.h
lordtet 7b4e4afd43 Defined a couple of functions, added documentation templates
Didn't feel the need to make a new branch for this one, but i added some
doxygen documentation templates to all of the headers. It's a bit
overdue.
2025-07-17 07:36:45 -04:00

78 lines
1.1 KiB
C

/**
* @file io.h
* @brief In/Out
* @details 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>
/**
* @brief
*/
typedef struct char_writer_s char_writer_t;
/**
* @brief
*/
struct char_writer_s {
int (*putChar)(void* ctx, char out); /**< @brief */
void* ctx; /**< @brief */
};
/**
* @brief
*/
extern char_writer_t* default_output;
/**
* @brief
* @param
* @param
* @return int
*/
int putc(char_writer_t*, char);
/**
* @brief
* @param
* @param
* @return int
*/
int print(char_writer_t*, const char*);
/**
* @brief
* @param
* @param
* @return int
*/
int println(char_writer_t*, const char*);
/**
* @brief
* @param
* @param
* @return int
*/
int printhex(char_writer_t*, uint64_t);
/**
* @brief
* @param
* @param out
* @return int
*/
int prindec(char_writer_t*, uint64_t out);
/**
* @brief
* @param
* @param fmt
* @param ...
* @return int
*/
int printf(char_writer_t*, const char* fmt, ...);
#endif