15 printf(
"str:%s\n",
_nstr( nstr ) );
17 nstrprintf( nstr,
"Hello, file is %s line %d date %s", __FILE__, __LINE__, __TIME__ );
19 printf(
"str:%s\n",
_nstr( nstr ) );
21 nstrprintf_cat( nstr,
" - This will be added at file %s line %d date %s", __FILE__, __LINE__, __TIME__ );
23 printf(
"str:%s\n",
_nstr( nstr ) );
29 printf(
"str:%s\n",
_nstr( nstr ) );
31 nstrprintf( nstr,
"Hello, file is %s line %d date %s", __FILE__, __LINE__, __TIME__ );
33 printf(
"str:%s\n",
_nstr( nstr ) );
35 nstrprintf_cat( nstr,
" - This will be added at file %s line %d date %s", __FILE__, __LINE__, __TIME__ );
37 printf(
"str:%s\n",
_nstr( nstr ) );
43 printf(
"str: %s\n str2: %s\n",
_nstr( nstr ),
_nstr( nstr2 ) );
50 printf(
"str:%s\n",
_nstr( nstr3 ) );
57 printf(
"str:%s\n",
_nstr( nstr3 ) );
#define _nstr(__PTR)
N_STR or "NULL" string for logging purposes.
#define LOG_DEBUG
debug-level messages
void set_log_level(const int log_level)
Set the global log level value ( static int LOG_LEVEL )
int nstrcat(N_STR *dst, N_STR *src)
Add N_STR *src content to N_STR *dst, resizing it if needed.
#define free_nstr(__ptr)
free a N_STR structure and set the pointer to NULL
#define nstrprintf(__nstr_var,...)
Macro to quickly allocate and sprintf to N_STR *.
N_STR * nstrdup(N_STR *str)
Duplicate a N_STR.
N_STR * new_nstr(NSTRBYTE size)
create a new N_STR string
#define nstrprintf_cat(__nstr_var,...)
Macro to quickly allocate and sprintf and cat to a N_STR *.
A box including a string and his lenght.
Header for a monolith use.