+#define FREE(b) ({ free((b)); (b)=0; })
+
+struct load_ctx {
+ void (*verror)(struct load_ctx *l, const struct cloc *loc,
+ FILE *maybe_f, bool_t unsup,
+ const char *message, va_list args);
+ bool_t (*postreadcheck)(struct load_ctx *l, FILE *f);
+ const char *what;
+ struct cloc *loc;
+ union {
+ struct {
+ struct log_if *log;
+ } tryload;
+ } u;
+};
+
+FORMAT(printf,5,0)
+static void verror_tryload(struct load_ctx *l, const struct cloc *loc,
+ FILE *maybe_f, bool_t unsup,
+ const char *message, va_list args)
+{
+ int class=unsup ? M_DEBUG : M_ERR;
+ slilog_part(l->u.tryload.log,class,"%s: ",l->what);
+ vslilog(l->u.tryload.log,class,message,args);
+}
+
+static void verror_cfgfatal(struct load_ctx *l, const struct cloc *loc,
+ FILE *maybe_f, bool_t unsup,
+ const char *message, va_list args)
+{
+ vcfgfatal_maybefile(maybe_f,*l->loc,l->what,message,args);
+}
+