gstinfo: API: Add GST_DEBUG_REGISTER_FUNCPTR method.

This is a variant of GST_DEBUG_FUNCPTR which does not return anything.
This commit is contained in:
Edward Hervey 2009-12-01 17:53:03 +01:00
parent 7796ae457e
commit 8f40effea6
2 changed files with 17 additions and 0 deletions

View file

@ -1017,6 +1017,7 @@ GST_DEBUG
GST_LOG
GST_FIXME
GST_MEMDUMP
GST_DEBUG_REGISTER_FUNCPTR
GST_DEBUG_FUNCPTR
GST_DEBUG_FUNCPTR_NAME
GST_DEBUG_BIN_TO_DOT_FILE

View file

@ -1100,12 +1100,27 @@ void _gst_debug_register_funcptr (GstDebugFuncPtr func,
G_CONST_RETURN gchar *
_gst_debug_nameof_funcptr (GstDebugFuncPtr func);
/**
* GST_DEBUG_REGISTER_FUNCPTR:
* @ptr: pointer to the function to register
*
* Register a pointer to a function with its name, so it can later be used by
* GST_DEBUG_FUNCPTR_NAME().
*
* Use this variant of #GST_DEBUG_FUNCPTR if you do not need to use @ptr.
*
* Since: 0.10.26
*/
#define GST_DEBUG_REGISTER_FUNCPTR(ptr) \
_gst_debug_register_funcptr((GstDebugFuncPtr)(ptr), #ptr)
/**
* GST_DEBUG_FUNCPTR:
* @ptr: pointer to the function to register
*
* Register a pointer to a function with its name, so it can later be used by
* GST_DEBUG_FUNCPTR_NAME().
*
* Returns: the value passed to @ptr.
*/
#define GST_DEBUG_FUNCPTR(ptr) \
(_gst_debug_register_funcptr((GstDebugFuncPtr)(ptr), #ptr) , ptr)
@ -1379,6 +1394,7 @@ GST_FIXME (const char *format, ...)
#endif /* G_HAVE_GNUC_VARARGS */
#endif /* G_HAVE_ISO_VARARGS */
#define GST_DEBUG_REGISTER_FUNCPTR(ptr) G_STMT_START{ }G_STMT_END
#define GST_DEBUG_FUNCPTR(ptr) (ptr)
#define GST_DEBUG_FUNCPTR_NAME(ptr) (g_strdup_printf ("%p", ptr))