<div dir="ltr">Hi,<br><br>I've been wanting something like this for a while so I decided to give it a try last night after Dridi moaned about the use of somewhat magic numbers in the utf8 vmod.<br>The result is that you can now define constants in .vcc like this:<br><br>$Const TYPE name value<br><br>e.g.:<br><br>$Const INT CASEFOLD 0x0400<br>$Const INT LUMP 0x1000<br>$Const INT STRIPMARK 0x2000<br><br>And access it in VCL via <vmod>.<name>.<br><br>e.g.:<br><br>set req.url = utf8.transform(req.url, utf8.CASEFOLD + utf8.LUMP + utf8.STRIPMARK);<br><br>This doesn't generate any C code in the current incarnation, it merely creates the symbol and replaces the value when referencing it so the resulting C will have e.g. 0x0001 but I could change it if required.<br><br>Personally I think this is quite useful but I might be biased so before I clean the patches and post them here is there any interest?<br><br>Comments welcome.<br><br><br></div>