gwion-util
utilities for the Gwion project
|
#include <stddef.h>
#include <stdbool.h>
#include <stdio.h>
Go to the source code of this file.
Data Structures | |
struct | libprettyerr_str |
struct | libprettyerr_pos |
struct | libprettyerr_error |
struct | libprettyerr_printer |
Macros | |
#define | PERR_Str(line_, start_) (struct libprettyerr_str){ .line = line_, .start = start_ } |
#define | PERR_Str_None() PERR_Str(0, NULL) |
#define | PERR_Pos(index_, length_) (struct libprettyerr_pos){ .index = index_, .length = length_ } |
#define | PERR_Error(type_, primary_, error_position_, main_, explain_, error_code_, filename_) |
#define | PERR_Secondary(type_, primary_, error_position_, main_, filename_) |
#define | PRETTYERR_EXPORT |
Typedefs | |
typedef void(* | libprettyerr_runner_t) (const struct libprettyerr_printer *, const struct libprettyerr_error *) |
typedef struct libprettyerr_error | perr_t |
typedef struct libprettyerr_printer | perr_printer_t |
typedef libprettyerr_runner_t | perr_runner_t |
Enumerations | |
enum | libprettyerr_errtype { PERR_SUCCESS , PERR_ERROR , PERR_WARNING , PERR_INFO , PERR_HINT } |
enum | libprettyerr_boxtype { PERR_BOX_THICK_VERT , PERR_BOX_THIN_HIGH , PERR_BOX_THIN_UL , PERR_BOX_THIN_UL_ROUNDED , PERR_BOX_THIN_HORIZ , PERR_BOX_THIN_BL , PERR_BOX_THIN_BL_ROUNDED , PERR_BOX_THIN_VERT , PERR_BOX_MAX } |
Functions | |
PRETTYERR_EXPORT void | perr_printer_init (struct libprettyerr_printer *printer, FILE *stream, const char *source, bool utf8, libprettyerr_runner_t style) |
PRETTYERR_EXPORT void | perr_print_error (const struct libprettyerr_printer *printer, const struct libprettyerr_error *err) |
PRETTYERR_EXPORT void | perr_print_line_number (const struct libprettyerr_printer *printer, const struct libprettyerr_error *err, const char *color) |
Variables | |
PRETTYERR_EXPORT perr_runner_t | perr_runner_basic_style |
PRETTYERR_EXPORT perr_runner_t | perr_runner_secondary_style |
#define PERR_Error | ( | type_, | |
primary_, | |||
error_position_, | |||
main_, | |||
explain_, | |||
error_code_, | |||
filename_ ) |
Definition at line 75 of file prettyerr.h.
#define PERR_Pos | ( | index_, | |
length_ ) (struct libprettyerr_pos){ .index = index_, .length = length_ } |
Definition at line 39 of file prettyerr.h.
#define PERR_Secondary | ( | type_, | |
primary_, | |||
error_position_, | |||
main_, | |||
filename_ ) |
Definition at line 82 of file prettyerr.h.
#define PERR_Str | ( | line_, | |
start_ ) (struct libprettyerr_str){ .line = line_, .start = start_ } |
Definition at line 29 of file prettyerr.h.
#define PERR_Str_None | ( | ) | PERR_Str(0, NULL) |
Definition at line 31 of file prettyerr.h.
#define PRETTYERR_EXPORT |
Definition at line 101 of file prettyerr.h.
typedef void(* libprettyerr_runner_t) (const struct libprettyerr_printer *, const struct libprettyerr_error *) |
Definition at line 90 of file prettyerr.h.
typedef struct libprettyerr_printer perr_printer_t |
Definition at line 120 of file prettyerr.h.
typedef libprettyerr_runner_t perr_runner_t |
Definition at line 121 of file prettyerr.h.
typedef struct libprettyerr_error perr_t |
Definition at line 119 of file prettyerr.h.
enum libprettyerr_boxtype |
Enumerator | |
---|---|
PERR_BOX_THICK_VERT | |
PERR_BOX_THIN_HIGH | |
PERR_BOX_THIN_UL | |
PERR_BOX_THIN_UL_ROUNDED | |
PERR_BOX_THIN_HORIZ | |
PERR_BOX_THIN_BL | |
PERR_BOX_THIN_BL_ROUNDED | |
PERR_BOX_THIN_VERT | |
PERR_BOX_MAX |
Definition at line 50 of file prettyerr.h.
enum libprettyerr_errtype |
Enumerator | |
---|---|
PERR_SUCCESS | |
PERR_ERROR | |
PERR_WARNING | |
PERR_INFO | |
PERR_HINT |
Definition at line 42 of file prettyerr.h.
PRETTYERR_EXPORT void perr_print_error | ( | const struct libprettyerr_printer * | printer, |
const struct libprettyerr_error * | err ) |
PRETTYERR_EXPORT void perr_print_line_number | ( | const struct libprettyerr_printer * | printer, |
const struct libprettyerr_error * | err, | ||
const char * | color ) |
PRETTYERR_EXPORT void perr_printer_init | ( | struct libprettyerr_printer * | printer, |
FILE * | stream, | ||
const char * | source, | ||
bool | utf8, | ||
libprettyerr_runner_t | style ) |
Definition at line 42 of file prettyerr.c.
|
extern |
Definition at line 245 of file prettyerr.c.
|
extern |
Definition at line 246 of file prettyerr.c.