Loading...
Searching...
No Matches
m_cstr_dup.h
1#pragma once
2#include <m-core.h>
3
4#define M_INIT_DUP(a) ((a) = strdup(""))
5#define M_INIT_SET_DUP(a, b) ((a) = strdup(b))
6#define M_SET_DUP(a, b) (free((void*)a), (a) = strdup(b))
7#define M_CLEAR_DUP(a) (free((void*)a))
8
9#define M_CSTR_DUP_OPLIST \
10 (INIT(M_INIT_DUP), \
11 INIT_SET(M_INIT_SET_DUP), \
12 SET(M_SET_DUP), \
13 CLEAR(M_CLEAR_DUP), \
14 HASH(m_core_cstr_hash), \
15 EQUAL(M_CSTR_EQUAL), \
16 CMP(strcmp), \
17 TYPE(const char*))