2023-08-28 20:46:50 -07:00
|
|
|
#ifdef GEN_INTELLISENSE_DIRECTIVES
|
|
|
|
# pragma once
|
|
|
|
# include "string_ops.hpp"
|
|
|
|
#endif
|
2023-08-21 17:30:13 -07:00
|
|
|
|
2023-07-25 20:00:57 -07:00
|
|
|
#pragma region Printing
|
|
|
|
|
2024-12-04 08:01:53 -08:00
|
|
|
GEN_API_C_BEGIN
|
|
|
|
|
2023-07-24 15:19:37 -07:00
|
|
|
struct FileInfo;
|
|
|
|
|
|
|
|
#ifndef GEN_PRINTF_MAXLEN
|
2023-07-25 12:12:51 -07:00
|
|
|
# define GEN_PRINTF_MAXLEN kilobytes(128)
|
2023-07-24 15:19:37 -07:00
|
|
|
#endif
|
|
|
|
|
|
|
|
// NOTE: A locally persisting buffer is used internally
|
2024-10-27 15:58:37 -07:00
|
|
|
char* str_fmt_buf ( char const* fmt, ... );
|
|
|
|
char* str_fmt_buf_va ( char const* fmt, va_list va );
|
|
|
|
ssize str_fmt ( char* str, ssize n, char const* fmt, ... );
|
|
|
|
ssize str_fmt_va ( char* str, ssize n, char const* fmt, va_list va );
|
|
|
|
ssize str_fmt_out_va ( char const* fmt, va_list va );
|
|
|
|
ssize str_fmt_out_err ( char const* fmt, ... );
|
|
|
|
ssize str_fmt_out_err_va( char const* fmt, va_list va );
|
|
|
|
ssize str_fmt_file ( FileInfo* f, char const* fmt, ... );
|
|
|
|
ssize str_fmt_file_va ( FileInfo* f, char const* fmt, va_list va );
|
2023-07-29 02:52:06 -07:00
|
|
|
|
2023-07-24 15:19:37 -07:00
|
|
|
constexpr
|
|
|
|
char const* Msg_Invalid_Value = "INVALID VALUE PROVIDED";
|
|
|
|
|
|
|
|
inline
|
2024-10-27 15:58:37 -07:00
|
|
|
ssize log_fmt(char const* fmt, ...)
|
2023-07-24 15:19:37 -07:00
|
|
|
{
|
2024-10-27 15:58:37 -07:00
|
|
|
ssize res;
|
2023-07-24 15:19:37 -07:00
|
|
|
va_list va;
|
|
|
|
|
|
|
|
va_start(va, fmt);
|
|
|
|
res = str_fmt_out_va(fmt, va);
|
|
|
|
va_end(va);
|
|
|
|
|
|
|
|
return res;
|
|
|
|
}
|
|
|
|
|
2024-12-04 08:01:53 -08:00
|
|
|
GEN_API_C_END
|
|
|
|
|
2023-07-25 20:00:57 -07:00
|
|
|
#pragma endregion Printing
|