|
json-gen-c
0.1.5
json-gen-c generate C code for json manipulation
|
Diagnostic engine implementation. More...
#include "utils/diag.h"#include "utils/compat.h"#include <stdarg.h>#include <stdio.h>#include <stdlib.h>#include <string.h>
Functions | |
| struct diag_engine * | diag_engine_new (const char *filename, const char *source, long source_len) |
| Create a new diagnostic engine. | |
| void | diag_engine_free (struct diag_engine *engine) |
| Free a diagnostic engine and all its entries. | |
| void | diag_emit (struct diag_engine *engine, enum diag_severity severity, int line, int col, const char *fmt,...) |
| void | diag_print_all (struct diag_engine *engine, FILE *stream) |
| Print all accumulated diagnostics to a stream. Uses ANSI colors if stream is a terminal. | |
| int | diag_has_errors (struct diag_engine *engine) |
| Check if any errors were emitted. | |
| int | diag_error_count (struct diag_engine *engine) |
| Get the number of errors emitted. | |
Diagnostic engine implementation.
| struct diag_engine * diag_engine_new | ( | const char * | filename, |
| const char * | source, | ||
| long | source_len | ||
| ) |
Create a new diagnostic engine.
| filename | Source filename (not owned, must outlive engine) |
| source | Source content string (not owned) |
| source_len | Length of source content |