LibLogicalAccess
2.5.0
An Open Source RFID Library
Loading...
Searching...
No Matches
plugins
logicalaccess
plugins
crypto
tomcrypt_argchk.h
Go to the documentation of this file.
1
#include "logicalaccess/plugins/crypto/lla_crypto_api.hpp"
2
3
/* Defines the LTC_ARGCHK macro used within the library */
4
/* ARGTYPE is defined in mycrypt_cfg.h */
5
#if ARGTYPE == 0
6
7
#include <signal.h>
8
9
/* this is the default LibTomCrypt macro */
10
LLA_CRYPTO_API
void
crypt_argchk
(
const
char
*v,
const
char
*s,
int
d);
11
#define LTC_ARGCHK(x) if (!(x)) { crypt_argchk(#x, __FILE__, __LINE__); }
12
#define LTC_ARGCHKVD(x) LTC_ARGCHK(x)
13
14
#elif ARGTYPE == 1
15
16
/* fatal type of error */
17
#define LTC_ARGCHK(x) assert((x))
18
#define LTC_ARGCHKVD(x) LTC_ARGCHK(x)
19
20
#elif ARGTYPE == 2
21
22
#define LTC_ARGCHK(x) if (!(x)) { fprintf(stderr, "\nwarning: ARGCHK failed at %s:%d\n"
, __FILE__, __LINE__); }
23
#define LTC_ARGCHKVD(x) LTC_ARGCHK(x)
24
25
#elif ARGTYPE == 3
26
27
#define LTC_ARGCHK(x)
28
#define LTC_ARGCHKVD(x) LTC_ARGCHK(x)
29
30
#elif ARGTYPE == 4
31
32
#define LTC_ARGCHK(x) if (!(x)) return CRYPT_INVALID_ARG;
33
#define LTC_ARGCHKVD(x) if (!(x)) return;
34
35
#endif
36
37
/* $Source$ */
38
/* $Revision$ */
39
/* $Date$ */
crypt_argchk
LLA_CRYPTO_API void crypt_argchk(const char *v, const char *s, int d)
Definition:
crypt_argchk.cpp:20
Generated on Wed Mar 29 2023 13:50:38 for LibLogicalAccess by
1.9.6