134c13be3be89cbbb4037f81db936a8237f5fe2d
[iotcloud.git] / version2 / src / C / common.h
1 #ifndef COMMON_H
2 #define COMMON_H
3 #include <inttypes.h>
4
5 //typedef uint32_t uint;
6 #define CMEMALLOC ;
7 #define model_print printf
8 #define ASSERT(expr) \
9         do {                         \
10                 if (!(expr)) {                                                      \
11                         fprintf(stderr, "Error: assertion failed in %s at line %d\n", __FILE__, __LINE__); \
12                         /* print_trace(); // Trace printing may cause dynamic memory allocation */ \
13                         exit(EXIT_FAILURE);                                               \
14                 }                                                                   \
15         } while (0)
16
17 #include "hashset.h"
18 #include "vector.h"
19 #include "array.h"
20
21 #define myerror(msg)                                                                                                                    \
22         do {                                                                                                                                                                    \
23                 printf(msg);                                                                                                                            \
24                 exit(-1);                                                                                                                                               \
25         } while(0)                                                                                                                                              
26                 
27 class TimingSingleton;
28 class Abort;
29 class Entry;
30 class Slot;
31 class ByteBuffer;
32 class Liveness;
33 class Commit;
34 class CommitPart;
35 class ArbitrationRound;
36 class KeyValue;
37 class RejectedMessage;
38 class PendingTransaction;
39 class CloudComm;
40 class IoTString;
41 class LastMessage;
42 class LocalComm;
43 class NewKey;
44 class SlotBuffer;
45 class SlotIndexer;
46 class Table;
47 class TableStatus;
48 class TimingSingleton;
49 class Transaction;
50 class TransactionPart;
51 class TransactionStatus;
52 class Error;
53 class Exception;
54 class ServerException;
55
56 //Code to write
57 class AESKey;
58 class Mac;
59 class SecureRandom;
60 class Thread;
61 class Key;
62 #endif