From df24bf29406e21c59464d5e4ac72164a6a404396 Mon Sep 17 00:00:00 2001 From: Robear Selwans Date: Sun, 13 Oct 2024 14:45:17 +0300 Subject: [PATCH] Added equal_fn to evstring TypeData Signed-off-by: Robear Selwans --- ev_str.h | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/ev_str.h b/ev_str.h index 6e3c12f..7d00e35 100644 --- a/ev_str.h +++ b/ev_str.h @@ -44,7 +44,6 @@ #endif typedef char *evstring; -TYPEDATA_GEN(evstring); typedef enum { EV_STR_ERR_NONE = 0, @@ -193,6 +192,16 @@ evstring_findLastChar( const evstring text, const char c); +DEFINE_EQUAL_FUNCTION(evstring, Default) +{ + return evstring_cmp(*(evstring*)self, *(evstring*)other) == 0; +} + +TYPEDATA_GEN(evstring, + EQUAL(Default) +); + + #if defined(EV_STR_IMPLEMENTATION) #if EV_OS_WINDOWS