LibGame v0.4.0
The LG Game Engine - Copyright (C) 2024-2026 ETMSoftware
Loading...
Searching...
No Matches
lg_error.c File Reference

Functions

void sig_handler (int sig_num, siginfo_t *sig_info, void *context)
 
void set_sig_handler ()
 
void lg_print_out_error_codes ()
 
void test_big_error (int test)
 

Detailed Description

 === Errors handling ===

 TODO: complete the doc

Function Documentation

◆ sig_handler()

void sig_handler ( int  sig_num,
siginfo_t *  sig_info,
void *  context 
)

Set up the Unix signals handler

You must define app_sig_handler() somewhere in your app, so that you can get useful debugging info and exit properly

void app_sig_handler(int sig_num, const char *sig_txt)
{
INFO_ERR("%s received - will probably exit\n", sig_txt);
big_error(LG_SIG_START + sig_num, "%s received - this is a *bug*", sig_txt);
}

lg_error_code enum is defined in libgame.h

◆ set_sig_handler()

void set_sig_handler ( )

Handling a few UNIX signals

◆ lg_print_out_error_codes()

void lg_print_out_error_codes ( )

Print out error codes

◆ test_big_error()

void test_big_error ( int  test)

Testing big_error()