+2008-03-24 Ian Jackson <ian@davenant.greenend.org.uk>
+
+ * lib/dpkg.h (error_printer): New function pointer type.
+ (push_error_handler): Use error_printer instead of an explicit
+ declaration in the argument list.
+ (set_error_display): Likewise.
+ * lib/ehandle.c (push_error_handler): Likewise.
+ (set_error_display): Likewise.
+
2008-03-23 Guillem Jover <guillem@debian.org>
* configure.ac (DPKG_CHECK_COMPAT_FUNCS): Add 'strnlen'.
/*** from ehandle.c ***/
-void push_error_handler(jmp_buf *jbufp,
- void (*printerror)(const char *, const char *),
+typedef void error_printer(const char *emsg, const char *contextstring);
+
+void push_error_handler(jmp_buf *jbufp, error_printer *printerror,
const char *contextstring);
-void set_error_display(void (*printerror)(const char *, const char *),
- const char *contextstring);
+void set_error_display(error_printer *printerror, const char *contextstring);
void print_error_fatal(const char *emsg, const char *contextstring);
void error_unwind(int flagset);
void push_cleanup(void (*f1)(int argc, void **argv), int flagmask1,
static struct errorcontext *volatile econtext= NULL;
static struct { struct cleanupentry ce; void *args[20]; } emergency;
-void set_error_display(void (*printerror)(const char *, const char *),
+void set_error_display(error_printer *printerror,
const char *contextstring) {
assert(econtext);
econtext->printerror= printerror;
}
void push_error_handler(jmp_buf *jbufp,
- void (*printerror)(const char *, const char *),
+ error_printer *printerror,
const char *contextstring) {
struct errorcontext *necp;
necp= malloc(sizeof(struct errorcontext));