2023-08-21 17:30:13 -07:00
|
|
|
#pragma once
|
2023-08-21 20:02:20 -07:00
|
|
|
#include "string_ops.hpp"
|
2023-08-21 17:30:13 -07:00
|
|
|
|
2023-07-25 20:00:57 -07:00
|
|
|
#pragma region Printing
|
|
|
|
|
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
|
|
|
|
char* str_fmt_buf ( char const* fmt, ... );
|
|
|
|
char* str_fmt_buf_va ( char const* fmt, va_list va );
|
2023-08-08 06:48:50 -07:00
|
|
|
sw str_fmt ( char* str, sw n, char const* fmt, ... );
|
2023-07-24 15:19:37 -07:00
|
|
|
sw str_fmt_va ( char* str, sw n, char const* fmt, va_list va );
|
|
|
|
sw str_fmt_out_va ( char const* fmt, va_list va );
|
|
|
|
sw str_fmt_out_err ( char const* fmt, ... );
|
|
|
|
sw str_fmt_out_err_va( char const* fmt, va_list va );
|
2023-07-29 02:52:06 -07:00
|
|
|
sw str_fmt_file ( FileInfo* f, char const* fmt, ... );
|
2023-07-29 03:32:16 -07:00
|
|
|
sw 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
|
|
|
|
sw log_fmt(char const* fmt, ...)
|
|
|
|
{
|
|
|
|
sw res;
|
|
|
|
va_list va;
|
|
|
|
|
|
|
|
va_start(va, fmt);
|
|
|
|
res = str_fmt_out_va(fmt, va);
|
|
|
|
va_end(va);
|
|
|
|
|
|
|
|
return res;
|
|
|
|
}
|
|
|
|
|
2023-07-25 20:00:57 -07:00
|
|
|
#pragma endregion Printing
|