Path: blob/master/thirdparty/linuxbsd_headers/pulse/mainloop-signal.h
9905 views
#ifndef foomainloopsignalhfoo1#define foomainloopsignalhfoo23/***4This file is part of PulseAudio.56Copyright 2004-2008 Lennart Poettering7Copyright 2006 Pierre Ossman <[email protected]> for Cendio AB89PulseAudio is free software; you can redistribute it and/or modify10it under the terms of the GNU Lesser General Public License as published11by the Free Software Foundation; either version 2.1 of the License,12or (at your option) any later version.1314PulseAudio is distributed in the hope that it will be useful, but15WITHOUT ANY WARRANTY; without even the implied warranty of16MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU17General Public License for more details.1819You should have received a copy of the GNU Lesser General Public License20along with PulseAudio; if not, see <http://www.gnu.org/licenses/>.21***/2223#include <pulse/mainloop-api.h>24#include <pulse/cdecl.h>2526PA_C_DECL_BEGIN2728/** \file29* UNIX signal support for main loops. In contrast to other30* main loop event sources such as timer and IO events, UNIX signal31* support requires modification of the global process32* environment. Due to this the generic main loop abstraction layer as33* defined in \ref mainloop-api.h doesn't have direct support for UNIX34* signals. However, you may hook signal support into an abstract main loop via the routines defined herein.35*/3637/** An opaque UNIX signal event source object */38typedef struct pa_signal_event pa_signal_event;3940/** Callback prototype for signal events */41typedef void (*pa_signal_cb_t) (pa_mainloop_api *api, pa_signal_event*e, int sig, void *userdata);4243/** Destroy callback prototype for signal events */44typedef void (*pa_signal_destroy_cb_t) (pa_mainloop_api *api, pa_signal_event*e, void *userdata);4546/** Initialize the UNIX signal subsystem and bind it to the specified main loop */47int pa_signal_init(pa_mainloop_api *api);4849/** Cleanup the signal subsystem */50void pa_signal_done(void);5152/** Create a new UNIX signal event source object */53pa_signal_event* pa_signal_new(int sig, pa_signal_cb_t callback, void *userdata);5455/** Free a UNIX signal event source object */56void pa_signal_free(pa_signal_event *e);5758/** Set a function that is called when the signal event source is destroyed. Use this to free the userdata argument if required */59void pa_signal_set_destroy(pa_signal_event *e, pa_signal_destroy_cb_t callback);6061PA_C_DECL_END6263#endif646566