-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathcapdebug.h
More file actions
40 lines (27 loc) · 775 Bytes
/
capdebug.h
File metadata and controls
40 lines (27 loc) · 775 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
//
// Created by mteg on 5/6/18.
//
#ifndef CAPOC2_CAPDEBUG_H
#define CAPOC2_CAPDEBUG_H
#define RING_ENTRY_LENGTH 256
#define RING_ENTRY_COUNT 1024
struct capRingEntry
{
char entry[RING_ENTRY_LENGTH];
};
#define CA_ERROR_MAX 256
class capDebug {
public:
static unsigned int debugLevel;
static unsigned int ring_pos, ring_count;
static struct capRingEntry ring[RING_ENTRY_COUNT];
static char errorMessage[CA_ERROR_MAX];
static int report(unsigned int severity, const char *msg, ...);
static int error(const char *fmt, ...);
static void assert(void *ptr);
static int init();
static size_t ringSize();
static const char *ringGet(unsigned int n);
static void ringInsert(const char *msg);
};
#endif //CAPOC2_CAPDEBUG_H