diff options
author | Akira TAGOH <akira@tagoh.org> | 2006-11-04 06:41:18 +0000 |
---|---|---|
committer | Akira TAGOH <akira@tagoh.org> | 2006-11-04 06:41:18 +0000 |
commit | 144dc9ca2fcf5cbecb1598e3fe9ab41b611dd9e5 (patch) | |
tree | 52ebfc60cc7c89c1068a46a507428e6c74ac907b /src | |
parent | 9717851f69f0ceae508e162768b098d6f58d6c4b (diff) |
* 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.
Diffstat (limited to 'src')
-rw-r--r-- | src/hgs.c | 18 |
1 files changed, 17 insertions, 1 deletions
@@ -24,6 +24,7 @@ #include <hieroglyph/hgdevice.h> #include <hieroglyph/hgdict.h> #include <hieroglyph/hgfile.h> +#include <hieroglyph/hglog.h> #include <hieroglyph/hgmem.h> #include <hieroglyph/hgvaluenode.h> #include <hieroglyph/vm.h> @@ -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); |