From 144dc9ca2fcf5cbecb1598e3fe9ab41b611dd9e5 Mon Sep 17 00:00:00 2001 From: Akira TAGOH Date: Sat, 4 Nov 2006 06:41:18 +0000 Subject: * hieroglyph/vm.c (hg_vm_lookup): ues logger facility. (hg_vm_lookup_with_string): likewise. (hg_vm_set_error): likewise. * hieroglyph/hgplugins.c (_hg_plugin_load): use logger facility. * hieroglyph/hgmem.c (_hg_mem_init_stack_start): use logger facility. (hg_mem_pool_new): likewise. (hg_mem_gc_mark_array_region): likewise. * hieroglyph/hgallocator-bfit.c (_hg_allocator_bfit_real_garbage_collection): use logger facility. (_hg_allocator_bfit_real_gc_mark): likewise. * src/hgs.c (main): set flags from HIEROGLYPH_DEBUG environment variable. * devices/cairo/hgdevice-cairo.c (_hg_cairo_device_print_path): use logger facility. (_hg_cairo_device_real_eofill): likewise. (_hg_cairo_device_real_fill): likewise. (_hg_cairo_device_real_stroke): likewise. (_hg_cairo_device_set_matrix): likewise. --- src/hgs.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/hgs.c b/src/hgs.c index 948fc45..fe90d4d 100644 --- a/src/hgs.c +++ b/src/hgs.c @@ -24,6 +24,7 @@ #include #include #include +#include #include #include #include @@ -90,12 +91,27 @@ main(int argc, {NULL} }; GError *error = NULL; - const gchar *psfile = NULL; + const gchar *psfile = NULL, *env; gint32 errcode = 0; HG_MEM_INIT; hg_vm_init(); + /* set debugging flags prior to initialize VM */ + if ((env = g_getenv("HIEROGLYPH_DEBUG")) != NULL) { + gchar **flags = g_strsplit(env, ",:", 0); + int i; + + for (i = 0; flags[i] != NULL; i++) { + gchar *key = g_strdup_printf("DEBUG_%s", flags[i]); + + hg_log_set_flag(key, TRUE); + g_free(key); + } + + g_strfreev(flags); + } + vm = hg_vm_new(VM_EMULATION_LEVEL_1); group = g_option_group_new(NULL, NULL, NULL, vm, NULL); -- cgit v1.2.3