5 #include <ctu_notify_api.h>
#define RET_NOTNULL
annotate the return value as not being null
#define STA_FIELD_STRING
annotate a field as being a null terminated string
#define CT_NODISCARD
mark a function as returning a value that must be used
#define STA_PRINTF(a, b)
mark a function as a printf style function
#define IN_NOTNULL
annotate a parameter as not being null
#define STA_FORMAT_STRING
mark a function parameter as a printf format string
#define IN_STRING
annotate a parameter as being a null terminated string
CT_NOTIFY_API event_builder_t msg_notify(INOUT_NOTNULL logger_t *logs, const diagnostic_t *diagnostic, const node_t *node, STA_FORMAT_STRING const char *fmt,...)
notify the logger of a new message
CT_NOTIFY_API void logger_reset(logger_t *logs)
reset the loggers messages
CT_NODISCARD CT_NOTIFY_API bool logger_has_errors(const logger_t *logs, notify_rules_t rules)
check if the logger has any fatal errors
CT_NOTIFY_API void msg_append(event_builder_t builder, const node_t *node, STA_FORMAT_STRING const char *fmt,...)
append additional information to a message
CT_NODISCARD CT_NOTIFY_API arena_t * logger_get_arena(const logger_t *logs)
CT_NOTIFY_API event_builder_t msg_vnotify(INOUT_NOTNULL logger_t *logs, const diagnostic_t *diagnostic, const node_t *node, const char *fmt, va_list args)
notify the logger of a new message
CT_NODISCARD CT_NOTIFY_API logger_t * logger_new(arena_t *arena)
create a new logger
CT_NOTIFY_API void msg_vnote(event_builder_t builder, const char *fmt, va_list args)
add a note to an existing message
CT_NOTIFY_API void msg_vappend(event_builder_t builder, const node_t *node, const char *fmt, va_list args)
append additional information to a message
CT_NOTIFY_API void msg_note(event_builder_t builder, STA_FORMAT_STRING const char *fmt,...)
add a note to an existing message
CT_NODISCARD CT_NOTIFY_API typevec_t * logger_get_events(const logger_t *logs)
get the events from the logger
CT_NODISCARD STA_FORMAT_STRING const char * fmt
typedefCT_BEGIN_API struct event_t event_t
an event builder handles adding additional information to an event
arena_t * arena
allocation context
event_t * event
the event to append to
an event handle TODO: make this and segment_t opaque
node_t node
the primary node that this event is attached to
const diagnostic_t * diagnostic
the related diagnostic
vector_t * notes
extra notes that this event is attached to
STA_FIELD_STRING char * message
the primary message
typevec_t * segments
extra segments that this event is attached to
a position in a source file
a set of rules for filtering notifications
set_t * warnings_as_errors
the set of warnings to treat as errors
set_t * ignored_warnings
the set of warnings to ignore this takes precedence over warnings_as_errors
a segment inside an event
node_t node
the related node
STA_FIELD_STRING char * message
the message associated with this segment
A vector with a fixed type size.
a generic vector of pointers