infix
A JIT-Powered FFI Library for C
Loading...
Searching...
No Matches
Error Handling API

Functions and types for detailed, thread-safe error reporting. More...

Collaboration diagram for Error Handling API:

Classes

struct  infix_error_details_t
 Provides detailed, thread-local information about the last error that occurred. More...
 

Enumerations

enum  infix_error_category_t {
  INFIX_CATEGORY_NONE , INFIX_CATEGORY_GENERAL , INFIX_CATEGORY_ALLOCATION , INFIX_CATEGORY_PARSER ,
  INFIX_CATEGORY_ABI
}
 Enumerates the high-level categories of errors that can occur. More...
 
enum  infix_error_code_t {
  INFIX_CODE_SUCCESS = 0 , INFIX_CODE_UNKNOWN , INFIX_CODE_OUT_OF_MEMORY = 100 , INFIX_CODE_EXECUTABLE_MEMORY_FAILURE ,
  INFIX_CODE_PROTECTION_FAILURE , INFIX_CODE_UNEXPECTED_TOKEN = 200 , INFIX_CODE_UNTERMINATED_AGGREGATE , INFIX_CODE_INVALID_KEYWORD ,
  INFIX_CODE_MISSING_RETURN_TYPE , INFIX_CODE_INTEGER_OVERFLOW , INFIX_CODE_RECURSION_DEPTH_EXCEEDED , INFIX_CODE_EMPTY_MEMBER_NAME ,
  INFIX_CODE_UNSUPPORTED_ABI = 300 , INFIX_CODE_TYPE_TOO_LARGE , INFIX_CODE_UNRESOLVED_NAMED_TYPE , INFIX_CODE_INVALID_MEMBER_TYPE ,
  INFIX_CODE_LAYOUT_FAILED , INFIX_CODE_LIBRARY_NOT_FOUND = 400 , INFIX_CODE_SYMBOL_NOT_FOUND , INFIX_CODE_LIBRARY_LOAD_FAILED
}
 Enumerates specific error codes. More...
 

Functions

infix_error_details_t infix_get_last_error (void)
 Retrieves detailed information about the last error that occurred on the current thread.
 

Detailed Description

Functions and types for detailed, thread-safe error reporting.

Enumeration Type Documentation

◆ infix_error_category_t

Enumerates the high-level categories of errors that can occur.

Enumerator
INFIX_CATEGORY_NONE 

No error.

INFIX_CATEGORY_GENERAL 

A general or miscellaneous error.

INFIX_CATEGORY_ALLOCATION 

A memory allocation error.

INFIX_CATEGORY_PARSER 

A syntax error in a signature string.

INFIX_CATEGORY_ABI 

An error related to ABI classification or layout.

◆ infix_error_code_t

Enumerates specific error codes.

Enumerator
INFIX_CODE_SUCCESS 

No error occurred.

INFIX_CODE_UNKNOWN 

An unspecified error occurred.

INFIX_CODE_OUT_OF_MEMORY 

A call to malloc, calloc, etc. failed.

INFIX_CODE_EXECUTABLE_MEMORY_FAILURE 

Failed to allocate executable memory from the OS.

INFIX_CODE_PROTECTION_FAILURE 

Failed to change memory protection flags (e.g., mprotect).

INFIX_CODE_UNEXPECTED_TOKEN 

Encountered an unexpected character or token.

INFIX_CODE_UNTERMINATED_AGGREGATE 

A struct, union, or array was not properly closed.

INFIX_CODE_INVALID_KEYWORD 

An unknown or misspelled type keyword was used.

INFIX_CODE_MISSING_RETURN_TYPE 

A function signature was missing the '->' and return type.

INFIX_CODE_INTEGER_OVERFLOW 

An integer overflow occurred during layout calculation.

INFIX_CODE_RECURSION_DEPTH_EXCEEDED 

A type definition was too deeply nested.

INFIX_CODE_EMPTY_MEMBER_NAME 

A named member was declared with an empty name.

INFIX_CODE_UNSUPPORTED_ABI 

The current platform's ABI is not supported by infix.

INFIX_CODE_TYPE_TOO_LARGE 

A data type exceeded the ABI's size limits.

INFIX_CODE_UNRESOLVED_NAMED_TYPE 

A named type (@Name) was not found in the provided registry.

INFIX_CODE_INVALID_MEMBER_TYPE 

An aggregate contained an illegal member type (e.g., void).

INFIX_CODE_LAYOUT_FAILED 

The ABI layer failed to calculate a valid memory layout for a type.

INFIX_CODE_LIBRARY_NOT_FOUND 

The requested dynamic library could not be found.

INFIX_CODE_SYMBOL_NOT_FOUND 

The requested symbol was not found in the library.

INFIX_CODE_LIBRARY_LOAD_FAILED 

The dynamic library failed to load for other reasons.

Function Documentation

◆ infix_get_last_error()

infix_error_details_t infix_get_last_error ( void  )

Retrieves detailed information about the last error that occurred on the current thread.

Returns
A copy of the last error details structure. This function is thread-safe.