Cthulhu  0.2.10
Cthulhu compiler collection
notify.c File Reference
#include "notify/notify.h"
#include "base/panic.h"
#include "arena/arena.h"
#include "std/set.h"
#include "std/str.h"
#include "std/typed/vector.h"
#include "std/vector.h"
#include "notify/notify.inc"
Include dependency graph for notify.c:

Go to the source code of this file.

Data Structures

struct  logger_t
 a logging sink More...
 

Macros

#define CHECK_BUILDER(bld)
 
#define SEVERITY(id, name)   [id] = (name),
 

Functions

STA_DECL logger_tlogger_new (arena_t *arena)
 create a new logger More...
 
STA_DECL typevec_tlogger_get_events (const logger_t *logs)
 get the events from the logger More...
 
STA_DECL bool logger_has_errors (const logger_t *logs, notify_rules_t rules)
 check if the logger has any fatal errors More...
 
STA_DECL void logger_reset (logger_t *logs)
 reset the loggers messages More...
 
STA_DECL arena_tlogger_get_arena (const logger_t *logs)
 
STA_DECL event_builder_t msg_notify (logger_t *logs, const diagnostic_t *diagnostic, const node_t *node, const char *fmt,...)
 
STA_DECL event_builder_t msg_vnotify (logger_t *logs, const diagnostic_t *diagnostic, const node_t *node, const char *fmt, va_list args)
 
STA_DECL void msg_append (event_builder_t builder, const node_t *node, const char *fmt,...)
 
STA_DECL void msg_vappend (event_builder_t builder, const node_t *node, const char *fmt, va_list args)
 append additional information to a message More...
 
STA_DECL void msg_note (event_builder_t builder, const char *fmt,...)
 
STA_DECL void msg_vnote (event_builder_t builder, const char *fmt, va_list args)
 add a note to an existing message More...
 
STA_DECL const char * severity_string (severity_t severity)
 get the name of a severity More...
 

Macro Definition Documentation

◆ CHECK_BUILDER

#define CHECK_BUILDER (   bld)
Value:
CTASSERT((bld).event != NULL); \
CTASSERT((bld).arena != NULL);
#define CTASSERT(expr)
assert a condition, prints the condition as a message
Definition: panic.h:130

Definition at line 153 of file notify.c.

◆ SEVERITY

#define SEVERITY (   id,
  name 
)    [id] = (name),

Function Documentation

◆ msg_append()

STA_DECL void msg_append ( event_builder_t  builder,
const node_t node,
const char *  fmt,
  ... 
)

Definition at line 143 of file notify.c.

◆ msg_note()

STA_DECL void msg_note ( event_builder_t  builder,
const char *  fmt,
  ... 
)

Definition at line 182 of file notify.c.

◆ msg_notify()

STA_DECL event_builder_t msg_notify ( logger_t logs,
const diagnostic_t diagnostic,
const node_t node,
const char *  fmt,
  ... 
)

Definition at line 105 of file notify.c.

◆ msg_vnotify()

STA_DECL event_builder_t msg_vnotify ( logger_t logs,
const diagnostic_t diagnostic,
const node_t node,
const char *  fmt,
va_list  args 
)

Definition at line 118 of file notify.c.

◆ severity_string()

STA_DECL const char* severity_string ( severity_t  severity)

get the name of a severity

Parameters
severitythe severity to get the name of
Returns
the name of severity

Definition at line 216 of file notify.c.