• Nils Goroll's avatar
    make vmod_std conversions more flexible · 5a1a9b08
    Nils Goroll authored
    In order to avoid the cross product problem with conversion functions
    (from x to y types would require x*y functions), we add flexibility
    regarding the input parameters to conversion functions:
    
    Each convertion function named after the destination type now takes all
    sensible arguments by name.
    
    int is named integer because of the reserved symbol name "int" in C.
    
    All functions should be fully backwards compatible (existing vtcs
    continue to work), but compile time checks are now effectively removed.
    The conversion functions now trigger vcl errors if used incorrectly or
    if conversion errors occur and no failback is provided. However, if a
    failback is provided, vcl errors are only raised for usage errors.
    
    For consistency, the conversion functions now only ever truncate if
    necessary. std.round() is added for explicit rounding where required.
    
    Existing functions which are now obsolete are marked deprecated.
    
    Ref #2899
    Ref https://github.com/varnishcache/varnish-cache/wiki/VIP12:-vmod-polymorphism-(for-type-conversions)
    5a1a9b08
Name
Last commit
Last update
.github Loading commit data...
bin Loading commit data...
doc Loading commit data...
etc Loading commit data...
include Loading commit data...
lib Loading commit data...
m4 Loading commit data...
man Loading commit data...
tools Loading commit data...
.dir-locals.el Loading commit data...
.gitignore Loading commit data...
.syntastic_c_config Loading commit data...
.travis.yml Loading commit data...
CONTRIBUTING Loading commit data...
ChangeLog Loading commit data...
INSTALL Loading commit data...
LICENSE Loading commit data...
Makefile.am Loading commit data...
README.Packaging Loading commit data...
README.rst Loading commit data...
autogen.des Loading commit data...
autogen.sh Loading commit data...
configure.ac Loading commit data...
flint.lnt Loading commit data...
varnish-legacy.m4 Loading commit data...
varnish.m4 Loading commit data...
varnishapi-uninstalled.pc.in Loading commit data...
varnishapi.pc.in Loading commit data...