PulseAudio 16.1

mainloop.h
Go to the documentation of this file.
1#ifndef foomainloophfoo
2#define foomainloophfoo
3
4/***
5 This file is part of PulseAudio.
6
7 Copyright 2004-2006 Lennart Poettering
8 Copyright 2006 Pierre Ossman <ossman@cendio.se> for Cendio AB
9
10 PulseAudio is free software; you can redistribute it and/or modify
11 it under the terms of the GNU Lesser General Public License as published
12 by the Free Software Foundation; either version 2.1 of the License,
13 or (at your option) any later version.
14
15 PulseAudio is distributed in the hope that it will be useful, but
16 WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 General Public License for more details.
19
20 You should have received a copy of the GNU Lesser General Public License
21 along with PulseAudio; if not, see <http://www.gnu.org/licenses/>.
22***/
23
24#include <pulse/mainloop-api.h>
25#include <pulse/cdecl.h>
26
27PA_C_DECL_BEGIN
28
29 struct pollfd;
30
78 typedef struct pa_mainloop pa_mainloop;
79
81 pa_mainloop *pa_mainloop_new(void);
82
84 void pa_mainloop_free(pa_mainloop* m);
85
89 int pa_mainloop_prepare(pa_mainloop *m, int timeout);
90
92 int pa_mainloop_poll(pa_mainloop *m);
93
96 int pa_mainloop_dispatch(pa_mainloop *m);
97
99 int pa_mainloop_get_retval(const pa_mainloop *m);
100
107 int pa_mainloop_iterate(pa_mainloop *m, int block, int *retval);
108
113 int pa_mainloop_run(pa_mainloop *m, int *retval);
114
118 pa_mainloop_api* pa_mainloop_get_api(pa_mainloop*m);
119
121 void pa_mainloop_quit(pa_mainloop *m, int retval);
122
124 void pa_mainloop_wakeup(pa_mainloop *m);
125
127 typedef int (*pa_poll_func)(struct pollfd *ufds, unsigned long nfds, int timeout, void*userdata);
128
130 void pa_mainloop_set_poll_func(pa_mainloop *m, pa_poll_func poll_func, void *userdata);
131
132PA_C_DECL_END
133
134#endif
mainloop-api.h
Main loop abstraction layer.
pa_mainloop_prepare
int pa_mainloop_prepare(pa_mainloop *m, int timeout)
Prepare for a single iteration of the main loop.
pa_mainloop_get_retval
int pa_mainloop_get_retval(const pa_mainloop *m)
Return the return value as specified with the main loop's quit() routine.
pa_mainloop_wakeup
void pa_mainloop_wakeup(pa_mainloop *m)
Interrupt a running poll (for threaded systems)
pa_mainloop_quit
void pa_mainloop_quit(pa_mainloop *m, int retval)
Shutdown the main loop with the specified return value.
pa_mainloop_iterate
int pa_mainloop_iterate(pa_mainloop *m, int block, int *retval)
Run a single iteration of the main loop.
pa_mainloop_new
pa_mainloop * pa_mainloop_new(void)
Allocate a new main loop object.
pa_mainloop_free
void pa_mainloop_free(pa_mainloop *m)
Free a main loop object.
pa_mainloop_poll
int pa_mainloop_poll(pa_mainloop *m)
Execute the previously prepared poll.
pa_poll_func
int(* pa_poll_func)(struct pollfd *ufds, unsigned long nfds, int timeout, void *userdata)
Generic prototype of a poll() like function.
Definition: mainloop.h:127
pa_mainloop
struct pa_mainloop pa_mainloop
An opaque main loop object.
Definition: mainloop.h:78
pa_mainloop_dispatch
int pa_mainloop_dispatch(pa_mainloop *m)
Dispatch timeout, io and deferred events from the previously executed poll.
pa_mainloop_set_poll_func
void pa_mainloop_set_poll_func(pa_mainloop *m, pa_poll_func poll_func, void *userdata)
Change the poll() implementation.
pa_mainloop_run
int pa_mainloop_run(pa_mainloop *m, int *retval)
Run unlimited iterations of the main loop object until the main loop's quit() routine is called.
pa_mainloop_get_api
pa_mainloop_api * pa_mainloop_get_api(pa_mainloop *m)
Return the abstract main loop abstraction layer vtable for this main loop.
pa_mainloop_api
An abstract mainloop API vtable.
Definition: mainloop-api.h:87