Cthulhu
0.2.10
Cthulhu compiler collection
notify.h
Go to the documentation of this file.
1
// SPDX-License-Identifier: LGPL-3.0-only
2
3
#pragma once
4
5
#include <ctu_format_api.h>
6
7
#include "
core/analyze.h
"
8
#include "
core/compiler.h
"
9
10
#include <stdbool.h>
11
#include <stddef.h>
12
17
24
34
35
typedef
struct
io_t
io_t
;
36
typedef
struct
event_t
event_t
;
37
typedef
struct
typevec_t
typevec_t
;
38
typedef
struct
arena_t
arena_t
;
39
40
typedef
struct
colour_pallete_t
colour_pallete_t
;
41
typedef
struct
cache_map_t
cache_map_t
;
42
typedef
struct
set_t
set_t
;
43
typedef
struct
text_cache_t
text_cache_t
;
44
45
CT_BEGIN_API
46
48
typedef
struct
file_config_t
49
{
51
bool
zeroth_line
;
52
55
size_t
max_columns
;
56
58
bool
override_fatal
;
59
}
file_config_t
;
60
61
typedef
enum
text_format_t
62
{
63
eTextSimple
,
64
eTextComplex
,
65
66
eTextTotal
67
}
text_format_t
;
68
69
typedef
struct
text_config_t
70
{
72
cache_map_t
*
cache
;
73
74
// is the first line of a source file the zeroth line or the first line
75
file_config_t
config
;
76
77
// colour configuration
78
const
colour_pallete_t
*
colours
;
79
80
// the io object to write to
81
io_t
*
io
;
82
}
text_config_t
;
83
84
typedef
struct
report_config_t
85
{
86
size_t
max_errors
;
87
size_t
max_warnings
;
88
89
set_t
*
ignore_warnings
;
90
set_t
*
error_warnings
;
91
92
text_format_t
report_format
;
93
text_config_t
text_config
;
94
}
report_config_t
;
95
96
CT_FORMAT_API
int
text_report
(
97
IN_NOTNULL
typevec_t
*events,
98
report_config_t
config,
99
IN_STRING
const
char
*title);
100
101
// complex reporting
102
CT_FORMAT_API
void
text_report_rich
(
103
text_config_t
config,
104
IN_NOTNULL
const
event_t
*event);
105
106
// simple reporting like msvc
107
// path(line): severity id: main message
108
109
CT_FORMAT_API
void
text_report_simple
(
110
text_config_t
config,
111
IN_NOTNULL
const
event_t
*event);
112
113
CT_END_API
analyze.h
compiler.h
IN_NOTNULL
#define IN_NOTNULL
annotate a parameter as not being null
IN_STRING
#define IN_STRING
annotate a parameter as being a null terminated string
CT_BEGIN_API
#define CT_BEGIN_API
Definition:
compiler.h:129
CT_END_API
#define CT_END_API
Definition:
compiler.h:130
arena_t
an allocator object
Definition:
arena.h:86
cache_map_t
Definition:
common_extra.c:135
colour_pallete_t
a colour pallete
Definition:
colour.h:39
event_t
an event handle TODO: make this and segment_t opaque
Definition:
notify.h:36
file_config_t
the configuration for a file
Definition:
notify.h:49
file_config_t::override_fatal
bool override_fatal
if true all warnings are treated as fatal
Definition:
notify.h:58
file_config_t::max_columns
size_t max_columns
the maximum number of columns to print set to 0 to use default
Definition:
notify.h:55
file_config_t::zeroth_line
bool zeroth_line
the zeroth line of a file is the first line
Definition:
notify.h:51
io_t
io object implementation
Definition:
impl.h:122
report_config_t
Definition:
notify.h:85
report_config_t::max_errors
size_t max_errors
Definition:
notify.h:86
report_config_t::max_warnings
size_t max_warnings
Definition:
notify.h:87
report_config_t::text_config
text_config_t text_config
Definition:
notify.h:93
report_config_t::ignore_warnings
set_t * ignore_warnings
Definition:
notify.h:89
report_config_t::error_warnings
set_t * error_warnings
Definition:
notify.h:90
report_config_t::report_format
text_format_t report_format
Definition:
notify.h:92
set_t
an unordered hash set
Definition:
set.c:19
text_cache_t
Definition:
common_extra.c:147
text_config_t
Definition:
notify.h:70
text_config_t::io
io_t * io
Definition:
notify.h:81
text_config_t::colours
const colour_pallete_t * colours
Definition:
notify.h:78
text_config_t::config
file_config_t config
Definition:
notify.h:75
text_config_t::cache
cache_map_t * cache
a shared cache between all reports, set to NULL to disable caching
Definition:
notify.h:72
typevec_t
A vector with a fixed type size.
Definition:
vector.h:24
text_report
CT_FORMAT_API int text_report(typevec_t *events, report_config_t config, const char *title)
Definition:
common_extra.c:416
text_format_t
text_format_t
Definition:
notify.h:62
eTextSimple
@ eTextSimple
simple text reporting
Definition:
notify.h:63
eTextComplex
@ eTextComplex
complex text reporting
Definition:
notify.h:64
eTextTotal
@ eTextTotal
Definition:
notify.h:66
text_report_simple
CT_FORMAT_API void text_report_simple(text_config_t config, const event_t *event)
Definition:
text_simple.c:162
text_report_rich
CT_FORMAT_API void text_report_rich(text_config_t config, const event_t *event)
Definition:
text_rich.c:528
support
format
include
format
notify.h
Generated by
1.9.1