Commit e9e69b61 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

In preparation for generic types functions, including conversion functions,

rename "RTIME" to "DURATION", to appease the POLA.



git-svn-id: http://www.varnish-cache.org/svn/trunk/varnish-cache@4999 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent 9db2cf28
...@@ -129,7 +129,7 @@ parse_set(struct vcc *tl) ...@@ -129,7 +129,7 @@ parse_set(struct vcc *tl)
case INT: case INT:
case SIZE: case SIZE:
case TIME: case TIME:
case RTIME: case DURATION:
case FLOAT: case FLOAT:
if (tl->t->tok != '=') if (tl->t->tok != '=')
Fb(tl, 0, "%s %c ", vp->rname, *tl->t->b); Fb(tl, 0, "%s %c ", vp->rname, *tl->t->b);
......
...@@ -116,7 +116,7 @@ enum var_type { ...@@ -116,7 +116,7 @@ enum var_type {
FLOAT, FLOAT,
SIZE, SIZE,
TIME, TIME,
RTIME, DURATION,
STRING, STRING,
IP, IP,
HASH, HASH,
......
...@@ -128,7 +128,7 @@ struct var vcc_vars[] = { ...@@ -128,7 +128,7 @@ struct var vcc_vars[] = {
0, 0,
0, 0,
}, },
{ "req.grace", RTIME, 9, { "req.grace", DURATION, 9,
"VRT_r_req_grace(sp)", "VRT_r_req_grace(sp)",
VCL_MET_RECV | VCL_MET_PIPE | VCL_MET_PASS | VCL_MET_HASH VCL_MET_RECV | VCL_MET_PIPE | VCL_MET_PASS | VCL_MET_HASH
| VCL_MET_MISS | VCL_MET_HIT | VCL_MET_FETCH | VCL_MET_DELIVER | VCL_MET_MISS | VCL_MET_HIT | VCL_MET_FETCH | VCL_MET_DELIVER
...@@ -192,21 +192,21 @@ struct var vcc_vars[] = { ...@@ -192,21 +192,21 @@ struct var vcc_vars[] = {
VCL_MET_PIPE | VCL_MET_PASS | VCL_MET_MISS | VCL_MET_FETCH, VCL_MET_PIPE | VCL_MET_PASS | VCL_MET_MISS | VCL_MET_FETCH,
"HDR_BEREQ", "HDR_BEREQ",
}, },
{ "bereq.connect_timeout", RTIME, 21, { "bereq.connect_timeout", DURATION, 21,
"VRT_r_bereq_connect_timeout(sp)", "VRT_r_bereq_connect_timeout(sp)",
VCL_MET_PIPE | VCL_MET_PASS | VCL_MET_MISS, VCL_MET_PIPE | VCL_MET_PASS | VCL_MET_MISS,
"VRT_l_bereq_connect_timeout(sp, ", "VRT_l_bereq_connect_timeout(sp, ",
VCL_MET_PIPE | VCL_MET_PASS | VCL_MET_MISS, VCL_MET_PIPE | VCL_MET_PASS | VCL_MET_MISS,
0, 0,
}, },
{ "bereq.first_byte_timeout", RTIME, 24, { "bereq.first_byte_timeout", DURATION, 24,
"VRT_r_bereq_first_byte_timeout(sp)", "VRT_r_bereq_first_byte_timeout(sp)",
VCL_MET_PASS | VCL_MET_MISS, VCL_MET_PASS | VCL_MET_MISS,
"VRT_l_bereq_first_byte_timeout(sp, ", "VRT_l_bereq_first_byte_timeout(sp, ",
VCL_MET_PASS | VCL_MET_MISS, VCL_MET_PASS | VCL_MET_MISS,
0, 0,
}, },
{ "bereq.between_bytes_timeout", RTIME, 27, { "bereq.between_bytes_timeout", DURATION, 27,
"VRT_r_bereq_between_bytes_timeout(sp)", "VRT_r_bereq_between_bytes_timeout(sp)",
VCL_MET_PASS | VCL_MET_MISS, VCL_MET_PASS | VCL_MET_MISS,
"VRT_l_bereq_between_bytes_timeout(sp, ", "VRT_l_bereq_between_bytes_timeout(sp, ",
...@@ -220,7 +220,7 @@ struct var vcc_vars[] = { ...@@ -220,7 +220,7 @@ struct var vcc_vars[] = {
VCL_MET_FETCH, VCL_MET_FETCH,
0, 0,
}, },
{ "beresp.saintmode", RTIME, 16, { "beresp.saintmode", DURATION, 16,
NULL, /* No reads allowed */ NULL, /* No reads allowed */
0, 0,
"VRT_l_beresp_saintmode(sp, ", "VRT_l_beresp_saintmode(sp, ",
...@@ -255,14 +255,14 @@ struct var vcc_vars[] = { ...@@ -255,14 +255,14 @@ struct var vcc_vars[] = {
VCL_MET_FETCH, VCL_MET_FETCH,
0, 0,
}, },
{ "beresp.ttl", RTIME, 10, { "beresp.ttl", DURATION, 10,
"VRT_r_beresp_ttl(sp)", "VRT_r_beresp_ttl(sp)",
VCL_MET_FETCH, VCL_MET_FETCH,
"VRT_l_beresp_ttl(sp, ", "VRT_l_beresp_ttl(sp, ",
VCL_MET_FETCH, VCL_MET_FETCH,
0, 0,
}, },
{ "beresp.grace", RTIME, 12, { "beresp.grace", DURATION, 12,
"VRT_r_beresp_grace(sp)", "VRT_r_beresp_grace(sp)",
VCL_MET_FETCH, VCL_MET_FETCH,
"VRT_l_beresp_grace(sp, ", "VRT_l_beresp_grace(sp, ",
...@@ -311,21 +311,21 @@ struct var vcc_vars[] = { ...@@ -311,21 +311,21 @@ struct var vcc_vars[] = {
VCL_MET_HIT, VCL_MET_HIT,
0, 0,
}, },
{ "obj.ttl", RTIME, 7, { "obj.ttl", DURATION, 7,
"VRT_r_obj_ttl(sp)", "VRT_r_obj_ttl(sp)",
VCL_MET_HIT | VCL_MET_ERROR, VCL_MET_HIT | VCL_MET_ERROR,
"VRT_l_obj_ttl(sp, ", "VRT_l_obj_ttl(sp, ",
VCL_MET_HIT | VCL_MET_ERROR, VCL_MET_HIT | VCL_MET_ERROR,
0, 0,
}, },
{ "obj.grace", RTIME, 9, { "obj.grace", DURATION, 9,
"VRT_r_obj_grace(sp)", "VRT_r_obj_grace(sp)",
VCL_MET_HIT | VCL_MET_ERROR, VCL_MET_HIT | VCL_MET_ERROR,
"VRT_l_obj_grace(sp, ", "VRT_l_obj_grace(sp, ",
VCL_MET_HIT | VCL_MET_ERROR, VCL_MET_HIT | VCL_MET_ERROR,
0, 0,
}, },
{ "obj.lastuse", RTIME, 11, { "obj.lastuse", DURATION, 11,
"VRT_r_obj_lastuse(sp)", "VRT_r_obj_lastuse(sp)",
VCL_MET_HIT | VCL_MET_DELIVER | VCL_MET_ERROR, VCL_MET_HIT | VCL_MET_DELIVER | VCL_MET_ERROR,
NULL, /* No writes allowed */ NULL, /* No writes allowed */
......
...@@ -347,7 +347,7 @@ vcc_Cond_2(struct vcc *tl) ...@@ -347,7 +347,7 @@ vcc_Cond_2(struct vcc *tl)
case IP: L(tl, vcc_Cond_Ip(vp, tl)); break; case IP: L(tl, vcc_Cond_Ip(vp, tl)); break;
case STRING: L(tl, vcc_Cond_String(vp, tl)); break; case STRING: L(tl, vcc_Cond_String(vp, tl)); break;
case TIME: L(tl, vcc_Cond_Int(vp, tl)); break; case TIME: L(tl, vcc_Cond_Int(vp, tl)); break;
case RTIME: L(tl, vcc_Cond_Int(vp, tl)); break; case DURATION: L(tl, vcc_Cond_Int(vp, tl)); break;
case BACKEND: L(tl, vcc_Cond_Backend(vp, tl)); break; case BACKEND: L(tl, vcc_Cond_Backend(vp, tl)); break;
default: default:
vsb_printf(tl->sb, vsb_printf(tl->sb,
......
...@@ -179,7 +179,7 @@ vcc_StringVal(struct vcc *tl) ...@@ -179,7 +179,7 @@ vcc_StringVal(struct vcc *tl)
case TIME: case TIME:
Fb(tl, 0, "VRT_time_string(sp, %s)", vp->rname); Fb(tl, 0, "VRT_time_string(sp, %s)", vp->rname);
break; break;
case RTIME: case DURATION:
Fb(tl, 0, "VRT_double_string(sp, %s)", vp->rname); Fb(tl, 0, "VRT_double_string(sp, %s)", vp->rname);
break; break;
case BACKEND: case BACKEND:
......
...@@ -140,7 +140,7 @@ vcc_VarVal(struct vcc *tl, const struct var *vp, const struct token *vt) ...@@ -140,7 +140,7 @@ vcc_VarVal(struct vcc *tl, const struct var *vp, const struct token *vt)
vcc_TimeVal(tl, &d); vcc_TimeVal(tl, &d);
ERRCHK(tl); ERRCHK(tl);
Fb(tl, 0, "%g", d); Fb(tl, 0, "%g", d);
} else if (vp->fmt == RTIME) { } else if (vp->fmt == DURATION) {
vcc_RTimeVal(tl, &d); vcc_RTimeVal(tl, &d);
ERRCHK(tl); ERRCHK(tl);
Fb(tl, 0, "%g", d); Fb(tl, 0, "%g", d);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment