-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdebug_class.c
More file actions
49 lines (42 loc) · 1.01 KB
/
Copy pathdebug_class.c
File metadata and controls
49 lines (42 loc) · 1.01 KB
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
40
41
42
43
44
45
46
47
48
49
/*
* Debug class source file
*
* Since the debug class struct only has public members, there is no need for a _pri.h file,
* therefor private source function declarations are in this file
*
* The debug class simply writes messages to the console or stderr
*/
#include <stdio.h>
#include "lib/debug_pub.h"
#include "lib/eOOPc.h"
//private source function declarations
void Debug4c04_t_consoleLog(char * msg);
void Debug4c04_t_consoleErr(char * msg);
/**
* Create the window of a given height and width
* @param void* eOBJ Self object
* @return void
*/
void Debug4c04_t_instantiate(void * eOBJ)
{
eSELF(Debug4c04_t);
//bind methods
//public
self->consoleLog = &Debug4c04_t_consoleLog;
self->consoleErr = &Debug4c04_t_consoleErr;
}
/**
* Print to console
* @return void
*/
void Debug4c04_t_consoleLog(char * msg){
printf("%s", msg);
}
/**
* Print to stderr
* @return void
*/
void Debug4c04_t_consoleErr(char * msg){
fprintf(stderr, "%s", msg);
exit(1);
}