From 52e1859e5f05eb102fee6734e71695d4c29b0d97 Mon Sep 17 00:00:00 2001 From: Frederic Culot Date: Sat, 4 Aug 2007 14:32:31 +0000 Subject: ASSERT macro, ierror() and aerror() added --- src/utils.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/utils.h b/src/utils.h index ec06c1b..396fb9c 100755 --- a/src/utils.h +++ b/src/utils.h @@ -1,4 +1,4 @@ -/* $calcurse: utils.h,v 1.22 2007/07/28 13:11:43 culot Exp $ */ +/* $calcurse: utils.h,v 1.23 2007/08/04 14:32:31 culot Exp $ */ /* * Calcurse - text-based organizer @@ -32,6 +32,10 @@ #define MAX(x,y) ((x)>(y)?(x):(y)) #define MIN(x,y) ((x)<(y)?(x):(y)) +#define ASSERT(e) do { \ + ((e) ? (void)0 : aerror(__FILE__, __LINE__, #e)); \ +} while (0) + #define SPC 32 /* ASCII code for white space */ #define NB_CAL_CMDS 16 /* number of commands while in cal view */ @@ -52,7 +56,9 @@ typedef struct { /* structure defining a keybinding */ char *label; } binding_t; -void exit_calcurse(void); +void exit_calcurse(int); +void ierror(const char *); +void aerror(const char *, int, const char *); void status_mesg(char *, char *); void erase_status_bar(void); void erase_window_part(WINDOW *, int, int, int, int); -- cgit v1.2.3-70-g09d2