Purple  0.1
Standard Language Specification
Functions
logging.c File Reference

Warnings and fatal error handling. More...

#include <stdarg.h>
#include <stdlib.h>
#include "data.h"
#include "utils/arguments.h"
#include "utils/logging.h"
Include dependency graph for logging.c:

Functions

void fatal (ReturnCode rc, const char *fmt,...)
 Raises a fatal error that will exit the compiler. More...
 
void syntax_error (char *fn, int line_number, int char_number, const char *fmt,...)
 Raises a fatal syntax error. More...
 
void identifier_error (char *fn, int line_number, int char_number, const char *fmt,...)
 Raises a fatal identifier error. More...
 
void purple_log (LogLevel level, const char *fmt,...)
 Raises a non-fatal logging statement. More...
 

Detailed Description

Warnings and fatal error handling.

Author
Charles Averill
Date
08-Sep-2022

Function Documentation

◆ fatal()

void fatal ( ReturnCode  rc,
const char *  fmt,
  ... 
)

Raises a fatal error that will exit the compiler.

Parameters
rcReturn code to exit with
fmtFormat string for printed error
...Varargs for printed error

◆ identifier_error()

void identifier_error ( char *  fn,
int  line_number,
int  char_number,
const char *  fmt,
  ... 
)

Raises a fatal identifier error.

Parameters
fnFilename in which identifier error occurs
line_numberLine number on which identifier error occurs
char_numberCharacter numbre on which syntax error occurs
fmtFormat string for details printed before fatal error
...Varargs for details printed before fatal error

◆ purple_log()

void purple_log ( LogLevel  level,
const char *  fmt,
  ... 
)

Raises a non-fatal logging statement.

Parameters
levelSeverity of statement
fmtFormat string for printed statement
...Varargs for printed statement

◆ syntax_error()

void syntax_error ( char *  fn,
int  line_number,
int  char_number,
const char *  fmt,
  ... 
)

Raises a fatal syntax error.

Parameters
fnFilename in which syntax error occurs
line_numberLine number on which syntax error occurs
char_numberCharacter numbre on which syntax error occurs
fmtFormat string for details printed before fatal error
...Varargs for details printed before fatal error