2009-05-11 Akira TAGOH * hieroglyph/hgobject.c (_hg_object_new): Fix the alignment issue. * hieroglyph/hgstack.c (hg_stack_dump): Fix a warning on 64bit arch. * tests/hgobject.c (test_hg_object_sized_new): update the aligned size. 2007-12-31 Akira TAGOH * tests/Makefile.am (test_hgstack_SOURCES): use check library. * tests/hgstack.c: Add more testcases. 2007-12-22 Akira TAGOH * tests/hgstring.c: Add more testcases. 2007-12-06 Akira TAGOH * tests/hgdict.c: Add more testcases. 2007-12-03 Akira TAGOH * hieroglyph/hgobject.h (HG_OBJECT_REAL_IS_EQUAL_TO): new macro. * hieroglyph/hgobject.c (hg_object_name_compare_with_raw): new function. (hg_object_name_n_compare_with_raw): new function. * hieroglyph/vm.c (hg_vm_new): have a flag to check if the initialization is done. (hg_vm_initialize): do nothing if the initialization is already done. (hg_vm_finalize): finalize the VM. * hieroglyph/hgoperator.c (hg_object_operator_initialize): have a flag to check if the initialization is done. * hieroglyph/hgdictprime.h (__hg_dict_primes): correct primes table. * tests/hgobject.c: Add more test cases. 2007-12-02 Akira TAGOH * hieroglyph/utils.c (hg_quiet_warning_messages): new function. (hg_allow_warning_messages): new function. * tests/hgobject.c (test_hgobject_new): disable the warning messages for some things that is intentional not to confuse. (test_hg_object_dup): likewise. * tests/hgarray.c (test_hg_object_array_subarray_new): likewise. 2007-11-27 Akira TAGOH * update-version: trivial update. * hieroglyph/hgobject.c (_hg_object_new): Initialize the object type. (hg_object_name_new): Initialize the unused value too. * hieroglyph/vm.c (hg_vm_get_current_allocation_mode): new function. (hg_vm_set_current_allocation_mode): likewise. (hg_vm_get_attributes): Follow the value for the allocation mode. * hieroglyph/hgdict.c (_hg_object_dict_insert): Fix a typo. (hg_object_dict_new): Initialize the array area. * configure.ac (AC_INIT): Update the bug report address. * tests/hgdict.c: Add more test cases. 2007-10-22 Akira TAGOH * hieroglyph/hgarray.c (hg_object_array_new): initialize the array. (hg_object_array_compare): consider the objects as the same if the same address is given. * hieroglyph/hgobject.c (hg_object_compare): consider the objects as the same if the same address is given. * tests/hgarray.c: add more test cases. 2007-10-18 Akira TAGOH * tests/Makefile.am: add more test cases. * hieroglyph/hgobject.c (hg_object_dup): initialize the return value with NULL. 2007-09-18 Akira TAGOH * hieroglyph/vm.c (hg_vm_stepi): new function to step one instruction exactly. 2006-12-20 Akira TAGOH * hieroglyph/hgfile.c (hg_file_object_ungetc): fix a duplicate of pushing back. 2006-12-19 Akira TAGOH * hieroglyph/hgstring.c (hg_string_erase): new function. * hieroglyph/scanner.c (_hg_scanner_parse_number): fix a parser to recognize a special character after numeric. * tests/ps/test-0base.ps: fix a typo. * plugins/test/test-main.c (_test_op_validateunittest): fix a typo. 2006-12-03 Akira TAGOH * hieroglyph/scanner.c (_hg_scanner_parse_number): remove an unnecessary push back. * hieroglyph/hgstack.c (_hg_stack_real_set_flags): modify due to using HgList instead of GList. (_hg_stack_real_relocate): likewise. (_hg_stack_real_dup): likewise. (hg_stack_new): likewise. (_hg_stack_push): likewise. (hg_stack_pop): likewise. (hg_stack_clear): likewise. (hg_stack_index): likewise. (hg_stack_roll): likewise. (hg_stack_dump): likewise. * hieroglyph/hglist.c (hg_list_iter_get_index): new function. (hg_list_iter_roll): new function. 2006-11-21 Akira TAGOH * hieroglyph/hglist.c (hg_list_get_iter_previous): new function. (hg_list_get_iter_last): new function. 2006-11-13 Akira TAGOH * hieroglyph/operator.c (_hg_operator_op_arc): fix a typo. * hieroglyph/hgfile.c (hg_file_object_ungetc): improve dealing with ungetc. * hieroglyph/vm.c (hg_vm_get_save_level): just ask HgMemPool instead of managing snapshot in VM. * hieroglyph/hgmem.c (hg_mem_pool_get_n_snapshots): new function. (hg_mem_pool_get_snapshot): new function. (hg_mem_pool_clear_snapshot): new function. (hg_mem_pool_add_root_node): renamed. (hg_mem_pool_remove_root_node): likewise. (hg_mem_pool_add_pool_reference): likewise. (hg_mem_pool_remove_pool_reference): likewise. * hieroglyph/ilist.c (_hg_list_iter_delete_link): fix a memory leak. * hieroglyph/scanner.c (_hg_scanner_parse_number): push back a space to deal with it later. 2006-11-12 Akira TAGOH * hieroglyph/hgmem.c (hg_mem_init): remove GAllocator initialization code. (hg_mem_finalize): remove GAllocator finalization code. (hg_mem_pool_destroy): use HgList instead of GList. (hg_mem_pool_is_own_object): likewise. (hg_mem_pool_save_snapshot): save an snapshot image to the list in pool. (hg_mem_pool_get_age_of_snapshot): new function. (_hg_mem_set_flags): new function. (hg_mem_add_root_node): use HgList instead of GList. (hg_mem_remove_root_node): likewise. (hg_mem_add_pool_reference): likewise. (hg_mem_remove_pool_reference): likewise. * hieroglyph/hgallocator-bfit.c (_hg_allocator_bfit_relocate): use HgList instead of GList. (_hg_allocator_bfit_real_set_flags): new function to avoid a fail of restoring a snapshot when the unused complex objects are freed after snapping shot, because snapshot image doesn't take care of mere complex objects. (_hg_allocator_bfit_real_garbage_collection): use HgList instead of GList. (_hg_allocator_bfit_real_restore_snapshot): take an argument to adjust the amount of objects for the fudge factor. * hieroglyph/hgmacros.h (HG_MEMOBJ_GET_SNAPSHOT_AGE): add a new macro. (HG_MEMOBJ_SET_SNAPSHOT_AGE): add a new macro. * hieroglyph/hglist.c (hg_list_length): fixed an infinite loop issue. (hg_list_remove): reimplement with iterator to be simplified. * hieroglyph/ilist.c (_hg_list_length): fixed an infinite loop issue. (_hg_list_remove): reimplement with iterator to be simplified. 2006-11-04 Akira TAGOH * hieroglyph/vm.c (hg_vm_finalize): change the order of fnalization. * hieroglyph/hglog.c (hg_logv): don't use HgString to get it working even when memory allocation error happens. * 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. * hieroglyph/vm.c (hg_vm_init): initialize logger facility. (hg_vm_finalize): finalize logger. * hieroglyph/hglog.c (hg_log_set_flag): new function. (hg_logv): allow to output a message without initialization. 2006-10-22 Akira TAGOH * hieroglyph/Makefile.am (libhieroglyph_la_SOURCES): added hglog.c. * hieroglyph/hglog.[ch]: new files for logger. 2006-10-21 Akira TAGOH * hieroglyph/vm.c (_hg_vm_op_rollbacksecuritylevel): ignore the errors. 2006-10-18 Akira TAGOH * hieroglyph/operator.c (_hg_operator_op_exec): save the current security level and rollback it after finished the object's execution. * hieroglyph/vm.c (_hg_vm_op_rollbacksecuritylevel): new function. (hg_vm_set_security_level): implemented. (hg_vm_get_security_level): implemented. * hieroglyph/operator.c (_hg_operator_op_countdictstack): check VMerror. (_hg_operator_op_countexecstack): likewise. (_hg_operator_op_currentdict): likewise. (_hg_operator_op_currentfile): likewise. (_hg_operator_op_dup): likewise. (_hg_operator_op_private_hg_getsecuritylevel): new function. (_hg_operator_op_private_hg_setsecuritylevel): new function. 2006-10-16 Akira TAGOH * plugins/test/hg_unittest.ps (initunittest): erase a prompt. (.updateunittestprogress): show a pinwheel. 2006-10-15 Akira TAGOH * hieroglyph/operator.c (_hg_operator_op_restore): drop the save object out of ostack if restore successfully complete. * hieroglyph/vm.c (hg_vm_startjob): allow an empty initializer to just makes VM initialization. * src/hgs.c (main): add --sync option. * hieroglyph/hgfile.c (hg_file_io_synchronous): new function. (hg_file_object_write): call fsync after writing according to the current state of I/O synchronous. * hieroglyph/hgstring.c (hg_string_append_printf): new function. (hg_string_append_vprintf): new function. * hieroglyph/hgdict.c (_hg_dict_traverse_set_flags): removed the unnecessary debugging code. 2006-10-12 Akira TAGOH * tests/ps/test-exp.ps: new testcase. * tests/ps/test-ps.sh (run_test): new function. * hieroglyph/scanner.c (_hg_scanner_parse_number): fixed a typo. * hieroglyph/operator.c (_hg_operator_op_exit): throw /invalidexit if it's going to jump stopped context. (_hg_operator_op_private_hg_exit): new function to not check /invalidexit for stopped. * lib/hg_init.ps (executive): use .exit instead of exit. * tests/ps/test-exec.ps: * tests/ps/test-executeonly.ps: * tests/ps/test-execstack.ps: * tests/ps/test-eq.ps: * tests/ps/test-exch.ps: * tests/ps/test-exit.ps: * tests/ps/testtest-exit.ps: new testcases. 2006-10-11 Akira TAGOH * hieroglyph/operator.c (_hg_operator_op_eq): check /invalidaccess for only name/string objects. * tests/ps/test-dup.ps: * tests/ps/test-end.ps: * tests/ps/test-dictstack.ps: * tests/ps/test-div.ps: * tests/ps/test-errordict.ps: * tests/ps/test-eq.ps: new testcases. * tests/ps/test-dict.ps: new testcase. * hieroglyph/operator.c (_hg_operator_op_put): check /dictfull. * hieroglyph/scanner.c (_hg_scanner_get_object): exclude dict object to make a readonly object. * hieroglyph/operator.c (_hg_operator_op_dict): detect /dictfull if it's running on PS1 VM. * hieroglyph/hgdict.c (hg_dict_new): allow to create an empty dict. * plugins/test/hg_unittest.ps (.dotypecheck): fixed /dictfull error. * tests/ps/test-cvx.ps: * tests/ps/test-def.ps: new testcases. 2006-10-10 Akira TAGOH * lib/hg_init.ps (cvs): better error handling. * tests/ps/test-cvs.ps: * tests/ps/test-cvrs.ps: new testcases. 2006-10-09 Akira TAGOH * hieroglyph/operator.c (_hg_operator_op_cvi): fixed not catching an exception in some cases. (_hg_operator_op_cvr): likewise. * tests/ps/test-cvr.ps: new testcase. * hieroglyph/scanner.c (_hg_scanner_get_object): shut up the warning. * hieroglyph/hgvaluenode.c (hg_value_node_compare_content): extend to be able to compare the permissions as well. * hieroglyph/hgdict.c (_hg_dict_compare_on_traverse): likewise. (hg_dict_compare): likewise. * hieroglyph/hgarray.c (hg_array_compare): likewise. * tests/ps/currentfile.ps: clean up. * tests/ps/test-cvn.ps: * tests/ps/test-cvlit.ps: new testcases. * tests/ps/test-concatmatrix.ps: * tests/ps/test-astore.ps: * tests/ps/test-copy.ps: * tests/ps/test-anchorsearch.ps: * tests/ps/test-aload.ps: * tests/ps/test-cvi.ps: add more testcases. * tests/ps/test-ps.sh: run with the quiet mode. * plugins/test/hg_unittest.ps (setunittestmask): new proc. * plugins/test/test-main.c (_test_op_validateunittest): compare the permissions too. * tests/ps/test-0base.ps: new testcase. * hieroglyph/operator.c (_hg_operator_op_cvi): check the overflow. * hieroglyph/scanner.c (_hg_scanner_get_object): split up the numeral parser. (_hg_scanner_parse_number): new function. * hieroglyph/Makefile.am (libhieroglyph_private_SOURCES): add iarray.[ch]. * hieroglyph/iarray.[ch]: new files. 2006-10-08 Akira TAGOH * hieroglyph/operator.c (_hg_operator_op_add): correct the overflow checking. * tests/ps/test-add.ps: add more testcases. 2006-10-05 Akira TAGOH * tests/ps/test-ps.sh: change the current dir during testing to ensure the expected behavior. * tests/ps/test-count.ps: * tests/ps/test-countdictstack.ps: * tests/ps/test-counttomark.ps: * tests/ps/test-currentdict.ps: * tests/ps/test-currentfile.ps: * tests/ps/testtest-currentfile.ps: new testcases. * hieroglyph/hgvaluenode.h (HG_VALUE_REAL_SIMILAR): need to decrease the precision to ensure "90 cos" is 0. * hieroglyph/hgvaluenode.c (hg_value_node_compare_content): use macro. * plugins/test/hg_unittest.ps (.dotypecheck): reflect the result to dict. 2006-09-24 Akira TAGOH * tests/ps/test-copy.ps: new testcase. * hieroglyph/operator.c (_hg_operator_op_concatmatrix): create new node to store the result. array may has the same instance for node. (_hg_operator_op_copy): fixed a typo. and check /typecheck first. * plugins/test/hg_unittest.ps (.dotypecheck): create another file object to avoid any breakages. * tests/ps/test-ceiling.ps: * tests/ps/test-clear.ps: * tests/ps/test-cleartomark.ps: * tests/ps/test-closefile.ps: * tests/ps/test-concatmatrix.ps: new testcases. * hieroglyph/hgplugins.c (_hg_plugin_load): silence the debug output. * tests/ps/test-and.ps: * tests/ps/test-array.ps: * tests/ps/test-astore.ps: * tests/ps/test-atan.ps: * tests/ps/test-begin.ps: * tests/ps/test-bind.ps: * tests/ps/test-bitshift.ps: new testcases. * hieroglyph/hgarray.c (hg_array_set_name): don't free array->name here. it may be likely that older objects in snapshot may still refers to it. * hieroglyph/hgstring.c (hg_string_new): fixed the uninitialized value. * plugins/debug/debug-main.c (_debug_op_breakpoint): new function. * lib/hg_init.ps (anchorsearch): fixed wrong return value. treat /rangecheck as /stackunderflow when it happens in index or roll. * tests/ps/test-aload.ps: new testcase. * tests/ps/test-anchorsearch.ps: new testcase. * plugins/test/hg_unittest.ps (typecheck): new procedure to test if /typecheck happens. (.dotypecheck): new. 2006-09-23 Akira TAGOH * hieroglyph/operator.c (_hg_operator_op_add): fixed a overflow. * hieroglyph/hgvaluenode.c (hg_value_node_compare): use macro. * tests/ps/test-add.ps: new test case. * src/hgs.c (main): returns an error code. * plugins/test/hg_unittest.ps (unittestresult): stop with an error code when unit test failed. 2006-09-20 Akira TAGOH * tests/ps/test-ps.sh: depends on hgs instead of pse. * tests/ps/Makefile.am (check): run test-ps.sh. * plugins/test/hg_unittest.ps (initunittest): new proc. (unittest): updated the result in dict. (unittestresult): new proc. * hieroglyph/hgmem.h (hg_mem_set_dead): new macro. (hg_mem_unset_dead): likewise. (hg_mem_is_dead): likewise. * hieroglyph/hgallocator-bfit.c (_hg_bfit_snapshot_chunk_new): new function. (_hg_bfit_snapshot_chunk_free): new function. (_hg_allocator_bfit_real_save_snapshot): implemented. (_hg_allocator_bfit_real_restore_snapshot): implemented. (_hg_allocator_bfit_real_resize): set a HG_FL_DEAD flag instead of hg_mem_free(). (_hg_allocator_bfit_snapshot_real_free): implemented. (_hg_allocator_bfit_snapshot_real_set_flags): implemented. 2006-09-18 Akira TAGOH * hieroglyph/vm.c (_hg_vm_set_error): replace *POINTER to *OPERATOR. (_hg_vm_set_error_from_file): likewise. (hg_vm_init): makes a VM memory pool to be a local pool. * hieroglyph/scanner.c (_hg_scanner_set_error): likewise. * plugins/test/test-main.c (REMOVE_OP): replace *POINTER to *OPERATOR. * plugins/debug/debug-main.c (REMOVE_OP): likewise. * plugins/libedit/libedit-main.c (REMOVE_OP): likewise. * hieroglyph/operator.[ch]: likewise. * hieroglyph/hgvaluenode.[ch]: use separate structure instead of union. (_hg_value_node_register_type): new function. (hg_value_node_init): new function. (hg_value_node_finalize): new function. (hg_value_node_register_type): new function. (hg_value_node_get_type_name): new function. * src/hgspy.c (_hgspy_vm_thread): likewise. * src/hgs.c (_hgs_arg_load_plugin_cb): reflect a return value from hg_vm_load_plugin(). 2006-09-09 Akira TAGOH * hieroglyph/hgallocator-private.h (HG_MEM_POOL_FLAGS_GET_FLAGS): new macro. (HG_MEM_POOL_GET_FLAGS): likewise. (HG_MEM_POOL_SET_FLAGS): likewise. (HG_MEM_POOL_FLAGS_HAS_FLAGS): likewise. (HG_MEM_POOL_HAS_FLAGS): likewise. * hieroglyph/hgmem.c (hg_mem_pool_new): take bitwise flags. (hg_mem_pool_use_global_mode): removed. 2006-09-06 Akira TAGOH * src/hgs.c (_hgs_arg_define_cb): implemented. (_hgs_arg_load_plugin_cb): simplified. (main): added --device option. 2006-09-05 Akira TAGOH * hieroglyph/hgmem.h (hg_mem_is_flags__inline): use hg_mem_is_gc_mark__inline if it goes to be marked for GC. (hg_mem_set_flags__inline): don't inherit the age of gc mark to the children. * hieroglyph/hgmem.c (hg_mem_pool_get_age_of_mark): new function. * hieroglyph/hgallocator-bfit.c (_hg_allocator_bfit_real_garbage_collection): show the age of gc mark for debugging purpose. * hieroglyph/hgvaluenode.c (hg_value_node_debug_print): show the age of gc mark for debugging purpose. * hieroglyph/hgfile.c (hg_file_object_read): trivial warning message fix. (hg_file_object_write): likewise. (hg_file_object_getc): likewise. * hieroglyph/hgarray.c (hg_array_make_subarray): make an empty array if end_index is out of range. * hieroglyph/operator.c (_hg_operator_op_search): just call hg_string_make_substring. * hieroglyph/hgstring.c (hg_string_make_substring): make an empty string if end_index is out of range. * hieroglyph/operator-private.h: moved macros from operator.c * hieroglyph/vm.c (_hg_vm_eval_file): reflect an error result from $error dict. * hieroglyph/hgplugins.c (hg_plugin_load): output an warning if load failed. * plugins/test/test-main.c (plugin_load): load will be failed if any errors happened during loading hg_unittest.ps. * hieroglyph/vm.c (hg_vm_startjob): no need to enter in the loop if the file is given. (_hg_vm_eval_file): set FALSE if no errors happened. 2006-09-04 Akira TAGOH * hieroglyph/hgdict.c: use HgList instead of GList. (_hg_dict_node_free): removed. (_hg_dict_real_free): removed. (_hg_dict_traverse_relocate): removed. * hieroglyph/hgallocator-libc.[ch]: removed. * hieroglyph/hgallocator-bfit.c: use HgList instead of GSList. (_hg_allocator_bfit_btree_traverse_in_destroy): removed. (_hg_allocator_bfit_real_initialize): libc pool is no longer needed. (_hg_allocator_bfit_real_free_block_traverse): new function. * hieroglyph/ilist.c (_hg_list_free): check NULL. (_hg_list_iter_delete_link): fixed a memory leak. * hieroglyph/hggraphics.c (hg_graphics_new): fixed uninitialized value. * hieroglyph/ilist.h (hg_list_free): new macro. * hieroglyph/ilist.[ch]: new files. * hieroglyph/ibtree.[ch]: new files. * hieroglyph/hglist.c (_hg_list_iter_real_set_data): new function. (hg_list_init): new function. (hg_list_finalize): new function. (hg_list_first): new function. (hg_list_last): new function. (hg_list_iter_new): use own memory pool to avoid an allocation failure, because it's quite likely so that it's used under set_flags where could be invoked during GC. (hg_list_iter_get_data): renamed. (hg_list_iter_set_data): new function. (hg_list_iter_set_object): new function. (hg_list_iter_delete_link): new function. (hg_list_find_iter): new function. (hg_list_find_iter_custom): new function. * hieroglyph/vm.c (_hg_vm_eval_file): allow NULL to not want to get an error result. * src/hgspy.c (_hgspy_quit_cb): try to shutdown VM. * hieroglyph/hgallocator-bfit.c (_hg_allocator_bfit_remove_block): * hieroglyph/operator.c (_hg_operator_real_set_flags): fixed outdated function call. * hieroglyph/hgallocator-bfit.c (_hg_allocator_bfit_real_initialize): disable the unsuported features. (_hg_allocator_bfit_real_garbage_collection): output more debugging info. * src/hgspy_helper.c (hg_mem_alloc_with_flags): fixed a segfault issue. 2006-09-03 Akira TAGOH * hieroglyph/hglist.[ch]: new files. * hieroglyph/hgbtree.c (_hg_btree_page_real_set_flags): stop marking if marking is disabled by request. (_hg_btree_page_real_relocate): likewise. (hg_btree_allow_marking): new function. * hieroglyph/hgallocator-bfit.c (_hg_allocator_bfit_real_initialize): disallow marking to avoid warnings so that the stored values aren't any hieroglyph objects. * hieroglyph/hgarray.c (_hg_array_real_set_flags): stop marking if the object is already marked. 2006-08-28 Akira TAGOH * hieroglyph/Makefile.am (hginclude_HEADERS): added hgallocator-libc.h (libhieroglyph_la_SOURCES): added hgallocator-libc.c * hieroglyph/hgbtree.c (_hg_btree_page_real_free): new function. (_hg_btree_page_real_set_flags): new function. (_hg_btree_page_real_relocate): new function. (_hg_btree_real_free): new function. (_hg_btree_real_set_flags): new function. (_hg_btree_real_relocate): new function. * hieroglyph/hgallocator-libc.[ch]: new files. * hieroglyph/hgdict.c (_hg_dict_real_free): modified to use new HgBTree that is now managed under the hieroglyph mm. (_hg_dict_real_set_flags): likewise. (_hg_dict_real_relocate): likewise. (hg_dict_new): likewise. * hieroglyph/hgmem.c (hg_mem_init): use GHashTable instead of HgBTree. it can't be used before hg_mem_init finished. (hg_mem_finalize): modified to use GHashTable. (hg_object_set_vtable): likewise. * hieroglyph/hgallocator-bfit.c (_hg_allocator_bfit_real_initialize): modified to use HgBTree that is now managed under the hieroglyph mm. (_hg_allocator_bfit_real_destroy): likewise. 2006-08-27 Akira TAGOH * hieroglyph/operator.c (_hg_operator_op_private_hg_filelibfile): push a filename into the stack even if no files found. * hieroglyph/vm.c (hg_vm_startjob): add an error handler when the external file is being invoked. (hg_vm_set_error_from_file): just ignore an error code 0. * hieroglyph/hglineedit.c (_hg_line_edit__default_get_line): return NULL if EBADF happens. * lib/hg_init.ps (runlibfile): trivial fix. * README: updated. 2006-08-25 Akira TAGOH * hieroglyph/hgstack.c (hg_stack_roll): trivial fix. 2006-08-23 Akira TAGOH * hieroglyph/hgstack.c (hg_stack_roll): fixed a segfault issue. * configure.ac: disable -Werror when not specifying --enable-maintainer-mode. 2006-08-22 Akira TAGOH * lib/hg_init.ps (StandardEncoding): implemented. * hieroglyph/operator.c (_hg_operator_op_bind): ignore the writable check during initialization. * hieroglyph/vm.c (hg_vm_set_io): reflect the IO changes to HgLineEdit. (hg_vm_startjob): just changes the IO with an initializer. * hieroglyph/hglineedit.c (_hg_line_edit_real_set_flags): new function. (_hg_line_edit_real_relocate): new function. (_hg_line_edit__default_get_line): use HgFileObject instead of using low APIs. (hg_line_edit_set_stdin): new function. (hg_line_edit_set_stdout): new function. * lib/hg_init.ps (start): implemented. not entered into the loop here. 2006-08-20 Akira TAGOH * hieroglyph/hgplugins.c (hg_plugin_unload): fixed a typo. (hg_plugin_open): trivial improvement. * hieroglyph/vm.c (hg_vm_main): make sure that VM isn't going to shut down. * hieroglyph/operator.c (_hg_operator_op_private_hg_quit): new function. * hieroglyph/vm.c (hg_vm_get_error_code): new function. (hg_vm_set_error_code): likewise. (hg_vm_shutdown): likewise. * lib/hg_init.ps (quit): implemented in PostScript. 2006-08-19 Akira TAGOH * lib/hg_init.ps (load): implemented in PostScript. * hieroglyph/operator.c (hg_operator_level1_init): removed anchorsearch implementation. (_hg_operator_op_load): removed. * lib/hg_init.ps (anchorsearch): implemented in PostScript. * hieroglyph/operator.c (_hg_operator_op_private_hg_undef): implemented. * lib/hg_init_lv2.ps (undef): defined. * lib/hg_init.ps: undef .forceput and .odef. * hieroglyph/hgarray.c (hg_array_set_name): new function. (hg_array_get_name): new function. * hieroglyph/operator.c (_hg_operator_op_private_hg_odef): new function. (_hg_operator_op_private_hg_forceput): ignore even readonly flag. * hieroglyph/scanner.c (_hg_scanner_get_object): disabled making an readonly object during initialization. * hieroglyph/vm.c (hg_vm_set_error): dumps stacks if no handler available. * hieroglyph/hgvaluenode.c (_hg_value_node_real_to_string): return the array name instead of -array- if it has. (hg_value_node_debug_print): fixed a segfault issue. * lib/hg_init.ps (odef): improved to deal with the error recovery. 2006-08-18 Akira TAGOH * tests/ps/test-abs.ps: new file. * tests/ps/test-ps.sh: try to test the PostScript file on the same directory to the test runner. * plugins/test/hg_unittest.ps: fixed a typo. * hieroglyph/hgarray.c (hg_array_compare): new function. * hieroglyph/hgbtree.c (hg_btree_page_foreach): breaks the loop if the function returns false. * hieroglyph/hgdict.c (_hg_dict_compare_on_traverse): new function. (hg_dict_compare): new function. * hieroglyph/hgvaluenode.c (hg_value_node_compare_content): new function. * tests/ps/Makefile.am: new file. * tests/ps/test-ps.sh: new file. * plugins/test/test-main.c (_test_op_validateunittest): use hg_value_node_compare_content instead of hg_value_node_compare. * hieroglyph/operator.c (_hg_operator_op_private_hg_findlibfile): new function. * hieroglyph/vm.c (hg_vm_find_libfile): new function. * lib/hg_init.ps (runlibfile): implemented. * tests/run.sh: inherit HIEROGLYPH_LIB_PATH. * plugins/test/hg_unittest.ps: new file. * plugins/test/Makefile.am (hgpslib_DATA): add hg_unittest.ps. * plugins/test/test-main.c (_test_op_validateunittest): new function. (plugin_init): implemented. (plugin_load): implemented. (plugin_unload): implemented. * hieroglyph/operator.c (_hg_operator_op_for): check the executeonly flag. (_hg_operator_op_forall): likewise. (_hg_operator_op_if): likewise. (_hg_operator_op_ifelse): likewise. (_hg_operator_op_loop): likewise. (_hg_operator_op_repeat): likewise. (_hg_operator_op_stopped): likewise. 2006-08-16 Akira TAGOH * hieroglyph/operator.c (_hg_operator_op_search): implemented. * hieroglyph/hgstring.c (hg_string_compare_offset_later): new function. (hg_string_ncompare_offset_later): new function. (hg_string_ncompare): just return false if length is greater than the source length. (hg_string_compare_with_raw): likewise. * src/hgspy.c (_hgspy_file_close_cb): new function. * hieroglyph/hgfile.c (hg_file_object_is_closed): new function. * hieroglyph/operator.c (_hg_operator_op_status): implemented. 2006-08-15 Akira TAGOH * hieroglyph/operator.c (_hg_operator_op_token): implemented. * hieroglyph/hgfile.c (hg_file_object_seek): reflect ungetc. * hieroglyph/scanner.h (_hg_scanner_isspace): new macro. * hieroglyph/hgstring.c (hg_string_copy_as_substring): refer to current substring offset to not break a substring when making from substring. * hieroglyph/hgarray.c (hg_array_copy_as_subarray): refer to current subarray offset to not break a subarray when making from subarray. * hieroglyph/operator.c (_hg_operator_op_put): improved to detect /invalidaccess. * hieroglyph/vm.c (hg_vm_is_global_object): new function. * hieroglyph/hgvaluenode.h (HG_VALUE_SET_ARRAY): inherited a complex mark to find it easily. (HG_VALUE_SET_STRING): likewise. (HG_VALUE_SET_DICT): likewise. (HG_VALUE_SET_POINTER): likewise. (HG_VALUE_SET_FILE): likewise. (HG_VALUE_SET_SNAPSHOT): likewise. (HG_VALUE_MAKE_ARRAY): likewise. (HG_VALUE_MAKE_STRING): likewise. (HG_VALUE_MAKE_DICT): likewise. (HG_VALUE_MAKE_POINTER): likewise. (HG_VALUE_MAKE_FILE): likewise. (HG_VALUE_MAKE_SNAPSHOT): likewise. (hg_value_node_inherit_complex): new macro. (hg_value_node_has_complex_object): likewise. * lib/hg_init.ps (store): implemented. * hieroglyph/hgfile.c (hg_file_object_new): marked as complex object. * hieroglyph/hgallocator-bfit.c (_hg_allocator_bfit_real_save_snapshot): likewise. * hieroglyph/operator.c (_hg_operator_op_writehexstring): implemented. (_hg_operator_op_write): implemented. 2006-08-14 Akira TAGOH * hieroglyph/operator.c (_hg_operator_op_readline): have to check EOF after reading a character. (_hg_operator_op_readstring): implemented. (_hg_operator_op_round): implemented. (_hg_operator_or_xor): implemented. * src/hgspy.c (_hgspy_update_vm_status): use macro. * hieroglyph/hgvaluenode.c (hg_value_node_debug_print): use macro instead of casting directly. * configure.ac: don't stop configure process even if libedit isn't installed. * plugins/Makefile.am (SUBDIRS): built without libedit plugin if it's not available. * hieroglyph/vm.c (_hg_vm_eval_file): new function. (hg_vm_set_ostack): new function. (hg_vm_set_estack): make it as a private function. (hg_vm_set_dstack): new function. (hg_vm_eval): new function. * lib/hg_init.ps: don't invoke if .loadhistory and .savehistory isn't available. * plugins/libedit/libedit-main.c (_libedit_op_loadhistory): moved from operator.c. (_libedit_op_statementedit): likewise. (_libedit_op_savehistory): likewise. 2006-08-13 Akira TAGOH * hieroglyph/scanner.c (_hg_scanner_get_object): '\r', '\n' and '\r\n' has to be escaped by '\'. * hieroglyph/operator.c (_hg_operator_op_readhexstring): check the access attributes. * hieroglyph/hglineedit.c (_hg_line_edit__default_get_line): implemented. 2006-08-10 Akira TAGOH * hieroglyph/operator.c (_hg_operator_op_file): give a HgLineEdit for %lineedit. (_hg_operator_op_readhexstring): implemented. * hieroglyph/hgstring.c (_hg_string_real_to_string): mask a character to get a char exactly. 2006-08-03 Akira TAGOH * hieroglyph/operator.c (_hg_operator_op_cvn): inherited the executeonly. * hieroglyph/hgmem.h (hg_object_is_accessible): new macro. * hieroglyph/hgmem.c (hg_mem_pool_new): changed the default access mode. * hieroglyph/operator.c (_hg_operator_op_exec): check executeonly flag. (_hg_operator_op_executeonly): implemented. (_hg_operator_op_noaccess): use hg_object_inaccessible. * hieroglyph/vm.c (hg_vm_main): set the same flags from string to file. * hieroglyph/hgmem.h (hg_object_inexecutable): renamed from hg_object_unexecutable. (hg_object_executeonly): new macro. (hg_object_is_executeonly): new macro. (hg_object_inaccessible): new macro. 2006-08-02 Akira TAGOH * plugins/debug/Makefile.am (LIBS): removed the unnecessary dependency. * hieroglyph/operator.c (hg_operator_hieroglyph_init): removed .startgc definition. (_hg_operator_op_private_hg_startgc): removed. * plugins/Makefile.am (SUBDIRS): added debug subdir. * plugins/debug/debug-main.c: new file. * plugins/debug/Makefile.am: new file. * hieroglyph/operator.h (_hg_operator_build_operator): moved from operator.c. (BUILD_OP): likewise. (BUILD_OP_): likewise. (hg_operator_build_operator__inline): new macro. 2006-07-26 Akira TAGOH * hieroglyph/operator.c (_hg_operator_op_ln): implemented. (_hg_operator_op_log): implemented. (_hg_operator_op_readonly): implemented. 2006-07-24 Akira TAGOH * lib/hg_init.ps (matrix): use identmatrix instead of the own C function. * hieroglyph/operator.c (_hg_operator_op_identmatrix): implemented. (_hg_operator_op_matrix): moved into lib/hg_init.ps. * hieroglyph/hgfile.c (hg_file_object_flush): changed the behavior for read mode. * hieroglyph/operator.c (_hg_operator_op_flushfile): implemented. 2006-07-23 Akira TAGOH * hieroglyph/operator.c (_hg_operator_op_cvrs): implemented. * hieroglyph/hgstring.c (hg_string_convert_from_integer): new function. * hieroglyph/hgvaluenode.c (_hg_value_node_real_to_string): suppressed the unnecessary zeros. 2006-07-18 Akira TAGOH * hieroglyph/operator.c (_hg_operator_op_cvr): implemented. (_hg_operator_op_copy): fixed to not include a invalid character in a substring. * tests/ps/currentfile.ps: new file. * hieroglyph/operator.c (_hg_operator_op_closefile): implemented. (_hg_operator_op_currentfile): implemented. (_hg_operator_op_readline): implemented. * hieroglyph/hgfile.c (_hg_file_object_real_free): use hg_file_object_close instead of handling a close process directly. (hg_file_object_close): new function. * src/hgspy.c (_hgspy_file_close_cb): new function. * hieroglyph/operator.c (_hg_operator_op_bytesavailable): implemented. (_hg_operator_op_ceiling): implemented. * hieroglyph/hgfile.c (hg_file_object_seek): new function. (hg_file_object_is_readable): new function. (hg_file_object_is_writable): new function. * src/hgspy.c (_hgspy_file_seek_cb): new function. 2006-07-17 Akira TAGOH * hieroglyph/operator.c (_hg_operator_op_anchorsearch): implemented. (_hg_operator_op_bitshift): implemented. * hieroglyph/hgstring.c (hg_string_ncompare): new function. (hg_string_copy_as_substring): fixed an index bug. * README: described a bit. * hieroglyph/Makefile.am (EXTRA_DIST): added version.h.in.in. * Makefile.am (EXTRA_DIST): added update-version. * hieroglyph.pc.in: trivial fix. * Makefile.am (pkgconfig_DATA): removed hg-libretto.pc. * examples/pse.c (_pse_plugin_arg_cb): new function. * hieroglyph/operator.c (_hg_operator_op_file): support new HgLineEdit. (_hg_operator_op_private_hg_initplugins): new function. * hieroglyph/vm.c (hg_vm_load_plugin): new function. (hg_vm_load_plugins_all): new function. (hg_vm_unload_plugin): new function. * hieroglyph/hgdevice.c (hg_device_new): support the multiple paths. * lib/hg_init.ps: initialize the plugins. * tests/run.sh: support the multiple paths. 2006-07-16 Akira TAGOH * hieroglyph/vm.c (hg_vm_new): create an instance of HgLineEdit. * hieroglyph/hglineedit.[ch]: made a lot of changes to get rid of the libedit dependency directly. * hieroglyph/hgplugins.[ch]: new files. * hieroglyph/hgfile.c (hg_file_object_new): handle an argument as HgLineEdit. * .gdbinit: modified for current object structures. (hgstringprint): implemented. * plugins/libedit/libedit-main.c (plugin_load): implemented. (plugin_unload): implemented. * hg-libretto.pc.in: removed. * configure.ac: check for exp10 function. * plugins/Makefile.am: new file. * plugins/test/Makefile.am: new file. * plugins/test/test-main.c: new file. * plugins/libedit/Makefile.am: new file. * plugins/libedit/libedit-main.c: new file. * src/hgspy.c: use hieroglyph/* instead of libretto/*. * src/Makefile.am: removed the libretto.la dependency. * examples/pse.c: use hieroglyph/* instead of libretto/*. * examples/cairo-xlib.c: likewise. * examples/Makefile.am: removed the libretto.la dependency. * hieroglyph/operator.[ch]: moved from libretto/. * hieroglyph/scanner.[ch]: moved from libretto/. * hieroglyph/vm.[ch]: moved from libretto/. * hieroglyph/hggraphics.[ch]: moved from libretto/lbgraphics.[ch]. 2006-07-04 Akira TAGOH * hieroglyph/hgvaluenode.c (hg_value_node_new): validate if pool is non-null. * src/hgspy.c (_hgspy_ask_dialog): new function. (_hgspy_run_vm): ask if VM is already running. * hieroglyph/hgstack.[ch]: new files. * libretto/Makefile.am: removed lbstack.[ch]. * libretto/lbtypes.h: removed LibrettoStack definition. * libretto/vm.[ch]: modified for LibrettoStack->HgStack transition. * libretto/scanner.c: likewise. * libretto/operator.c: likewise. * libretto/lbstack.[ch]: moved as hieroglyph/hgstack.[ch]. * devices/cairo/cairo-xlib-main.c (device_close): fixed a memory leak. 2006-07-01 Akira TAGOH * TODO: add an item. * hieroglyph/hgdict.c (hg_dict_new): add a limitation of the amount of Hash items. * libretto/vm.c (libretto_vm_new): allocate more spaces for the name dict. * hieroglyph/hgfile.h (HG_FILE_GET_FILE_TYPE): new macro. (HG_FILE_SET_FILE_TYPE): new macro. * hieroglyph/hgfile.c (_hg_file_object_real_free): use macro instead of a direct access. (_hg_file_object_real_set_flags): likewise. (_hg_file_object_real_relocate): likewise. (_hg_file_object_real_to_string): likewise. (hg_file_object_new): likewise. (hg_file_object_has_error): likewise. (hg_file_object_read): likewise. (hg_file_object_write): likewise. (hg_file_object_getc): likewise. (hg_file_object_flush): likewise. * hieroglyph/hgstring.c (hg_string_new): add a limitation of the amount of strings. * hieroglyph/hgarray.c (hg_array_new): add a limitation of the amount of arrays. * hieroglyph/hgvaluenode.c (_hg_value_node_real_dup): don't duplicate a null object and a mark object. (_hg_value_node_real_copy): don't copy a null object and a mark object. * libretto/operator.c (_libretto_operator_op_array): use the existing null object in systemdict. * libretto/scanner.c (_libretto_scanner_get_object): free a special null object that used for a terminator of proc. (_libretto_scanner_get_object): use the existing mark object in systemdict. 2006-06-20 Akira TAGOH * hieroglyph/hgvaluenode.c (hg_value_node_debug_print): show the name to be dumped. * hieroglyph/hgallocator-bfit.c (_hg_allocator_bfit_real_alloc): exactly set HG_FL_HGOBJECT. 2006-06-19 Akira TAGOH * hieroglyph/hgmem.h (HG_OBJECT_INIT_OBJECT): new macro. * hieroglyph/hgmacros.h (HG_MEMOBJ_GET_HGOBJECT_ID): new macro. (HG_MEMOBJ_SET_HGOBJECT_ID): new macro. (HG_MEMOBJ_IS_HGOBJECT): new macro. (HG_OBJECT_GET_USER_DATA): new macro. (HG_OBJECT_SET_USER_DATA): new macro. * hieroglyph/hgvaluenode.h (HG_VALUE_GET_VALUE_TYPE): new macro. (HG_VALUE_SET_VALUE_TYPE): new macro. * hieroglyph/hgmem.h (HG_MEMOBJ_GET_MARK_AGE): new macro. (HG_MEMOBJ_SET_MARK_AGE): new macro. (hg_mem_set_flags__inline): use HG_MEMOBJ_SET_MARK_AGE for marking. (hg_mem_add_flags__inline): modified for marking. (hg_mem_gc_mark): removed. (hg_mem_gc_unmark): removed. (hg_mem_is_gc_mark): removed. (hg_mem_gc_mark__inline): new macro. (hg_mem_is_gc_mark__inline): new macro. * hieroglyph/hgallocator-bfit.c (_hg_allocator_bfit_real_garbage_collection): increase an age of mark. (_hg_allocator_bfit_real_garbage_collection): removed unmarking code. (_hg_allocator_bfit_real_gc_unmark): removed. * hieroglyph/hgarray.c (_hg_array_real_set_flags): modified to not use HG_FL_MARK which is obsolete. (hg_array_append_forcibly): removed pre-marking code. (hg_array_replace_forcibly): likewise. * hieroglyph/hgfile.c (_hg_file_object_real_set_flags): modified to not use HG_FL_MARK which is obsolete. * hieroglyph/hgstring.c (_hg_string_real_set_flags): likewise. * hieroglyph/hgvaluenode.c (_hg_value_node_real_set_flags): likewise. * hieroglyph/hgdict.c (_hg_dict_node_real_set_flags): likewise. (hg_dict_insert_forcibly): removed pre-marking code. 2006-06-18 Akira TAGOH * hieroglyph/hgarray.c (hg_array_new): use macro. * hieroglyph/hgdict.c (hg_dict_node_new): use macro. (hg_dict_new): likewise. * hieroglyph/hgmem.h (hg_mem_get_object__inline): use macro. (hg_mem_set_flags__inline): likewise. * hieroglyph/hgmem.c (hg_mem_free): use macro. (hg_object_dup): likewise. (hg_object_copy): likewise. (hg_object_get_vtable): likewise. * hieroglyph/hgstring.c (hg_string_new): use macro. * hieroglyph/hgallocator-bfit.c (_hg_allocator_bfit_relocate): use macro. (_hg_allocator_bfit_real_alloc): likewise. (_hg_allocator_bfit_real_resize): likewise. (_hg_allocator_bfit_real_save_snapshot): likewise. * hieroglyph/hgpath.c (hg_path_node_new): use macro. (hg_path_new): likewise. * hieroglyph/hgmacros.h (HG_CHECK_MAGIC_CODE): new macro. (HG_SET_MAGIC_CODE): new macro. * hieroglyph/hgvaluenode.c (hg_value_node_new): use macro. * hieroglyph/hgfile.c (hg_file_object_new): use macro. * hieroglyph/hgrender.c (hg_render_eofill_new): use macro. (hg_render_fill_new): likewise. (hg_render_stroke_new): likewise. (hg_render_debug_new): likewise. * libretto/operator.c (libretto_operator_new): use macro. * libretto/lbstack.c (libretto_stack_new): use macro. * libretto/vm.c (libretto_vm_new): use macro. * libretto/lbgraphics.c (libretto_graphic_state_new): use macro. (libretto_graphics_new): likewise. * src/hgspy.c (_hgspy_entry_activate_cb): don't send anything if VM isn't running. (main): added visualizer widget into VPaned. * src/visualizer.c (hg_memory_visualizer_real_size_request): new function. * src/hgspy.c (_hgspy_file_read_cb): update a prompt. (_hgspy_entry_activate_cb): echo back the input to the textview. (_hgspy_insert_text_into_textview): new function. (main): added a prompt label. * src/visualizer.c (hg_memory_visualizer_class_init): added gc-started and gc-finished signals. (hg_memory_visualizer_notify_gc_state): new function. * src/hgspy.c (_hgspy_gc_started_cb): new function. (_hgspy_gc_finished_cb): new function. (main): added a statusbar. * src/hgspy_helper.c (helper_init): watch hg_mem_garbage_collection too. (hg_mem_garbage_collection): new function. * examples/cairo-xlib.c (main): invoke HG_MEM_INIT before doing anything. * hieroglyph/hgarray.c (hg_array_new): improved a footprint. * hieroglyph/hgmem.h (hg_mem_set_flags__inline): don't access vtable directly. (HG_OBJECT_GET_VTABLE_ID): new macro. (HG_OBJECT_SET_VTABLE_ID): likewise. (HG_OBJECT_GET_STATE): likewise. (HG_OBJECT_SET_STATE): likewise. * hieroglyph/hgdict.c (hg_dict_node_new): improved a footprint. (hg_dict_new): likewise. * hieroglyph/hgmem.c (hg_mem_init): initialize vtable tree for HgObject. (hg_mem_finalize): destroy vtable tree for HgObject. (hg_mem_free): don't access vtable directly. (hg_object_get_state): use macro instead of direct access. (hg_object_set_state): likewise. (hg_object_is_state): likewise. (hg_object_dup): don't access vtable directly. (hg_object_copy): likewise. (hg_object_get_vtable): new function. (hg_object_set_vtable): new function. * hieroglyph/hgstring.c (hg_string_new): improved a footprint. (hg_object_to_string): use macro instead of direct access. * hieroglyph/hgallocator-bfit.c (_hg_allocator_bfit_relocate): don't access vtable directly. (_hg_allocator_bfit_real_resize): likewise. (_hg_allocator_bfit_real_save_snapshot): improved a footprint. * hieroglyph/hgpath.c (hg_path_node_new): improved a footprint. (hg_path_new): likewise. * hieroglyph/hgvaluenode.c (_hg_value_node_real_dup): use macro instead of direct access. (_hg_value_node_real_copy): likewise. (hg_value_node_new): improved a footprint. * hieroglyph/hgfile.c (hg_file_object_new): improved a footprint. * hieroglyph/hgrender.c (hg_render_eofill_new): improved a footprint. (hg_render_fill_new): likewise. (hg_render_stroke_new): likewise. (hg_render_debug_new): likewise. * libretto/operator.c (libretto_operator_new): improved a footprint. * libretto/lbgraphics.c (libretto_graphic_state_new): improved a footprint. (libretto_graphics_new): likewise. * libretto/vm.c (libretto_vm_new): likewise. * libretto/lbstack.c (libretto_stack_new): likewise. (libretto_stack_dump): don't reply on hieroglyph memory management system to dump a stack. it may be failed. 2006-06-16 Akira TAGOH * src/hgspy.c (_hgspy_quit_cb): new function. (_hgspy_file_write_cb): scroll up to the latest output. (main): only wait for finalize process when VM is running. * src/visualizer.c (_hg_memory_visualizer_idle_handler_cb): update a pixmap in lock. * src/hgspy.c (main): changed the default window size. * hieroglyph/hgfile.c (_hg_file_object_real_free): add HG_FILE_TYPE_BUFFER_WITH_CALLBACK support. (hg_file_object_new): likewise. (hg_file_object_has_error): likewise. (hg_file_object_read): likewise. (hg_file_object_write): likewise. (hg_file_object_getc): likewise. (hg_file_object_flush): new function. * src/visualizer.c (hg_memory_visualizer_set_max_size): fixed memory corruption. (hg_memory_visualizer_set_heap_state): don't add a pool name when it's already in pool_name_list. * src/hgspy.c (_hgspy_op_private_statementedit): new function to take over the statementedit. (_hgspy_file_read_cb): new function. (_hgspy_file_write_cb): new function. (_hgspy_file_is_eof_cb): new function. (_hgspy_file_get_error_code_cb): new function. (_hgspy_vm_thread): override stdin/stdout in VM, and ..statementedit operator. (_hgspy_entry_activate_cb): new function. (main): invoke gdk_threads_init first. (main): add input/output widget. 2006-06-15 Akira TAGOH * hieroglyph/hgallocator-bfit.c (_hg_allocator_bfit_real_garbage_collection): use a flag instead of mutex lock. * src/visualizer.c (hg_memory_visualizer_real_destroy): free a node in pool_name_list. (_hg_memory_visualizer_compare_pool_name_list): new function. (hg_memory_visualizer_remove_pool): new function. * src/hgspy.c (_hgspy_vm_thread): finalize vm instance. (_hgspy_pool_updated_cb): allow NULL for name and add None item to menu when no menuitem is added. (_hgspy_update_vm_status): clear text when name is NULL. * src/hgspy_helper.c (helper_init): watch hg_mem_pool_destroy as well. (hg_mem_pool_destroy): new function. * src/visualizer.c (hg_memory_visualizer_real_size_allocate): implemented. (hg_memory_visualizer_real_realize): implemented. (hg_memory_visualizer_real_expose): implemented. (hg_memory_visualizer_class_init): added draw-updated signal. (hg_memory_visualizer_real_unrealize): implemented. (_hg_memory_visualizer_idle_handler_cb): update a pixmap. (_hg_memory_visualizer_create_gc): new function. (_hg_memory_visualizer_redraw_in_pixmap): new function. (hg_memory_visualizer_get_used_size): new function. (hg_memory_visualizer_get_current_pool_name): new function. (hg_memory_visualizer_set_chunk_state): update a pixmap only when changes happened on current pool. * src/hgspy.c (_hgspy_draw_updated_cb): new function. (_hgspy_update_vm_status): new function. (main): add widgets for memory informations. * src/hgspy_helper.c (helper_init): get an original function pointer for hg_mem_resize. (hg_mem_alloc_with_flags): check null. (hg_mem_free): fixed a typo. (hg_mem_resize): new function. need to watch this function too. * examples/pse.c (main): invoke HG_MEM_INIT before doing anything. * hieroglyph/hgvaluenode.h (HG_VALUE_SET_VALUE_NODE): check null. * libretto/operator.c (_libretto_operator_op_array): set /VMError when creating a null object is failed. 2006-06-12 Akira TAGOH * hieroglyph/hgfile.c (hg_file_object_new): use strncpy instead of strcpy. * libretto/operator.c (_libretto_operator_op_private_hg_abort): dump a vm status as well. (libretto_operator_new): use strncpy instead of strpy. * devices/cairo/cairo-ps-main.c (device_open): use g_file_open_tmp instead. 2006-06-05 Akira TAGOH * src/visualizer.c (hg_memory_visualizer_real_destroy): remove idle timer. (hg_memory_visualizer_real_size_allocate): implemented a bit. (hg_memory_visualizer_real_unrealize): remove idle timer. (hg_memory_visualizer_real_map): add idle timer. (hg_memory_visualizer_real_unmap): remove idle timer. (hg_memory_visualizer_class_init): add a signal, pool-updated. (_hg_memory_visualizer_idle_handler_cb): new function. (_hg_memory_visualizer_add_idle): new function. (_hg_memory_visualizer_remove_idle): new function. (hg_memory_visualizer_set_heap_state): set current pool and info. (hg_memory_visualizer_set_chunk_state): set a flag to be updated. (hg_memory_visualizer_change_pool): new function. * src/hgspy.c (_hgspy_radio_menu_pool_activate_cb): new function. (_hgspy_pool_updated_cb): new function. * hieroglyph/version.h.in.in: surround with G_*_DECLS. * src/visualizer.c (hg_memory_visualizer_real_destroy): set a null to avoid a double-free. * src/hgspy.c (_hgspy_action_menubar_open_cb): set a filter name. (main): set a window title and added a view menu. * Makefile.am (SUBDIRS): added po. * configure.ac (ALL_LINGUAS): added ja. * hieroglyph/hgmem.c (hg_mem_init_stack_start): new function. (hg_mem_pool_add_heap): new function. * hieroglyph/hgallocator-bfit.c (_hg_allocator_bfit_real_initialize): use hg_mem_pool_add_heap instead of direct access. (_hg_allocator_bfit_real_resize_pool): likewise. * hieroglyph/hgmacros.h (HG_STACK_INIT): new macro. (HG_MEM_INIT): new macro. * src/visualizer.c (_heap2offset_new): new function. (_heap2offset_free): new function. (hg_memory_visualizer_set_max_size): store the max size for each pools. (hg_memory_visualizer_get_max_size): similar change. (hg_memory_visualizer_set_heap_state): new function. (hg_memory_visualizer_set_chunk_state): implemented. * src/hgspy.c (_hgspy_vm_thread): call HG_MEM_INIT here. * src/hgspy_helper.c (hg_mem_pool_add_heap): new function. 2006-06-04 Akira TAGOH * hieroglyph/hgmem.c (hg_mem_gc_mark_array_region): new function. * hieroglyph/hgallocator-bfit.c (_hg_allocator_bfit_real_garbage_collection): lock with mutex during GC. (_hg_allocator_bfit_real_gc_mark): use hg_mem_gc_mark_array_region. (_hg_allocator_bfit_real_is_safe_object): new function. 2006-06-03 Akira TAGOH * hieroglyph/hgmem.c (hg_mem_get_object_size): new function. * hieroglyph/hgallocator-bfit.c (_hg_allocator_get_object_size__inline): new macro. (_hg_allocator_bfit_real_get_size): new function. * src/hgspy_helper.c (hg_mem_alloc_with_flags): don't access block_size directly. (hg_mem_free): likewise. * hieroglyph/hgbtree.c (hg_btree_find_near): fixed to get correct near block. * hieroglyph/hgallocator-bfit.c (_hg_allocator_get_minimum_aligned_size__inline): new macro. (_hg_allocator_get_aligned_size__inline): likewise. (_hg_allocator_compute_minimum_block_size_index__inline): removed. (_hg_allocator_grow_index_size__inline): removed. (_hg_allocator_compute_block_size_index__inline): removed. (_hg_allocator_compute_block_size__inline): removed. * hieroglyph/hgvaluenode.h (HG_VALUE_SET_NAME_STATIC): allocate more memory for null-terminated. * .gdbinit (_hgmeminfo): support compat structure. 2006-06-02 Akira TAGOH * hieroglyph/hgtypes.h: improved a footprint a bit. * hieroglyph/hgmem.h (HG_MEMOBJ_GET_HEAP_ID): new macro. (HG_MEMOBJ_SET_HEAP_ID): new macro. (HG_MEMOBJ_GET_FLAGS): new macro. (HG_MEMOBJ_SET_FLAGS): new macro. (HG_MEMOBJ_INIT_FLAGS): new macro. (hg_mem_is_flags__inline): use macro instead of direct access. (hg_mem_get_flags__inline): likewise. (hg_mem_set_flags__inline): likewise. * hieroglyph/hgallocator-bfit.c (_hg_allocator_bfit_real_alloc): use macro instead of direct access. (_hg_allocator_bfit_real_resize): likewise. * hieroglyph/hgvaluenode.c (hg_value_node_new): removed unnecessary value. * src/hgspy_helper.c (hg_mem_alloc_with_flags): use macro instead of direct access. (hg_mem_free): likewise. 2006-05-29 Akira TAGOH * hieroglyph/hgmem.c (hg_mem_garbage_collection): trivial fix. * libretto/vm.c (libretto_vm_new): just disable a global pool so far. * commit.sh: ask once when going to commit without log. * src/hgspy_helper.[ch]: new files. * src/hgspy.c: new file. * src/visualizer.[ch]: new files. * src/Makefile.am: new file. * po/POTFILES.in: new file. 2006-05-25 Akira TAGOH * hieroglyph/hgallocator-bfit.c (_hg_allocator_bfit_real_resize): update a block size in HgMemObject as well. (_hg_allocator_bfit_snapshot_real_to_string): implemented. * hieroglyph/hgfile.c (hg_file_object_new): fixed a memory corruption. 2006-05-19 Akira TAGOH * hieroglyph/hgmem.c (hg_mem_pool_new): enable periodical GC by default. * hieroglyph/hgarray.c (_hg_array_real_copy): update the amount of objects in array when an object is copied once. it caused not marking when GC happened during copying. * hieroglyph/hgmem.h (hg_mem_set_flags__inline): don't recursively set flags that isn't expected. * hieroglyph/hgallocator-bfit.c (_hg_allocator_bfit_add_free_block): exactly clear headers. (_hg_allocator_bfit_real_alloc): likewise. * hieroglyph/hgvaluenode.c (hg_value_node_debug_print): renamed. * .gdbinit: added. * hieroglyph/hgstring.c (hg_string_new): ensure a memory for termination. (hg_string_append_c): likewise. (hg_string_append): likewise. (hg_string_fix_string_size): likewise. * hieroglyph/hgallocator-bfit.c (_hg_allocator_bfit_real_garbage_collection): unmark objects in other pools after GC. (_hg_allocator_bfit_real_gc_unmark): new function. * libretto/operator.c (_libretto_operator_op_copy): clean up. 2006-05-12 Akira TAGOH * hieroglyph/hgarray.c (_hg_array_real_copy): unset copying flag if fails happens. (hg_array_append_forcibly): add pool if node is from different pool. (hg_array_replace_forcibly): likewise. * hieroglyph/hgdict.c (hg_dict_insert_forcibly): check if object is sane. (hg_dict_insert_forcibly): add pool if node is from different pool. * hieroglyph/hgmem.c (_hg_mem_pool_is_own_memobject): new function. (hg_mem_add_pool_reference): don't add the duplicate pool. * hieroglyph/hgallocator-bfit.c (_hg_allocator_bfit_add_free_block): clear data to avoid incomplete header detection. (_hg_allocator_bfit_relocate): avoid the infinite loop. (_hg_allocator_bfit_real_gc_mark): likewise. * libretto/operator.c (_libretto_operator_op_private_hg_forceput): reverted a previous change. (libretto_operator_init): likewise. 2006-05-07 Akira TAGOH * hieroglyph/hgallocator-bfit.c (_hg_allocator_bfit_real_alloc): clear data to avoid incomplete header detection. (_hg_allocator_bfit_real_resize): fixed possibly causing wrong block chain. * libretto/operator.c (_libretto_operator_op_floor): removed. (_libretto_operator_op_run): removed. (_libretto_operator_op_private_hg_forceput): added objects to the pool reference. (_libretto_operator_real_set_flags): use hg_debug_print_gc_state. * hieroglyph/hgallocator-bfit.c (_hg_allocator_bfit_add_free_block): check if block chain is sane. (_hg_allocator_bfit_get_free_block): fixed causing wrong block chain. (_hg_allocator_bfit_real_gc_mark): trace the pool reference and the registers. * hieroglyph/hgvaluenode.c (_hg_value_node_real_set_flags): set flags for HG_TYPE_VALUE_POINTER as well. (hg_debug_print_gc_state): support HgValueNode dump. * hieroglyph/hgarray.c (hg_array_new): clear data to avoid segfaults. it may causes staying a incomplete header in the aligned memory. 2006-05-06 Akira TAGOH * commit.sh: implemented a testrun mode and -m option to give the own commit message. also check if the required command is available. * hieroglyph/hgmem.c (hg_pool_ref_new): new function. (hg_pool_ref_free): new function. (hg_pool_ref_last): new function. (hg_pool_ref_add): new function. (hg_pool_ref_remove): new function. (hg_mem_add_pool_reference): new function. (hg_mem_remove_pool_reference): new function. * libretto/vm.c (libretto_vm_new): correct adding object to root node. 2006-05-05 Akira TAGOH * hieroglyph/hgdict.c (hg_dict_insert_forcibly): clean up. * hieroglyph/hgarray.c (hg_array_replace_forcibly): clean up. * hieroglyph/hgmem.c (hg_mem_pool_is_own_object): always return true if current allocation mode is local. * lib/hg_init.ps (.defaulterrorhandler): enter the local allocation mode in advance to avoid /invalidaccess again. * libretto/operator.c (_libretto_operator_op_astore): check the allocation mode before an warning is output. (_libretto_operator_op_put): likewise. (_libretto_operator_op_private_dicttomark): likewise. (_libretto_operator_op_def): likewise. (_libretto_operator_op_private_hg_abort): possibly avoid /VMerror twice. * hieroglyph/hgmem.c (hg_mem_pool_new): enable GC by default. * libretto/vm.c (libretto_vm_init): use the best fit memory allocator by default. (libretto_vm_new): likewise. * hieroglyph/hgfile.c (hg_file_init): likewise. * hieroglyph/hgarray.c (hg_array_append_forcibly): new function. * hieroglyph/hgdict.c (hg_dict_insert_forcibly): new function. * hieroglyph/hgvaluenode.c (hg_debug_print_gc_state): new function. * lib/hg_init.ps (userdict): trick to add /userdict into systemdict. (odef): likewise for $error. (floor): implemented. (.seterror): don't use end here. (.printerror): show more information. * libretto/operator.c (_libretto_operator_op_private_hg_forceput): new function. (libretto_operator_init): add objects to the root node to allow including them to the global objects. * hieroglyph/hgmem.c (hg_mem_pool_is_own_object): check if it's in the root node and give a privilege to the object. * libretto/vm.c (libretto_vm_new): set a pool mode. * hieroglyph/hgmem.c (hg_mem_pool_is_own_object): new function. (hg_mem_pool_get_name): new function. 2006-05-04 Akira TAGOH * hieroglyph/hgmem.c (hg_mem_pool_is_global_mode): new function. (hg_mem_pool_use_global_mode): new function. * hieroglyph/hgallocator-bfit.c (_hg_allocator_bfit_real_garbage_collection): added the debugging messages. * libretto/operator.c (_libretto_operator_op_private_arraytomark): go along with the steps like PS. (_libretto_operator_op_private_hg_startgc): do GC for only local pool. * libretto/vm.c (libretto_vm_set_error): dump the stacks when the multiple errors happened. 2006-05-03 Akira TAGOH * configure.ac: configurable allocator for testing purpose. * libretto/vm.c: likewise. * hieroglyph/hgfile.c: likewise. * hieroglyph/hgallocator-bfit.c (_hg_allocator_bfit_real_garbage_collection): return TRUE if GC is succeeded. * hieroglyph/hgfile.c (hg_file_object_new): fixed a typo. (hg_file_object_clear_error): new function. * libretto/operator.c (_libretto_operator_op_private_hg_startgc): new private operator to start GC manually. * libretto/vm.c (libretto_vm_set_error_from_file): clear an error in a file object after set it to vm. 2006-05-02 Akira TAGOH * hieroglyph/hgmem.c (hg_mem_free): fixed causing the double-free issue. * hieroglyph/hgallocator-bfit.c (_hg_allocator_bfit_remove_block): fixed broken deletion from the linked list. (_hg_allocator_bfit_real_free): sanity check to get the block. (_hg_allocator_bfit_real_resize): set NULL to vtable before free'ing. (_hg_allocator_bfit_real_resize): exactly separate off the block. 2006-04-24 Akira TAGOH * hieroglyph/hgallocator-bfit.c (_hg_bfit_block_new): store a heap id. (_hg_allocator_bfit_get_free_block): update the amount of the used heap in pool. (_hg_allocator_bfit_relocate): new function. (_hg_allocator_bfit_real_free): update the amount of the used heap in pool. (_hg_allocator_bfit_real_resize): implemented. 2006-04-18 Akira TAGOH * hieroglyph/hgallocator-bfit.c (_hg_allocator_bfit_add_free_block): fixed invalid memory block reference. 2006-04-17 Akira TAGOH * hieroglyph/hgallocator-bfit.c (_hg_allocator_bfit_remove_block): remove node if there are no list for chunks. (_hg_allocator_bfit_get_free_block): likewise. (_hg_allocator_bfit_add_free_block): replace node with updated list if there are already list in btree. (_hg_allocator_bfit_real_garbage_collection): implemented. 2006-04-16 Akira TAGOH * hieroglyph/hgallocator-bfit.c (_hg_allocator_bfit_remove_block): changes to use btree instead of list to manage the free block. (_hg_allocator_bfit_add_free_block): likewise. (_hg_allocator_bfit_get_free_block): likewise. (_hg_allocator_bfit_btree_traverse_in_destroy): new function. (_hg_allocator_bfit_real_destroy): destroying blocks through block chain. (_hg_allocator_bfit_real_gc_mark): implemented. (_hg_allocator_bfit_add_user_block): removed. (_hg_allocator_bfit_get_used_block_list): removed. (_hg_allocator_bfit_has_used_block_with_list): removed. (_hg_allocator_bfit_remove_used_block): removed. 2006-04-13 Akira TAGOH * hieroglyph/hgallocator-bfit.[ch]: added the best fit algorithm memory allocator. 2006-04-12 Akira TAGOH * hieroglyph/hgmem.c (_hg_mem_pool_free): also use hg_heap_free. * hieroglyph/hgallocator-ffit.c: use hg_heap_new/free. * hieroglyph/hgmem.c (hg_heap_new): new function. (hg_heap_free): new function. 2006-04-05 Akira TAGOH * hieroglyph/hgmem.c (hg_allocator_new): new again. (hg_allocator_destroy): likewise. * hieroglyph/hgallocator-ffit.c (hg_allocator_ffit_get_vtable): new function. (hg_allocator_ffit_new): removed. (hg_allocator_ffit_destroy): removed. * hieroglyph/hgfile.c (hg_file_init): trivial thing to support optional allocator. * libretto/scanner.c: use own error function to not push self into the estack. * libretto/vm.c: trivial thing to support optional allocator. 2006-04-04 Akira TAGOH * hieroglyph/hgmem.c (_hg_mem_init_stack_start): comment out the incomplete code. * hieroglyph/hgbtree.c (hg_btree_find): use proper variable type. (hg_btree_find_near): likewise. (hg_btree_find_near): fixed uninitialized variable warning. [Toshiya Suzuki] 2006-04-03 Akira TAGOH * libretto/operator.c (_libretto_operator_op_counttomark): fixed a bulid error on older gcc. [Toshiya Suzuki] 2006-03-31 Akira TAGOH * libretto/operator.c (_libretto_operator_op_exp): implemented. * hieroglyph/hgvaluenode.h (HG_VALUE_GET_REAL_FROM_INTEGER): add a macro. 2006-03-30 Akira TAGOH * libretto/operator.c (_libretto_operator_op_cvlit): implemented. (_libretto_operator_op_cvn): implemented. (_libretto_operator_op_getinterval): check if it's readable. * lib/hg_init.ps (.printerror): show the details of dict. * hieroglyph/hgmem.c: split up the allocator part to another files. * hieroglyph/hgallocator-private.h: new file. * hieroglyph/hgallocator-ffit.[ch]: new files. 2006-03-28 Akira TAGOH * libretto/operator.c: makes a node with the same pool where the value was created. * libretto/vm.c: likewise. * libretto/scanner.c: likewise. * hieroglyph/hgvaluenode.h: get a memory pool from the given value for complex objects. 2006-03-27 Akira TAGOH * hieroglyph/hgmem.c (hg_mem_pool_new): initialize use_gc. (hg_mem_pool_get_used_heap_size): new function. (hg_mem_pool_get_free_heap_size): new function. * libretto/operator.c (_libretto_operator_op_vmstatus): implemented. * libretto/scanner.c (_libretto_scanner_get_object): fixed a null exception. * libretto/vm.c (libretto_vm_get_save_level): new function. * hieroglyph/hgvaluenode.c (_hg_value_node_real_to_string): fix an allocated size at the end. * commit.sh: don't commit if there are no changes. * lib/hg_init.ps (.seterror): modify /estack in $error to indicate a correct stack where an error actually happened. * libretto/operator.c (_libretto_operator_op_getinterval): implemented. 2006-03-26 Akira TAGOH * hieroglyph/hgfile.c (_hg_file_object_real_to_string): makes a difference to not confuse for string. * lib/hg_init.ps (.seterror): save ostack, estack and dstack into $error. (.printerror): show the stack in $error instead. * libretto/operator.c (_libretto_operator_op_dictstack): implemented. (_libretto_operator_op_execstack): fixed a typo. (_libretto_operator_op_stop): invoke /.abort instead of /quit. (_libretto_operator_op_private_hg_abort): implemented. * libretto/lbstack.c (libretto_stack_dump): new function. 2006-03-24 Akira TAGOH * libretto/operator.c (_libretto_operator_op_copy): always set TRUE to retval when the amount of copy object is 0. 2006-03-23 Akira TAGOH * lib/hg_init.ps (run): defined. * libretto/operator.c (_libretto_operator_op_exit): makes /invalidexit when file object appears on the estack. 2006-03-21 Akira TAGOH * hieroglyph/hglineedit.c (hg_line_edit_get_statement): show a prompt at only first. * lib/hg_init.ps (executive): take care of the real /undefinedfilename from interactive shell. load/save history. (..statementedit): defined. * libretto/operator.c (_libretto_operator_op_private_hg_loadhistory): implemented. (_libretto_operator_op_private_hg_savehistory): implemented. (_libretto_operator_op_private_hg_statementedit): fixed a memory leak and detect EOL. * hieroglyph/hglineedit.c (hg_line_edit_load_history): new function. (hg_line_edit_save_history): new function. * lib/hg_init.ps (prompt): use .promptmsg to get a prompt string. * hieroglyph/hglineedit.c (hg_line_edit_get_line): support the use of own prompt. (hg_line_edit_get_statement): don't add an empty line to the history. * hieroglyph/hgmem.c (hg_mem_pool_use_garbage_collection): new function. * hieroglyph/hgstring.c (hg_string_maxlength): new function. (hg_string_insert_c): update length. * lib/hg_init.ps (.promptmsg): defined. (cvs): defined. (executive): use .statementedit to avoid the prompt deletion. (putinterval): defined. * libretto/operator.c (_libretto_operator_op_string): implemented. (_libretto_operator_op_private_hg_execn): implemented. (_libretto_operator_op_private_hg_statementedit): implemented. * libretto/scanner.c (_libretto_scanner_get_object): don't set an executable bit to string. * libretto/lbstack.c (libretto_stack_roll): fixed the wrong chain. 2006-03-17 Akira TAGOH * libretto/vm.c (libretto_vm_reset_error): reenable stack validator. (libretto_vm_set_error): makes a copy for an error handler. * libretto/operator.c (_libretto_operator_op_private_hg_clearerror): implemented. * hieroglyph/hgfile.c (hg_file_object_has_error): set ENOENT if there are no buffer. * lib/hg_init.ps (executive): defined. * hieroglyph/hglineedit.[ch]: new files. * hieroglyph/hgfile.c (_hg_file_object_real_free): support HG_FILE_TYPE_STATEMENT_EDIT and HG_FILE_TYPE_LINE_EDIT. (_hg_file_object_real_set_flags): likewise. (_hg_file_object_real_relocate): likewise. (hg_file_object_new): likewise. (hg_file_object_has_error): likewise. (hg_file_object_read): likewise. (hg_file_object_getc): likewise. * lib/hg_init.ps (prompt): show the depth of current stack. support an interactive mode. * configure.ac: add a library check for libedit. * libretto/operator.c (_libretto_operator_op_file): makes an error when %statementedit and %lineedit is going to be opened as write/append mode. it must be read-only. (_libretto_operator_op_private_hg_startjobserver): don't stack a file object onto the exec stack. 2006-03-16 Akira TAGOH * libretto/operator.c (_libretto_operator_op_private_stringcvs): makes a string as is when given node is string. * lib/hg_init_lv2.ps (currentglobal): defined. (setglobal): defined. * lib/hg_init.ps (odef): defined. (.defaulterrorhandler): change an allocation mode to local. * libretto/operator.c (_libretto_operator_op_private_stopped_continue): don't always return true after error happened. it has to be false after stopped invoked once and no stop nor error happens. * libretto/vm.c (_libretto_vm_run): use libretto_vm_reset_error instead of libretto_vm_clear_error. (libretto_vm_reset_error): new function. * lib/hg_init_lv2.ps (globaldict): defined. * lib/hg_init.ps (userdict): defined. trivial fix to get PS initialization working. * libretto/operator.c (_libretto_operator_op_file): support (%statementedit) and (%lineedit). (_libretto_operator_op_private_hg_currentglobal): implemented. (_libretto_operator_op_private_hg_setglobal): implemented. (_libretto_operator_op_private_hg_startjobserver): set an read-only attribute to systemdict. (libretto_operator_init): removed /userdict and /globaldict definition. (libretto_operator_init): don't set an read-only attribute to systemdict here. * libretto/vm.c (libretto_vm_new): removed initialization of userdict and globaldict here. (libretto_vm_get_dict_userdict): removed. (libretto_vm_get_dict_globaldict): removed. (libretto_vm_startjob): removed initialization of dictstack here. (libretto_vm_startjob): set an read-only attribute to systemdict. * configure.ac: output more build info. * hieroglyph/hgfile.c (hg_file_object_new): set O_NONBLOCK flag to stdin. (hg_file_object_has_error): return true if error is only 0. * libretto/vm.c (libretto_vm_set_error_from_file): just ignore EAGAIN if it was from stdin. (libretto_vm_run): try to load a file from current path too when HIEROGLYPH_LIB_PATH isn't defined. * lib/hg_init.ps (stack): defined. (version): defined. 2006-03-15 Akira TAGOH * libretto/operator.c (libretto_operator_init): added /serverdict. * libretto/vm.c (libretto_vm_new): added serverdict. (libretto_vm_get_dict_serverdict): new function. * lib/hg_init.ps (prompt): defined. * libretto/operator.c (_libretto_operator_op_astore): implemented. (_libretto_operator_op_ne): implemented. (_libretto_operator_op_flush): implemented. (_libretto_operator_op_ge): implemented. (_libretto_operator_op_le): implemented. (_libretto_operator_op_load): implemented. (_libretto_operator_op_read): implemented. * hieroglyph/hgdict.c (_hg_dict_traverse_dup): new function. (_hg_dict_real_dup): new function. (hg_dict_remove): replace a value with a node being. (hg_dict_first): new function. * libretto/operator.c (_libretto_operator_op_private_forall_array_continue): implemented. (_libretto_operator_op_private_forall_string_continue): implemented. (_libretto_operator_op_and): return integer when it's called with integer. (_libretto_operator_op_forall): implemented. (_libretto_operator_op_or): implemented. (_libretto_operator_op_rcheck): implemented. (_libretto_operator_op_type): implemented. (_libretto_operator_op_wcheck): implemented. (_libretto_operator_op_where): implemented. (_libretto_operator_op_xcheck): implemented. (_libretto_operator_op_private_forall_dict_continue): implemented. (_libretto_operator_op_private_stringcvs): check NULL. * libretto/scanner.c (_libretto_scanner_get_object): use __lb_operator_list instead of __lb_operator_scanner. 2006-03-13 Akira TAGOH * lib/hg_init_lv2.ps (product): defined. (revision): defined. * lib/hg_init.ps (.printversion): new procedure. show version. * libretto/operator.c (_libretto_operator_op_file): use file objects in VM instead of using the external variables directly. (_libretto_operator_op_private_hg_hgrevision): implemented. (_libretto_operator_op_private_hg_product): implemented. (_libretto_operator_op_private_hg_revision): implemented. 2006-03-12 Akira TAGOH * hieroglyph/hgdict.c (_hg_dict_traverse_real_traverse): new function. (hg_dict_lookup): return a duplicate node. (hg_dict_lookup_with_string): likewise. (hg_dict_maxlength): new function. (hg_dict_traverse): new function. * libretto/operator.c (_libretto_operator_copy__traverse_dict): new function. (_libretto_operator_op_currentdict): implemented. (_libretto_operator_op_maxlength): implemented. (_libretto_operator_op_private_hg_startjobserver): implemented. * libretto/vm.c (libretto_vm_startjob): don't set a initialized flag here. * hieroglyph/hgarray.c (hg_array_append): remove the real node and reset removed_arrays before adding any node. (hg_array_make_subarray): new function. (hg_array_copy_as_subarray): new function. * hieroglyph/hgdict.c (hg_dict_maxlength): new function. * hieroglyph/hgstring.c (_hg_string_real_to_string): use current instead of strings. (hg_string_make_substring): new function. (hg_string_copy_as_substring): new function. * hieroglyph/hgfile.c (_hg_file_object_real_to_string): convert file object like string if it's from buffer. * lib/hg_init_lv2.ps: initialize error handlers. * lib/hg_init.ps (.seterror): new procedure to set an error. (.defaulterrorhandler): default handler for errors. (handleerror): new procedure. * libretto/operator.c (_libretto_operator_op_private_stopped_continue): implemented. (_libretto_operator_op_cleartomark): implemented. (_libretto_operator_op_copy): implemented. (_libretto_operator_op_counttomark): implemented. (_libretto_operator_op_execstack): implemented. (_libretto_operator_op_idiv): implemented. (_libretto_operator_op_not): implemented. (_libretto_operator_op_stop): implemented. (_libretto_operator_op_stopped): implemented. * libretto/scanner.c (_libretto_scanner_get_object): makes an object to the read-only if it's under the initialization. * libretto/vm.c (libretto_vm_set_error): report the multiple error. (libretto_vm_set_error): invoke an procedure for the error. (libretto_vm_main): parse a token from string. 2006-03-08 Akira TAGOH * hieroglyph/hgfile.c (hg_file_init): add objects to the root node. * libretto/lbtypes.h: new file. * hieroglyph/hgarray.c (_hg_array_real_copy): detect the circular reference. (_hg_array_real_to_string): likewise. * hieroglyph/hgmem.h (hg_mem_set_copying): new macro. (hg_mem_unset_copying): likewise. (hg_mem_is_copying): likewise. * hieroglyph/hgstring.c (_hg_string_real_to_string): check NULL. * hieroglyph/hgvaluenode.c (_hg_value_node_real_to_string): free an unnecessary object. * libretto/operator.c (_libretto_operator_op_private_write_eqeq_only): check NULL. (libretto_operator_init): add /statusdict into systemdict. * libretto/lbstack.c (_libretto_stack_use_stack_validator): new function. (libretto_stack_push): don't validate the stack if use_validator is false. * libretto/vm.c (libretto_vm_set_error): stop to use the stack validator when the error happened. (libretto_vm_main): check NULL. (libretto_vm_get_current_pool): return a special memory pool if it's in error handler. (libretto_vm_startjob): enable a executable bit for name object. (libretto_vm_main): now depends on the external PS file for the error handler. 2006-03-07 Akira TAGOH * libretto/operator.c (_libretto_operator_op_private_dicttomark): implemented. (_libretto_operator_op_countdictstack): implemented. (_libretto_operator_op_countexecstack): implemented. (_libretto_operator_op_cvx): implemented. (_libretto_operator_op_known): implemented. (_libretto_operator_load_file): removed. (libretto_operator_load_file): removed. (libretto_operator_init): set an readonly attribute to systemdict. * libretto/scanner.c (_libretto_scanner_get_object): implemented a parser for dict. * libretto/lbstack.c (_libretto_stack_push): new function. * libretto/vm.c (_libretto_vm_run): new function. (libretto_vm_startjob): allow to initialize VM with the specific PS file. (libretto_vm_clear_error): new function. (_libretto_vm_set_error): new function. (_libretto_vm_set_error_from_file): new function. (libretto_vm_run): new function. 2006-03-05 Akira TAGOH * hieroglyph/hgmatrix.c (hg_matrix_scale): new function. * libretto/operator.c (_libretto_operator_op_concatmatrix): implemented. (_libretto_operator_op_matrix): implemented. (_libretto_operator_op_scale): implemented. * libretto/lbgraphics.c (libretto_graphics_matrix_scale): new function. 2006-03-03 Akira TAGOH * hieroglyph/hgpath.c (hg_path_compute_current_point): check if currentpoint is there for lineto. (hg_path_get_bbox): likewise. * hieroglyph/hgvaluenode.c (_hg_value_node_real_dup): don't make a new object. * libretto/operator.c (_libretto_operator_op_private_for_pos_int_continue): take care of the minus value of the increment. (_libretto_operator_op_private_for_pos_real_continue): implemented. (_libretto_operator_op_lineto): check /nocurrentpoint. (_libretto_operator_op_rlineto): likewise. * lib/Makefile.am (EXTRA_DIST): added $(hgpslib_DATA) * hieroglyph/hgarray.c (_hg_array_real_to_string): check access mode. (hg_array_append): likewise. (hg_array_replace): likewise. (hg_array_remove): likewise. (hg_array_index): likewise. (hg_array_fix_array_size): likewise. (hg_array_new): set a default access mode. * hieroglyph/hgdict.c (hg_dict_node_new): set a default access mode. (hg_dict_new): likewise. (hg_dict_insert): check access mode. (hg_dict_remove): likewise. (hg_dict_lookup): likewise. (hg_dict_lookup_with_string): likewise. (hg_dict_length): likewise. * hieroglyph/hgmem.c (_hg_allocator_ffit_real_save_snapshot): set a default access mode. (hg_mem_pool_get_default_access_mode): new function. (hg_mem_pool_set_default_access_mode): new function. * hieroglyph/hgstring.c (_hg_string_real_to_string): check access mode. (hg_string_length): likewise. (hg_string_clear): likewise. (hg_string_append_c): likewise. (hg_string_append): likewise. (hg_string_insert_c): likewise. (hg_string_concat): likewise. (hg_string_index): likewise. (hg_string_get_string): likewise. (hg_string_compare): likewise. (hg_string_compare_with_raw): likewise. (hg_string_new): set a default access mode. (hg_string_fix_string_size): new function. * hieroglyph/hgpath.c (hg_path_node_new): set a default access mode. (hg_path_new): likewise. (hg_path_compute_current_point): fixed a typo. * hieroglyph/hgvaluenode.c (_hg_value_node_real_to_string): check access mode. (hg_value_node_new): set a default access mode. * hieroglyph/hgrender.c (hg_render_eofill_new): set a default access mode. (hg_render_fill_new): likewise. (hg_render_stroke_new): likewise. (hg_render_debug_new): likewise. * hieroglyph/hgfile.c (hg_file_object_new): set a default access mode. (hg_file_object_read): check access mode. (hg_file_object_write): likewise. (hg_file_object_getc): likewise. (hg_file_object_ungetc): likewise. (hg_file_object_vprintf): likewise. * libretto/operator.c (_libretto_operator_op_private_stringcvs): fixed a behavior to match the exact one. (_libretto_operator_op_aload): check the access attribute. (_libretto_operator_op_begin): likewise. (_libretto_operator_op_bind): likewise. (_libretto_operator_op_concat): likewise. (_libretto_operator_op_currentmatrix): likewise. (_libretto_operator_op_cvi): likewise. (_libretto_operator_op_def): likewise. (_libretto_operator_op_eq): likewise. (_libretto_operator_op_exec): likewise. (_libretto_operator_op_file): likewise. (_libretto_operator_op_for): likewise. (_libretto_operator_op_get): likewise. (_libretto_operator_op_gt): likewise. (_libretto_operator_op_if): likewise. (_libretto_operator_op_ifelse): likewise. (_libretto_operator_op_length): likewise. (_libretto_operator_op_loop): likewise. (_libretto_operator_op_lt): likewise. (_libretto_operator_op_print): likewise. (_libretto_operator_op_put): likewise. (_libretto_operator_op_repeat): likewise. (_libretto_operator_op_rotate): likewise. (_libretto_operator_op_setmatrix): likewise. (_libretto_operator_op_translate): likewise. (_libretto_operator_op_writestring): likewise. (_libretto_operator_op_noaccess): implemented. (libretto_operator_load_file): fixed a typo. (libretto_operator_new): set a default access mode. (libretto_operator_init): set systemdict in dict. * libretto/lbgraphics.c (libretto_graphic_state_new): set a default access mode. (libretto_graphics_new): likewise. * libretto/vm.c (libretto_vm_new): likewise. 2006-03-02 Akira TAGOH * lib/hg_init.ps: new file. * lib/hg_init_lv2.ps: new file. * lib/hg_init_lv3.ps: new file. * libretto/operator.c (_libretto_operator_load_file): new function. (libretto_operator_load_file): new function. (libretto_operator_init): initialize from PS file. * libretto/vm.c (libretto_vm_main): don't break current node in the estack. it causes segfault when scanner fails to get an object. (libretto_vm_startjob): check an return value of libretto_operator_init and if it fails, quit here immediately. * hieroglyph/hgarray.c (hg_array_fix_array_size): new function. * hieroglyph/hgpath.c (hg_path_compute_current_point): new function. * libretto/operator.c (_libretto_operator_op_concat): implemented. (_libretto_operator_op_currentpoint): implemented. (_libretto_operator_op_curveto): check /nocurrentpoint error. (_libretto_operator_op_initclip): implemented. (_libretto_operator_op_length): implemented. (_libretto_operator_op_lt): implemented. (_libretto_operator_op_setmatrix): set a path to update current matrix. * libretto/scanner.c (_libretto_scanner_get_object): check NULL. (_libretto_scanner_get_object): resize Array to fix the array size. * libretto/vm.c (libretto_vm_main): use another pool instead of local/global pool to avoid the allocation error when /VMerror happened. * libretto/lbgraphics.c (libretto_graphics_initclip): new function. 2006-03-01 Akira TAGOH * hieroglyph/hgmem.c (hg_mem_remove_root_node): fixed not to store a result. * configure.ac: add --with{,out}-x11 option. * devices/cairo/cairo-xlib-main.c (device_close): implemented. * libretto/lbgraphics.c (_libretto_graphics_real_free): destroy the pages. * hieroglyph/hgarray.c (hg_array_new): fixed the uninitialized value. * hieroglyph/hgmem.c (_hg_allocator_ffit_real_initialize): support the multiple heaps. (_hg_allocator_ffit_real_alloc): likewise. (_hg_allocator_ffit_real_free): likewise. (_hg_allocator_ffit_real_resize): likewise. (_hg_allocator_ffit_real_resize_pool): likewise. (_hg_allocator_ffit_compare): likewise. (_hg_allocator_ffit_real_garbage_collection): likewise. (_hg_allocator_ffit_snapshot_real_free): likewise. (_hg_allocator_ffit_snapshot_real_relocate): likewise. (_hg_allocator_ffit_real_save_snapshot): likewise. (_hg_allocator_ffit_real_restore_snapshot): likewise. (_hg_mem_pool_free): likewise. * libretto/operator.c (_libretto_operator_op_atan): implemented. (_libretto_operator_op_cos): implemented. (_libretto_operator_op_setmatrix): trivial fix. (_libretto_operator_op_sin): implemented. 2006-02-28 Akira TAGOH * hieroglyph/hgmatrix.[ch]: new files. * hieroglyph/hgpath.c (_hg_path_node_real_path_last): new function. (_hg_path_node_find): new function. (hg_path_find): new function. (hg_path_close): don't make a duplicate node for closepath. (hg_path_matrix): new function. * hieroglyph/hgdebug.[ch]: new files. * hieroglyph/hgrender.c (_hg_render_debug_real_set_flags): new function. (_hg_render_debug_real_relocate): new function. (hg_render_eofill_new): keep CTM in the structure. (hg_render_fill_new): likewise. (hg_render_stroke_new): likewise. (hg_render_debug_new): new function. * libretto/operator.c (_libretto_operator_op_array): allocate a node for each object. (_libretto_operator_op_currentmatrix): implemented. (_libretto_operator_op_initgraphics): implemented. (_libretto_operator_op_rotate): trivial fix. (_libretto_operator_op_setmatrix): implemented. (_libretto_operator_op_translate): trivial fix. (_libretto_operator_op_private_hg_sleep): new function. (libretto_operator_hieroglyph_init): new function. * libretto/lbgraphics.c (libretto_graphics_init): new function. (libretto_graphics_show_page): support the multiple pages. (libretto_graphics_matrix_rotate): transform the matrix to fit into cairo's device space. (libretto_graphics_matrix_translate): likewise. (libretto_graphic_state_path_new): update a snapshot matrix. (libretto_graphics_render_eofill): likewise. (libretto_graphics_render_fill): likewise. (libretto_graphics_render_stroke): likewise. (libretto_graphics_debug): new function. * devices/cairo/hgdevice-cairo.c (_hg_cairo_device_print_path): new function for debugging. (_hg_cairo_device_real_initialize): keep the page size. (_hg_cairo_device_real_initialize): use cairo_set_matrix instead of cairo_transform to manage CTM in hieroglyph. (_hg_cairo_device_real_finalize): call cairo_show_page here. (_hg_cairo_device_real_eofill): update CTM before doing anything. (_hg_cairo_device_real_fill): likewise. (_hg_cairo_device_real_stroke): likewise. (_hg_cairo_device_set_matrix): new function. (_hg_cairo_device_set_path): initialize path. (_hg_cairo_device_set_path): add HG_PATH_MATRIX support. 2006-02-26 Akira TAGOH * libretto/operator.c (libretto_operator_define_macro): check NULL. (_libretto_operator_op_and): implemented. (_libretto_operator_op_exit): implemented. (_libretto_operator_op_if): implemented. (_libretto_operator_op_sqrt): implemented. (BUILD_OP): check NULL. (libretto_operator_new): allocate one more byte memory. * libretto/lbgraphics.h (libretto_graphics_get_state): new macro. * libretto/vm.c (libretto_vm_main): revert a change to duplicate an object that isn't executable. it caused not updating an object in the dictionary say. (libretto_vm_main): shows the context of the objects in the stack. * libretto/lbgraphics.c (_libretto_graphic_state_real_set_flags): new function. (_libretto_graphic_state_real_relocate): new function. (_libretto_graphic_state_real_copy): new function. (libretto_graphic_state_new): new function. (libretto_graphics_save): implemented. (libretto_graphics_restore): implemented. 2006-02-25 Akira TAGOH * hieroglyph/hgpath.c (hg_path_get_bbox): add HG_PATH_ARC. (hg_path_arc): new function. * libretto/operator.c (_libretto_operator_op_arc): implemented. * libretto/lbgraphics.c (libretto_graphics_path_arc): new function. * devices/cairo/hgdevice-cairo.c (_hg_cairo_device_real_stroke): implemented the color conversion for HSV. (_hg_cairo_device_set_path): implemented for HG_PATH_ARC. 2006-02-21 Akira TAGOH * hieroglyph/hgpage.c (hg_page_get_size): convert mm size to unit size. * hieroglyph/hgdevice.c (hg_device_draw): added HG_RENDER_EOFILL. (hg_device_draw): call finalizer. * hieroglyph/hgpath.c (_hg_path_node_real_copy): new function. (_hg_path_real_copy): new function. (hg_path_copy): new function. (hg_path_get_bbox): new function. (hg_path_rlineto): new function. (hg_path_curveto): new function. * hieroglyph/hgrender.c (hg_render_eofill_new): new function. * libretto/operator.c (_libretto_operator_op_private_loop_continue): implemented. (_libretto_operator_op_private_repeat_continue): implemented. (_libretto_operator_op_abs): implemented. (_libretto_operator_op_aload): implemented. (_libretto_operator_op_clippath): implemented. (_libretto_operator_op_closepath): set VMerror if libretto_graphics_path_close failed. (_libretto_operator_op_curveto): implemented. (_libretto_operator_op_cvi): implemented. (_libretto_operator_op_div): implemented. (_libretto_operator_op_eofill): implemented. (_libretto_operator_op_fill): set VMerror if libretto_graphics_render_fill failed. (_libretto_operator_op_grestore): set VMerror if libretto_graphics_state_restore failed. (_libretto_operator_op_gsave): set VMerror if libretto_graphics_state_save failed. (_libretto_operator_op_gt): implemented. (_libretto_operator_op_lineto): set VMerror if libretto_graphics_path_lineto failed. (_libretto_operator_op_loop): implemented. (_libretto_operator_op_mod): implemented. (_libretto_operator_op_moveto): set VMerror if libretto_graphics_path_moveto failed. (_libretto_operator_op_mul): make an real object when it's bigger than G_MAXINT. (_libretto_operator_op_neg): implemented. (_libretto_operator_op_newpath): set VMerror if libretto_graphics_path_new failed. (_libretto_operator_op_pathbbox): implemented. (_libretto_operator_op_pop): implemented. (_libretto_operator_op_rand): implemented. (_libretto_operator_op_repeat): implemented. (_libretto_operator_op_rlineto): implemented. (_libretto_operator_op_rotate): set VMerror if libretto_graphics_matrix_rotate failed. (_libretto_operator_op_sethsbcolor): implemented. (_libretto_operator_op_srand): implemented. (_libretto_operator_op_stroke): set VMerror if libretto_graphics_render_stroke failed. (_libretto_operator_op_translate): set VMerror if libretto_graphics_matrix_translate failed. (_libretto_operator_op_truncate): implemented. (_libretto_operator_op_usertime): implemented. (libretto_operator_init): make a mark object. * libretto/vm.c (libretto_vm_new): initialize an random number generator. (libretto_vm_get_current_time): new function. (libretto_vm_get_random_generator): new function. (libretto_vm_main): drop an object if an empty array was pushed into exec stack. * libretto/lbgraphics.c (libretto_graphics_new): create an instance of clip_path. (libretto_graphics_set_page_size): new function. (libretto_graphics_set_graphic_size): new function. (libretto_graphics_path_from_clip): new function. (libretto_graphics_get_bbox_from_path): new function. (libretto_graphics_path_rlineto): new function. (libretto_graphics_path_curveto): new function. (libretto_graphics_color_set_hsv): new function. (libretto_graphics_render_eofill): new function. * devices/cairo/cairo-xlib-main.c (_cairo_xlib_real_set_page_size): removed an ad hoc code. * devices/cairo/hgdevice-cairo.c (hsv_to_rgb): new function. (_hg_cairo_device_real_initialize): removed an ad hoc code. (_hg_cairo_device_real_eofill): new function. (_hg_cairo_device_real_fill): implemented for hsv color. (_hg_cairo_device_set_path): added HG_PATH_RLINETO. 2006-02-17 Akira TAGOH * hieroglyph/hgdevice.c (hg_device_draw): add HG_RENDER_ROTATE and HG_RENDER_TRANSLATE. * hieroglyph/hgrender.c (hg_render_rotate_new): new function. (hg_render_translate_new): new function. * libretto/operator.c (_libretto_operator_op_private_arraytomark): implemented. (_libretto_operator_op_array): implemented. (_libretto_operator_op_eq): implemented. (_libretto_operator_op_get): implemented. (_libretto_opreator_op_grestore): implemented. (_libretto_operator_op_gsave): implemented. (_libretto_operator_op_ifelse): implemented. (_libretto_operator_op_mul): implemented. (_libretto_operator_op_newpath): implemented. (_libretto_operator_op_put): implemented. (_libretto_operator_op_rotate): implemented. (_libretto_operator_op_translate): implemented. * libretto/vm.c (libretto_vm_main): copy an object even if it's not an executable object. * libretto/lbgraphics.c (libretto_graphics_matrix_rotate): new function. (libretto_graphics_matrix_translate): new function. * devices/cairo/hgdevice-cairo.c (_hg_cairo_device_real_rotate): new function. (_hg_cairo_device_real_translate): new function. * hieroglyph/hgarray.c (_hg_array_real_to_string): return NULL if failed. * hieroglyph/hgmem.c (_hg_allocator_ffit_real_restore_snapshot): collect the unnecessary objects first because it prevents to success restoring snapshot. (hg_mem_pool_use_periodical_gc): new function. (hg_mem_alloc_with_flags): if it's under the periodical GC mode and the memory usage is over the threshold, try GC before allocating a memory. (hg_mem_free): this is now going to free an object immediately. be careful to use this. * hieroglyph/hgstring.c (hg_string_append): return FALSE if failed. (hg_string_concat): likewise. * hieroglyph/hgvaluenode.h (HG_VALUE_SET_SNAPSHOT): new macro. (HG_VALUE_MAKE_NAME_STATIC): terminate with NULL. (HG_VALUE_MAKE_SNAPSHOT): new macro. (HG_VALUE_GET_SNAPSHOT): new macro. (HG_IS_VALUE_SNAPSHOT): likewise. * hieroglyph/hgdict.c (_hg_dict_node_free): don't call hg_mem_free here. (hg_dict_insert): likewise. (hg_dict_remove): likewise. * hieroglyph/hgvaluenode.c (_hg_value_node_real_set_flags): support a snapshot object. (_hg_value_node_real_relocate): likewise. (_hg_value_node_real_dup): likewise. (_hg_value_node_real_copy): likewise. (_hg_value_node_real_to_string): likewise. (_hg_value_node_real_to_string): check NULL. (hg_value_node_get_hash): support all object types. (hg_value_node_compare): likewise. * libretto/operator.c (_libretto_operator_op_restore): implemented. (_libretto_operator_op_save): implemented. * libretto/scanner.c (_libretto_scanner_get_object): destroy an unnecessary object immediately. * libretto/lbgraphics.c (_libretto_graphics_real_free): destroy the pages. (libretto_graphics_new): take care of the multiple pages. * examples/cairo-xlib.c: new file. * hieroglyph/hgarray.c (hg_array_new): allow an empty array. * hieroglyph/hgdevice.c (hg_device_draw): support HG_RENDER_STROKE. * hieroglyph/hgrender.c (_hg_render_stroke_real_set_flags): new function. (_hg_render_stroke_real_relocate): new function. (hg_render_fill_new): fixed a typo. (hg_render_stroke_new): new function. * libretto/lbgraphics.c (libretto_graphics_new): check if an error happened. (libretto_graphics_render_stroke): implemented. * devices/cairo/cairo-xlib-main.c: reimplemented. * devices/cairo/hgdevice-cairo.[ch]: reimplemented. * hieroglyph/hgmem.c (_hg_allocator_ffit_traverse_for_gc): don't collect an object if it's locked. * hieroglyph/hgpage.c (hg_page_append_node): new function. * hieroglyph/hgdevice.[ch]: new files. * hieroglyph/hgpath.[ch]: new files. * hieroglyph/hgmem.h (hg_mem_set_lock): new macro. (hg_mem_set_unlock): likewise. (hg_mem_is_locked): likewise. * hieroglyph/hgrender.[ch]: new files. * libretto/vm.c (libretto_vm_new): make a memory pool for graphics. * libretto/lbgraphics.[ch]: new files, which was moved from hggraphics.[ch]. 2006-02-16 Akira TAGOH * hieroglyph/hgarray.c (_hg_array_real_set_flags): refers current. (_hg_array_real_relocate): relocate a current array pointer. (_hg_array_real_dup): duplicate an array from current array pointer. (_hg_array_real_copy): likewise. (_hg_array_real_to_string): refers current array pointer. (hg_array_append): if there are any removed array, then failed. (hg_array_remove): if index is 0, just increase a pointer to speed up. * hieroglyph/hggraphics.[ch]: new files. * libretto/operator.c (_libretto_operator_op_clear): implemented. (_libretto_operator_op_cleardictstack): implemented. (_libretto_operator_op_closepath): implemented. (_libretto_operator_op_dup): implemented. (_libretto_operator_op_end): implemented. (_libretto_operator_op_fill): implemented. (_libretto_operator_op_lineto): implemented. (_libretto_operator_op_moveto): implemented. (_libretto_operator_op_roll): implemented. (_libretto_operator_op_setgray): implemented. (_libretto_operator_op_setlinewidth): implemented. (_libretto_operator_op_setrgbcolor): implemented. (_libretto_operator_op_showpage): implemented. (_libretto_operator_op_stroke): implemented. * libretto/lbstack.c (libretto_stack_roll): new function. * libretto/vm.c (libretto_vm_get_graphics): new function. 2006-02-15 Akira TAGOH * libretto/scanner.c (_libretto_scanner_get_object): escape from the loop after an array is terminated. * hieroglyph/hgpage.[ch]: new files. * Makefile.am: modified to install .pc files. * configure.ac: modified to generate .pc files. * tests/hgpage.c: new testcase. * hieroglyph.pc.in: new file. * hg-libretto.pc.in: new file. 2006-02-14 Akira TAGOH * hieroglyph/hgstring.c (_hg_string_real_to_string): convert the unvisible characters to the visible characters. * hieroglyph/hgvaluenode.c (_hg_value_node_real_to_string): quote a string with (). * libretto/operator.c (_libretto_operator_op_private_stringcvs): implemented. (_libretto_operator_op_writestring): implemented. * libretto/scanner.c (_libretto_scanner_get_object): convert \\ stuff. * hieroglyph/hgarray.c (_hg_array_real_copy): new function. * hieroglyph/hgmem.c (hg_object_dup): check HgObject ID. (hg_object_copy): new function. * hieroglyph/hgvaluenode.c (_hg_value_node_real_copy): new function. * libretto/operator.c (_libretto_operator_op_private_for_pos_int_continue): copy a node to avoid an array object breakage. (_libretto_operator_op_exec): likewise. * libretto/vm.c (libretto_vm_main): copy a node to avoid an object breakage in dict. * hieroglyph/hgarray.c (_hg_array_real_dup): new function. (_hg_array_real_to_string): new function. * hieroglyph/hgmem.c (_hg_allocator_ffit_real_resize): set the stack end again. it may breaks after the memory allocation. (_hg_allocator_ffit_snapshot_real_to_string): new function. (hg_object_dup): new function. * hieroglyph/hgstring.c (_hg_string_real_to_string): new function. (hg_string_concat): new function. (hg_object_to_string): new function. * hieroglyph/hgmacros.h (HG_SET_STACK_END_AGAIN): new macro. * hieroglyph/hgdict.c (_hg_dict_real_to_string): new function. * hieroglyph/hgvaluenode.c (_hg_value_node_real_set_flags): check NULL. (_hg_value_node_real_dup): new function. (_hg_value_node_real_to_string): new function. * hieroglyph/hgfile.c (_hg_file_object_real_to_string): new function. (hg_file_object_new): fixed a typo. * libretto/operator.c (_libretto_operator_op_private_for_pos_int_continue): reimplemented. (_libretto_operator_op_private_write_eqeq_only): reimplemented. (_libretto_operator_op_begin): reimplemented. (_libretto_operator_op_count): reimplemented. (_libretto_operator_op_def): reimplemented. (_libretto_operator_op_dict): reimplemented. (_libretto_operator_op_exch): reimplemented. (_libretto_operator_op_exec): reimplemented. (_libretto_operator_get_file_type): new function. (_libretto_operator_get_file_mode): new function. (_libretto_operator_op_file): reimplemented. (_libretto_operator_op_for): reimplemented. (_libretto_operator_op_index): reimplemented. (_libretto_operator_op_print): reimplemented. (_libretto_operator_op_sub): reimplemented. (_libretto_operator_real_to_string): new function. (BUILD_OP): set an executable bit. * libretto/lbstack.c (_libretto_stack_real_dup): new function. * libretto/vm.c (libretto_vm_get_io): new function. (libretto_vm_set_io): likewise. (libretto_vm_main): implemented the handler of proc. 2006-02-12 Akira TAGOH * hieroglyph/hgmem.c (_hg_allocator_ffit_real_free): trivial fix. (_hg_allocator_ffit_real_resize): likewise. (_hg_allocator_ffit_real_resize_pool): likewise. (_hg_allocator_ffit_snapshot_real_set_flags): mark a snapshot itself. (_hg_allocator_ffit_snapshot_real_relocate): resize a private object. * hieroglyph/hgstring.c (hg_string_append_c): return FALSE if resize failed. (hg_string_get_string): terminate with 0 here. * hieroglyph/hgbtree.c (hg_btree_page_insert): avoid an unnecessary loop. (hg_btree_page_remove): likewise. (hg_btree_find): likewise. (hg_btree_find_near): new function. * hieroglyph/hgfile.c (_hg_file_object_real_set_flags): check if is.buf.buffer is NULL. (_hg_file_object_real_relocate): likewise. * libretto/scanner.c (_libretto_scanner_get_object): initialize with NULL. 2006-02-08 Akira TAGOH * hieroglyph/hgmem.c (_hg_allocator_ffit_real_resize): don't resize if the unnecessary memory is less than sizeof (HgMemObject). 2006-02-07 Akira TAGOH * hieroglyph/hgmem.c (_hg_allocator_ffit_real_save_snapshot): allocate a memory from system for snapshot of heap. * libretto/vm.[ch]: reimplemented. * libretto/operator.[ch]: reimplemented. * libretto/scanner.[ch]: reimplemented. 2006-02-06 Akira TAGOH * hieroglyph/hgarray.c (_hg_array_real_set_flags): use inline. * hieroglyph/hgmem.c (_hg_allocator_ffit_snapshot_real_set_flags): use inline. (hg_mem_set_flags): removed. (hg_mem_get_flags): removed. (hg_mem_add_flags): removed. (hg_mem_is_flags): removed. (hg_mem_get_object): removed. * hieroglyph/hgstring.c (_hg_string_real_set_flags): use inline. * hieroglyph/hgdict.c (_hg_dict_traverse_set_flags): use inline. (_hg_dict_node_real_set_flags): use inline. * hieroglyph/hgmem.h (hg_mem_get_object__inline_nocheck): new macro. (hg_mem_get_object__inline): new macro. (hg_mem_is_flags__inline): new macro. (hg_mem_get_flags__inline): new macro. (hg_mem_set_flags__inline): new macro. (hg_mem_add_flags__inline): new macro. * hieroglyph/hgvaluenode.c (_hg_value_node_real_set_flags): use inline. * hieroglyph/hgfile.c (_hg_file_object_real_set_flags): use inline. * libretto/lbstack.c (_libretto_stack_real_set_flags): use inline. * hieroglyph/hgarray.c (_hg_array_real_free): removed. * hieroglyph/hgmem.c (hg_mem_get_object__inline): new macro. (_hg_allocator_ffit_traverse_for_destroy): new function. (_hg_allocator_ffit_real_destroy): use hg_btree_foreach instead of iter. (_hg_allocator_ffit_traverse_for_relocation): new function. (_hg_allocator_ffit_relocate): relocate the variables which is located on the object that isn't allocated with the targetted pool. (_hg_allocator_ffit_relocate): use hg_btree_foreach instead of iter. (_hg_allocator_ffit_traverse_for_gc): new function. (_hg_allocator_ffit_traverse_for_gc_destroyed): new function. (_hg_allocator_ffit_real_garbage_collection): use hg_btree_foreach instead of iter. * hieroglyph/hgstring.c (_hg_string_real_free): removed. * hieroglyph/hgbtree.c (hg_btree_page_remove): fixed a typo. * hieroglyph/hgdict.c (_hg_dict_node_real_free): removed. * hieroglyph/hgvaluenode.c (_hg_value_node_real_free): removed. 2006-02-05 Akira TAGOH * examples/pse.c: reimplemented. * hieroglyph/hgmem.c (_hg_allocator_ffit_real_garbage_collection): join much more free spaces. (hg_mem_add_root_node): save the root node list. * hieroglyph/hgvaluenode.h (HG_VALUE_REAL_SIMILAR): new macro. * hieroglyph/hgfile.c (hg_stdout_printf): fixed a typo. (hg_stderr_printf): fixed a typo. 2006-02-04 Akira TAGOH * hieroglyph/hgarray.c (hg_array_new): support the variable sized array. (hg_array_append): resize an array when allocated array is full. * hieroglyph/hgmem.c (_hg_allocator_ffit_real_resize_pool): allocate much more memory if block_size is bigger than the initial allocated size. (_hg_allocator_ffit_real_garbage_collection): copy the object to new tree to avoid non-marking accidentally. * hieroglyph/hgvaluenode.h (HG_VALUE_SET_FILE): new macro. (HG_VALUE_MAKE_FILE): likewise. (HG_VALUE_GET_FILE): likewise. (HG_IS_VALUE_FILE): likewise. * hieroglyph/hgvaluenode.c (_hg_value_node_real_free): add file object support. (_hg_value_node_real_set_flags): likewise. (_hg_value_node_real_relocate): likewise. (hg_value_node_get_hash): likewise. (hg_value_node_compare): likewise. * hieroglyph/hgfile.c (hg_file_object_has_error): renamed. * libretto/lbstack.c (libretto_stack_pop): fixed a crash when the stack has just one item after pop. 2006-02-02 Akira TAGOH * hieroglyph/hgmem.c (_hg_allocator_ffit_relocate): new function. (_hg_allocator_ffit_real_resize): new function. (hg_mem_resize): new function. * hieroglyph/hgstring.c (hg_string_new): support a variable sized string. (hg_string_append_c): resize a string when the allocated size is full. (hg_string_append): likewise. 2006-02-01 Akira TAGOH * hieroglyph/hgmem.c (hg_object_get_state): new function. (hg_object_set_state): likewise. (hg_object_add_state): likewise. (hg_object_is_state): likewise. * hieroglyph/hgbtree.c (hg_btree_page_blance): check null. (hg_btree_page_blance): fixed a typo that causes a memory corruption. * hieroglyph/hgmem.h (hg_object_readable): new macro. (hg_object_unreadable): new macro. (hg_object_is_readable): new macro. (hg_object_writable): new macro. (hg_object_is_writable): new macro. (hg_object_unwritable): new macro. (hg_object_executable): new macro. (hg_object_unexecutable): new macro. (hg_object_is_executable): new macro. * hieroglyph/hgvaluenode.c (_hg_value_node_real_free): added null and mark object support. (_hg_value_node_real_set_flags): likewise. (_hg_value_node_real_relocate): likewise. * hieroglyph/hgarray.c (_hg_array_real_relocate): use HgMemRelocateInfo. * hieroglyph/hgmem.c (_hg_allocator_ffit_real_resize_pool): use HgMemRelocateInfo. (_hg_allocator_ffit_snapshot_real_relocate): likewise. * hieroglyph/hgstring.c (_hg_string_real_relocate): use HgMemRelocateInfo. * hieroglyph/hgdict.c (_hg_dict_traverse_relocate): use HgMemRelocateInfo. (_hg_dict_real_relocate): likewise. (_hg_dict_node_real_relocate): likewise. * hieroglyph/hgvaluenode.c (_hg_value_node_real_relocate): use HgMemRelocateInfo. * hieroglyph/hgfile.c (_hg_file_object_real_relocate): use HgMemRelocateInfo. (hg_file_object_new): get a buffer size as gint32 instead of gsize. * libretto/lbstack.c (_libretto_stack_real_relocate): use HgMemRelocateInfo. 2006-01-31 Akira TAGOH * hieroglyph/hgvaluenode.h (HG_VALUE_SET_MARK): new macro. (HG_VALUE_MAKE_MARK): new macro. (HG_VALUE_GET_MARK): new macro. (HG_IS_VALUE_MARK): new macro. * hieroglyph/hgdict.c (_hg_dict_node_compare_with_string): new function. (hg_dict_lookup_with_string): new function. * hieroglyph/hgfile.c (hg_file_object_new): resize the buffer size if the given is less than zero. * libretto/lbstack.c (libretto_stack_index): fixed a typo. * hieroglyph/hgvaluenode.h (HG_VALUE_SET_NULL): new macro. (HG_VALUE_SET_POINTER): likewise. (HG_VALUE_MAKE_NULL): likewise. (HG_VALUE_MAKE_POINTER): likewise. (HG_VALUE_GET_NULL): likewise. (HG_VALUE_GET_POINTER): likewise. (HG_IS_VALUE_NULL): likewise. (HG_IS_VALUE_POINTER): likewise. * hieroglyph/hgfile.c (hg_file_object_ungetc): new function. 2006-01-29 Akira TAGOH * hieroglyph/hgmem.c (hg_mem_pool_allow_resize): new function. * hieroglyph/hgarray.c (_hg_array_real_set_flags): use hg_mem_add_flags instead of hg_mem_use_flags. * hieroglyph/hgmem.c (_hg_allocator_ffit_snapshot_real_free): new function. (_hg_allocator_ffit_snapshot_real_set_flags): likewise. (_hg_allocator_ffit_snapshot_real_relocate): likewise. (_hg_allocator_ffit_snapshot_traverse_save): likewise. (_hg_allocator_ffit_snapshot_traverse_complex_object): likewise. (_hg_allocator_ffit_real_restore_snapshot): implemented. (hg_mem_garbage_collection): new function. (hg_mem_alloc_with_flags): likewise. (hg_mem_add_flags): likewise. * hieroglyph/hgstring.c (_hg_string_real_set_flags): new function. (_hg_string_real_relocate): new function. * hieroglyph/hgvaluenode.h (HG_VALUE_MAKE_NAME_STATIC): new macro. (HG_VALUE_SET_NAME_STATIC): new macro. * hieroglyph/hgdict.c (_hg_dict_traverse_set_flags): fixed to not set flags properly. (_hg_dict_traverse_relocate): new function. (_hg_dict_real_relocate): new function. (_hg_dict_node_real_set_flags): use hg_mem_add_flags instead of hg_mem_set_flags. * hieroglyph/hgfile.c (_hg_file_object_real_set_flags): use hg_mem_add_flags instead of hg_mem_set_flags. * hieroglyph/hgvaluenode.c (_hg_value_node_real_set_flags): likewise. 2006-01-25 Akira TAGOH * hieroglyph/hgbtree.c (_hg_btree_count_traverse): new function. (hg_btree_length): likewise. * hieroglyph/hgmem.h (hg_mem_complex_mark): new macro. (hg_mem_complex_unmark): likewise. (hg_mem_is_complex_mark): likewise. * libretto/lbstack.c (libretto_stack_new): check if allocation was failed. * hieroglyph/hgstring.c (hg_string_new): likewise. * hieroglyph/hgdict.c (hg_dict_new): likewise. * hieroglyph/hgvaluenode.c (hg_value_node_new): likewise. * hieroglyph/hgfile.c (hg_file_object_new): likewise. * hieroglyph/hgmem.c (hg_mem_pool_save_snapshot): new function. (hg_mem_pool_restore_snapshot): new function. * hieroglyph/hgvaluenode.c (_hg_value_node_real_free): add Array support. (_hg_value_node_real_set_flags): likewise. (_hg_value_node_real_relocate): likewise. (hg_value_node_get_hash): likewise. (hg_value_node_compare): likewise. * hieroglyph/hgvaluenode.h (hg_value_node_restorable): new macro. (hg_value_node_is_restorable): likewise. * hieroglyph/hgmem.h (hg_mem_restorable): new macro. (hg_mem_is_restorable): likewise. * hieroglyph/hgmem.c (_hg_allocator_ffit_real_gc_mark): try to mark the object from the root node. (hg_mem_add_root_node): new function. (hg_mem_remove_root_node): new function. (hg_mem_pool_destroy): free the root node. (_hg_allocator_ffit_real_resize_pool): try to relocate the addresses in the root node. (hg_mem_pool_save_snapshot): new function. (hg_mem_pool_restore_snapshot): new function. 2006-01-24 Akira TAGOH * libretto/lbstack.c (_libretto_stack_real_set_flags): implemented. (_libretto_stack_real_relocate): implemented. * libretto/lbstack.[ch]: reimplemented. * hieroglyph/hgfile.[ch]: reimplemented. 2006-01-23 Akira TAGOH * hieroglyph/hgdict.c (_hg_dict_traverse_set_flags): new function. (_hg_dict_real_set_flags): likewise. (_hg_dict_node_real_set_flags): likewise. (_hg_dict_node_real_relocate): likewise. * hieroglyph/hgvaluenode.c (_hg_value_node_real_relocate): new function. * hieroglyph/hgarray.c (_hg_array_real_set_flags): new function. (_hg_array_real_relocate): likewise. * hieroglyph/hgmem.c (_hg_allocator_ffit_real_resize_pool): recompute all the addresses. (hg_mem_set_flags): notify to all the children objects. (hg_mem_get_object): new function. * hieroglyph/hgvaluenode.c (_hg_value_node_real_free): added name and dict object. (_hg_value_node_real_set_flags): new function. (hg_value_node_get_hash): added name and dict object. (hg_value_node_compare): likewise. 2006-01-21 Akira TAGOH * hieroglyph/hgmem.c (_hg_allocator_ffit_real_garbage_collection): implemented GC. (_hg_allocator_ffit_real_gc_mark): new function. (_hg_mem_free): moved out from hg_mem_free. (hg_mem_set_stack_end): new function. (hg_mem_free): do nothing if allocator supports GC. (hg_mem_set_flags): new function. (hg_mem_get_flags): likewise. (hg_mem_is_flags): likewise. * hieroglyph/hgbtree.c (hg_btree_page_foreach): fixed not to pick up some nodes. (hg_btree_page_get_iter): new function. (hg_btree_iter_new): likewise. (hg_btree_iter_free): likewise. (hg_btree_get_iter_first): likewise. (hg_btree_get_iter_next): likewise. (hg_btree_is_iter_valid): likewise. (hg_btree_update_iter): likewise. (hg_btree_first): removed. * hieroglyph/hgmem.h (hg_mem_gc_mark): new macro. (hg_mem_gc_unmark): likewise. (hg_mem_is_gc_mark): likewise. 2006-01-20 Akira TAGOH * hieroglyph/hgvaluenode.c (hg_value_node_get_hash): support HG_TYPE_VALUE_STRING. * hieroglyph/hgstring.[ch]: reimplemented. * hieroglyph/hgmem.c (_hg_mem_init_stack_start): use __libc_stack_end instead of the value where from /proc/self/stat. (_hg_allocator_ffit_real_destroy): destroy all the node. (_hg_allocator_ffit_real_alloc): fixed a memory leak. (_hg_allocator_ffit_compare): fixed not to sort out properly. * hieroglyph/hgbtree.c (hg_btree_page_foreach): fixed a typo. (hg_btree_page_first): new function. (hg_btree_first): new function. * hieroglyph/hgdict.c (_hg_dict_node_free): new function. (_hg_dict_destroy): destroy the node instance as well. (hg_dict_new): don't set a destroyer function where called at destroying, to avoid the loop between the allocator destroyer. (hg_dict_remove): remove the hash key when there are no items for that anymore. * hieroglyph/hgmem.c (_hg_allocator_ffit_real_resize_pool): align to the block size. * hieroglyph/hgdict.[ch]: reimplemented. * hieroglyph/hgvaluenode.c (hg_value_node_get_hash): new function. (hg_value_node_compare): likewise. 2006-01-19 Akira TAGOH * hieroglyph/hgarray.[ch]: reimplemented. * hieroglyph/hgmem.c (_hg_mem_init_stack_start): new function to determine the stack location. (_hg_allocator_get_block_id): fixed a problem that the return value could be less than the given size. (_hg_allocator_ffit_real_alloc): put an identity to recognize an object. (_hg_allocator_ffit_real_free): forgot to add a free block to the list. (hg_mem_init): implemented. (hg_mem_finalize): new function. (hg_mem_free): free an object without a memory pool because the given pool could be the different thing. so tell the object which one was your mother. * hieroglyph/hgbtree.c (hg_btree_page_foreach): make it possible to give an extra data. (hg_btree_foreach): likewise. * hieroglyph/hgvaluenode.[ch]: reimplemented. 2006-01-18 Akira TAGOH * hieroglyph/hgmem.[ch]: reimplemented a lot. * hieroglyph/hgmacros.h: new file. 2006-01-17 Akira TAGOH * hieroglyph/hgbtree.c (hg_btree_page_destroy): fixed a memory leak. (hg_btree_page_insert): fixed a typo. (hg_btree_page_insert): free a val when it's called as replaced. (hg_btree_replace): new function. 2006-01-16 Akira TAGOH * hieroglyph/hgbtree.[ch]: new files. 2006-01-13 Akira TAGOH * hieroglyph/hgmem.c (hg_mem_save_object_new): make it speeding up a bit. * hieroglyph/hgfile.c (_hg_file_object_free__internal): mmap support. (hg_file_object_new): likewise. (hg_file_object_is_error): likewise. (hg_file_object_read): likewise. (hg_file_object_read_line): likewise. (hg_file_object_write): likewise. (hg_file_object_seek): likewise. (hg_file_object_getchar): new function. * libretto/scanner.c (libretto_scanner_get_token): make it speeding up a bit. 2006-01-11 Akira TAGOH * hieroglyph/hgarray.c (hg_array_new): try GC when the memory allocation was failed. (hg_array_length__internal): removed. * hieroglyph/hgmem.c (_gg_list_reverse_find): new function. (hg_mem_save_object_new): try GC when the memory allocation was failed. (hg_mem_object_new): likewise. (hg_mem_object_gc_append_root): new function. (hg_mem_object_gc_remove_root): new function. (hg_mem_gc_mark_from_root_node__internal): new function. (hg_mem_gc_mark_from_root_node): new function. * hieroglyph/hgstring.c (hg_string_new): try GC when the memory allocation was failed. * hieroglyph/hgdict.c (_hg_dict_real_dup): new function. (hg_dict_new): try GC when the memory allocation was failed. * hieroglyph/hgvaluenode.c (hg_value_node_new): return NULL when hg_mem_object_new was failed. * hieroglyph/hgfile.c (_hg_file_object_real_to_string): new function. (hg_file_object_read_line): don't try to copy the buffer more than the buffer size. (hg_file_object_seek): new function. * configure.ac: check if fseeko is available. * libretto/operator.c (_libretto_operator_op_begin): implemented. (_libretto_operator_op_def): implemented. (_libretto_operator_op_dict): implemented. (_libretto_operator_op_exec): implemented. * libretto/scanner.c (_libretto_scanner_get_next_token): parse a token from the file object instead of String. (libretto_scanner_get_object): return NULL when there are no token. * libretto/vm.c (libretto_vm_new): enable the statement edit scanning by default. (libretto_vm_new): add the stacks, the dictionaries to the root node to get GC working. (libretto_vm_init): wrap up the dictionaries with HgValueNode before pushing them into the stack. (libretto_vm_exec): don't set an executable flag to the name object since Array has the proper flag. (libretto_vm_exec): get a token from the file object directly. 2006-01-06 Akira TAGOH * hieroglyph/hgarray.c (_hg_array_real_gc_marker): call hg_value_node_node_gc_mark__internal instead of its own codes for the nodes. (_hg_array_real_gc_lock): likewise. (_hg_array_real_to_string): likewise. * hieroglyph/hgdict.c (_hg_dict_real_gc_marker): call hg_value_node_node_gc_mark__internal instead of its own codes for the nodes. (_hg_dict_real_gc_lock): likewise. (_hg_dict_node_gc_marker): removed. (_hg_dict_node_gc_lock): removed. * hieroglyph/hgvaluenode.c (_hg_value_node_real_gc_lock): new function. (_hg_value_node_real_to_string): new function. (_hg_value_node_real_dup): new function. (hg_value_node_node_gc_mark__internal): new function. (hg_value_node_node_gc_lock__internal): new function. (hg_value_node_node_to_string__internal): new function. (hg_value_node_node_dup__internal): new function. (hg_value_node_compare): new function. * libretto/scanner.c (_libretto_scanner_get_next_token): clean the buffer up when a line is only a comment. * libretto/lbstack.c (_libretto_stack_real_gc_marker): call hg_value_node_node_gc_mark__internal instead of having its own code for the nodes. (_libretto_stack_real_gc_lock): likewise. * libretto/vm.c (libretto_vm_set_emulation_level): new function. (libretto_vm_exec): fixed a fail when comment appears in the string. * hieroglyph/hgarray.c (_hg_array_real_to_string): output a string without / if the name object has an executable flag. (_hg_array_real_dup): new function. (hg_array_length__internal): new function. (hg_array_append__internal): likewise. (hg_array_replace_with_index__internal): likewise. * hieroglyph/hgstring.c (hg_string_real_length__internal): new function. (hg_string_get_character__internal): new function. * hieroglyph/hgvaluenode.[ch]: new files. * hieroglyph/hgfile.c (hg_file_object_is_error): renamed from hg_file_is_accessible. (hg_file_object_get_error): new function. * libretto/operator.c (_libretto_operator_op_private_for_pos_int_continue): implemented. (_libretto_operator_op_private_write_eqeq_only): implemented. (_libretto_operator_op_bind): implemented. (_libretto_operator_op_count): implemented. (_libretto_operator_op_exch): implemented. (_libretto_operator_get_open_type): new function. (_libretto_operator_get_access_type): new function. (_libretto_operator_op_file): implemented. (_libretto_operator_op_for): implemented. (_libretto_operator_op_index): implemented. (_libretto_operator_op_print): implemented. (_libretto_operator_op_sub): implemented. (_libretto_operator_op_writestring): implemented. (libretto_operator_init): defined /write==only, /==only, /== and /pstack operator. * libretto/scanner.c (_libretto_scanner_parse_string): convert \n, \r, \t, \b and \f to the actual control characters. (_libretto_scanner_get_next_token): fixed a typo. (libretto_scanner_get_object): use hg_value_node_new instead of hg_mem_object_new. * libretto/vm.c (_libretto_vm_examine_object): make a duplicate object to avoid an array breakage. (libretto_vm_destroy): destroy a scanner object. (libretto_vm_file_set_error): new function. (libretto_vm_exec): implemented a procedure for array. (libretto_vm_exec): make a duplicate object to avoid an array breakage. (libretto_vm_exec): implemented a trivial code to dump current ostack and estack. (FIXME: it should be done by PS code) 2006-01-05 Akira TAGOH * hieroglyph/hgarray.c (_hg_array_real_gc_marker): support HG_TYPE_FILE object. (_hg_array_real_to_string): new function. * hieroglyph/hgmem.c (hg_mem_object_dup): new function. (hg_mem_object_to_string_internal): new function. (hg_mem_object_to_string): new function. * hieroglyph/hgstring.c (_hg_string_real_to_string): new function. (hg_string_real_length): new function. * hieroglyph/hgtypes.c (hg_value_compare): support HG_TYPE_FILE object. * hieroglyph/hgdict.c (_hg_dict_node_gc_marker): support HG_TYPE_FILE object. (_hg_dict_node_gc_lock): likewise. (_hg_dict_hash): likewise. (_hg_dict_real_to_string): new function. * hieroglyph/hgmem.h (hg_mem_object_set_node_internal): new macro. (hg_mem_object_set_node): likewise. (hg_mem_object_copy_node_internal): likewise. (hg_mem_object_copy_node): likewise. * hieroglyph/hgfile.c (_hg_file_get_access_mode): new function. (hg_file_object_is_accessible): likewise. * libretto/operator.c (libretto_operator_define_macro): a macro to define the couple of PS object. (libretto_operator_op_private_gstringcvs): implemented. (libretto_operator_op_add): implemented. (_libretto_operator_real_to_string): new function. (libretto_operator_init): define /write=only, /=only and /= operator. (libretto_operator_get_name): new function. * libretto/scanner.c: reimplemented. * libretto/lbstack.c (_libretto_stack_real_gc_marker): support HG_TYPE_FILE object. * libretto/vm.c (_libretto_vm_examine_object): new function. (libretto_vm_new): initialize a scanner. (libretto_vm_set_estack): new function. (libretto_vm_is_error): likewise. (libretto_vm_set_error): likewise. (libretto_vm_exec): implemented. 2005-12-30 Akira TAGOH * hieroglyph/hgfile.[ch]: new files. * hieroglyph/hgmem.c (hg_mem_chunk_new): new function. (hg_mem_chunk_ref): likewise. (hg_mem_chunk_unref): likewise. (hg_mem_chunk_alloc): likewise. (hg_mem_chunk_alloc0): likewise. (hg_mem_chunk_free): likewise. (hg_mem_is_internal): likewise. (hg_mem_object_is_internal): likewise. (hg_mem_object_is): likewise. * hieroglyph/hgtypes.h (HG_VALUE_SET_NAME): fixed a typo. * hieroglyph/hgdict.c (hg_dict_lookup_internal): new function. * hieroglyph/hgmem.h (hg_mem_chunk_create): new macro. (hg_chunk_new): likewise. (hg_chunk_new0): likewise. (hg_chunk_free): likewise. (hg_mem_object_is_executable_internal): likewise. (hg_mem_object_is_executable): likewise. * libretto/operator.c (libretto_operator_call): new function. * libretto/lbstack.c (libretto_stack_index): new function. * libretto/vm.c (libretto_vm_get_userdict): new function. (libretto_vm_get_errordict): likewise. (libretto_vm_get_errorhandlerdict): likewise. (libretto_vm_get_io): likewise. (libretto_vm_set_io): likewise. (libretto_vm_init): initialize operators here. (libretto_vm_lookup_operator): new function. (libretto_vm_exec): likewise. 2005-12-29 Akira TAGOH * hieroglyph/hgarray.c (_hg_array_real_gc_marker): added null/pointer object support. (_hg_array_real_gc_lock): new function. * hieroglyph/hgmem.c (_hg_mem_gc_compute_relocatable): don't swap a start pointer and an end pointer when end is null. (hg_mem_gc_lock_internal): new function. (hg_mem_object_gc_lock_internal): new function. (hg_mem_object_gc_lock): new function. (hg_mem_object_gc_mark_internal): don't mark HG_FL_MARK when it has already been marked. * hieroglyph/hgtypes.c (hg_value_compare): added null/pointer object support. * hieroglyph/hgdict.c (_hg_dict_node_gc_marker): added null/pointer object support. (_hg_dict_node_gc_lock): new function. (_hg_dict_real_gc_lock): likewise. (_hg_dict_hash): added null/pointer object support. (hg_dict_insert_internal): new function. * hieroglyph/hgmem.h: added gc_lock function pointer. * libretto/lbstack.c (_libretto_stack_real_gc_marker): added null/pointer object support. (_libretto_stack_real_gc_lock): new function. * libretto/vm.c (libretto_vm_new): validate an allocated memory. (libretto_vm_get_emulation_level): new function. (libretto_vm_get_systemdict): likewise. (libretto_vm_get_current_pool): likewise. (libretto_vm_is_global_pool_used): likewise. (libretto_vm_use_global_pool): likewise. (libretto_vm_get_ostack): likewise. (libretto_vm_get_estack): likewise. (libretto_vm_get_dstack): likewise. (libretto_vm_init): use a local pool by default. (libretto_vm_startjob): new function. * libretto/operator.[ch]: new files. 2005-12-27 Akira TAGOH * configure.ac: added -Werror to CFLAGS to be sane. * libretto/inputdevice.[ch]: new files. * hieroglyph/hgmem.c (_hg_mem_save_object_free_internal): fixed an wrong free. (hg_mem_save_object_new): increase an reference count for the allocated object. (hg_mem_save_object_free): validate the heap memory before restoring. * hieroglyph/hgtypes.h: added mark value. * hieroglyph/hgstring.c (hg_string_set_string): reset error status. (hg_string_put_character): set an error if it's out of range. (hg_string_get_character): likewise. * hieroglyph/hgdict.c (hg_dict_new): initialize nodes. * hieroglyph/hgmem.h (hg_mem_mark_complex_object_internal): new macro. (hg_mem_object_mark_complex_object_internal): likewise. (hg_mem_object_mark_complex_object): likewise. (hg_mem_executable_internal): likewise. (hg_mem_object_executable_internal): likewise. (hg_mem_object_executable): likewise. * libretto/scanner.[ch]: modified to sit down on the current memory management system. * libretto/lbstack.[ch]: new files. * libretto/vm.[ch]: new files. 2005-12-26 Akira TAGOH * hieroglyph/hgmem.c (_hg_mem_save_object_free_internal): new function. (hg_mem_init): set GAllocator here. (hg_mem_is_initialized): new function. (hg_mem_save_object_new): new function. (hg_mem_save_object_free): new function. (hg_mem_alloc): don't fail allocation even if atom_size <= 0. 2005-12-25 Akira TAGOH * hieroglyph/hgdict.c (_hg_dict_hash_node_lookup): new function. (hg_dict_insert): replace the value when the key was already registered. * hieroglyph/hgmem.c (hg_mem_pool_new): initialize all member variables in structure. (hg_mem_pool_allow_heap_expansion): removed. (hg_mem_pool_set_emulation_level): new function. (hg_mem_pool_get_emulation_level): new function. (hg_mem_object_gc_mark_internal): new function. (hg_mem_gc_start): check why the lock failed and retry to lock if GC isn't still running. (hg_mem_gc_suspend): new function. * hieroglyph/hgstring.c (hg_string_compare): new function. * hieroglyph/hgtypes.c: new file. * hieroglyph/hgdict.[ch]: new files. * hieroglyph/hgmem.h (hg_mem_object_restorable_internal): new macro. (hg_mem_object_restorable): likewise. (hg_mem_object_relocatable_internal): likewise. (hg_mem_object_relocatable): likewise. 2005-12-21 Akira TAGOH * hieroglyph/hgtypes.h: new file. * hieroglyph/hgmem.c: added the reverse map to object and function pointer to free it. (_hg_mem_object_free_internal): new function to do it without lock. (hg_mem_pool_allow_heap_expansion): do lock. (hg_mem_pool_lookup): new function to lookup the list which contains HgMem. (hg_mem_alloc): removed lock stuff. (hg_mem_free): likewise. (hg_mem_set_destroyer): new function. (hg_mem_object_new): trivial fix. (hg_mem_object_get_status): new function. (hg_mem_object_set_status): new function. (hg_mem_gc_mark_internal): new function. (hg_mem_gc_mark): new function. * hieroglyph/hgstring.[ch]: new files for handling string. * hieroglyph/hgerror.h: error definition file. * hieroglyph/hgarray.[ch]: new files for the array. 2005-12-19 Akira TAGOH * hieroglyph/hgmem.[ch]: new file for the memory management. 2005-12-03 Akira TAGOH * tests/doretree.ps: added a testcase. * tests/snowflak.ps: added a testcase. * tests/run.sh: added. * devices/cairo/hgdevice-cairo.c, libretto/lvstring.c, libretto/lvarray.c, libretto/lvarray.h, libretto/lvdict.c, libretto/operator.c, libretto/lvmark.c, hieroglyph/hgvalue-string.c, hieroglyph/hgfilter.c, hieroglyph/hgvalue-boolean.c, hieroglyph/hgvalue-name.c, hieroglyph/hgvalue-real.c, hieroglyph/hgvalue-hash.c, hieroglyph/hgvalue-integer.c, hieroglyph/hgvalue.c, hieroglyph/hgvalue-array.c, hieroglyph/hgvalue-pointer.c, hieroglyph/hgstream.c, hieroglyph/hgvalue-array.h, hieroglyph/hgdevice.c: removed the unused variable. * hieroglyph/hgdevice.c (hieroglyph_device_class_init): added rmove_to signal. (hieroglyph_device_rmove_to): new function. * libretto/operator.c (libretto_operator_op_atan): implemented atan operator. (libretto_operator_op_concatmatrix): implemented concatmatrix operator. (libretto_operator_op_cos): implemented cos operator. (libretto_operator_op_lt): implemented lt operator. (libretto_operator_op_matrix): implemented matrix operator. (libretto_operator_op_rmoveto): implemented rmoveto operator. (libretto_operator_op_sin): implemented sin operator. (libretto_operator_op_sqrt): implemented sqrt operator. * devices/cairo/hgdevice-cairo.c (hieroglyph_cairo_device_real_rmove_to): new callback function. * hieroglyph/hgdevice.c (hieroglyph_device_class_init): removed the unnecessary callback functions. (hieroglyph_device_class_init): added a clip signal and removed path_bbox and path_bbox2 signals. (_hieroglyph_device_open): set the initial clippath. (hieroglyph_path_new): new function. (hieroglyph_path_free): likewise. (hieroglyph_path_copy): likewise. (_hieroglyph_device_path_bbox): likewise. (hieroglyph_device_clip): likewise. (hieroglyph_device_clip_path): set a path. (hieroglyph_device_close_path): likewise. (hieroglyph_device_curve_to): likewise. (hieroglyph_device_eofill): likewise. (hieroglyph_device_fill): likewise. (hieroglyph_device_line_to): likewise. (hieroglyph_device_move_to): likewise. (hieroglyph_device_new_path): clear the paths. (hieroglyph_device_rline_to): set a path. * libretto/operator.c (libretto_operator_op_clip): implemented clip operator. (libretto_operator_op_rotate): convert a degree to a radian. * libretto/scanner.c (_libretto_scanner_find_skip_characters): trival fix. (_libretto_scanner_skip_characters): likewise. (_libretto_scanner_get_next_token): skip the comment without the large loop. * libretto/lvdict.c (libretto_value_dict_hash_key_equal): trival fix. * libretto/operator.h: include the stacks in the structure. * devices/cairo/hgdevice-cairo.c (hieroglyph_cairo_device_real_clip): new callback function. (hieroglyph_cairo_device_real_clip_path): fixed the wrong implementation. (hieroglyph_cairo_device_real_path_bbox): removed. (hieroglyph_cairo_device_real_path_bbox2): removed. (_hieroglyph_cairo_device_show_path): new function for the path debug. 2005-11-30 Akira TAGOH * tests/Makefile.am (noinst_PROGRAMS): clean up. * libretto/Makefile.am (lrinclude_HEADERS): clean up. * requires (GLIB_REQUIRED): require glib >= 2.8.0. * hieroglyph/hgdevice.c (hieroglyph_device_class_init): added more signals. (hieroglyph_device_curve_to): new function. (hieroglyph_device_eofill): likewise. (hieroglyph_device_rline_to): likewise. (hieroglyph_device_rotate): likewise. (hieroglyph_device_translate): likewise. * hieroglyph/hgvalue-array.c (hieroglyph_value_array_pop): access to GPtrArray directly. * configure.ac: added --enable-profile option. * libretto/operator.c (libretto_operator_op_abs): implemented abs operator. (libretto_operator_op_aload): implemented aload operator. (libretto_operator_op_curveto): implemented curveto operator. (libretto_operator_op_eofill): implemented eofill operator. (libretto_operator_op_mod): implemented mod operator. (libretto_operator_op_rand): implemented rand operator. (libretto_operator_op_rlineto): implemented rlineto operator. (libretto_operator_op_rotate): implemented rotate operator. (libretto_operator_op_setgray): implemented setgray operator. (libretto_operator_op_sethsbcolor): implemented sethsbcolor operator. (libretto_operator_op_srand): implemented srand operator. (libretto_operator_op_translate): implemented translate operator. (rgb_to_hsv): borrowed from GTK+. (hsv_to_rgb): likewise. (libretto_operator_new): add true, false and null into the systemdict. * devices/cairo/hgdevice-cairo.c (hieroglyph_cairo_device_real_curve_to): new callback function. (hieroglyph_cairo_device_real_eofill): likewise. (hieroglyph_cairo_device_real_rline_to): likewise. (hieroglyph_cairo_device_real_rotate): likewise. (hieroglyph_cairo_device_real_translate): likewise. 2005-11-25 Akira TAGOH * examples/ps2x.c: new file. * examples/Makefile.am (noinst_PROGRAMS): added ps2x. * examples/ps2ps.c (main): use hieroglyph_init instead of the macros for debug. * hieroglyph/hgdevice.c (hieroglyph_device_class_init): added more callbacks and signals. (hieroglyph_device_clip_path): new function. (hieroglyph_device_close_path): likewise. (hieroglyph_device_fill): likewise. (hieroglyph_device_line_to): likewise. (hieroglyph_device_new_path): likewise. (hieroglyph_device_path_bbox): likewise. (hieroglyph_device_path_bbox2): likewise. (hieroglyph_device_restore): likewise. (hieroglyph_device_save): likewise. (hieroglyph_device_set_line_width): likewise. (hieroglyph_device_set_rgb_color): likewise. (hieroglyph_device_stroke): likewise. * hieroglyph/hgvalue-array.c (hieroglyph_value_array_clear): fixed an removal from the wrong place. * hieroglyph/hgobject.c (hieroglyph_init): new function. * hieroglyph/hgdefs.h: added HgBBox structure. * hieroglyph/hgfilter.c (hieroglyph_filter_real_set_device): new callback function. * filters/ps/ps-filter.c (ps_filter_private_init): call libretto_operator_init. (ps_filter_real_set_device): new callback function. (filter_open): connect to set_device signal. * libretto/operator.c (libretto_operator_op_begin): implemented begin operator. (libretto_operator_op_clear): implemented clear operator. (libretto_operator_op_cleardictstack): implemented cleardictstack operator. (libretto_operator_op_clippath): implemented clippath operator. (libretto_operator_op_closepath): implemented closepath operator. (libretto_operator_op_cvi): implemented cvi operator. (libretto_operator_op_dict): implemented dict operator. (libretto_operator_op_div): implemented div operator. (libretto_operator_op_end): implemented end operator. (libretto_operator_op_fill): implemented fill operator. (libretto_operator_op_get): implemented get operator. (libretto_operator_op_grestore): implemented grestore operator. (libretto_operator_op_gsave): implemented gsave operator. (libretto_operator_op_lineto): implemented lineto operator. (libretto_operator_op_moveto): implemented moveto operator. (libretto_operator_op_newpath): implemented newpath operator. (libretto_operator_op_pathbbox): implemented pathbbox operator. (libretto_operator_op_repeat): implemented repeat operator. (libretto_operator_op_roll): implemented roll operator. (libretto_operator_op_setlinewidth): implemented setlinewidth operator. (libretto_operator_op_setrgbcolor): implemented setrgbcolor operator. (libretto_operator_op_stroke): implemented stroke operator. (libretto_operator_op_truncate): implemented truncate operator. (libretto_operator_op_usertime): implemented usertime operator. * libretto/scanner.c (_libretto_scanner_parse_string): ignore only \r at the end of line. (_libretto_scanner_parse_hexadecimal_string): new function. (_libretto_scanner_get_next_token): implemented scanner. (libretto_scanner_parse_numbers): new function. * devices/cairo/cairo-xlib-main.c: new file for x11 module. * devices/cairo/hgdevice-cairo.c (hieroglyph_cairo_device_real_clip_path): new callback function. (hieroglyph_cairo_device_real_close_path): likewise. (hieroglyph_cairo_device_real_fill): likewise. (hieroglyph_cairo_device_real_line_to): likewise. (hieroglyph_cairo_device_real_new_path): likewise. (hieroglyph_cairo_device_real_path_bbox): likewise. (hieroglyph_cairo_device_real_path_bbox2): likewise. (hieroglyph_cairo_device_real_restore): likewise. (hieroglyph_cairo_device_real_save): likewise. (hieroglyph_cairo_device_real_set_line_width): likewise. (hieroglyph_cairo_device_real_set_rgb_color): likewise. (hieroglyph_cairo_device_real_stroke): likewise. * devices/cairo/Makefile.am (device_LTLIBRARIES): added x11 module. * devices/cairo/hgdevice-cairo.h: added Xlib support. 2005-11-23 Akira TAGOH * libretto/operator.c (libretto_operator_op_and): implemented and operator. (libretto_operator_op_eq): implemented eq operator. (libretto_operator_op_gt): implemented gt operator. (libretto_operator_op_mul): implemented mul operator. (libretto_operator_op_neg): implemented neg operator. * libretto/scanner.c (_libretto_scanner_get_next_token): moved from libretto_scanner_get_next_token to parse the multiple { } recursively. * libretto/operator.c (_libretto_operator_object2string): check the array size. (libretto_operator_op_array): implemented array operator. (libretto_operator_op_for): implemented for operator. (libretto_operator_op_put): implemented put operator. * libretto/operator.c (_libretto_operator_object2string): display an operator object. (libretto_operator_op_bind): implemented bind operator. (libretto_operator_build_closure): take an operator name in the argument and set it as quark. (libretto_operator_process_object): call libretto_operator_call when it was HgValuePointer. * libretto/lvdict.c (libretto_value_dict_real_lookup): new function for lookup signal on HgValueHash. (libretto_value_dict_new): connect to lookup signal. (libretto_value_dict_lookup): emit a lookup signal instead of calling hieroglyph_value_hash_lookup. 2005-11-22 Akira TAGOH * libretto/operator.c (libretto_operator_real_destroy): use LibrettoValueDict instead of HgValueHash. (_libretto_operator_object2string): display the object type for the debugging purpose. (libretto_operator_op_currentdict): fixed a typo. (libretto_operator_op_def): use LibrettoValueDict instead of HgValueHash. (libretto_operator_op_exec): call libretto_operator_exec_procedure for LibrettoValueArray. (libretto_operator_op_known): use LibrettoValueDict instead of HgValueHash. (libretto_operator_instance_init): likewise. (DEFUNC_CLOSURE): likewise. (libretto_operator_op_sub): implemented sub operator. (libretto_operator_is_operator): removed. (libretto_operator_lookup): new function. (libretto_operator_process_object): look up the object from the dictionary stack. (libretto_operator_exec_procedure): new function. * libretto/lvdict.[ch]: new class. * libretto/operator.c (libretto_operator_op_s_bracketright): use LibrettoValueArray instead of HgValueArray. (_libretto_operator_object2string): likewise. (libretto_operator_op_if): likewise. (libretto_operator_op_ifelse): likewise. (libretto_operator_op_currentdict): pick up the dictionary from the stack. (libretto_operator_init): new function to initialize the PS engine. * libretto/scanner.c (_libretto_scanner_parse_numbers): implemented a parser for { }. * libretto/lvmark.h (LIBRETTO_IS_VALUE_MARK_TYPE): fixed a typo. * libretto/scanner.h: added LIBRETTO_SCANNER_NO_MEMORY. * libretto/lvarray.[ch]: new class. 2005-11-21 Akira TAGOH * po/POTFILES.in: added libretto/attribute.c * hieroglyph/_marshal.list: added UINT:VOID marshaler. * hieroglyph/hgvalue.c (hieroglyph_value_real_get_node_size): a empty function for get_node_size signal. (hieroglyph_value_class_init): added a get_node_size signal. (hieroglyph_value_dup): don't use g_object_ref. (hieroglyph_value_get_node_size): new function. * hieroglyph/hgvalue-boolean.c (hieroglyph_value_boolean_real_get_node_size): implemented a get_node_size signal callback. * hieroglyph/hgvalue-name.c (hieroglyph_value_name_real_get_node_size): likewise. * hieroglyph/hgvalue-real.c (hieroglyph_value_real_real_get_node_size): likewise. * hieroglyph/hgvalue-hash.c (hieroglyph_value_hash_real_get_node_size): likewise. * hieroglyph/hgvalue-integer.c (hieroglyph_value_integer_real_get_node_size): likewise. * hieroglyph/hgvalue-array.c (hieroglyph_value_array_real_get_node_size): likewise. * hieroglyph/hgvalue-pointer.c (hieroglyph_value_pointer_real_get_node_size): likewise. * hieroglyph/hgvalue-string.c (hieroglyph_value_string_real_dup_node): implemented a dup_node signal callback. (hieroglyph_value_string_real_get_node_size): likewise. * libretto/operator.c (_libretto_operator_object2string): use LibrettoValueString instead of HgValueString. (libretto_operator_op_dup): use hieroglyph_value_dup and set attributes. (libretto_operator_op_if): unref the object. (libretto_operator_op_ifelse): implemented ifelse operator. (libretto_operator_op_xcheck): implemented xcheck operator. (libretto_operator_is_operator): use LibrettoValueString instead of HgValueString. * libretto/scanner.c (_libretto_scanner_parse_string): use LibrettoValueString instead of HgValueString. * libretto/lvstring.[ch]: new class. * libretto/attribute.c: trivial changes. * libretto/Makefile.am: added lvstring.[ch]. 2005-11-19 Akira TAGOH * libretto/operator.c (_libretto_operator_object2string): display { } as well. (libretto_operator_op_cvx): implemented cvx operator. (libretto_operator_op_exec): implemented exec operator. (libretto_operator_op_if): implemented if operator. (libretto_operator_process_object): new function to process the object. * libretto/scanner.c (_libretto_scanner_parse_string): ignore \n and \r\n with \. (libretto_scanner_get_next_token): use HgValueName instead of HgValueKey. give the exec attribute to the operators. * hieroglyph/hgvalue-key.[ch]: removed. * libretto/attribute.[ch]: new file. * tests/attribute.c: new testcase for LibrettoAttribute. 2005-11-18 Akira TAGOH * libretto/operator.c (libretto_operator_op_s_bracketright): implemented ] operator. (_libretto_operator_object2string): fixed a typo. (libretto_operator_op_pop): implemented pop operator. * libretto/scanner.c (_libretto_scanner_is_skip_character): new function which was seprated from _libretto_scanner_find_skip_characters. (libretto_scanner_get_next_token): return the name object of ]. * libretto/lvmark.h: added null type. 2005-11-17 Akira TAGOH * examples/ps2ps.c: added an example file for converting PS to the embedded PS. * filters/ps/ps-filter.c (ps_filter_private_init): new function to initialize the private structure. (ps_filter_private_destroy): new function to destroy the private structure. (ps_filter_get_private): new function. (ps_filter_real_parse): new function for parse signal. * libretto/operator.c (libretto_operator_op_s_eqeq): implemented ==. (_libretto_operator_object2string): new function to convert the object to the string. (libretto_operator_op_add): implemented add operator. (libretto_operator_op_currentdict): implemented currentdict operator. (libretto_operator_op_def): implemented def operator. (libretto_operator_op_dup): implemented dup operator. (libretto_operator_op_exch): implemented exch operator. (libretto_operator_op_known): implemented known operator. (libretto_operator_op_pstack): implemented pstack operator. (libretto_operator_is_operator): implemented. (libretto_operator_call): implemented. * libretto/scanner.c (libretto_scanner_reset): new function to reset the scanner. * hieroglyph/hgvalue-array.c (hieroglyph_value_array_real_dup_node): new callback for dup_node signal. * hieroglyph/hgvalue.c (hieroglyph_value_real_dup_node): new callback for dup_node signal. (hieroglyph_value_class_init): added dup_node signal. (hieroglyph_value_dup): new function to duplicate HgValue. * hieroglyph/hgvalue-hash.c (hieroglyph_value_hash_real_hash_foreach): new function to duplicate the hash value. (hieroglyph_value_hash_real_dup_node): new callback for dup_node signal. 2005-11-16 Akira TAGOH * libretto/operator.[ch]: new class. * hieroglyph/hgfilter.c (hieroglyph_filter_class_init): added a parse signal. (hieroglyph_filter_set_device): increase an reference count for device. (hieroglyph_filter_parse): new function. * tests/hgvalue-pointer.c: new testcase for HgValuePointer. * hieroglyph/hgvalue-pointer.[ch]: new class. * hieroglyph/hgvalue-array.c (hieroglyph_value_array_real_destroy): ensure to destroy the objects in the array. * tests/hgvalue-array.c: new testcase for HgValueArray. * hieroglyph/hgvalue-array.[ch]: new class. 2005-11-15 Akira TAGOH * libretto/lvmark.[ch]: new class. * filters/ps/ps-filter.c: new file for ps filter module. * hieroglyph/hgdevice.[ch]: added the modular support. * hieroglyph/hgdefs.h: new file. * hieroglyph/hgfilter.[ch]: new class. * filters/Makefile.am: new file. * filters/ps/Makefile.am: new file. * tests/hgfilter-ps.c: new testcase for ps filter. * tests/hgdevice-cairo.c: new testcase for cairo device. * tests/Makefile.am (TESTS): added a testcase for HgFilter and HgCairoDevice. * devices/cairo/cairo-ps-main.c: new file for cairo device module. * devices/cairo/hgdevice-cairo.[ch]: new class to handle cairo device. 2005-11-14 Akira TAGOH * libretto/scanner.c (libretto_scanner_read_from_stream): new function to read from the stream. (libretto_scanner_get_error): new function to get the error code. 2005-11-11 Akira TAGOH * libretto/scanner.c (libretto_scanner_get_cur_line): new function. (libretto_scanner_get_next_token): added string support. (_libretto_scanner_parse_string): new function. * hieroglyph/hgvalue-string.c (hieroglyph_value_string_new): allow NULL for the initial value. * libretto/scanner.c (_libretto_scanner_parse_numbers): support the value with the radix. * hieroglyph/hgvalue-real.h: added a macro to compare the floating variable. * configure.ac: added a rule for LFS support. * tests/scanner.c: new testcase for scanner. * tests/Makefile.am (noinst_PROGRAMS): added a new testcase for scanner. * libretto/Makefile.am: added. * libretto/scanner.[ch]: new class to parse PostScript. 2005-11-10 Akira TAGOH * hieroglyph/hgvalue-key.[ch]: new class. 2005-11-01 Akira TAGOH * hieroglyph/hgstream.[ch]: new class. * hieroglyph/debug.c.in (debug_assist_new_with_masks): fixed a gcc warning. * hieroglyph/hgfont.[ch]: new class. 2005-10-31 Akira TAGOH * hieroglyph/hgvalue-hash.c (hieroglyph_value_hash_real_lookup): moved from hieroglyph_value_hash_lookup. (hieroglyph_value_hash_class_init): made a lookup signal. * tests/hgvalue-font.c: new testcase for HgValueFont. * hieroglyph/hgvalue-font.[ch]: new class. 2005-10-29 Akira TAGOH * hieroglyph/hgvalue.c (hieroglyph_value_real_destroy): call the parent's destroy method. * hieroglyph/hgvalue-hash.c (hieroglyph_value_hash_real_create_node): use the virtualized functions. (hieroglyph_value_hash_instance_init): set the real functions for GHashTable here. 2005-10-28 Akira TAGOH * hieroglyph/hgvalue-hash.[ch]: new class. * tests/hgvalue-hash.c: new testcase for HgValueHash. * tests/hgvalue-name.c: new testcase for HgValueName. * hieroglyph/hgvalue-name.[ch]: new class. 2005-10-27 Akira TAGOH * hieroglyph/hgvalue-real.h: added a macro to convert the integer value to an real. * hieroglyph/hgvalue-integer.h: added a macro to convert the real value to a integer. * hieroglyph/debug.c (debug_assist_new_with_masks): fixed a memory leak. * devices/cairo/Makefile.am: added. * devices/Makefile.am: added. * configure.ac: added cairo checking. 2005-10-25 Akira TAGOH * hieroglyph/hgvalue.c (hieroglyph_value_real_create_node): added warning message. (hieroglyph_value_real_destroy_node): likewise. * hieroglyph/hgdevice.[ch]: new class to handle the devices. * hieroglyph/hgvalue-string.[ch]: new class. * tests/hgvalue-string.c: new testcase for HgValueString. * hieroglyph/hgvalue-float.[ch]: new class. * tests/hgvalue-float.c: new testcase for HgValueFloat. * hieroglyph/hgvalue-integer.c: new class. * hieroglyph/hgvalue-integer.h: new header file. * hieroglyph/Makefile.am (libhieroglyph_la_SOURCES): added hgvalue-integer.c * tests/Makefile.am (noinst_PROGRAMS): added test-hgvalue-integer. * tests/hgvalue-integer.c: new testcase for HgValueInteger. * hieroglyph/hgvalue-boolean.c (hieroglyph_value_set_boolean): new function. * hieroglyph/hgvalue.c (hieroglyph_value_get_node): new function. 2005-10-24 Akira TAGOH * hieroglyph/hgvalue.c: added a create_node and a destroy_node signal. * hieroglyph/hgobject.c: added a destroy signal. (hieroglyph_object_unref): new function. * hieroglyph/hgvalue.list: removed. * hieroglyph/hg-mkvalue.rb: removed. * hieroglyph/_marshal.list: added some marshaler. * hieroglyph/hgvalue-boolean.[ch]: new class. * tests/Makefile.am: added a new testcase for HgValueBoolean. * tests/hgvalue-boolean.c: added a new testcase for HgValueBoolean. 2005-10-22 Akira TAGOH * hieroglyph/Makefile.am: modified to generate the HgValue classes. * hieroglyph/hgvalue.list: added a list to generate the HgValue classes. * hieroglyph/hg-mkvalue.rb: added a helper program. * Makefile.am (EXTRA_DIST): added intltool stuff. 2005-10-20 Akira TAGOH * hieroglyph/common.h: added hgobject.h and hgvalue.h * hieroglyph/Makefile.am: added hgobject.[ch] and hgvalue.[ch]. * hieroglyph/hgobject.[ch]: base class for hieroglyph. * hieroglyph/hgvalue.[ch]: new class to handle the value. * tests/Makefile.am: added a testcase for HgValue.