X-Git-Url: https://code.delx.au/pulseaudio/blobdiff_plain/8ae83d618e439d959e765845b55fa8521ab0e453..515e9d43c4a2d88792f5b71daf9928d5462b157d:/src/pulse/mainloop-api.h diff --git a/src/pulse/mainloop-api.h b/src/pulse/mainloop-api.h index 53c7411e..b4eccb1a 100644 --- a/src/pulse/mainloop-api.h +++ b/src/pulse/mainloop-api.h @@ -24,23 +24,23 @@ ***/ #include -#include #include +#include /** \file * * Main loop abstraction layer. Both the PulseAudio core and the * PulseAudio client library use a main loop abstraction layer. Due to * this it is possible to embed PulseAudio into other - * applications easily. Two main loop implemenations are + * applications easily. Two main loop implementations are * currently available: * \li A minimal implementation based on the C library's poll() function (See \ref mainloop.h) * \li A wrapper around the GLIB main loop. Use this to embed PulseAudio into your GLIB/GTK+/GNOME programs (See \ref glib-mainloop.h) * * The structure pa_mainloop_api is used as vtable for the main loop abstraction. * - * This mainloop abstraction layer has no direct support for UNIX signals. Generic, mainloop implementation agnostic support is available throught \ref mainloop-signal.h. + * This mainloop abstraction layer has no direct support for UNIX signals. Generic, mainloop implementation agnostic support is available through \ref mainloop-signal.h. * */ PA_C_DECL_BEGIN @@ -59,27 +59,27 @@ typedef enum pa_io_event_flags { /** An opaque IO event source object */ typedef struct pa_io_event pa_io_event; -/** An IO event callback protoype \since 0.9.3 */ +/** An IO event callback prototype \since 0.9.3 */ typedef void (*pa_io_event_cb_t)(pa_mainloop_api*ea, pa_io_event* e, int fd, pa_io_event_flags_t events, void *userdata); -/** A IO event destroy callback prototype \ since 0.9.3 */ +/** A IO event destroy callback prototype \since 0.9.3 */ typedef void (*pa_io_event_destroy_cb_t)(pa_mainloop_api*a, pa_io_event *e, void *userdata); /** An opaque timer event source object */ typedef struct pa_time_event pa_time_event; /** A time event callback prototype \since 0.9.3 */ typedef void (*pa_time_event_cb_t)(pa_mainloop_api*a, pa_time_event* e, const struct timeval *tv, void *userdata); -/** A time event destroy callback prototype \ since 0.9.3 */ +/** A time event destroy callback prototype \since 0.9.3 */ typedef void (*pa_time_event_destroy_cb_t)(pa_mainloop_api*a, pa_time_event *e, void *userdata); /** An opaque deferred event source object. Events of this type are triggered once in every main loop iteration */ typedef struct pa_defer_event pa_defer_event; -/** A defer event callback protoype \since 0.9.3 */ +/** A defer event callback prototype \since 0.9.3 */ typedef void (*pa_defer_event_cb_t)(pa_mainloop_api*a, pa_defer_event* e, void *userdata); -/** A defer event destroy callback prototype \ since 0.9.3 */ +/** A defer event destroy callback prototype \since 0.9.3 */ typedef void (*pa_defer_event_destroy_cb_t)(pa_mainloop_api*a, pa_defer_event *e, void *userdata); /** An abstract mainloop API vtable */ -struct pa_mainloop_api { +struct pa_mainloop_api { /** A pointer to some private, arbitrary data of the main loop implementation */ void *userdata; @@ -110,11 +110,13 @@ struct pa_mainloop_api { /** Set a function that is called when the deferred event source is destroyed. Use this to free the userdata argument if required */ void (*defer_set_destroy)(pa_defer_event *e, pa_defer_event_destroy_cb_t cb); - /** Exit the main loop and return the specfied retval*/ + /** Exit the main loop and return the specified retval*/ void (*quit)(pa_mainloop_api*a, int retval); }; -/** Run the specified callback function once from the main loop using an anonymous defer event. */ +/** Run the specified callback function once from the main loop using an anonymous defer event. Note that this performs + * multiple mainloop operations non-atomically. If, for example, you are using a \ref pa_threaded_mainloop, you will need to + * take the mainloop lock before this call. */ void pa_mainloop_api_once(pa_mainloop_api*m, void (*callback)(pa_mainloop_api*m, void *userdata), void *userdata); PA_C_DECL_END