• 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
..
Makefile.am Loading commit data...
automake_boilerplate.am Loading commit data...
flint.lnt Loading commit data...
flint.sh Loading commit data...
vmod.vcc Loading commit data...
vmod_std.c Loading commit data...
vmod_std_conversions.c Loading commit data...
vmod_std_fileread.c Loading commit data...
vmod_std_querysort.c Loading commit data...