forked from libfirm/cparser
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdiagnostic.h
50 lines (42 loc) · 1.28 KB
/
diagnostic.h
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
/*
* This file is part of cparser.
* Copyright (C) 2012 Matthias Braun <[email protected]>
*/
#ifndef DIAGNOSTIC_H
#define DIAGNOSTIC_H
#include <stdbool.h>
#include "token_t.h"
#include "warning.h"
/**
* Issue a diagnostic message.
* Format types:
* %E expression_t const*
* %K token_t const*
* %k token_kind_t
* %#k va_list*, char const*
* %N entity_t const*
* %#N entity_t const*
* %Q unsigned (qualifier)
* %S string_t const*
* %T type_t const*
* %Y symbol_t const*
*/
void errorf(const position_t *pos, const char *fmt, ...);
/**
* Issue a diagnostic message with the prefix "note:".
*/
void notef(position_t const *pos, char const *fmt, ...);
/**
* Issue a diagnostic message with the prefix "warning:" and increase the
* warning count, if the given warning is activated.
*
* @return Whether the diagnostic was shown.
*/
bool warningf(warning_t, position_t const *pos, char const *fmt, ...);
extern unsigned error_count;
extern unsigned warning_count;
extern bool show_column; /**< Show column in diagnostic messages */
extern bool diagnostics_show_option; /**< Show the switch, which controls a warning. */
/** enable color output, allowed values for n_cols are 0, 8 and 256 */
void diagnostic_enable_color(int n_cols);
#endif