[6.0] d491c3349 txt: New macros to work with strings

Dridi Boukelmoune dridi.boukelmoune at gmail.com
Thu Apr 4 14:33:08 UTC 2024


commit d491c3349ebf9f900f74a2a1d95b505555191929
Author: Dridi Boukelmoune <dridi.boukelmoune at gmail.com>
Date:   Wed Mar 27 15:19:01 2024 +0100

    txt: New macros to work with strings
    
    Conflicts:
            include/vdef.h

diff --git a/include/vdef.h b/include/vdef.h
index 20ce9a63f..86fdb0a21 100644
--- a/include/vdef.h
+++ b/include/vdef.h
@@ -241,3 +241,5 @@ typedef struct {
 
 #define Tcheck(t)	do { (void)pdiff((t).b, (t).e); } while (0)
 #define Tlen(t)		(pdiff((t).b, (t).e))
+#define Tstr(s)		((txt){(s), (s) + strlen(s)})
+#define Tstrcmp(t, s)	(strncmp((t).b, (s), Tlen(t)))


More information about the varnish-commit mailing list