Object PKCS#11 C++ Wrapper
Main Page
Modules
Namespaces
Classes
Files
File List
File Members
include
macros.h
Go to the documentation of this file.
1
#ifndef MACROS_H
2
#define MACROS_H
3
4
#include <stdio.h>
5
#include <iostream>
6
7
#define NOT_IMPLEMENTED TRACE("\e[34m[NOT IMPLEMENTED.]")
8
#define OK TRACE("\e[32m[OK]")
9
#define FAILED TRACE("\e[31m[FAILED]")
10
20
#ifdef DEBUG
21
#define TRACE(x) \
22
{ std::cerr <<"\e[33m"<<"[TRACE] "<<__FILE__<<"::" \
23
<<__func__<<":"<<__LINE__<<" >>\e[34m " \
24
<< x <<"\e[0m"<<std::endl; }
25
26
#define TRACEm(fmt,...) \
27
fprintf(stderr, "\e[33m[TRACE] %s::%s:%d >>\e[34m " fmt\
28
"\e[0m\n",__FILE__,__func__,__LINE__, __VA_ARGS__)
29
30
#define TRACE_ERROR(x) \
31
{ std::cerr <<"\e[33m"<<"[TRACE] "<<__FILE__<<"::" \
32
<<__func__<<":"<<__LINE__<<" >>\e[31m " \
33
<< x <<"\e[0m"<<std::endl; }
34
35
#define TRACEm_ERROR(fmt,...) \
36
fprintf(stderr, "\e[33m[TRACE] %s::%s:%d >>\e[31m " fmt\
37
"\e[0m\n",__FILE__,__func__,__LINE__, __VA_ARGS__)
38
#else
39
#define TRACE(x)
40
#define TRACEm(fmt,...)
41
#define TRACE_ERROR(x)
42
#define TRACEm_ERROR(fmt,...)
43
#endif
44
45
#ifdef PREC
46
#define EXPECT_ZERO(x) if(x){\
47
TRACE_ERROR(#x)\
48
throw CryptokiException(__func__,666);}
49
50
#define EXPECT_N_ZERO(x) if(!x){\
51
TRACE_ERROR(#x)\
52
throw CryptokiException(__func__,666);}
53
#else
54
#define EXPECT_ZERO(x)
55
#define EXPECT_N_ZERO(x)
56
#endif
57
#define PRECONDITION(x) EXPECT_N_ZERO(x)
58
59
#endif
/*MACROS_H*/
Generated by
1.8.9.1