[pulseaudio-commits] r1100 - /trunk/src/pulse/mainloop-api.h
svnmailer-noreply at 0pointer.de
svnmailer-noreply at 0pointer.de
Tue Jul 18 11:51:36 PDT 2006
Author: lennart
Date: Tue Jul 18 20:51:35 2006
New Revision: 1100
URL: http://0pointer.de/cgi-bin/viewcvs.cgi?rev=1100&root=pulseaudio&view=rev
Log:
define proper typdefs for callback prototypes
Modified:
trunk/src/pulse/mainloop-api.h
Modified: trunk/src/pulse/mainloop-api.h
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/trunk/src/pulse/mainloop-api.h?rev=1100&root=pulseaudio&r1=1099&r2=1100&view=diff
==============================================================================
--- trunk/src/pulse/mainloop-api.h (original)
+++ trunk/src/pulse/mainloop-api.h Tue Jul 18 20:51:35 2006
@@ -44,6 +44,9 @@
PA_C_DECL_BEGIN
+/** An abstract mainloop API vtable */
+typedef struct pa_mainloop_api pa_mainloop_api;
+
/** A bitmask for IO events */
typedef enum pa_io_event_flags {
PA_IO_EVENT_NULL = 0, /**< No event */
@@ -55,15 +58,24 @@
/** An opaque IO event source object */
typedef struct pa_io_event pa_io_event;
+/** An IO event callback protoype \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 */
+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 */
+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;
-
-/** An opaque timer event source object */
-typedef struct pa_time_event pa_time_event;
-
-/** An abstract mainloop API vtable */
-typedef struct pa_mainloop_api pa_mainloop_api;
+/** A defer event callback protoype \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 */
+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 {
@@ -71,40 +83,31 @@
void *userdata;
/** Create a new IO event source object */
- pa_io_event* (*io_new)(pa_mainloop_api*a, int fd, pa_io_event_flags_t events, void (*callback) (pa_mainloop_api*a, pa_io_event* e, int fd, pa_io_event_flags_t events, void *userdata), void *userdata);
-
+ pa_io_event* (*io_new)(pa_mainloop_api*a, int fd, pa_io_event_flags_t events, pa_io_event_cb_t cb, void *userdata);
/** Enable or disable IO events on this object */
void (*io_enable)(pa_io_event* e, pa_io_event_flags_t events);
-
/** Free a IO event source object */
void (*io_free)(pa_io_event* e);
-
/** Set a function that is called when the IO event source is destroyed. Use this to free the userdata argument if required */
- void (*io_set_destroy)(pa_io_event *e, void (*callback) (pa_mainloop_api*a, pa_io_event *e, void *userdata));
+ void (*io_set_destroy)(pa_io_event *e, pa_io_event_destroy_cb_t cb);
/** Create a new timer event source object for the specified Unix time */
- pa_time_event* (*time_new)(pa_mainloop_api*a, const struct timeval *tv, void (*callback) (pa_mainloop_api*a, pa_time_event* e, const struct timeval *tv, void *userdata), void *userdata);
-
+ pa_time_event* (*time_new)(pa_mainloop_api*a, const struct timeval *tv, pa_time_event_cb_t cb, void *userdata);
/** Restart a running or expired timer event source with a new Unix time */
void (*time_restart)(pa_time_event* e, const struct timeval *tv);
-
/** Free a deferred timer event source object */
void (*time_free)(pa_time_event* e);
-
/** Set a function that is called when the timer event source is destroyed. Use this to free the userdata argument if required */
- void (*time_set_destroy)(pa_time_event *e, void (*callback) (pa_mainloop_api*a, pa_time_event *e, void *userdata));
+ void (*time_set_destroy)(pa_time_event *e, pa_time_event_destroy_cb_t cb);
/** Create a new deferred event source object */
- pa_defer_event* (*defer_new)(pa_mainloop_api*a, void (*callback) (pa_mainloop_api*a, pa_defer_event* e, void *userdata), void *userdata);
-
+ pa_defer_event* (*defer_new)(pa_mainloop_api*a, pa_defer_event_cb_t cb, void *userdata);
/** Enable or disable a deferred event source temporarily */
void (*defer_enable)(pa_defer_event* e, int b);
-
/** Free a deferred event source object */
void (*defer_free)(pa_defer_event* e);
-
/** 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, void (*callback) (pa_mainloop_api*a, pa_defer_event *e, void *userdata));
+ void (*defer_set_destroy)(pa_defer_event *e, pa_defer_event_destroy_cb_t cb);
/** Exit the main loop and return the specfied retval*/
void (*quit)(pa_mainloop_api*a, int retval);
More information about the pulseaudio-commits
mailing list