2023-08-28 20:46:50 -07:00
|
|
|
#ifdef GEN_INTELLISENSE_DIRECTIVES
|
|
|
|
# pragma once
|
2024-12-12 09:55:15 -08:00
|
|
|
# include "strbuilder_ops.hpp"
|
2023-08-28 20:46:50 -07:00
|
|
|
#endif
|
2023-08-21 17:30:13 -07:00
|
|
|
|
2023-07-25 20:00:57 -07:00
|
|
|
#pragma region Printing
|
|
|
|
|
2024-12-06 21:21:09 -08:00
|
|
|
typedef struct FileInfo FileInfo;
|
2023-07-24 15:19:37 -07:00
|
|
|
|
|
|
|
#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
|
2024-12-04 23:53:14 -08:00
|
|
|
typedef char PrintF_Buffer[GEN_PRINTF_MAXLEN];
|
2023-07-24 15:19:37 -07:00
|
|
|
|
|
|
|
// NOTE: A locally persisting buffer is used internally
|
2024-12-12 09:55:15 -08:00
|
|
|
char* c_str_fmt_buf ( char const* fmt, ... );
|
|
|
|
char* c_str_fmt_buf_va ( char const* fmt, va_list va );
|
|
|
|
ssize c_str_fmt ( char* str, ssize n, char const* fmt, ... );
|
|
|
|
ssize c_str_fmt_va ( char* str, ssize n, char const* fmt, va_list va );
|
|
|
|
ssize c_str_fmt_out_va ( char const* fmt, va_list va );
|
|
|
|
ssize c_str_fmt_out_err ( char const* fmt, ... );
|
|
|
|
ssize c_str_fmt_out_err_va( char const* fmt, va_list va );
|
|
|
|
ssize c_str_fmt_file ( FileInfo* f, char const* fmt, ... );
|
|
|
|
ssize c_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);
|
2024-12-12 09:55:15 -08:00
|
|
|
res = c_str_fmt_out_va(fmt, va);
|
2023-07-24 15:19:37 -07:00
|
|
|
va_end(va);
|
|
|
|
|
|
|
|
return res;
|
|
|
|
}
|
|
|
|
|
2023-07-25 20:00:57 -07:00
|
|
|
#pragma endregion Printing
|