[master] 81a7e8513 doc: It is now possible to name PRIV_ arguments

Dridi Boukelmoune dridi.boukelmoune at gmail.com
Tue Jul 28 08:09:07 UTC 2020


commit 81a7e851388f726ac96b7e32c387e9b7f969485c
Author: Dridi Boukelmoune <dridi.boukelmoune at gmail.com>
Date:   Tue Jul 28 09:58:42 2020 +0200

    doc: It is now possible to name PRIV_ arguments
    
    Contrary to what the documentation stated, PRIV_ arguments aren't
    unnamed by nature with the current vmodtool script. Both the generated
    struct and JSON descriptor would account for named PRIV_ arguments and
    the only limitation was in libvcc.
    
    It was really a bug in the sense that vmodtool would generate C code
    incompatible with the code generated by libvcc. It was simpler to fix
    libvcc and allow VMOD authors to give meaningful names to PRIVs if they
    happen to use them in conjunction with [optional arguments].
    
    Refs 82491c2a8abd

diff --git a/doc/sphinx/reference/vmod.rst b/doc/sphinx/reference/vmod.rst
index ca448bb8e..f4edad883 100644
--- a/doc/sphinx/reference/vmod.rst
+++ b/doc/sphinx/reference/vmod.rst
@@ -156,7 +156,7 @@ Optional arguments
 The vmod.vcc declaration also allows for optional arguments in square
 brackets like so::
 
-	$Function VOID opt(PRIV_TASK, INT four = 4, [ STRING opt])
+	$Function VOID opt(PRIV_TASK priv, INT four = 4, [STRING opt])
 
 With any optional argument present, the C function prototype looks
 completely different:
@@ -185,9 +185,6 @@ declarations:
 	  with `n` starting at 1 and incrementing with the argument's
 	  position.
 
-	  Note that in particular also ``PRIV_*`` arguments (which are
-	  unnamed by definition) are passed as ``arg``\ `n`
-
 .. _ref-vmod-vcl-c-objects:
 
 Objects and methods


More information about the varnish-commit mailing list