|
1 | 1 | /* ---------- headers */ |
2 | 2 |
|
3 | 3 | #include "core\corelib\cseries\cseries_events.h" |
| 4 | +#include "core\corelib\cseries\events\event_handler.h" |
| 5 | + |
| 6 | +#include <cstdarg> |
| 7 | +#include <stdarg.h> |
4 | 8 |
|
5 | 9 | /* ---------- constants */ |
6 | 10 |
|
|
12 | 16 |
|
13 | 17 | /* ---------- public code */ |
14 | 18 |
|
| 19 | +bool event_level_query(e_event_level level) |
| 20 | +{ |
| 21 | + mangled_ppc("?event_level_query@@YA_NW4e_event_level@@@Z"); |
| 22 | + |
| 23 | + bool result = false; |
| 24 | + if(c_event_handler_hook::active()) |
| 25 | + { |
| 26 | + result = c_event_handler_hook::get_handler()->event_level_query(level); |
| 27 | + } |
| 28 | + return result; |
| 29 | +}; |
| 30 | + |
| 31 | +bool event_query(s_event_properties const * properties) |
| 32 | +{ |
| 33 | + mangled_ppc("?event_query@@YA_NPBUs_event_properties@@@Z"); |
| 34 | + |
| 35 | + bool result = false; |
| 36 | + if(c_event_handler_hook::active()) |
| 37 | + { |
| 38 | + result = c_event_handler_hook::get_handler()->event_query(properties); |
| 39 | + } |
| 40 | + return result; |
| 41 | +}; |
| 42 | + |
| 43 | +long event_process(s_event_properties const * properties, char const * format, ...) |
| 44 | +{ |
| 45 | + mangled_ppc("?event_process@@YAJPBUs_event_properties@@PBDZZ"); |
| 46 | + |
| 47 | + long result = -1; // $todo NONE |
| 48 | + va_list arglist; |
| 49 | + va_start(arglist, format); |
| 50 | + if(c_event_handler_hook::active()) |
| 51 | + { |
| 52 | + result = c_event_handler_hook::get_handler()->event_process(properties, format, arglist); |
| 53 | + } |
| 54 | + va_end(arglist); |
| 55 | + return result; |
| 56 | +}; |
| 57 | + |
| 58 | +long event_process_va(s_event_properties const * properties, char const * format, va_list arglist) |
| 59 | +{ |
| 60 | + mangled_ppc("?event_process_va@@YAJPBUs_event_properties@@PBDPAD@Z"); |
| 61 | + |
| 62 | + long result = -1; // $todo NONE |
| 63 | + if(c_event_handler_hook::active()) |
| 64 | + { |
| 65 | + result = c_event_handler_hook::get_handler()->event_process(properties, format, arglist); |
| 66 | + } |
| 67 | + return result; |
| 68 | +}; |
| 69 | + |
| 70 | +void event_store_category(long arg1, long volatile * arg2) |
| 71 | +{ |
| 72 | + mangled_ppc("?event_store_category@@YAXJPCJ@Z"); |
| 73 | + |
| 74 | + if(c_event_handler_hook::active()) |
| 75 | + { |
| 76 | + c_event_handler_hook::get_handler()->store_category(arg1, arg2); |
| 77 | + } |
| 78 | +}; |
| 79 | + |
| 80 | +void event_context_push(char const * arg1, unsigned long arg2, char const * arg3) |
| 81 | +{ |
| 82 | + mangled_ppc("?event_context_push@@YAXPBDK0@Z"); |
| 83 | + |
| 84 | + if(c_event_handler_hook::active()) |
| 85 | + { |
| 86 | + c_event_handler_hook::get_handler()->context_push(arg1, arg2, arg3); |
| 87 | + } |
| 88 | +}; |
| 89 | + |
| 90 | +void event_context_pop(void) |
| 91 | +{ |
| 92 | + mangled_ppc("?event_context_pop@@YAXXZ"); |
| 93 | + |
| 94 | + if(c_event_handler_hook::active()) |
| 95 | + { |
| 96 | + c_event_handler_hook::get_handler()->context_pop(); |
| 97 | + } |
| 98 | +}; |
| 99 | + |
15 | 100 | /* ---------- private code */ |
16 | 101 |
|
17 | 102 | /* ---------- reverse engineering */ |
18 | | - |
19 | | -// bool event_level_query(enum e_event_level); |
20 | | -// bool event_query(struct s_event_properties const *); |
21 | | -// long event_process(struct s_event_properties const *, char const *, ...); |
22 | | -// long event_process_va(struct s_event_properties const *, char const *, char *); |
23 | | -// void event_store_category(long, long volatile *); |
24 | | -// void event_context_push(char const *, unsigned long, char const *); |
25 | | -// void event_context_pop(void); |
26 | | - |
27 | | -//bool event_level_query(enum e_event_level) |
28 | | -//{ |
29 | | -// mangled_ppc("?event_level_query@@YA_NW4e_event_level@@@Z"); |
30 | | -//}; |
31 | | - |
32 | | -//bool event_query(struct s_event_properties const *) |
33 | | -//{ |
34 | | -// mangled_ppc("?event_query@@YA_NPBUs_event_properties@@@Z"); |
35 | | -//}; |
36 | | - |
37 | | -//long event_process(struct s_event_properties const *, char const *, ...) |
38 | | -//{ |
39 | | -// mangled_ppc("?event_process@@YAJPBUs_event_properties@@PBDZZ"); |
40 | | -//}; |
41 | | - |
42 | | -//long event_process_va(struct s_event_properties const *, char const *, char *) |
43 | | -//{ |
44 | | -// mangled_ppc("?event_process_va@@YAJPBUs_event_properties@@PBDPAD@Z"); |
45 | | -//}; |
46 | | - |
47 | | -//void event_store_category(long, long volatile *) |
48 | | -//{ |
49 | | -// mangled_ppc("?event_store_category@@YAXJPCJ@Z"); |
50 | | -//}; |
51 | | - |
52 | | -//void event_context_push(char const *, unsigned long, char const *) |
53 | | -//{ |
54 | | -// mangled_ppc("?event_context_push@@YAXPBDK0@Z"); |
55 | | -//}; |
56 | | - |
57 | | -//void event_context_pop(void) |
58 | | -//{ |
59 | | -// mangled_ppc("?event_context_pop@@YAXXZ"); |
60 | | -//}; |
61 | | - |
|
0 commit comments