xorriso  1.5.4.pl02
About: GNU xorriso creates, loads, manipulates and writes ISO 9660 filesystem images with Rock Ridge extensions. It is suitable for incremental data backup and for production of bootable ISO 9660 images. GNU xorriso is a statical compilation of the libraries libburn, libisofs, libisoburn, and libjte.
  Fossies Dox: xorriso-1.5.4.pl02.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

cleanup.c File Reference
#include <sys/types.h>
#include <stdlib.h>
#include <unistd.h>
#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <signal.h>
#include "cleanup.h"
#include "../libburn/os.h"
Include dependency graph for cleanup.c:

Go to the source code of this file.

Typedefs

typedef void(* sighandler_t) (int)
 

Functions

static int Cleanup_handler_exit (int exit_value, int signum, int flag)
 
static void Cleanup_handler_generic (int signum)
 
static char * Cleanup_signo_to_name (int signo)
 
int Cleanup_set_handlers (void *handle, Cleanup_app_handler_T handler, int flag)
 

Variables

static int signal_list [] = { BURN_OS_SIGNAL_MACRO_LIST , -1}
 
static char * signal_name_list [] = { BURN_OS_SIGNAL_NAME_LIST , "@"}
 
static int signal_list_count = BURN_OS_SIGNAL_COUNT
 
static int non_signal_list [] = { BURN_OS_NON_SIGNAL_MACRO_LIST, -1}
 
static int non_signal_list_count = BURN_OS_NON_SIGNAL_COUNT
 
static char cleanup_msg [4096] = {""}
 
static int cleanup_exiting = 0
 
static int cleanup_has_reported = -1234567890
 
static void * cleanup_app_handle = NULL
 
static Cleanup_app_handler_T cleanup_app_handler = NULL
 
static int cleanup_perform_app_handler_first = 0
 

Typedef Documentation

◆ sighandler_t

typedef void(* sighandler_t) (int)

Definition at line 25 of file cleanup.c.

Function Documentation

◆ Cleanup_handler_exit()

static int Cleanup_handler_exit ( int  exit_value,
int  signum,
int  flag 
)
static

◆ Cleanup_handler_generic()

static void Cleanup_handler_generic ( int  signum)
static

◆ Cleanup_set_handlers()

int Cleanup_set_handlers ( void *  handle,
Cleanup_app_handler_T  handler,
int  flag 
)

Establish exiting signal handlers on (hopefully) all signals that are not ignored by default or non-catchable.

Parameters
handleOpaque object which knows how to cleanup application
handlerFunction which uses handle to perform application cleanup
flagControl Bitfield bit0= reset to default signal handling

Definition at line 146 of file cleanup.c.

References cleanup_app_handle, cleanup_app_handler, Cleanup_handler_generic(), cleanup_msg, cleanup_perform_app_handler_first, Cleanup_signo_to_name(), non_signal_list, non_signal_list_count, signal_list, and signal_list_count.

Referenced by burn_builtin_abort_handler(), and burn_set_signal_handling().

◆ Cleanup_signo_to_name()

static char* Cleanup_signo_to_name ( int  signo)
static

Definition at line 136 of file cleanup.c.

References signal_list, signal_list_count, and signal_name_list.

Referenced by Cleanup_set_handlers().

Variable Documentation

◆ cleanup_app_handle

void* cleanup_app_handle = NULL
static

Definition at line 85 of file cleanup.c.

Referenced by Cleanup_handler_exit(), and Cleanup_set_handlers().

◆ cleanup_app_handler

Cleanup_app_handler_T cleanup_app_handler = NULL
static

Definition at line 86 of file cleanup.c.

Referenced by Cleanup_handler_exit(), and Cleanup_set_handlers().

◆ cleanup_exiting

int cleanup_exiting = 0
static

Definition at line 82 of file cleanup.c.

Referenced by Cleanup_handler_exit().

◆ cleanup_has_reported

int cleanup_has_reported = -1234567890
static

Definition at line 83 of file cleanup.c.

Referenced by Cleanup_handler_exit().

◆ cleanup_msg

char cleanup_msg[4096] = {""}
static

Definition at line 81 of file cleanup.c.

Referenced by Cleanup_handler_exit(), Cleanup_handler_generic(), and Cleanup_set_handlers().

◆ cleanup_perform_app_handler_first

int cleanup_perform_app_handler_first = 0
static

Definition at line 87 of file cleanup.c.

Referenced by Cleanup_handler_exit(), and Cleanup_set_handlers().

◆ non_signal_list

int non_signal_list[] = { BURN_OS_NON_SIGNAL_MACRO_LIST, -1}
static

Definition at line 40 of file cleanup.c.

Referenced by Cleanup_set_handlers().

◆ non_signal_list_count

int non_signal_list_count = BURN_OS_NON_SIGNAL_COUNT
static

Definition at line 41 of file cleanup.c.

Referenced by Cleanup_set_handlers().

◆ signal_list

int signal_list[] = { BURN_OS_SIGNAL_MACRO_LIST , -1}
static

Definition at line 37 of file cleanup.c.

Referenced by Cleanup_handler_generic(), Cleanup_set_handlers(), and Cleanup_signo_to_name().

◆ signal_list_count

int signal_list_count = BURN_OS_SIGNAL_COUNT
static

Definition at line 39 of file cleanup.c.

Referenced by Cleanup_handler_generic(), Cleanup_set_handlers(), and Cleanup_signo_to_name().

◆ signal_name_list

char* signal_name_list[] = { BURN_OS_SIGNAL_NAME_LIST , "@"}
static

Definition at line 38 of file cleanup.c.

Referenced by Cleanup_handler_generic(), and Cleanup_signo_to_name().