diff options
author | Michael R Sweet <michael.r.sweet@gmail.com> | 2019-05-13 17:10:48 -0400 |
---|---|---|
committer | Michael R Sweet <michael.r.sweet@gmail.com> | 2019-05-13 17:10:48 -0400 |
commit | c8d7d4bf5555898ad53dd69694dba20a9a1aa493 (patch) | |
tree | 8c41c80c400fe674599433958c0cf9e8ac8468a8 /tools | |
parent | bd5165714864567d6626b0fabacdd4ac56498307 (diff) | |
download | cups-c8d7d4bf5555898ad53dd69694dba20a9a1aa493.tar.gz |
Add support for $date-current, $date-start, and ISO-8601 time period values for
relative date/time values.
Diffstat (limited to 'tools')
-rw-r--r-- | tools/ipptool.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/tools/ipptool.c b/tools/ipptool.c index 847dfb586..aca6d24cb 100644 --- a/tools/ipptool.c +++ b/tools/ipptool.c @@ -240,6 +240,8 @@ main(int argc, /* I - Number of command-line args */ _ippVarsInit(&vars, NULL, (_ipp_ferror_cb_t)error_cb, (_ipp_ftoken_cb_t)token_cb); + _ippVarsSet(&vars, "date-start", iso_date(ippTimeToDate(time(NULL)))); + /* * We need at least: * @@ -3992,6 +3994,8 @@ token_cb(_ipp_file_t *f, /* I - IPP file data */ data->transfer = data->def_transfer; data->version = data->def_version; + _ippVarsSet(vars, "date-current", iso_date(ippTimeToDate(time(NULL)))); + f->attrs = ippNew(); f->group_tag = IPP_TAG_ZERO; } @@ -4003,6 +4007,7 @@ token_cb(_ipp_file_t *f, /* I - IPP file data */ if (_ippFileReadToken(f, name, sizeof(name)) && _ippFileReadToken(f, temp, sizeof(temp))) { + _ippVarsSet(vars, "date-current", iso_date(ippTimeToDate(time(NULL)))); _ippVarsExpand(vars, value, temp, sizeof(value)); _ippVarsSet(vars, name, value); } @@ -4022,6 +4027,7 @@ token_cb(_ipp_file_t *f, /* I - IPP file data */ { if (!_ippVarsGet(vars, name)) { + _ippVarsSet(vars, "date-current", iso_date(ippTimeToDate(time(NULL)))); _ippVarsExpand(vars, value, temp, sizeof(value)); _ippVarsSet(vars, name, value); } @@ -4040,6 +4046,7 @@ token_cb(_ipp_file_t *f, /* I - IPP file data */ if (_ippFileReadToken(f, temp, sizeof(temp))) { + _ippVarsSet(vars, "date-current", iso_date(ippTimeToDate(time(NULL)))); _ippVarsExpand(vars, data->file_id, temp, sizeof(data->file_id)); } else |