Nilorea Library monolith api test.
int main(void)
{
printf(
"str:%s\n",
_nstr( nstr ) );
nstrprintf( nstr,
"Hello, file is %s line %d date %s", __FILE__, __LINE__, __TIME__ );
printf(
"str:%s\n",
_nstr( nstr ) );
nstrprintf_cat( nstr,
" - This will be added at file %s line %d date %s", __FILE__, __LINE__, __TIME__ );
printf(
"str:%s\n",
_nstr( nstr ) );
printf(
"str:%s\n",
_nstr( nstr ) );
nstrprintf( nstr,
"Hello, file is %s line %d date %s", __FILE__, __LINE__, __TIME__ );
printf(
"str:%s\n",
_nstr( nstr ) );
nstrprintf_cat( nstr,
" - This will be added at file %s line %d date %s", __FILE__, __LINE__, __TIME__ );
printf(
"str:%s\n",
_nstr( nstr ) );
printf(
"str: %s\n str2: %s\n",
_nstr( nstr ),
_nstr( nstr2 ) );
printf(
"str:%s\n",
_nstr( nstr3 ) );
printf(
"str:%s\n",
_nstr( nstr3 ) );
exit( 0 );
}
#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.