2022-09-25 11:48:57 +00:00
|
|
|
#pragma once
|
|
|
|
#include <m-core.h>
|
|
|
|
|
2024-07-15 04:38:49 +00:00
|
|
|
#define M_INIT_DUP(a) ((a) = strdup(""))
|
2023-06-27 10:50:09 +00:00
|
|
|
#define M_INIT_SET_DUP(a, b) ((a) = strdup(b))
|
2024-07-15 04:38:49 +00:00
|
|
|
#define M_SET_DUP(a, b) (free((void*)a), (a) = strdup(b))
|
|
|
|
#define M_CLEAR_DUP(a) (free((void*)a))
|
2022-09-25 11:48:57 +00:00
|
|
|
|
2023-06-27 10:50:09 +00:00
|
|
|
#define M_CSTR_DUP_OPLIST \
|
|
|
|
(INIT(M_INIT_DUP), \
|
|
|
|
INIT_SET(M_INIT_SET_DUP), \
|
|
|
|
SET(M_SET_DUP), \
|
|
|
|
CLEAR(M_CLEAR_DUP), \
|
|
|
|
HASH(m_core_cstr_hash), \
|
|
|
|
EQUAL(M_CSTR_EQUAL), \
|
|
|
|
CMP(strcmp), \
|
2022-10-05 15:15:23 +00:00
|
|
|
TYPE(const char*))
|