![]() |
FrostWing
A lightweight raw-control operating system.
|
Contains all the print functions. More...
#include <stdint.h>#include <stddef.h>#include <stdarg.h>#include <stdbool.h>#include <basics.h>#include <strings.h>#include <stream.h>

Go to the source code of this file.
Macros | |
| #define | reset_color "\033[37m" |
| #define | red_color "\x1b[91m" |
| #define | yellow_color "\x1b[93m" |
| #define | blue_color "\x1b[36m" |
| #define | green_color "\x1b[32m" |
| #define | orange_color "\x1b[38;5;208m" |
| #define | printf(fmt, ...) |
| #define | printfnoln(fmt, ...) |
| #define | eprintf(fmt, ...) |
Functions | |
| void | warn (cstring message, cstring file) |
| Display a warning message. | |
| void | error (cstring message, cstring file) |
| Display an error message. | |
| void | info (cstring message, cstring file) |
| Display an informational message. | |
| void | done (cstring message, cstring file) |
| Display a success message. | |
| void | putc (char c) |
| Prints a char, using vput(char c); Replaces '' with "\b \b". | |
| void | vputc (char c) |
| Prints a char though the standard streams. | |
| void | printbin (uint8_t value) |
| Prints a value in binary format. | |
| int | format_number (char *out, long value, int base, int width, bool zero, bool upper) |
| void | printf_internal (cstring file, cstring func, int64 line, cstring format,...) |
| Prints with formatting supported. | |
| void | printfnoln_internal (cstring file, cstring func, int64 line, cstring format,...) |
| Prints with formatting supported (does not add an new line). | |
| void | vprintf_internal (stream_t stream, cstring file, cstring func, int64 line, bool newline, cstring format, va_list argp) |
| Core printf implementation used internally by both printf_internal and printfnoln_internal. | |
| int | vsnprintf (char *buf, size_t size, const char *fmt, va_list args) |
| Formats a string into a buffer using a va_list. | |
| int | snprintf (char *buf, size_t size, const char *fmt,...) |
| Formats a string into a fixed-size buffer. | |
| void | kprint (cstring msg) |
| RAW kernel print function for plain strings. (No Formatter & No Streams). | |
| void | print (cstring s) |
| Plain print function, goes through the stream. | |
| void | print_bitmap (int x, int y, int w, int h, bool *pixels, int32 color) |
Variables | |
| string | last_filename |
| string | last_print_file |
| string | last_print_func |
| int32 | last_print_line |
| bool | enable_logging |
Contains all the print functions.
Definition in file graphics.h.
| #define blue_color "\x1b[36m" |
Definition at line 26 of file graphics.h.
| #define eprintf | ( | fmt, | |
| ... ) |
Definition at line 51 of file graphics.h.
| #define green_color "\x1b[32m" |
Definition at line 27 of file graphics.h.
| #define orange_color "\x1b[38;5;208m" |
Definition at line 28 of file graphics.h.
| #define printf | ( | fmt, | |
| ... ) |
Definition at line 45 of file graphics.h.
| #define printfnoln | ( | fmt, | |
| ... ) |
Definition at line 48 of file graphics.h.
| #define red_color "\x1b[91m" |
Definition at line 24 of file graphics.h.
| #define reset_color "\033[37m" |
Definition at line 23 of file graphics.h.
| #define yellow_color "\x1b[93m" |
Definition at line 25 of file graphics.h.
| void done | ( | cstring | message, |
| cstring | file ) |
Display a success message.
This function displays a success message on the console with color formatting.
| message | The success message to be displayed. |
| file | The file name associated with the success. |
| void error | ( | cstring | message, |
| cstring | file ) |
Display an error message.
This function displays an error message on the console with color formatting.
| message | The error message to be displayed. |
| file | The file name where the error occurred. |
| void info | ( | cstring | message, |
| cstring | file ) |
Display an informational message.
This function displays an informational message on the console with color formatting.
| message | The informational message to be displayed. |
| file | The file name where the information is coming from. |
| void kprint | ( | cstring | msg | ) |
RAW kernel print function for plain strings. (No Formatter & No Streams).
| msg | The string. |
| void print | ( | cstring | s | ) |
Plain print function, goes through the stream.
| s | Normal string to be displayed |
| void print_bitmap | ( | int | x, |
| int | y, | ||
| int | w, | ||
| int | h, | ||
| bool * | pixels, | ||
| int32 | color ) |
| x | |
| y | |
| w | |
| h | |
| pixels | |
| color |
| void printbin | ( | uint8_t | value | ) |
Prints a value in binary format.
| value | The value that will be printed |
| void printf_internal | ( | cstring | file, |
| cstring | func, | ||
| int64 | line, | ||
| cstring | format, | ||
| ... ) |
Prints with formatting supported.
| file | Filename where the function is called. |
| func | The function name. |
| line | The line. |
| format | String. |
| ... |
| void printfnoln_internal | ( | cstring | file, |
| cstring | func, | ||
| int64 | line, | ||
| cstring | format, | ||
| ... ) |
Prints with formatting supported (does not add an new line).
| file | Filename where the function is called. |
| func | The function name. |
| line | The line. |
| format | String. |
| ... |
| void putc | ( | char | c | ) |
Prints a char, using vput(char c); Replaces '' with "\b \b".
| c | char to print |
| int snprintf | ( | char * | buf, |
| size_t | size, | ||
| const char * | fmt, | ||
| ... ) |
Formats a string into a fixed-size buffer.
| buf | destination buffer. |
| size | buffer size in bytes. |
| fmt | format string. |
| void vprintf_internal | ( | stream_t | stream, |
| cstring | file, | ||
| cstring | func, | ||
| int64 | line, | ||
| bool | newline, | ||
| cstring | format, | ||
| va_list | argp ) |
Core printf implementation used internally by both printf_internal and printfnoln_internal.
This function handles all formatted output processing, including support for format specifiers such as b, x, X, u, d, s, and c. It also interprets escape characters like '
', '\r', and '\t'.
The newline flag controls whether a newline character ('
') is printed automatically at the end of the output.
| stream | The unix like STDOUT, STDERR. |
| file | The source file name of the caller (for logging context) |
| func | The function name of the caller (for logging context) |
| line | The source line number of the call (for logging context) |
| newline | If true, appends a newline at the end of the formatted output |
| format | The printf-style format string |
| argp | The variable argument list (already started via va_start) |
| void vputc | ( | char | c | ) |
Prints a char though the standard streams.
| c | The charecter to be printed. |
| int vsnprintf | ( | char * | buf, |
| size_t | size, | ||
| const char * | fmt, | ||
| va_list | args ) |
Formats a string into a buffer using a va_list.
| buf | destination buffer. |
| size | buffer size in bytes. |
| fmt | format string. |
| args | variable argument list. |
| void warn | ( | cstring | message, |
| cstring | file ) |
Display a warning message.
This function displays a warning message on the console with color formatting.
| message | The warning message to be displayed. |
| file | The file name where the warning occurred. |
|
extern |
Definition at line 39 of file graphics.h.