Original commit message from CVS:
cleanup
This commit is contained in:
Thomas Vander Stichele 2004-07-09 11:00:06 +00:00
parent 0b685fac13
commit c309ad76fb
2 changed files with 67 additions and 56 deletions

View file

@ -1,3 +1,8 @@
2004-07-09 Thomas Vander Stichele <thomas (at) apestaart (dot) org>
* gst/gstinfo.h:
clean up layout a little.
2004-07-09 Thomas Vander Stichele <thomas (at) apestaart (dot) org> 2004-07-09 Thomas Vander Stichele <thomas (at) apestaart (dot) org>
* configure.ac: * configure.ac:

View file

@ -50,12 +50,14 @@ typedef enum {
GST_LEVEL_COUNT GST_LEVEL_COUNT
} GstDebugLevel; } GstDebugLevel;
/* we can now override this to be more general in maintainer builds or cvs checkouts */ /* we can now override this to be more general in maintainer builds
* or cvs checkouts */
#ifndef GST_LEVEL_DEFAULT #ifndef GST_LEVEL_DEFAULT
#define GST_LEVEL_DEFAULT GST_LEVEL_NONE #define GST_LEVEL_DEFAULT GST_LEVEL_NONE
#endif #endif
/* defines for format (colors etc) - don't change them around, it uses terminal layout /* defines for format (colors etc)
* don't change them around, it uses terminal layout
* Terminal color strings: * Terminal color strings:
* 00=none 01=bold 04=underscore 05=blink 07=reverse 08=concealed * 00=none 01=bold 04=underscore 05=blink 07=reverse 08=concealed
* Text color codes: * Text color codes:
@ -132,7 +134,7 @@ typedef void (*GstLogFunction) (GstDebugCategory * category,
const gchar * function, const gchar * function,
gint line, gint line,
GObject * object, GObject * object,
GstDebugMessage * message, GstDebugMessage * message,
gpointer data); gpointer data);
#ifndef GST_DISABLE_GST_DEBUG #ifndef GST_DISABLE_GST_DEBUG
@ -141,33 +143,33 @@ void _gst_debug_init (void);
/* note we can't use G_GNUC_PRINTF (7, 8) because gcc chokes on %P, which /* note we can't use G_GNUC_PRINTF (7, 8) because gcc chokes on %P, which
* we use for GST_PTR_FORMAT. */ * we use for GST_PTR_FORMAT. */
void gst_debug_log (GstDebugCategory * category, void gst_debug_log (GstDebugCategory * category,
GstDebugLevel level, GstDebugLevel level,
const gchar * file, const gchar * file,
const gchar * function, const gchar * function,
gint line, gint line,
GObject * object, GObject * object,
const gchar * format, const gchar * format,
...) G_GNUC_NO_INSTRUMENT; ...) G_GNUC_NO_INSTRUMENT;
void gst_debug_log_valist (GstDebugCategory * category, void gst_debug_log_valist (GstDebugCategory * category,
GstDebugLevel level, GstDebugLevel level,
const gchar * file, const gchar * file,
const gchar * function, const gchar * function,
gint line, gint line,
GObject * object, GObject * object,
const gchar * format, const gchar * format,
va_list args) G_GNUC_NO_INSTRUMENT; va_list args) G_GNUC_NO_INSTRUMENT;
const gchar * gst_debug_message_get (GstDebugMessage * message); const gchar * gst_debug_message_get (GstDebugMessage * message);
void gst_debug_log_default (GstDebugCategory * category, void gst_debug_log_default (GstDebugCategory * category,
GstDebugLevel level, GstDebugLevel level,
const gchar * file, const gchar * file,
const gchar * function, const gchar * function,
gint line, gint line,
GObject * object, GObject * object,
GstDebugMessage * message, GstDebugMessage * message,
gpointer unused) G_GNUC_NO_INSTRUMENT; gpointer unused) G_GNUC_NO_INSTRUMENT;
G_CONST_RETURN gchar * G_CONST_RETURN gchar *
gst_debug_level_get_name (GstDebugLevel level); gst_debug_level_get_name (GstDebugLevel level);
@ -214,9 +216,9 @@ void gst_debug_unset_threshold_for_name (const gchar * name);
*/ */
#define GST_DEBUG_CATEGORY_STATIC(cat) static GstDebugCategory *cat = NULL #define GST_DEBUG_CATEGORY_STATIC(cat) static GstDebugCategory *cat = NULL
/* do not use this function, use the macros below */ /* do not use this function, use the macros below */
GstDebugCategory *_gst_debug_category_new (gchar * name, GstDebugCategory *_gst_debug_category_new (gchar * name,
guint color, guint color,
gchar * description); gchar * description);
/** /**
* GST_DEBUG_CATEGORY_INIT: * GST_DEBUG_CATEGORY_INIT:
* @cat: the category to initialize. * @cat: the category to initialize.
@ -252,24 +254,26 @@ GstDebugCategory *_gst_debug_category_new (gchar * name,
* </para> * </para>
* </note> * </note>
*/ */
#define GST_DEBUG_CATEGORY_INIT(cat,name,color,description) G_STMT_START{ \ #define GST_DEBUG_CATEGORY_INIT(cat,name,color,description) G_STMT_START{\
if (cat == NULL) \ if (cat == NULL) \
cat = _gst_debug_category_new (name,color,description); \ cat = _gst_debug_category_new (name,color,description); \
}G_STMT_END }G_STMT_END
void gst_debug_category_free (GstDebugCategory * category); void gst_debug_category_free (GstDebugCategory * category);
void gst_debug_category_set_threshold (GstDebugCategory * category, void gst_debug_category_set_threshold (GstDebugCategory * category,
GstDebugLevel level); GstDebugLevel level);
void gst_debug_category_reset_threshold (GstDebugCategory * category); void gst_debug_category_reset_threshold(GstDebugCategory * category);
GstDebugLevel gst_debug_category_get_threshold (GstDebugCategory * category); GstDebugLevel
gst_debug_category_get_threshold (GstDebugCategory * category);
G_CONST_RETURN gchar * G_CONST_RETURN gchar *
gst_debug_category_get_name (GstDebugCategory * category); gst_debug_category_get_name (GstDebugCategory * category);
guint gst_debug_category_get_color (GstDebugCategory * category); guint gst_debug_category_get_color (GstDebugCategory * category);
G_CONST_RETURN gchar * G_CONST_RETURN gchar *
gst_debug_category_get_description (GstDebugCategory * category); gst_debug_category_get_description (GstDebugCategory * category);
GSList * gst_debug_get_all_categories (void); GSList *
gst_debug_get_all_categories (void);
gchar * gst_debug_construct_term_color (guint colorinfo); gchar * gst_debug_construct_term_color (guint colorinfo);
extern GstDebugCategory * GST_CAT_DEFAULT; extern GstDebugCategory * GST_CAT_DEFAULT;
@ -277,17 +281,19 @@ extern GstDebugCategory * GST_CAT_DEFAULT;
extern gboolean __gst_debug_enabled; extern gboolean __gst_debug_enabled;
#ifdef G_HAVE_ISO_VARARGS #ifdef G_HAVE_ISO_VARARGS
#define GST_CAT_LEVEL_LOG(cat,level,object,...) G_STMT_START{ \ #define GST_CAT_LEVEL_LOG(cat,level,object,...) G_STMT_START{ \
if (__gst_debug_enabled) { \ if (__gst_debug_enabled) { \
gst_debug_log ((cat), (level), __FILE__, GST_FUNCTION, __LINE__, (GObject *) (object), __VA_ARGS__); \ gst_debug_log ((cat), (level), __FILE__, GST_FUNCTION, __LINE__, \
} \ (GObject *) (object), __VA_ARGS__); \
} \
}G_STMT_END }G_STMT_END
#else /* G_HAVE_GNUC_VARARGS */ #else /* G_HAVE_GNUC_VARARGS */
#ifdef G_HAVE_GNUC_VARARGS #ifdef G_HAVE_GNUC_VARARGS
#define GST_CAT_LEVEL_LOG(cat,level,object,args...) G_STMT_START{ \ #define GST_CAT_LEVEL_LOG(cat,level,object,args...) G_STMT_START{ \
if (__gst_debug_enabled) { \ if (__gst_debug_enabled) { \
gst_debug_log ((cat), (level), __FILE__, GST_FUNCTION, __LINE__, (GObject *) (object), ##args ); \ gst_debug_log ((cat), (level), __FILE__, GST_FUNCTION, __LINE__, \
} \ (GObject *) (object), ##args ); \
} \
}G_STMT_END }G_STMT_END
#else /* no variadic macros, use inline */ #else /* no variadic macros, use inline */
static inline void static inline void
@ -587,10 +593,10 @@ GST_LOG (const char *format, ...)
/********** function pointer stuff **********/ /********** function pointer stuff **********/
void* _gst_debug_register_funcptr (void * ptr, void * _gst_debug_register_funcptr (void * ptr,
gchar * ptrname); gchar * ptrname);
G_CONST_RETURN gchar* G_CONST_RETURN gchar *
_gst_debug_nameof_funcptr (void * ptr); _gst_debug_nameof_funcptr (void * ptr);
#define GST_DEBUG_FUNCPTR(ptr) (_gst_debug_register_funcptr((void *)(ptr), #ptr) , ptr) #define GST_DEBUG_FUNCPTR(ptr) (_gst_debug_register_funcptr((void *)(ptr), #ptr) , ptr)
#define GST_DEBUG_FUNCPTR_NAME(ptr) _gst_debug_nameof_funcptr((void *)ptr) #define GST_DEBUG_FUNCPTR_NAME(ptr) _gst_debug_nameof_funcptr((void *)ptr)