|
#define | MIN(x, y) ((x) < (y) ? (x) : (y)) |
|
#define | MAX(x, y) ((x) > (y) ? (x) : (y)) |
|
#define | _MP_STRINGIFY(x) #x |
|
#define | MP_STRINGIFY(x) _MP_STRINGIFY(x) |
|
#define | m_new(type, num) ((type*)(m_malloc(sizeof(type) * (num)))) |
|
#define | m_new_maybe(type, num) ((type*)(m_malloc_maybe(sizeof(type) * (num)))) |
|
#define | m_new0(type, num) ((type*)(m_malloc0(sizeof(type) * (num)))) |
|
#define | m_new_obj(type) (m_new(type, 1)) |
|
#define | m_new_obj_maybe(type) (m_new_maybe(type, 1)) |
|
#define | m_new_obj_var(obj_type, var_type, var_num) ((obj_type*)m_malloc(sizeof(obj_type) + sizeof(var_type) * (var_num))) |
|
#define | m_new_obj_var_maybe(obj_type, var_type, var_num) ((obj_type*)m_malloc_maybe(sizeof(obj_type) + sizeof(var_type) * (var_num))) |
|
#define | m_new_obj_with_finaliser(type) m_new_obj(type) |
|
#define | m_renew(type, ptr, old_num, new_num) ((type*)(m_realloc((ptr), sizeof(type) * (new_num)))) |
|
#define | m_renew_maybe(type, ptr, old_num, new_num, allow_move) ((type*)(m_realloc_maybe((ptr), sizeof(type) * (new_num), (allow_move)))) |
|
#define | m_del(type, ptr, num) ((void)(num), m_free(ptr)) |
|
#define | m_del_var(obj_type, var_type, var_num, ptr) ((void)(var_num), m_free(ptr)) |
|
#define | m_del_obj(type, ptr) (m_del(type, ptr, 1)) |
|
#define | MP_ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0])) |
|
#define | MP_ALIGN(ptr, alignment) (void*)(((uintptr_t)(ptr) + ((alignment) - 1)) & ~((alignment) - 1)) |
|
#define | UTF8_IS_NONASCII(ch) ((ch) & 0x80) |
|
#define | UTF8_IS_CONT(ch) (((ch) & 0xC0) == 0x80) |
|
#define | VSTR_FIXED(vstr, alloc) vstr_t vstr; char vstr##_buf[(alloc)]; vstr_init_fixed_buf(&vstr, (alloc), vstr##_buf); |
|
#define | CHECKBUF(buf, max_size) char buf[max_size + 1]; size_t buf##_len = max_size; char *buf##_p = buf; |
|
#define | CHECKBUF_RESET(buf, max_size) buf##_len = max_size; buf##_p = buf; |
|
#define | CHECKBUF_APPEND(buf, src, src_len) |
|
#define | CHECKBUF_APPEND_0(buf) { *buf##_p = 0; } |
|
#define | CHECKBUF_LEN(buf) (buf##_p - buf) |
|
|
void * | m_malloc (size_t num_bytes) |
|
void * | m_malloc_maybe (size_t num_bytes) |
|
void * | m_malloc_with_finaliser (size_t num_bytes) |
|
void * | m_malloc0 (size_t num_bytes) |
|
void * | m_realloc (void *ptr, size_t new_num_bytes) |
|
void * | m_realloc_maybe (void *ptr, size_t new_num_bytes, bool allow_move) |
|
void | m_free (void *ptr) |
|
NORETURN void | m_malloc_fail (size_t num_bytes) |
|
unichar | utf8_get_char (const byte *s) |
|
const byte * | utf8_next_char (const byte *s) |
|
bool | unichar_isspace (unichar c) |
|
bool | unichar_isalpha (unichar c) |
|
bool | unichar_isprint (unichar c) |
|
bool | unichar_isdigit (unichar c) |
|
bool | unichar_isxdigit (unichar c) |
|
bool | unichar_isident (unichar c) |
|
bool | unichar_isupper (unichar c) |
|
bool | unichar_islower (unichar c) |
|
unichar | unichar_tolower (unichar c) |
|
unichar | unichar_toupper (unichar c) |
|
mp_uint_t | unichar_xdigit_value (unichar c) |
|
mp_uint_t | unichar_charlen (const char *str, mp_uint_t len) |
|
void | vstr_init (vstr_t *vstr, size_t alloc) |
|
void | vstr_init_len (vstr_t *vstr, size_t len) |
|
void | vstr_init_fixed_buf (vstr_t *vstr, size_t alloc, char *buf) |
|
void | vstr_init_print (vstr_t *vstr, size_t alloc, struct _mp_print_t *print) |
|
void | vstr_clear (vstr_t *vstr) |
|
vstr_t * | vstr_new (size_t alloc) |
|
void | vstr_free (vstr_t *vstr) |
|
void | vstr_hint_size (vstr_t *vstr, size_t size) |
|
char * | vstr_extend (vstr_t *vstr, size_t size) |
|
char * | vstr_add_len (vstr_t *vstr, size_t len) |
|
char * | vstr_null_terminated_str (vstr_t *vstr) |
|
void | vstr_add_byte (vstr_t *vstr, byte v) |
|
void | vstr_add_char (vstr_t *vstr, unichar chr) |
|
void | vstr_add_str (vstr_t *vstr, const char *str) |
|
void | vstr_add_strn (vstr_t *vstr, const char *str, size_t len) |
|
void | vstr_ins_byte (vstr_t *vstr, size_t byte_pos, byte b) |
|
void | vstr_ins_char (vstr_t *vstr, size_t char_pos, unichar chr) |
|
void | vstr_cut_head_bytes (vstr_t *vstr, size_t bytes_to_cut) |
|
void | vstr_cut_tail_bytes (vstr_t *vstr, size_t bytes_to_cut) |
|
void | vstr_cut_out_bytes (vstr_t *vstr, size_t byte_pos, size_t bytes_to_cut) |
|
void | vstr_printf (vstr_t *vstr, const char *fmt,...) |
|
int | DEBUG_printf (const char *fmt,...) |
|