From b01459d1ef87891455983a4cda912c5c6924f3d8 Mon Sep 17 00:00:00 2001 From: Patrick Pelissier Date: Wed, 1 Aug 2018 23:36:04 +0200 Subject: [PATCH] Add out_str for CSTR_OPLIST --- m-core.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/m-core.h b/m-core.h index f7e83e9c..6b2f0425 100644 --- a/m-core.h +++ b/m-core.h @@ -1799,10 +1799,12 @@ m_core_hash (const void *str, size_t length) /* OPLIST for 'const char *' (with NO memory allocation) */ #define M_CSTR_HASH(s) (m_core_hash((s), strlen(s))) #define M_CSTR_EQUAL(a,b) (strcmp((a),(b)) == 0) +#define M_CSTR_OUT_STR(file, str) fprintf(file, "%s", str) #define M_CSTR_OPLIST (INIT(M_INIT_DEFAULT), INIT_SET(M_SET_DEFAULT), \ SET(M_SET_DEFAULT), CLEAR(M_NOTHING_DEFAULT), \ HASH(M_CSTR_HASH), EQUAL(M_CSTR_EQUAL), \ - CMP(strcmp), TYPE(const char *) ) + CMP(strcmp), TYPE(const char *), \ + OUT_STR(M_CSTR_OUT_STR) ) /* From an oplist (...) return ... */ #define M_OPFLAT(...) __VA_ARGS__