-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdefault_listener.c
58 lines (49 loc) · 2.18 KB
/
default_listener.c
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
50
51
52
53
54
55
56
57
58
/*
* The MIT License (MIT)
*
* Copyright (c) 2020 - 2021 TheVice
*
*/
#include "default_listener.h"
#include <stdio.h>
#if ((defined(__APPLE__) && defined(__MACH__))) || defined(__OpenBSD__)
#define PTRDIFF_FORMAT_TYPE "td"
#elif (defined(_WIN64) || defined(__amd64) || defined(__x86_64))
#include <inttypes.h>
#define PTRDIFF_FORMAT_TYPE PRId64
#else
#define PTRDIFF_FORMAT_TYPE "td"
#endif
void listener_project_started(const uint8_t* source, const uint8_t* the_project)
{
printf("The project '%s' is started from source '%s'.\n", the_project, source);
}
void listener_project_finished(const uint8_t* source, const uint8_t* the_project,
uint8_t result)
{
printf("The project '%s' is finished from source '%s' with result '%i'.\n", the_project, source, result);
}
void listener_target_started(const uint8_t* source, ptrdiff_t offset,
const uint8_t* the_project, const uint8_t* the_target)
{
printf("\tThe target '%s' is started from project '%s' at offset '%"PTRDIFF_FORMAT_TYPE"' from source '%s'.\n",
the_target, the_project, offset, source);
}
void listener_target_finished(const uint8_t* source, ptrdiff_t offset,
const uint8_t* the_project, const uint8_t* the_target, uint8_t result)
{
printf("\tThe target '%s' is finished from project '%s' at offset '%"PTRDIFF_FORMAT_TYPE"' from source '%s' with result '%i'.\n",
the_target, the_project, offset, source, result);
}
void listener_task_started(const uint8_t* source, ptrdiff_t offset,
const uint8_t* the_project, const uint8_t* the_target, const uint8_t* task)
{
printf("%sThe task '%s' is started (current target is '%s') from project '%s' at offset '%"PTRDIFF_FORMAT_TYPE"' from source '%s'.\n",
NULL == the_target ? "\t" : "\t\t", task, the_target, the_project, offset, source);
}
void listener_task_finished(const uint8_t* source, ptrdiff_t offset,
const uint8_t* the_project, const uint8_t* the_target, const uint8_t* task, uint8_t result)
{
printf("%sThe task '%s' is finished (current target is '%s') from project '%s' at offset '%"PTRDIFF_FORMAT_TYPE"' from source '%s' with result '%i'.\n",
NULL == the_target ? "\t" : "\t\t", task, the_target, the_project, offset, source, result);
}