summaryrefslogtreecommitdiffabout
authorSergey Poznyakoff <gray@gnu.org.ua>2015-02-12 14:47:56 (GMT)
committer Sergey Poznyakoff <gray@gnu.org.ua>2015-02-12 15:59:06 (GMT)
commitf06fcc848fa5a5b15d170bf5cc34986ed6164621 (patch) (side-by-side diff)
tree399b822af71efe9240bb9352465f8ab32bbc7c68
parent133e104d9efac43c0cf243207c2c5eaf0343bced (diff)
downloadvmod-variable-f06fcc848fa5a5b15d170bf5cc34986ed6164621.tar.gz
vmod-variable-f06fcc848fa5a5b15d170bf5cc34986ed6164621.tar.bz2
Rename batchset to regset
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--src/variable.c27
-rw-r--r--src/variable.vcc2
-rw-r--r--tests/Makefile.am2
-rw-r--r--tests/regset.at (renamed from tests/batchset.at)6
-rw-r--r--tests/testsuite.at2
5 files changed, 18 insertions, 21 deletions
diff --git a/src/variable.c b/src/variable.c
index 9442b6b..667cfc0 100644
--- a/src/variable.c
+++ b/src/variable.c
@@ -619,4 +619,3 @@ bref_expand(const char *str, const char *input, pcre *re,
VCL_VOID
-vmod_batchset(VARIABLE_CTX ctx,
- VCL_STRING vars, VCL_STRING rxs, VCL_STRING input)
+vmod_regset(VARIABLE_CTX ctx, VCL_STRING vars, VCL_STRING rxs, VCL_STRING input)
{
@@ -640,3 +639,3 @@ vmod_batchset(VARIABLE_CTX ctx,
if (!vars || !rxs || !input) {
- log_error("variable.batchset: bad arguments: vars=%s, rxs=%s, input=%s",
+ log_error("variable.regset: bad arguments: vars=%s, rxs=%s, input=%s",
S(vars), S(rxs), S(input));
@@ -701,3 +700,3 @@ vmod_batchset(VARIABLE_CTX ctx,
if (!re) {
- log_error("variable.batchset: %s: compilation failed near %s: %s",
+ log_error("variable.regset: %s: compilation failed near %s: %s",
rxs, rxs + error_offset, error_ptr);
@@ -715,3 +714,3 @@ vmod_batchset(VARIABLE_CTX ctx,
if (n < count) {
- log_error("variable.batchset: %s: too few subexpressions to satisfy %s",
+ log_error("variable.regset: %s: too few subexpressions to satisfy %s",
rxs, vars);
@@ -726,9 +725,7 @@ vmod_batchset(VARIABLE_CTX ctx,
if (rc <= 0) {
- if (rc == 0)
- log_error("matched, but too many substrings");
- else
- /*FIXME*/;
+ if (rc != PCRE_ERROR_NOMATCH)
+ log_error("variable.regset: pcre_exec failed: %d", rc);
vardef_free(head);
return;
- }
+ }
@@ -745,6 +742,6 @@ vmod_batchset(VARIABLE_CTX ctx,
if (*p) {
- log_error("variable.batchset: %s(%s)#%d: not an integer", rxs, input, i);
+ log_error("variable.regset: %s(%s)#%d: not an integer", rxs, input, i);
value.i = 0;
} else if (errno) {
- log_error("variable.batchset: %s(%s)#%d: %s",
+ log_error("variable.regset: %s(%s)#%d: %s",
rxs, input, i, strerror(errno));
@@ -752,3 +749,3 @@ vmod_batchset(VARIABLE_CTX ctx,
} else if (lval < INT_MIN || lval > INT_MAX) {
- log_error("variable.batchset: %s(%s)#%d: value out of range",
+ log_error("variable.regset: %s(%s)#%d: value out of range",
rxs, input, i);
@@ -763,6 +760,6 @@ vmod_batchset(VARIABLE_CTX ctx,
if (*p) {
- log_error("variable.batchset: %s(%s)#%d: not a valid number", rxs, input, i);
+ log_error("variable.regset: %s(%s)#%d: not a valid number", rxs, input, i);
value.r = 0;
} else if (errno) {
- log_error("variable.batchset: %s(%s)#%d: %s",
+ log_error("variable.regset: %s(%s)#%d: %s",
rxs, input, i, strerror(errno));
diff --git a/src/variable.vcc b/src/variable.vcc
index b8eb8e2..7fca518 100644
--- a/src/variable.vcc
+++ b/src/variable.vcc
@@ -35,3 +35,3 @@ $Function STRING type_of(STRING)
$Function VOID undef(STRING)
-$Function VOID batchset(STRING, STRING, STRING)
+$Function VOID regset(STRING, STRING, STRING)
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 1a81bea..99769ae 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -43,3 +43,2 @@ TESTSUITE_AT = \
testsuite.at\
- batchset.at\
complex.at\
@@ -51,2 +50,3 @@ TESTSUITE_AT = \
real.at\
+ regset.at\
string.at\
diff --git a/tests/batchset.at b/tests/regset.at
index 506fe78..cc92578 100644
--- a/tests/batchset.at
+++ b/tests/regset.at
@@ -16,4 +16,4 @@
-AT_SETUP(batchset)
-AT_KEYWORDS(batchset)
+AT_SETUP(regset)
+AT_KEYWORDS(regset)
@@ -21,3 +21,3 @@ AT_VARNISHTEST([
sub vcl_recv {
- variable.batchset("y:i,x,time:d=\3s", "^/(\d+)/(.+)/(\d+)", req.url);
+ variable.regset("y:i,x,time:d=\3s", "^/(\d+)/(.+)/(\d+)", req.url);
}
diff --git a/tests/testsuite.at b/tests/testsuite.at
index 7312433..d0cc846 100644
--- a/tests/testsuite.at
+++ b/tests/testsuite.at
@@ -56,3 +56,3 @@ m4_include([type_of.at])
m4_include([undef.at])
-m4_include([batchset.at])
+m4_include([regset.at])
m4_include([gstring.at])

Return to:

Send suggestions and report system problems to the System administrator.