Navigation


Changeset 235:8773740401a5 in freeDiameter for include


Ignore:
Timestamp:
Mar 5, 2010, 7:01:48 PM (14 years ago)
Author:
Sebastien Decugis <sdecugis@nict.go.jp>
Branch:
default
Phase:
public
Message:

Centralized signal handlers management in the library

File:
1 edited

Legend:

Unmodified
Added
Removed
  • include/freeDiameter/libfreeDiameter.h

    r232 r235  
    7575#include <libgen.h>     /* for basename if --dbg_file is specified */
    7676#endif /* DEBUG */
     77
     78
     79/*============================================================*/
     80/*                          INIT                              */
     81/*============================================================*/
     82
     83/* This function must be called first, before any call to another library function */
     84/* If the parameter is not 0, the support for signals (fd_sig_register) is enabled, otherwise it is disabled */
     85/* The function must be called while the application is single-threaded to enable support for signals */
     86int fd_lib_init(int support_signals);
     87
     88/* Call this one when the application terminates, to destroy internal threads */
     89void fd_lib_fini(void);
     90
     91
     92
    7793
    7894/*============================================================*/
     
    559575
    560576/*============================================================*/
     577/*                          SIGNALS                           */
     578/*============================================================*/
     579
     580/* Register a new callback to be called on reception of a given signal (it receives the signal as parameter) */
     581/* EALREADY will be returned if there is already a callback registered on this signal */
     582/* NOTE: the signal handler will be called from a new detached thread */
     583int fd_sig_register(int signal, char * modname, void (*callback)(int signal));
     584
     585/* Remove the handler for a given signal */
     586int fd_sig_unregister(int signal);
     587
     588/* Dump list of handlers */
     589void fd_sig_dump(int level, int indent);
     590
     591/* Name of signals */
     592#ifdef HAVE_SIGNALENT_H
     593extern const char *const fd_sig_str[];
     594extern const int fd_sig_nstr;
     595# define SIGNALSTR(sig) (((sig) < fd_sig_nstr) ? fd_sig_str[(sig)] : "[unknown signal]")
     596#else /* HAVE_SIGNALENT_H */
     597# define SIGNALSTR(sig) ("[no sig names]")
     598#endif /* HAVE_SIGNALENT_H */
     599
     600
     601/*============================================================*/
    561602/*                          LISTS                             */
    562603/*============================================================*/
Note: See TracChangeset for help on using the changeset viewer.