diff options
Diffstat (limited to '')
-rw-r--r-- | include/lib.h | 52 |
1 files changed, 48 insertions, 4 deletions
diff --git a/include/lib.h b/include/lib.h index 1b6d1f4..3be1f8b 100644 --- a/include/lib.h +++ b/include/lib.h @@ -1,5 +1,6 @@ #pragma once +#include <stdarg.h> #include <stddef.h> /** @@ -109,7 +110,7 @@ long long int atoll(const char* s); /** * Converts a integer to asci inside a string with a given radix (base). - * @param n - the number to conver + * @param n - the number to conver * @param buffer - the string buffer * @param radix - the base to convert */ @@ -117,15 +118,23 @@ char *itoa(int n, char *buffer, int radix); /** * Converts a long to asci inside a string with a given radix (base). - * @param n - the number to conver + * @param n - the number to conver * @param buffer - the string buffer * @param radix - the base to convert */ char *ltoa(long int n, char *buffer, int radix); /** + * Converts a long long to asci inside a string with a given radix (base). + * @param n - the number to conver + * @param buffer - the string buffer + * @param radix - the base to convert + */ +char *lltoa(long long int n, char *buffer, int radix); + +/** * Converts a unsigned integer to asci inside a string with a given radix (base). - * @param n - the number to conver + * @param n - the number to conver * @param buffer - the string buffer * @param radix - the base to convert */ @@ -133,13 +142,21 @@ char *utoa(unsigned int n, char *buffer, int radix); /** * Converts a unsigned long to asci inside a string with a given radix (base). - * @param n - the number to conver + * @param n - the number to conver * @param buffer - the string buffer * @param radix - the base to convert */ char *ultoa(unsigned long int n, char *buffer, int radix); /** + * Converts a unsigned long long to asci inside a string with a given radix (base). + * @param n - the number to conver + * @param buffer - the string buffer + * @param radix - the base to convert + */ +char *ulltoa(unsigned long long int n, char *buffer, int radix); + +/** * Converts the string in str to an int value based on the given base. * The endptr is updated to where the string was no longer valid. * @param str - the string buffer @@ -168,3 +185,30 @@ long int strtol(const char *str, char **endptr, int base); * @returns 0 on error or success, error if endptr is still equal to str */ long long int strtoll(const char *str, char **endptr, int base); + +/** + * Prints out a char + * @param c - the char + */ +void kputc(char c); + +/** + * Prints out a null terminated string + * @param s - the string + */ +void kputs(const char *s); + +/** + * Prints out a formatted string + * @param format - the format string + * @param ... - variable args for the format + */ +void kvprintf(const char *format, va_list args); + +/** + * Prints out a formatted string + * @param format - the format string + * @param ... - variable args for the format + */ +__attribute__((format(printf, 1, 2))) +void kprintf(const char *format, ...); |