2006-09-01 Atsushi Enomoto * gutf8.c : bad allocation size. multiply sizeof gchar/gunichar2. 2006-09-01 Atsushi Enomoto * gutf8.c : when error is null, utf8_to_utf16_len() and utf16_to_utf8_len() could return -1, so return NULL for those cases in g_utf8_to_utf16() and g_utf16_to_utf8(). 2006-09-01 Miguel de Icaza * src/gmarkup.c: Builds and does minimal parsing. * test/markup.c: Sample test cases I have been using 2006-08-31 Atsushi Enomoto * src/gerror.h, src/gerror.c : added g_set_error(). * src/gutf8.c : g_utf8_to_utf16() and g_utf16_to_utf8() implementation. * src/glib.h : added all above, and some dependent bits. * src/Makefile.am : added gutf8.c. * TODO: removed above. * test/Makefile.am, test/tests.h : added utf8 tests. * test/utf8.c : test for g_utf8_to_utf16 and g_utf16_to_utf8. It still needs more tests e.g. for multibytes. 2006-08-31 Gonzalo Paniagua Javier * src/gspawn.c: small touch-ups and make read/write EINTR-proof. 2006-08-31 Gonzalo Paniagua Javier * test/file.c: remove useless test. * test/spawn.c: new g_spawn_async_with_pipes test. * src/glib.h: Modified file. * src/gspawn.c: implemented g_spawn_async_with_pipes. Needs fine tuning. 2006-08-28 Gonzalo Paniagua Javier * TODO: Modified file. * test/tests.h: * test/pattern.c: * test/dir.c: * test/Makefile.am: * src/Makefile.am: * src/glib.h: * src/gdir.c: * src/gfile.c: implemented g_dir_*, unix version. 2006-08-27 Gonzalo Paniagua Javier * src/glib.h: * test/Makefile.am: Modified file. * test/tests.h: * src/Makefile.am: Modified file. * test/pattern.c: * src/gpattern.c: implemented the 3 pattern matching functions used. * test/ptrarray.c: fix the compare function to work with qsort. * test/file.c: * test/path.c: * src/gspawn.c: * src/gpath.c: made valgrind happy. 2006-08-26 Gonzalo Paniagua Javier * test/file.c: * src/glib.h: * src/gfile.c: implemented g_file_test. Changed the default mask to .XXXXXX. Add tests. 2006-08-26 Raja R Harinath * src/sort.frag.h (digit): Declare here based on externally provided typedef 'list_node'. (MAX_DIGITS): Use 'sizeof (list_node)'. * src/gslist.c (list_node): Declare instead of 'digit'. * src/glist.c: Likewise. * test/slist.c (verify_sort): Verify the length of the list too. (test_slist_sort): Free the correct list. * test/list.c: Likewise. * src/sort.frag.h (MAX_DIGITS): Rename from N_DIGITS. (combine_sort): Change 'max_pos' argument to more natural 'n_digits'. (increment): Likewise. Use 'n_digits' to avoid reading at an offset that hasn't been initialized. (do_sort): Remove memset. 2006-08-25 Gonzalo Paniagua Javier * TODO: * test/file.c: * src/glib.h: * src/gfile.c: implement g_file_open_tmp. 2006-08-25 Gonzalo Paniagua Javier * TODO: * src/glib.h: * src/gdate.c: New file. * src/gfile.c: New file. * src/Makefile.am: implemented g_file_get_contents and g_get_current_time. * test/tests.h: * test/file.c: New file. * test/Makefile.am: tests for the above. 2006-08-26 Raja R Harinath * src/sort.frag.h: Add copyright notice and some explanation. (increment): Remove null check. (combine_digits): Add 'list' argument to seed the summation. (do_sort): Use the empty or singleton tail as the seed, rather than calling 'increment'. 2006-08-25 Raja R Harinath * TODO: Remove 'List' entries. * src/Makefile.am (libeglib_la_SOURCES): Add sort.frag.h. * src/sort.frag.h: New. Implements a "generic" bottom-up "counting" mergesort that works both on singly- and doubly-linked lists. * src/gslist.c (g_slist_sort): Use it. * src/glist.c (g_list_sort): Likewise. * src/glib.h (g_slist_sort, g_list_sort): Declare. * test/slist.c, test/list.c: Add basic testcases. 2006-08-25 Gonzalo Paniagua Javier * src/gspawn.c: propagate errors from reads. * src/gpath.c: an empty PATH is like a NULL one. 2006-08-25 Gonzalo Paniagua Javier * test/tests.h: * test/timer.c: * test/Makefile.am: * TODO: * src/glib.h: * src/gtimer.c: * src/Makefile.am: implemented GTimer. 2006-08-25 Gonzalo Paniagua Javier * test/tests.h: * test/Makefile.am: * test/spawn.c: * src/gspawn.c: * src/glib.h: * src/Makefile.am: initial implentation of g_spawn_command_line_sync. Still need better error handling, but works for the most part. 2006-08-25 Gonzalo Paniagua Javier * src/garray.c: grow faster so that the 'big' test does not crawl. 2006-08-25 Gonzalo Paniagua Javier * test/shell.c: * src/gqueue.c: plugged leaks. 2006-08-25 Gonzalo Paniagua Javier * test/path.c: * src/gpath.c: when PATH is not defined, the current dir is used. See execvp(3). 2006-08-25 Alp Toker * src/gstr.c: g_strv_length() should return guint, not gint * src/glib.h: Add g_strv_length() prototype 2006-08-24 Miguel de Icaza * src/gpath.c (g_get_home_dir, g_get_tmp_dir, g_get_user_name, g_get_prgname, g_set_prgname): implemented. * test/ Fix leaks. * src/gpath.c (g_get_current_dir): Implement. (g_find_program_in_path, g_path_is_absolute): implement. Add g_path_get_dirname, g_path_get_basename * src/gpath.c: Path routines 2006-08-23 Miguel de Icaza * src/gerror.c: Implement. * src/glist.c (g_list_sort): Remove routine instead of hoping that it wont crash when we run it. 2006-08-23 Raja R Harinath * src/glist.c (g_list_insert_before): Avoid non-head declaration. * test/slist.c (test_slist_insert_before): Add. * src/gslist.c (g_slist_insert_before): Append if 'sibling' is null. * test/list.c (test_list_insert_before): Add test for return value of g_list_insert_before. * test/Makefile.am (test_eglib_LDADD): Refer to the .la file so as to rebuild test if eglib changes. * src/glist.c (new_node, disconnect_node): New helpers that maintain doubly-linked list invariants. (g_list_prepend, g_list_append): Express in terms of new_node. (g_list_insert_before): Likewise. Fix return value when inserting in the middle of the list. (g_list_concat): Reorganize to make more compact. (g_list_nth): Likewise. (g_list_nth_data): Don't segfault if 'n' is too large. (g_list_remove): Rewrite using _find and disconnect_node. (g_list_remove_link): Don't traverse list: use disconnect_node. (g_list_insert_sorted): Rewrite to make more compact. Use new_node. (g_list_copy): Likewise. (_prepend, _concat): Remove. * src/gslist.c (insert_after, find_prev, find_prev_link): New helpers. (g_slist_copy): Simplify slightly, using insert_after. (g_slist_concat): Reorganize to make more compact. (g_slist_find): Likewise. (g_slist_insert_sorted): Likewise. (g_slist_remove): Rewrite using find_prev. (g_slist_remove_link): Rewrite using find_prev_link. (g_slist_remove_all, g_slist_insert_before): New. 2006-08-21 Duncan Mak * src/gqueue.c: GQueue implementation. * src/glib.h: Add prototypes. * src/Makefile.am (libeglib_la_SOURCES): Include gqueue.c. * test/queue.c: * test/Makefile.am (SOURCES): * test/tests.h (DEFINE_TEST_GROUP_INIT_H): add tests for GQueue. 2006-08-21 Aaron Bockover * src/gstr.c: fixed bug/invalid read/write on malloc-only case (no realloc/delimiter token not found); use memcpy instead of strncpy for better performance * test/test.c (run_group): allow running specific tests under a group; added copied g_strsplit/g_strfreev from EGlib source as eg_strsplit and eg_strfreev to avoid performance skews in the driver * test/driver.c: allow user-specified group name to contain specific test to run under the group as 'group_name:test1,test2,...testN' * test/string-util.c: Added more g_strsplit tests * test/slist.c: * test/ptrarray.c: * test/fake.c: * test/string.c: * test/list.c: * test/array.c: * test/hashtable.c: make test names shorter (no need to prefix with the group since it runs under the group) 2006-08-21 Miguel de Icaza * src/glib.h (g_hash_table_new_full): Add missing prototype. Replace g_free(x) with plain free, so it can be used as a function argument. Add ABS * src/ghashtable.c: Add rehashing. * test/hashtable.c: Add a bunch of extra tests. * src/goutput.c: Fix g_log so it actually formats the data. * src/ghashtable.c (g_hash_table_new): The glib test suite uncovered a bunch of bugs, the g_hash_table_new should actually have parameters. (g_hash_table_remove, g_hash_table_foreach_remove): Fixed bugs uncovered. 2006-08-20 Aaron Bockover * src/gmisc.c: added g_setenv, g_getenv, g_unsetenv * src/gstr.c: added g_snprintf, g_sprintf, g_fprintf, g_printf * src/glib.h: added macros for above va_args printf functions * src/Makefile.am: added gmisc.c * test/whats-implemented: script to see what needs to be implemented 2006-08-20 Chris Toshok * test/array.c (test_array_big): add a test from the glib documentation. 2006-08-20 Chris Toshok * test/tests.h: add array tests to the mix. * test/array.c: a few array tests. * src/glib.h: add array prototypes. * src/garray.c: initial array foo. * test/Makefile.am (SOURCES): add array.c * src/Makefile.am (libeglib_la_SOURCES): add garray.c 2006-08-19 Aaron Bockover * src/gstring.c: optimize and generalize reallocation by providing a GROW_IF_NECESSARY macro, do not use strcpy/strcat as they are very, very slow; GString is now much closer to GLib's implementation in terms of performance * test/string.c: added speed-specific tests to beat on reallocation code * test/test-both: run make if the test drivers don't exist 2006-08-19 Jonathan Chambers * src/gmodule.c: Add gmodule support for windows and fix windows build. Contribution is licensed as MIT/X11. 2006-08-19 Aaron Bockover * test/driver.c: Added --debug mode that allows for testing all paths of the driver without actually running real tests; runs only the 'fake' test, which does nothing; useful for running the driver through valgrind * test/Makefile.am: * test/tests.h: * test/fake.c: Added fake test for valgrinding the driver * test/ptrarray.c: update sort test 2006-08-19 Aaron Bockover * test/test-both: added --help 2006-08-19 Aaron Bockover * test/driver.c: added -n mode to show only raw global run times, which is useful for scripts (test-both --speed-compare) * test/test-both: added --speed-compare mode * test/README: updated with information on --speed-compare 2006-08-19 Aaron Bockover * test/test.c: do not print times if -t is not passed * test/driver.c: removed use of GList from the driver to avoid skews due to performance differences between GLib and EGLib 2006-08-19 Aaron Bockover * test/test.c: Perform iterations at the test level, only output one report for all iterations of tests in a group to produce more usable output; add timing for the tests and group; added get_timestamp for easy code timing * test/test.h: Removed run_test as it should only be called from run_group, added get_timestamp * test/Makefile.am: Added -DDRIVER_NAME * test/test-both: simple script to run both drivers with the same options * test/driver.c: Iterations are now run at the test level, show a global status (OK/FAIL) indicator * test/README: Updated * configure.ac: Renamed from configure.in as configure.in naming convention is deprecated in favor of configure.ac * autogen.sh: s/configure.in/configure.ac/ 2006-08-19 Miguel de Icaza * Makefile.am: Removed MAINTAINERCLEANFILES that was too aggresive, it failed make distcheck and the resulting tarball was not buildable. * src/glib.h: remove the various GPOINTER_TO_*, G*_TO_POINTER, GSIZE_FORMAT macros, and move them into src/eglib-config.h Moved also gssize and gsize to be arch specific. This should fix the 32/64 problems that Jon Chambers reported. * configure.in: test for pointer size, define the various values depending on 32 vs 32/64 worlds, might need further porting in the future. Change package name to eglib * test/slist.c, test/list.c, test/hashtable.c: Update tests to use FAILURE macro. * test/string-util.c: fix leak for valgrind tests. * test/tests.h: New size test, for testing datatypes. * test/sizes.c: New tests. 2006-08-19 Aaron Bockover * test/README: Added quick guide on adding new tests/groups to the driver and some examples on how to perform various tests with the driver 2006-08-18 Aaron Bockover * test/driver.c: Added getopt support and code timing, among other nice features to make testing/profiling easier * test/test.c: Add support for suppressing output (quiet) and define RESULT, FAILED, and OK * src/glib.h: * src/glist.c: Added g_list_nth_data implementation * test/slist.c: * test/string-util.c: * test/ptrarray.c: * test/string.c: * test/hashtable.c: * test/list.c: Use RESULT, FAILURE, and OK for tests 2006-08-18 Miguel de Icaza * src/gstring.c (g_string_truncate): Implement truncate. (g_string_prepend): implement. Fix various bugs uncovered by new tests. * src/glib.h: introduce gssize type, the signed one. Important. * src/eglib-config.h (G_OS_): Add the G_OS_UNIX and G_OS_WIN32 defines that we can use to check on the host OS. 2006-08-18 Aaron Bockover * test/test.[ch]: * test/driver.c: Support pass/fail logging on tests to show group report 2006-08-18 Aaron Bockover * test/test.c: * test/test.h: Added result() to be used in place of g_strdup_printf(), it's shorter to write and allows the duped string to be freed safely; added license header to file * test/driver.c: Added license header to file * test/string-util.c: * test/ptrarray.c: * test/string.c: * test/list.c: Use result() in place of g_strdup_printf(), it's nicer 2006-08-18 Aaron Bockover * src/gptrarray.c: Implemented g_ptr_array_sort * test/ptrarray.c: Added sort test * test/driver.c: Added --help; support running N iterations and allow selecting which test groups to run; uses the test group table in tests.h * test/tests.h: Added group table * test/test.h: * test/test.c: Using a Group structure and table, removed run_groups as we only need run_group now * test/slist.h: Removed, not needed, tests/groups defined in tests.h 2006-08-18 Miguel de Icaza * src/unicode.c: New file, to host unicode code, it will throw as this code is no longer used in the Mono runtime anyways. * src/glib.h: Use stdint.h types, a lot of the good stuff is replicated by glib. 2006-08-18 Duncan Mak * src/glist.c (g_list_remove, g_list_remove_link): Implemented. * src/gslist.c (g_slist_remove): Remember to set the next pointer to NULL when the item to remove is the first item in the list. 2006-08-18 Duncan Mak * src/glist.c: Implemented. Missing remove, remove_link and insert_before. * test/list.c: Tests for GList. 2006-08-17 Aaron Bockover * src/gptrarray.c: Implemented g_ptr_array_remove and g_ptr_array_remove_index * test/other: Removed, rewritten in Makefile.am * test/Makefile.am: Build test-eglib against local eglib and test-glib against GLib 2.0 (replaces 'other') * test/ptrarray.c: Added tests for g_ptr_array_remove and g_ptr_array_remove_index 2006-08-17 Duncan Mak * src/gslist.c: Added MIT license. (g_slist_insert_sorted): Forgot the case where the data is appended to the end of the list. * test/slist.c (test_slist_insert_sorted): Fix the test. 2006-08-17 Aaron Bockover * src/gptrarray.c: Added g_ptr_array_set_size implementation * test/ptrarray.c: Added test for g_ptr_array_set_size 2006-08-17 Miguel de Icaza * src/glib.h: A handful of extra macros * configure.in, src/eglib-config.h.in: Set some system-specific settings that are probed at configure time. 2006-08-17 Aaron Bockover * src/gptrarray.c: Added beginnings of GPtrArray (alloc, free, add, iterate) * src/glib.h: Added GPtrArray signatures * src/Makefile.am: Added gptrarray.c to build * test/ptrarray.c: * test/tests.h: * test/driver.c: * test/Makefile.am: Add ptrarray tests for available functionality 2006-08-17 Aaron Bockover * test/test.h: * test/test.c: Added group iterator/test driver functionality * test/driver.c: Added groups to run using new test functionality * test/slist.h: * test/hashtable.h: * test/string-util.h: Test group definitions for string util/hashtable * test/slist.c: * test/str.c: * test/hash.c: Added test definition table * test/Makefile.am: Added -Wall -Werror -D_FORTIFY_SOURCE=2 * src/gstr.c: Added implementation for g_str_has_prefix, g_str_has_suffix * src/glib.h: Added missing function signatures * src/Makefile.am: added -D_FORTIFY_SOURCE=2 2006-08-17 Duncan Mak * src/gslist.c (g_slist_remove_link): I misread the function signature. Re-implemented. (g_slist_delete_link): Implemented. (g_slist_reverse): Implemented. (g_slist_insert_sorted): Implemented. 2006-08-17 Duncan Mak * src/gslist.c (g_slist_find): (g_slist_length): (g_slist_remove): (g_slist_remove_link): Implemented. * test/slist.c: Tests for GSList. 2006-08-17 Raja R Harinath * src/gslist.c (g_slist_free_1): New. Free a single list node. (g_slist_free): Use it to free the list nodes. Don't free the data, since the list doesn't own it. (g_slist_append): Convert into a one-liner. (g_slist_foreach): Remove redundant null check. (g_slist_last): Actually return the last node. (g_slist_copy): Simplify. * src/gslist.h (g_slist_free_1): Add. 2006-08-16 Duncan Mak * src/gslist.c: * src/gslist.h: First attempt at implementing GSList, incomplete. * src/Makefile.am (libeglib_la_SOURCES): add gslist.c * src/glib.h: Add GFunc definition. #include the new gslist.h. 2006-08-16 Miguel de Icaza * src/Makefile.am: Added -Wall,-Werror, corrected lots of mistakes. * src/gstring.c: Gstring implementation. * test/str.c (test_gstring): string tests. 2006-08-16 Aaron Bockover * src/gstr.c: Added g_strsplit implementation * test/driver.c: Run the split test * test/str.c: Added a test for g_strsplit * Makefile.am: * src/Makefile.am: * test/Makefile.am: Added MAINTAINERCLEANFILES 2006-08-16 Miguel de Icaza * src/gouput.c: Implement some output routines, update missing progress. * test: Add test driver, and initial tests. 2006-08-15 Miguel de Icaza * src/ghashtable.c: Implement most of this, it is completely untested at this point.