libosmocore  0.9.3
Osmocom core library
include/osmocom/core/signal.h
Go to the documentation of this file.
00001 #pragma once
00002 
00003 #include <stdint.h>
00004 
00010 /* subsystem signaling numbers: we split the numberspace for applications and
00011  * libraries: from 0 to UINT_MAX/2 for applications, from UINT_MAX/2 to
00012  * UINT_MAX for libraries. */
00013 #define OSMO_SIGNAL_SS_APPS             0
00014 #define OSMO_SIGNAL_SS_RESERVED         2147483648u
00015 
00017 enum {
00018         SS_L_GLOBAL             = OSMO_SIGNAL_SS_RESERVED,
00019         SS_L_INPUT,
00020         SS_L_NS,
00021         SS_L_VTY,
00022 };
00023 
00024 /* application-defined signal types. */
00025 #define OSMO_SIGNAL_T_APPS              0
00026 #define OSMO_SIGNAL_T_RESERVED          2147483648u
00027 
00029 enum {
00030         S_L_GLOBAL_SHUTDOWN     = OSMO_SIGNAL_T_RESERVED,
00031 };
00032 
00034 typedef int osmo_signal_cbfn(unsigned int subsys, unsigned int signal, void *handler_data, void *signal_data);
00035 
00036 
00037 /* Management */
00038 int osmo_signal_register_handler(unsigned int subsys, osmo_signal_cbfn *cbfn, void *data);
00039 void osmo_signal_unregister_handler(unsigned int subsys, osmo_signal_cbfn *cbfn, void *data);
00040 
00041 /* Dispatch */
00042 void osmo_signal_dispatch(unsigned int subsys, unsigned int signal, void *signal_data);
00043