#include "shmlog.h"
#include "cli_priv.h"
#include "cache.h"
+#include "vrt.h"
struct ban {
TAILQ_ENTRY(ban) list;
AddBan("a");
}
+
+void
+VRT_repurge(const char *regexp)
+{
+ AddBan(regexp);
+}
int VRT_re_test(struct vsb *, const char *, int sub);
const char *VRT_regsub(struct sess *sp, const char *, void *, const char *);
+void VRT_repurge(const char *);
+
void VRT_count(struct sess *, unsigned);
int VRT_rewrite(const char *, const char *);
void VRT_error(struct sess *, unsigned, const char *);
vcc_NextToken(tl);
}
+/*--------------------------------------------------------------------*/
+
+static void
+parse_repurge(struct tokenlist *tl)
+{
+ vcc_NextToken(tl);
+
+ Fb(tl, 0, "VRT_repurge(");
+
+ Expect(tl, '(');
+ vcc_NextToken(tl);
+
+ if (!vcc_StringVal(tl)) {
+ vcc_ExpectedStringval(tl);
+ }
+
+ Expect(tl, ')');
+ vcc_NextToken(tl);
+ Fb(tl, 0, ");");
+}
+
+
/*--------------------------------------------------------------------*/
typedef void action_f(struct tokenlist *tl);
{ "call", parse_call },
{ "set", parse_set },
{ "remove", parse_remove },
+ { "purge", parse_repurge },
{ NULL, NULL }
};
vsb_cat(sb, "int VRT_re_test(struct vsb *, const char *, int sub);\n");
vsb_cat(sb, "const char *VRT_regsub(struct sess *sp, const char *, void *, const char *);\n");
vsb_cat(sb, "\n");
+ vsb_cat(sb, "void VRT_repurge(const char *);\n");
+ vsb_cat(sb, "\n");
vsb_cat(sb, "void VRT_count(struct sess *, unsigned);\n");
vsb_cat(sb, "int VRT_rewrite(const char *, const char *);\n");
vsb_cat(sb, "void VRT_error(struct sess *, unsigned, const char *);\n");