Mailing List Archive

[6.0] d491c3349 txt: New macros to work with strings
commit d491c3349ebf9f900f74a2a1d95b505555191929
Author: Dridi Boukelmoune <dridi.boukelmoune@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)))
_______________________________________________
varnish-commit mailing list
varnish-commit@varnish-cache.org
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-commit