Mailing List Archive

[master] 7c684d90f txt: New macros to work with strings
commit 7c684d90f21eda97afeeeb9712044446ca4696b7
Author: Dridi Boukelmoune <dridi.boukelmoune@gmail.com>
Date: Wed Mar 27 15:19:01 2024 +0100

txt: New macros to work with strings

diff --git a/include/vdef.h b/include/vdef.h
index 2df601119..a321407d7 100644
--- a/include/vdef.h
+++ b/include/vdef.h
@@ -263,6 +263,8 @@ 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)))

/* #3020 dummy definitions until PR is merged*/
#define LIKELY(x) (x)
_______________________________________________
varnish-commit mailing list
varnish-commit@varnish-cache.org
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-commit