tevent: Create a typedef for the debug function callback.
authorAndreas Schneider <asn@redhat.com>
Mon, 8 Feb 2010 20:10:55 +0000 (21:10 +0100)
committerAndreas Schneider <asn@samba.org>
Wed, 5 May 2010 07:28:04 +0000 (09:28 +0200)
lib/tevent/tevent.h

index 3252423b342b46f1287821c038c1bda2b2c7a845..5aea1c3ed7ee75c93755e9c93c24915f2af7567f 100644 (file)
@@ -459,21 +459,35 @@ enum tevent_debug_level {
        TEVENT_DEBUG_TRACE
 };
 
+/**
+ * @brief The tevent debug callbac.
+ *
+ * @param[in]  context  The memory context to use.
+ *
+ * @param[in]  level    The debug level.
+ *
+ * @param[in]  fmt      The format string.
+ *
+ * @param[in]  ap       The arguments for the format string.
+ */
+typedef void (*tevent_debug_fn)(void *context,
+                               enum tevent_debug_level level,
+                               const char *fmt,
+                               va_list ap) PRINTF_ATTRIBUTE(3,0);
+
 /**
  * Set destination for tevent debug messages
  *
- * @param[in] ev     Event context to debug
- * @param[in] debug  Function to handle output printing
+ * @param[in] ev        Event context to debug
+ * @param[in] debug     Function to handle output printing
+ * @param[in] context   The context to pass to the debug function.
  *
  * @return Always returns 0 as of version 0.9.8
  *
  * @note Default is to emit no debug messages
  */
 int tevent_set_debug(struct tevent_context *ev,
-                    void (*debug)(void *context,
-                                  enum tevent_debug_level level,
-                                  const char *fmt,
-                                  va_list ap) PRINTF_ATTRIBUTE(3,0),
+                    tevent_debug_fn debug,
                     void *context);
 
 /**