chiark / gitweb /
config parsing: Break out cfgfatal_cl_type
[secnet.git] / log.c
diff --git a/log.c b/log.c
index 1ff2e5cd8c19df25c8da074df1b2e6733f6977b3..dd3e4776c4517d79cc84b14615379f7ffd56b6ea 100644 (file)
--- a/log.c
+++ b/log.c
@@ -162,6 +162,13 @@ void cfgfatal_maybefile(FILE *maybe_f, struct cloc loc, cstring_t facility,
     va_end(args);
 }    
 
+void cfgfatal_cl_type(struct cloc loc, const char *facility,
+                     closure_t *cl, uint32_t exp_type, const char *name)
+{
+    assert(cl->type != exp_type);
+    cfgfatal(loc,facility,"\"%s\" is the wrong type of closure\n",name);
+}
+
 void cfgfatal(struct cloc loc, cstring_t facility, const char *message, ...)
 {
     va_list args;