[master] 69574c5af doc tlc

Nils Goroll nils.goroll at uplex.de
Tue Feb 5 15:28:09 UTC 2019


commit 69574c5aff714d34904837a5eae188797ff78961
Author: Nils Goroll <nils.goroll at uplex.de>
Date:   Tue Feb 5 16:27:29 2019 +0100

    doc tlc

diff --git a/doc/changes.rst b/doc/changes.rst
index a83fe8e84..d8fb2404c 100644
--- a/doc/changes.rst
+++ b/doc/changes.rst
@@ -154,6 +154,20 @@ C APIs (for vmod and utility authors)
 
       AZ(ObjGetU64(req->wrk, req->body_oc, OA_LEN, &u));
 
+* vmodtool has been changed significantly to avoid various name
+  clashes. Rather than using literal prefixes/suffixes, vmod authors
+  should now (and might have to for making existing code continue to
+  compile) use the following macros
+
+  * ``VPFX(name)`` to prepend the vmod prefix (``vmod_`` by default)
+
+  * ``VARGS(name)`` as the name of a function/method's argument
+    struct, e.g.::
+
+	VCL_VOID vmod_test(VRT_CTX, struct VARGS(test) *args) { ...
+
+  * ``VENUM(name)`` to access the enum by the name `name`
+
 Fixed bugs
 ----------
 
diff --git a/doc/sphinx/reference/vmod.rst b/doc/sphinx/reference/vmod.rst
index 36ef2b51c..574da32dc 100644
--- a/doc/sphinx/reference/vmod.rst
+++ b/doc/sphinx/reference/vmod.rst
@@ -324,6 +324,10 @@ ENUM
 	Allows values from a set of constant strings. `Note` that the
 	C-type is a string, not a C enum.
 
+	Enums will be passed as fixed pointers, so instead of string
+	comparisons, also pointer comparisons with ``VENUM(name)`` are
+	possible.
+
 HEADER
 	C-type: ``const struct gethdr_s *``
 


More information about the varnish-commit mailing list