tomcrypt/src/headers/tomcrypt_argchk.h

30 lines
616 B
C
Raw Normal View History

2004-12-30 23:55:53 +00:00
/* Defines the LTC_ARGCHK macro used within the library */
2003-03-03 00:59:24 +00:00
/* ARGTYPE is defined in mycrypt_cfg.h */
#if ARGTYPE == 0
#include <signal.h>
2003-03-03 01:02:10 +00:00
/* this is the default LibTomCrypt macro */
2004-10-30 03:00:26 +00:00
void crypt_argchk(char *v, char *s, int d);
2004-12-30 23:55:53 +00:00
#define LTC_ARGCHK(x) if (!(x)) { crypt_argchk(#x, __FILE__, __LINE__); }
2003-03-03 00:59:24 +00:00
#elif ARGTYPE == 1
/* fatal type of error */
2004-12-30 23:55:53 +00:00
#define LTC_ARGCHK(x) assert((x))
2003-03-03 00:59:24 +00:00
#elif ARGTYPE == 2
2005-08-01 16:36:47 +00:00
#define LTC_ARGCHK(x) if (!(x)) { fprintf(stderr, "\nwarning: ARGCHK failed at %s:%d\n", __FILE__, __LINE__); }
#elif ARGTYPE == 3
2004-12-30 23:55:53 +00:00
#define LTC_ARGCHK(x)
2003-03-03 00:59:24 +00:00
#endif
2005-06-09 00:08:13 +00:00
/* $Source$ */
/* $Revision$ */
/* $Date$ */