From 429f724d10ad441a12fb7dd13f23038cb0582b5c Mon Sep 17 00:00:00 2001 From: ian Date: Wed, 5 Jul 2006 21:25:46 +0000 Subject: [PATCH] finish logging and safety_panic --- hostside/common.h | 2 ++ hostside/errorcodes.h.gen | 39 +++++++++++++++++++++++++++--------- hostside/gui-plan.c | 1 + hostside/main.c | 1 + hostside/realtime.c | 42 +++++++++++++++++++++++++++++---------- hostside/utils.c | 22 ++++++++++++++++---- 6 files changed, 83 insertions(+), 24 deletions(-) diff --git a/hostside/common.h b/hostside/common.h index 008d219..83754b3 100644 --- a/hostside/common.h +++ b/hostside/common.h @@ -93,6 +93,8 @@ void diee(const char *fmt, ...) __attribute__((noreturn,format(printf,1,2))); void diem(void) __attribute__((noreturn)); void die_hook(void); +void die_vprintf_hook(const char *fmt, va_list al) + __attribute__((format(printf,1,0))); void *mmalloc(size_t sz); char *mstrdupl(const char *s, int l); diff --git a/hostside/errorcodes.h.gen b/hostside/errorcodes.h.gen index f624b0e..a3093dc 100755 --- a/hostside/errorcodes.h.gen +++ b/hostside/errorcodes.h.gen @@ -1,10 +1,31 @@ #!/usr/bin/perl -print "typedef enum {\n" or die $!; -foreach $f (qw( - OK - Safety - )) { - $_= $f; s/\-//g; - printf " EC_%s,\n", $_; -} -print "} ErrorCode;\n" or die $!; + +@f= qw( + OK + Safety + ); + + + +$decl= "const char *const errorcodelist[]"; + +print <