Serene Runtime 1.0.0
C runtime for the Serene programming language
Loading...
Searching...
No Matches
errors.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  srn_error_t
 

Macros

#define ERROR_HEADER   srn_error_t *maybe_error
 
#define ERR(ctx, err, msg)
 

Typedefs

typedef enum srn_error_tag_t srn_error_tag_t
 
typedef struct srn_error_t srn_error_t
 

Enumerations

enum  srn_error_tag_t {
  ABSURD , SEQ_LIMIT_REACHED , INDEX_OUT_OF_BOUND , CORRUPTED_SEQ ,
  FAILED_TO_ADD_MODULE , EMPTY_NAMESPACE_NAME , EMPTY_SYMBOL_NAME , STRING_LENGTH_LIMIT_EXCEEDED
}
 

Functions

srn_error_tsrn_errors_make (const srn_context_t *ctx, srn_error_tag_t tag, const char *msg)
 

Macro Definition Documentation

◆ ERR

#define ERR ( ctx,
err,
msg )
Value:
srn_errors_make(ctx, err, msg)
srn_error_t * srn_errors_make(const srn_context_t *ctx, srn_error_tag_t tag, const char *msg)
Definition errors.c:28

Definition at line 74 of file errors.h.

◆ ERROR_HEADER

#define ERROR_HEADER   srn_error_t *maybe_error

Definition at line 35 of file errors.h.

Typedef Documentation

◆ srn_error_t

typedef struct srn_error_t srn_error_t

◆ srn_error_tag_t

Enumeration Type Documentation

◆ srn_error_tag_t

Enumerator
ABSURD 
SEQ_LIMIT_REACHED 
INDEX_OUT_OF_BOUND 
CORRUPTED_SEQ 

When the memory layout of a seq is incorrect.

FAILED_TO_ADD_MODULE 

Failed to add a module to the jit engine.

EMPTY_NAMESPACE_NAME 
EMPTY_SYMBOL_NAME 
STRING_LENGTH_LIMIT_EXCEEDED 

Definition at line 44 of file errors.h.

44 {
45 ABSURD,
48 CORRUPTED_SEQ, ///< When the memory layout of a seq is incorrect
49 FAILED_TO_ADD_MODULE, ///< Failed to add a module to the jit engine
srn_error_tag_t
Definition errors.h:44
@ CORRUPTED_SEQ
When the memory layout of a seq is incorrect.
Definition errors.h:48
@ EMPTY_NAMESPACE_NAME
Definition errors.h:50
@ STRING_LENGTH_LIMIT_EXCEEDED
Definition errors.h:52
@ ABSURD
Definition errors.h:45
@ FAILED_TO_ADD_MODULE
Failed to add a module to the jit engine.
Definition errors.h:49
@ INDEX_OUT_OF_BOUND
Definition errors.h:47
@ SEQ_LIMIT_REACHED
Definition errors.h:46
@ EMPTY_SYMBOL_NAME
Definition errors.h:51

Function Documentation

◆ srn_errors_make()

srn_error_t * srn_errors_make ( const srn_context_t * ctx,
srn_error_tag_t tag,
const char * msg )

Definition at line 28 of file errors.c.

28 {
29 srn_error_t *err = ALLOC(ctx, srn_error_t);
30 PANIC_IF_NULL(err);
31 err->tag = tag;
32 err->msg = (char *)msg;
33 return err;
34}
#define ALLOC(ctx, T)
Definition context.h:82
char * msg
Definition errors.h:57
srn_error_tag_t tag
Definition errors.h:56
#define PANIC_IF_NULL(ptr)
Definition utils.h:64
Here is the caller graph for this function: