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 )
#define free_nstr(__ptr)
free a N_STR structure and set the pointer to NULL
#define nstrcat(__nstr_dst, __nstr_src)
Macro to quickly concatenate two N_STR.
N_STR * nstrdup(N_STR *str)
Duplicate a N_STR.
#define nstrprintf_cat(__nstr_var, __format,...)
Macro to quickly allocate and sprintf and cat to a N_STR.
N_STR * new_nstr(NSTRBYTE size)
create a new N_STR string
#define nstrprintf(__nstr_var, __format,...)
Macro to quickly allocate and sprintf to N_STR.
A box including a string and his lenght.
Header for a monolith use.