my stdio.h implementation
More...
#include "graphic.h"
#include "utilities.h"
#include <stdarg.h>
Go to the source code of this file.
|
static int16_t | _draw_char (char ch, int offset, uint8_t style) |
|
static int16_t | putch_style (char ch, uint8_t style) |
|
static int16_t | putch (char ch) |
|
static int16_t | padding (int16_t num) |
|
static int16_t | __uts_read_int (const char *s, int16_t *readNum) |
|
static int16_t | draw_str (char const *str, int row, int col) |
|
static int16_t | newline () |
|
static int16_t | draw_str_style (char const *str, int row, int col, uint8_t style) |
|
static int16_t | draw_char_style (char ch, int row, int col, uint8_t style) |
|
static int16_t | puts_style (char const *str, uint8_t style) |
|
static int16_t | puts (char const *str) |
|
static int16_t | putln (char const *str) |
|
static int16_t | puti (int32_t num) |
|
static int16_t | putiln (int num) |
|
static int | printf (const char *format,...) |
|
static int | getch () |
|
static int16_t | putn (const char *s, uint16_t size) |
|
my stdio.h implementation
Definition in file stdio.h.
◆ DEFAULT_STYLE
◆ DEFAULT_STYLE_DARK
◆ __uts_read_int()
static int16_t __uts_read_int |
( |
const char * |
s, |
|
|
int16_t * |
readNum |
|
) |
| |
|
inlinestatic |
no need to used this. inner function that used to parce int from string
Definition at line 82 of file stdio.h.
◆ _draw_char()
static int16_t _draw_char |
( |
char |
ch, |
|
|
int |
offset, |
|
|
uint8_t |
style |
|
) |
| |
|
inlinestatic |
low level char output function
- Parameters
-
ch | that character that want to draw |
offset | the offset from (0, 0) in terminal counted by ((row * 80) + column) * 2 |
style | print style |
- Returns
- always 1
Definition at line 21 of file stdio.h.
◆ draw_char_style()
static int16_t draw_char_style |
( |
char |
ch, |
|
|
int |
row, |
|
|
int |
col, |
|
|
uint8_t |
style |
|
) |
| |
|
inlinestatic |
◆ draw_str()
static int16_t draw_str |
( |
char const * |
str, |
|
|
int |
row, |
|
|
int |
col |
|
) |
| |
|
inlinestatic |
- Parameters
-
str | string to output |
row | the starting row in terminal (0 based, count from left) |
col | (0 based, count from up) |
Definition at line 104 of file stdio.h.
◆ draw_str_style()
static int16_t draw_str_style |
( |
char const * |
str, |
|
|
int |
row, |
|
|
int |
col, |
|
|
uint8_t |
style |
|
) |
| |
|
inlinestatic |
◆ getch()
◆ newline()
static int16_t newline |
( |
| ) |
|
|
inlinestatic |
◆ padding()
static int16_t padding |
( |
int16_t |
num | ) |
|
|
inlinestatic |
output space specified by num
- Parameters
-
num | how much space to output |
- Returns
- same as num
Definition at line 71 of file stdio.h.
◆ printf()
static int printf |
( |
const char * |
format, |
|
|
|
... |
|
) |
| |
|
inlinestatic |
almost same as printf. currently support d, s, c, and %<num>d ...
- Returns
- TODO: BUG.
Definition at line 190 of file stdio.h.
◆ putch()
static int16_t putch |
( |
char |
ch | ) |
|
|
inlinestatic |
◆ putch_style()
static int16_t putch_style |
( |
char |
ch, |
|
|
uint8_t |
style |
|
) |
| |
|
inlinestatic |
◆ puti()
static int16_t puti |
( |
int32_t |
num | ) |
|
|
inlinestatic |
put integer.
- Parameters
-
Definition at line 159 of file stdio.h.
◆ putiln()
static int16_t putiln |
( |
int |
num | ) |
|
|
inlinestatic |
◆ putln()
static int16_t putln |
( |
char const * |
str | ) |
|
|
inlinestatic |
◆ putn()
static int16_t putn |
( |
const char * |
s, |
|
|
uint16_t |
size |
|
) |
| |
|
inlinestatic |
◆ puts()
static int16_t puts |
( |
char const * |
str | ) |
|
|
inlinestatic |
◆ puts_style()
static int16_t puts_style |
( |
char const * |
str, |
|
|
uint8_t |
style |
|
) |
| |
|
inlinestatic |
put string with style
Definition at line 137 of file stdio.h.