* Move app/service code from tactility-core to tactility * fix formatting * updated dev docs
29 lines
632 B
C
29 lines
632 B
C
/** @file:m_cstr_dup.h
|
|
* @brief Helpers for mlib
|
|
*/
|
|
#pragma once
|
|
#include <m-core.h>
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
#define M_INIT_DUP(a) ((a) = strdup(""))
|
|
#define M_INIT_SET_DUP(a, b) ((a) = strdup(b))
|
|
#define M_SET_DUP(a, b) (free((void*)a), (a) = strdup(b))
|
|
#define M_CLEAR_DUP(a) (free((void*)a))
|
|
|
|
#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), \
|
|
TYPE(const char*))
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|