changeset 490:d4e50da7e5c5

ui: debug -> mlk_debug
author David Demelier <markand@malikania.fr>
date Tue, 28 Feb 2023 13:14:59 +0100
parents ad6e9970a191
children 734b598534c4
files examples/example-debug/example-debug.c libmlk-ui/mlk/ui/debug.c libmlk-ui/mlk/ui/debug.h
diffstat 3 files changed, 17 insertions(+), 17 deletions(-) [+]
line wrap: on
line diff
--- a/examples/example-debug/example-debug.c	Tue Feb 28 13:13:19 2023 +0100
+++ b/examples/example-debug/example-debug.c	Tue Feb 28 13:14:59 2023 +0100
@@ -44,7 +44,7 @@
 	if ((err = mlk_example_init("example-debug")) < 0)
 		mlk_panicf("mlk_example_init: %s", mlk_err_string(err));
 
-	debug_options.enable = 1;
+	mlk_debug_options.enable = 1;
 }
 
 static void
@@ -70,12 +70,12 @@
 {
 	(void)st;
 
-	struct debug_report report = {0};
+	struct mlk_debug_report report = {0};
 
 	mlk_painter_set_color(0x4f8fbaff);
 	mlk_painter_clear();
-	debugf(&report, "Game running.");
-	debugf(&report, "mouse: %d, %d", mouse_x, mouse_y);
+	mlk_debugf(&report, "Game running.");
+	mlk_debugf(&report, "mouse: %d, %d", mouse_x, mouse_y);
 	mlk_painter_present();
 }
 
--- a/libmlk-ui/mlk/ui/debug.c	Tue Feb 28 13:13:19 2023 +0100
+++ b/libmlk-ui/mlk/ui/debug.c	Tue Feb 28 13:14:59 2023 +0100
@@ -24,38 +24,38 @@
 #include "debug.h"
 #include "theme.h"
 
-struct debug_options debug_options = {
+struct mlk_debug_options mlk_debug_options = {
 #if !defined(NDEBUG)
 	.enable = 1
 #endif
 };
 
 void
-debugf(struct debug_report *report, const char *fmt, ...)
+mlk_debugf(struct mlk_debug_report *report, const char *fmt, ...)
 {
 	assert(report);
 	assert(fmt);
 
-	if (!debug_options.enable)
+	if (!mlk_debug_options.enable)
 		return;
 
 	va_list ap;
 
 	va_start(ap, fmt);
-	debugva(report, fmt, ap);
+	mlk_debugva(report, fmt, ap);
 	va_end(ap);
 }
 
 void
-debugva(struct debug_report *report, const char *fmt, va_list ap)
+mlk_debugva(struct mlk_debug_report *report, const char *fmt, va_list ap)
 {
 	assert(report);
 	assert(fmt);
 
-	if (!debug_options.enable)
+	if (!mlk_debug_options.enable)
 		return;
 
-	char line[DEBUG_LINE_MAX];
+	char line[MLK_DEBUG_LINE_MAX];
 	const struct theme *theme;
 	struct mlk_font *font;
 	struct mlk_texture tex;
--- a/libmlk-ui/mlk/ui/debug.h	Tue Feb 28 13:13:19 2023 +0100
+++ b/libmlk-ui/mlk/ui/debug.h	Tue Feb 28 13:14:59 2023 +0100
@@ -24,29 +24,29 @@
 #include <mlk/core/core.h>
 #include <mlk/core/font.h>
 
-#define DEBUG_LINE_MAX 1024
+#define MLK_DEBUG_LINE_MAX 256
 
 struct theme;
 
-struct debug_options {
+struct mlk_debug_options {
 	int enable;
 };
 
-struct debug_report {
+struct mlk_debug_report {
 	const struct theme *theme;
 	unsigned int count;
 };
 
 MLK_CORE_BEGIN_DECLS
 
-extern struct debug_options debug_options;
+extern struct mlk_debug_options mlk_debug_options;
 
 void
-debugf(struct debug_report *, const char *, ...);
+mlk_debugf(struct mlk_debug_report *, const char *, ...);
 
 
 void
-debugva(struct debug_report *, const char *, va_list);
+mlk_debugva(struct mlk_debug_report *, const char *, va_list);
 
 MLK_CORE_END_DECLS