Skip to content
Snippets Groups Projects
Commit dc1ceeeb authored by Benedikt Meurer's avatar Benedikt Meurer
Browse files

2006-03-15 Benedikt Meurer <benny@xfce.org>

	* thunar/thunar-debug.{c,h}, thunar/Makefile.am: Add THUNAR_DEBUG_MARK()
	  which can be used to easily profile parts of Thunar.




(Old svn revision: 20445)
parent 01ff1a78
No related branches found
No related tags found
No related merge requests found
2006-03-15 Benedikt Meurer <benny@xfce.org>
* thunar/thunar-debug.{c,h}, thunar/Makefile.am: Add THUNAR_DEBUG_MARK()
which can be used to easily profile parts of Thunar.
2006-03-15 Benedikt Meurer <benny@xfce.org>
* acinclude.m4(BM_THUNAR_VFS_VOLUME_IMPL): Handle "none" properly.
......
......@@ -46,6 +46,8 @@ Thunar_SOURCES = \
thunar-component.h \
thunar-create-dialog.c \
thunar-create-dialog.h \
thunar-debug.h \
thunar-debug.c \
thunar-details-view-ui.h \
thunar-details-view.c \
thunar-details-view.h \
......
/* $Id$ */
/*-
* Copyright (c) 2006 Benedikt Meurer <benny@xfce.org>.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
* Software Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc., 59 Temple
* Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#ifdef HAVE_STDARG_H
#include <stdarg.h>
#endif
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#include <thunar/thunar-debug.h>
#if GLIB_CHECK_VERSION(2,8,0)
#include <glib/gstdio.h>
#else
#define g_access(filename, mode) access((filename),(mode))
#endif
/**
* thunar_debug_mark:
* @file : the filename.
* @line : the line in @file.
* @format : the message format.
* @... : the @format parameters.
*
* Sets a profile mark.
**/
void
thunar_debug_mark (const gchar *file,
const gint line,
const gchar *format,
...)
{
#ifdef G_ENABLE_DEBUG
va_list args;
gchar *formatted;
gchar *message;
va_start (args, format);
formatted = g_strdup_vprintf (format, args);
va_end (args);
message = g_strdup_printf ("MARK: %s: %s:%d: %s", g_get_prgname(), file, line, formatted);
g_access (message, F_OK);
g_free (formatted);
g_free (message);
#endif
}
/* $Id$ */
/*-
* Copyright (c) 2006 Benedikt Meurer <benny@xfce.org>.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
* Software Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc., 59 Temple
* Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef __THUNAR_DEBUG_H__
#define __THUNAR_DEBUG_H__
#include <glib.h>
G_BEGIN_DECLS;
#if defined(G_ENABLE_DEBUG) && defined(G_HAVE_ISO_VARARGS)
#define THUNAR_DEBUG_MARK(...) \
G_STMT_START{ \
thunar_debug_mark (__FILE__, __LINE__, __VA_ARGS__); \
}G_STMT_END
#else
#define THUNAR_DEBUG_MARK(...) \
G_STMT_START{ \
(void)0; \
}G_STMT_END
#endif
void thunar_debug_mark (const gchar *file,
const gint line,
const gchar *format,
...);
G_END_DECLS;
#endif /* !__THUNAR_DEBUG_H__ */
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment