summaryrefslogtreecommitdiffstats
path: root/src/gallium/include/pipe/p_debug.h
diff options
context:
space:
mode:
authorJosé Fonseca <[email protected]>2008-03-24 22:30:33 +0000
committerJosé Fonseca <[email protected]>2008-03-24 22:31:36 +0000
commite8c6ea4f608296ed976f1597ffd46ac0b42fc84a (patch)
treed7d2047da352769896bc7cc058b055dfef59718f /src/gallium/include/pipe/p_debug.h
parentdd51365acdd515577ee76850ceda01347ceb27c0 (diff)
gallium: Simple cross platform get-opt system.
Uses getenv on Linux, and a memory mapped text file on Windows. It supports boolean options, flags, and plain strings.
Diffstat (limited to 'src/gallium/include/pipe/p_debug.h')
-rw-r--r--src/gallium/include/pipe/p_debug.h27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/gallium/include/pipe/p_debug.h b/src/gallium/include/pipe/p_debug.h
index 494cc3bb71a..95bdf2d3b99 100644
--- a/src/gallium/include/pipe/p_debug.h
+++ b/src/gallium/include/pipe/p_debug.h
@@ -256,6 +256,33 @@ debug_dump_flags(const struct debug_named_value *names,
unsigned long value);
+/**
+ * Get option.
+ *
+ * It is an alias for getenv on Linux.
+ *
+ * On Windows it reads C:\gallium.cfg, which is a text file with CR+LF line
+ * endings with one option per line as
+ *
+ * NAME=value
+ *
+ * This file must be terminated with an extra empty line.
+ */
+const char *
+debug_get_option(const char *name, const char *dfault);
+
+boolean
+debug_get_bool_option(const char *name, boolean dfault);
+
+long
+debug_get_unsigned_option(const char *name, long dfault);
+
+unsigned long
+debug_get_flags_option(const char *name,
+ const struct debug_named_value *flags,
+ unsigned long dfault);
+
+
void *
debug_malloc(const char *file, unsigned line, const char *function,
size_t size);