exceptions4c 4.0
Exceptions for C
Loading...
Searching...
No Matches
e4c_context Struct Reference

Contains the configuration and the current status of exceptions. More...

#include <exceptions4c.h>

Data Fields

void(* uncaught_handler )(const struct e4c_exception *exception)
 The function to execute in the event of an uncaught exception.
 
void(* termination_handler )()
 The function to execute in the event of program termination.
 
void(* initialize_exception )(struct e4c_exception *exception)
 The function to execute whenever a new exception is thrown.
 
void(* finalize_exception )(const struct e4c_exception *exception)
 The function to execute whenever an exception is destroyed.
 

Detailed Description

Contains the configuration and the current status of exceptions.

This structure allows you to configure the way the exception system behaves.

  • Set uncaught_handler to a function that will be executed when an exception reaches the top level of the program.
  • Set termination_handler to a function that will be executed when the program abruptly terminates due to an uncaught exception.
  • Set initialize_exception to a function that will be executed whenever an exception is thrown. This function MAY create and assign custom data to the exception.
  • Set finalize_exception to a function that will be executed whenever an exception is deleted. This function MAY delete custom data previously created.
See also
e4c_get_context
e4c_set_context_supplier

Field Documentation

◆ uncaught_handler

void(* uncaught_handler) (const struct e4c_exception *exception)

The function to execute in the event of an uncaught exception.

◆ termination_handler

void(* termination_handler) ()

The function to execute in the event of program termination.

◆ initialize_exception

void(* initialize_exception) (struct e4c_exception *exception)

The function to execute whenever a new exception is thrown.

◆ finalize_exception

void(* finalize_exception) (const struct e4c_exception *exception)

The function to execute whenever an exception is destroyed.


The documentation for this struct was generated from the following file: