20 #ifndef LIBAUDCORE_CORE_H
21 #define LIBAUDCORE_CORE_H
29 #define NULL ((void *) 0)
37 #define FALSE ((bool_t) 0)
39 #define TRUE ((bool_t) 1)
42 #define MIN(a,b) ((a) < (b) ? (a) : (b))
44 #define MAX(a,b) ((a) > (b) ? (a) : (b))
46 #define CLAMP(a,min,max) ((a) < (min) ? (min) : (a) > (max) ? (max) : (a))
48 #define SPRINTF(s,...) \
49 char s[snprintf (NULL, 0, __VA_ARGS__) + 1]; \
50 snprintf (s, sizeof s, __VA_ARGS__);
55 #define STR_CHECK(str) do {if ((str) && (str)[-1] != '@') strpool_abort (str);} while (0)
63 char * str_get_debug (
const char * str,
const char * file,
int line);
64 #define str_get(str) str_get_debug (str, __FILE__, __LINE__)
66 char *
str_get (
const char * str);
74 char * str_ref_debug (
char * str,
const char * file,
int line);
75 #define str_ref(str) str_ref_debug (str, __FILE__, __LINE__)
85 void str_unref_debug (
char * str,
const char * file,
int line);
86 #define str_unref(str) str_unref_debug (str, __FILE__, __LINE__)
93 char *
str_nget (
const char * str,
int len);
void strpool_shutdown(void)
char * str_printf(const char *format,...)
char * str_ref(char *str)
char * str_nget(const char *str, int len)
void str_unref(char *str)
void strpool_abort(char *str)
char * str_get(const char *str)