2006-09-01 Miguel de Icaza <miguel@novell.com>
[mono.git] / eglib / ChangeLog
1 2006-09-01  Miguel de Icaza  <miguel@novell.com>
2
3         * src/gmarkup.c: Builds and does minimal parsing.
4
5         * test/markup.c: Sample test cases I have been using
6
7 2006-08-31 Atsushi Enomoto <atsushi@ximian.com>
8
9         * src/gerror.h,
10           src/gerror.c : added g_set_error().
11         * src/gutf8.c :
12           g_utf8_to_utf16() and g_utf16_to_utf8() implementation.
13         * src/glib.h : added all above, and some dependent bits.
14         * src/Makefile.am : added gutf8.c.
15         * TODO: removed above.
16         * test/Makefile.am,
17           test/tests.h : added utf8 tests.
18         * test/utf8.c : test for g_utf8_to_utf16 and g_utf16_to_utf8.
19           It still needs more tests e.g. for multibytes.
20
21 2006-08-31 Gonzalo Paniagua Javier <gonzalo@ximian.com>
22
23         * src/gspawn.c: small touch-ups and make read/write EINTR-proof.
24
25 2006-08-31 Gonzalo Paniagua Javier <gonzalo@ximian.com>
26
27         * test/file.c: remove useless test.
28
29         * test/spawn.c: new g_spawn_async_with_pipes test.
30         * src/glib.h: Modified file.
31         * src/gspawn.c: implemented g_spawn_async_with_pipes. Needs fine tuning.
32
33 2006-08-28 Gonzalo Paniagua Javier <gonzalo@ximian.com>
34
35         * TODO: Modified file.
36         * test/tests.h:
37         * test/pattern.c:
38         * test/dir.c:
39         * test/Makefile.am:
40         * src/Makefile.am:
41         * src/glib.h:
42         * src/gdir.c:
43         * src/gfile.c: implemented g_dir_*, unix version.
44
45 2006-08-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
46
47         * src/glib.h:
48         * test/Makefile.am: Modified file.
49         * test/tests.h:
50         * src/Makefile.am: Modified file.
51         * test/pattern.c:
52         * src/gpattern.c: implemented the 3 pattern matching functions used.
53
54         * test/ptrarray.c: fix the compare function to work with qsort.
55
56         * test/file.c:
57         * test/path.c:
58         * src/gspawn.c:
59         * src/gpath.c: made valgrind happy.
60
61 2006-08-26 Gonzalo Paniagua Javier <gonzalo@ximian.com>
62
63         * test/file.c:
64         * src/glib.h:
65         * src/gfile.c:  implemented g_file_test. Changed the default mask to
66         .XXXXXX. Add tests.
67
68 2006-08-26  Raja R Harinath  <rharinath@novell.com>
69
70         * src/sort.frag.h (digit): Declare here based on externally
71         provided typedef 'list_node'.
72         (MAX_DIGITS): Use 'sizeof (list_node)'.
73         * src/gslist.c (list_node): Declare instead of 'digit'.
74         * src/glist.c: Likewise.
75
76         * test/slist.c (verify_sort): Verify the length of the list too.
77         (test_slist_sort): Free the correct list.
78         * test/list.c: Likewise.
79         * src/sort.frag.h (MAX_DIGITS): Rename from N_DIGITS.
80         (combine_sort): Change 'max_pos' argument to more natural
81         'n_digits'.
82         (increment): Likewise.  Use 'n_digits' to avoid reading at an
83         offset that hasn't been initialized.
84         (do_sort): Remove memset.
85
86 2006-08-25 Gonzalo Paniagua Javier <gonzalo@ximian.com>
87
88         * TODO:
89         * test/file.c:
90         * src/glib.h:
91         * src/gfile.c: implement g_file_open_tmp.
92
93 2006-08-25 Gonzalo Paniagua Javier <gonzalo@ximian.com>
94
95         * TODO:
96         * src/glib.h:
97         * src/gdate.c: New file.
98         * src/gfile.c: New file.
99         * src/Makefile.am: implemented g_file_get_contents and
100         g_get_current_time.
101
102         * test/tests.h:
103         * test/file.c: New file.
104         * test/Makefile.am: tests for the above.
105
106 2006-08-26  Raja R Harinath  <rharinath@novell.com>
107
108         * src/sort.frag.h: Add copyright notice and some explanation.
109         (increment): Remove null check.
110         (combine_digits): Add 'list' argument to seed the summation.
111         (do_sort): Use the empty or singleton tail as the seed, rather
112         than calling 'increment'.
113
114 2006-08-25  Raja R Harinath  <rharinath@novell.com>
115
116         * TODO: Remove 'List' entries.
117         * src/Makefile.am (libeglib_la_SOURCES): Add sort.frag.h.
118         * src/sort.frag.h: New.  Implements a "generic" bottom-up "counting"
119         mergesort that works both on singly- and doubly-linked lists.
120         * src/gslist.c (g_slist_sort): Use it.
121         * src/glist.c (g_list_sort): Likewise.
122         * src/glib.h (g_slist_sort, g_list_sort): Declare.
123         * test/slist.c, test/list.c: Add basic testcases.
124
125 2006-08-25 Gonzalo Paniagua Javier <gonzalo@ximian.com>
126
127         * src/gspawn.c: propagate errors from reads.
128         * src/gpath.c: an empty PATH is like a NULL one.
129
130 2006-08-25 Gonzalo Paniagua Javier <gonzalo@ximian.com>
131
132         * test/tests.h:
133         * test/timer.c:
134         * test/Makefile.am:
135         * TODO:
136         * src/glib.h:
137         * src/gtimer.c:
138         * src/Makefile.am: implemented GTimer.
139
140 2006-08-25 Gonzalo Paniagua Javier <gonzalo@ximian.com>
141
142         * test/tests.h:
143         * test/Makefile.am:
144         * test/spawn.c:
145         * src/gspawn.c:
146         * src/glib.h:
147         * src/Makefile.am: initial implentation of g_spawn_command_line_sync.
148         Still need better error handling, but works for the most part.
149
150 2006-08-25 Gonzalo Paniagua Javier <gonzalo@ximian.com>
151
152         * src/garray.c: grow faster so that the 'big' test does not crawl.
153
154 2006-08-25 Gonzalo Paniagua Javier <gonzalo@ximian.com>
155
156         * test/shell.c:
157         * src/gqueue.c: plugged leaks.
158
159 2006-08-25 Gonzalo Paniagua Javier <gonzalo@ximian.com>
160
161         * test/path.c:
162         * src/gpath.c: when PATH is not defined, the current dir is used.
163         See execvp(3).
164
165 2006-08-25  Alp Toker  <alp@atoker.com>
166
167         * src/gstr.c: g_strv_length() should return guint, not gint
168         * src/glib.h: Add g_strv_length() prototype
169         
170 2006-08-24  Miguel de Icaza  <miguel@novell.com>
171
172         * src/gpath.c (g_get_home_dir, g_get_tmp_dir, g_get_user_name,
173         g_get_prgname, g_set_prgname): implemented.
174
175         * test/ Fix leaks.
176         
177         * src/gpath.c (g_get_current_dir): Implement.
178
179         (g_find_program_in_path, g_path_is_absolute): implement.
180         
181         Add g_path_get_dirname, g_path_get_basename
182
183         * src/gpath.c: Path routines
184
185 2006-08-23  Miguel de Icaza  <miguel@novell.com>
186
187         * src/gerror.c: Implement. 
188
189         * src/glist.c (g_list_sort): Remove routine instead of hoping that
190         it wont crash when we run it.
191
192 2006-08-23  Raja R Harinath  <rharinath@novell.com>
193
194         * src/glist.c (g_list_insert_before): Avoid non-head declaration.
195
196         * test/slist.c (test_slist_insert_before): Add.
197         * src/gslist.c (g_slist_insert_before): Append if 'sibling' is null.
198
199         * test/list.c (test_list_insert_before): Add test for return value
200         of g_list_insert_before.
201         * test/Makefile.am (test_eglib_LDADD): Refer to the .la file so as
202         to rebuild test if eglib changes.
203         * src/glist.c (new_node, disconnect_node): New helpers that
204         maintain doubly-linked list invariants.
205         (g_list_prepend, g_list_append): Express in terms of new_node.
206         (g_list_insert_before): Likewise.  Fix return value when inserting
207         in the middle of the list.
208         (g_list_concat): Reorganize to make more compact.
209         (g_list_nth): Likewise.
210         (g_list_nth_data): Don't segfault if 'n' is too large.
211         (g_list_remove): Rewrite using _find and disconnect_node.
212         (g_list_remove_link): Don't traverse list: use disconnect_node.
213         (g_list_insert_sorted): Rewrite to make more compact.  Use new_node.
214         (g_list_copy): Likewise.
215         (_prepend, _concat): Remove.
216         * src/gslist.c (insert_after, find_prev, find_prev_link):
217         New helpers.
218         (g_slist_copy): Simplify slightly, using insert_after.
219         (g_slist_concat): Reorganize to make more compact.
220         (g_slist_find): Likewise.
221         (g_slist_insert_sorted): Likewise.
222         (g_slist_remove): Rewrite using find_prev.
223         (g_slist_remove_link): Rewrite using find_prev_link.
224         (g_slist_remove_all, g_slist_insert_before): New.
225
226 2006-08-21  Duncan Mak  <duncan@a-chinaman.com>
227
228         * src/gqueue.c: GQueue implementation.
229         * src/glib.h: Add prototypes.
230         * src/Makefile.am (libeglib_la_SOURCES): Include gqueue.c.
231
232         * test/queue.c:         
233         * test/Makefile.am (SOURCES):
234         * test/tests.h (DEFINE_TEST_GROUP_INIT_H): add tests for GQueue.
235
236 2006-08-21  Aaron Bockover  <abockover@novell.com>
237
238         * src/gstr.c: fixed bug/invalid read/write on malloc-only case (no
239         realloc/delimiter token not found); use memcpy instead of strncpy for
240         better performance
241
242         * test/test.c (run_group): allow running specific tests under a group;
243         added copied g_strsplit/g_strfreev from EGlib source as eg_strsplit
244         and eg_strfreev to avoid performance skews in the driver
245         
246         * test/driver.c: allow user-specified group name to contain specific
247         test to run under the group as 'group_name:test1,test2,...testN'
248
249         * test/string-util.c: Added more g_strsplit tests
250
251         * test/slist.c:
252         * test/ptrarray.c:
253         * test/fake.c:
254         * test/string.c:
255         * test/list.c:
256         * test/array.c:
257         * test/hashtable.c: make test names shorter (no need to prefix with
258         the group since it runs under the group)
259
260 2006-08-21  Miguel de Icaza  <miguel@novell.com>
261
262         * src/glib.h (g_hash_table_new_full): Add missing prototype.
263         Replace g_free(x) with plain free, so it can be used as a function
264         argument. 
265         Add ABS
266
267         * src/ghashtable.c: Add rehashing. 
268
269         * test/hashtable.c: Add a bunch of extra tests.
270
271         * src/goutput.c: Fix g_log so it actually formats the data. 
272
273         * src/ghashtable.c (g_hash_table_new): The glib test suite
274         uncovered a bunch of bugs, the g_hash_table_new should actually
275         have parameters.
276
277         (g_hash_table_remove, g_hash_table_foreach_remove): Fixed bugs
278         uncovered. 
279
280 2006-08-20  Aaron Bockover  <abockover@novell.com>
281
282         * src/gmisc.c: added g_setenv, g_getenv, g_unsetenv
283
284         * src/gstr.c: added g_snprintf, g_sprintf, g_fprintf, g_printf
285
286         * src/glib.h: added macros for above va_args printf functions
287
288         * src/Makefile.am: added gmisc.c
289
290         * test/whats-implemented: script to see what needs to be implemented
291
292 2006-08-20  Chris Toshok  <toshok@ximian.com>
293
294         * test/array.c (test_array_big): add a test from the glib
295         documentation.
296
297 2006-08-20  Chris Toshok  <toshok@ximian.com>
298
299         * test/tests.h: add array tests to the mix.
300
301         * test/array.c: a few array tests.
302
303         * src/glib.h: add array prototypes.
304
305         * src/garray.c: initial array foo.
306
307         * test/Makefile.am (SOURCES): add array.c
308
309         * src/Makefile.am (libeglib_la_SOURCES): add garray.c
310
311 2006-08-19  Aaron Bockover  <abockover@novell.com>
312
313         * src/gstring.c: optimize and generalize reallocation by providing
314         a GROW_IF_NECESSARY macro, do not use strcpy/strcat as they are 
315         very, very slow; GString is now much closer to GLib's implementation
316         in terms of performance
317
318         * test/string.c: added speed-specific tests to beat on reallocation code
319
320         * test/test-both: run make if the test drivers don't exist
321
322 2006-08-19  Jonathan Chambers  <jonathan.chambers@gmail.com>
323
324         * src/gmodule.c: Add gmodule support for windows and fix
325         windows build. Contribution is licensed as MIT/X11.
326         
327 2006-08-19  Aaron Bockover  <abockover@novell.com>
328
329         * test/driver.c: Added --debug mode that allows for testing all paths
330         of the driver without actually running real tests; runs only the 'fake'
331         test, which does nothing; useful for running the driver through valgrind
332
333         * test/Makefile.am:
334         * test/tests.h:
335         * test/fake.c: Added fake test for valgrinding the driver
336
337         * test/ptrarray.c: update sort test
338
339 2006-08-19  Aaron Bockover  <abockover@novell.com>
340
341         * test/test-both: added --help
342
343 2006-08-19  Aaron Bockover  <abockover@novell.com>
344
345         * test/driver.c: added -n mode to show only raw global run times,
346         which is useful for scripts (test-both --speed-compare)
347
348         * test/test-both: added --speed-compare mode
349
350         * test/README: updated with information on --speed-compare
351
352 2006-08-19  Aaron Bockover  <abockover@novell.com>
353
354         * test/test.c: do not print times if -t is not passed
355
356         * test/driver.c: removed use of GList from the driver to avoid skews due
357         to performance differences between GLib and EGLib
358         
359 2006-08-19  Aaron Bockover  <abockover@novell.com>
360
361         * test/test.c: Perform iterations at the test level, only output one
362         report for all iterations of tests in a group to produce more usable
363         output; add timing for the tests and group; added get_timestamp for
364         easy code timing
365
366         * test/test.h: Removed run_test as it should only be called from 
367         run_group, added get_timestamp
368
369         * test/Makefile.am: Added -DDRIVER_NAME 
370
371         * test/test-both: simple script to run both drivers with the same options
372
373         * test/driver.c: Iterations are now run at the test level, show a global
374         status (OK/FAIL) indicator
375
376         * test/README: Updated
377
378         * configure.ac: Renamed from configure.in as configure.in naming 
379         convention is deprecated in favor of configure.ac
380
381         * autogen.sh: s/configure.in/configure.ac/
382
383 2006-08-19  Miguel de Icaza  <miguel@novell.com>
384
385         * Makefile.am: Removed MAINTAINERCLEANFILES that was too
386         aggresive, it failed make distcheck and the resulting tarball was
387         not buildable.
388
389         * src/glib.h: remove the various GPOINTER_TO_*, G*_TO_POINTER,
390         GSIZE_FORMAT macros, and move them into src/eglib-config.h
391
392         Moved also gssize and gsize to be arch specific.   This should fix
393         the 32/64 problems that Jon Chambers reported. 
394
395         * configure.in: test for pointer size, define the various values
396         depending on 32 vs 32/64 worlds, might need further porting in the
397         future. 
398
399         Change package name to eglib
400
401         * test/slist.c, test/list.c, test/hashtable.c: Update tests to use
402         FAILURE macro.
403
404         * test/string-util.c: fix leak for valgrind tests.
405
406         * test/tests.h: New size test, for testing datatypes.
407
408         * test/sizes.c: New tests.
409         
410 2006-08-19  Aaron Bockover  <abockover@novell.com>
411
412         * test/README: Added quick guide on adding new tests/groups to the 
413         driver and some examples on how to perform various tests with the driver
414
415 2006-08-18  Aaron Bockover  <abockover@novell.com>
416
417         * test/driver.c: Added getopt support and code timing, among other 
418         nice features to make testing/profiling easier
419
420         * test/test.c: Add support for suppressing output (quiet) and
421         define RESULT, FAILED, and OK
422
423         * src/glib.h:
424         * src/glist.c: Added g_list_nth_data implementation
425
426         * test/slist.c:
427         * test/string-util.c:
428         * test/ptrarray.c:
429         * test/string.c:
430         * test/hashtable.c:
431         * test/list.c: Use RESULT, FAILURE, and OK for tests
432
433 2006-08-18  Miguel de Icaza  <miguel@novell.com>
434
435         * src/gstring.c (g_string_truncate): Implement truncate. 
436         (g_string_prepend): implement. 
437
438         Fix various bugs uncovered by new tests. 
439
440         * src/glib.h: introduce gssize type, the signed one.  Important. 
441
442         * src/eglib-config.h (G_OS_): Add the G_OS_UNIX and G_OS_WIN32
443         defines that we can use to check on the host OS.
444
445 2006-08-18  Aaron Bockover  <abockover@novell.com>
446
447         * test/test.[ch]:
448         * test/driver.c: Support pass/fail logging on tests to show group report
449
450 2006-08-18  Aaron Bockover  <abockover@novell.com>
451
452         * test/test.c: 
453         * test/test.h: Added result() to be used in place of g_strdup_printf(),
454         it's shorter to write and allows the duped string to be freed safely;
455         added license header to file
456
457         * test/driver.c: Added license header to file
458
459         * test/string-util.c:
460         * test/ptrarray.c:
461         * test/string.c:
462         * test/list.c: Use result() in place of g_strdup_printf(), it's nicer
463
464 2006-08-18  Aaron Bockover  <abockover@novell.com>
465
466         * src/gptrarray.c: Implemented g_ptr_array_sort
467
468         * test/ptrarray.c: Added sort test
469         
470         * test/driver.c: Added --help; support running N iterations and allow
471         selecting which test groups to run; uses the test group table in tests.h
472         
473         * test/tests.h: Added group table
474         
475         * test/test.h:
476         * test/test.c: Using a Group structure and table, removed run_groups
477         as we only need run_group now
478
479         * test/slist.h: Removed, not needed, tests/groups defined in tests.h
480
481 2006-08-18  Miguel de Icaza  <miguel@novell.com>
482
483         * src/unicode.c: New file, to host unicode code, it will throw as
484         this code is no longer used in the Mono runtime anyways.
485         
486         * src/glib.h: Use stdint.h types, a lot of the good stuff is
487         replicated by glib.
488
489 2006-08-18  Duncan Mak  <duncan@a-chinaman.com>
490
491         * src/glist.c (g_list_remove, g_list_remove_link): Implemented. 
492
493         * src/gslist.c (g_slist_remove): Remember to set the next pointer
494         to NULL when the item to remove is the first item in the list.
495         
496 2006-08-18  Duncan Mak  <duncan@a-chinaman.com>
497
498         * src/glist.c: Implemented. Missing remove,
499         remove_link and insert_before.
500
501         * test/list.c: Tests for GList.
502
503 2006-08-17  Aaron Bockover  <abockover@novell.com>
504
505         * src/gptrarray.c: Implemented g_ptr_array_remove and 
506         g_ptr_array_remove_index
507
508         * test/other: Removed, rewritten in Makefile.am
509
510         * test/Makefile.am: Build test-eglib against local eglib and 
511         test-glib against GLib 2.0 (replaces 'other')
512
513         * test/ptrarray.c: Added tests for g_ptr_array_remove and
514         g_ptr_array_remove_index
515
516 2006-08-17  Duncan Mak  <duncan@a-chinaman.com>
517
518         * src/gslist.c: Added MIT license.
519         (g_slist_insert_sorted): Forgot the case where the data is
520         appended to the end of the list.
521
522         * test/slist.c (test_slist_insert_sorted): Fix the test.        
523
524 2006-08-17  Aaron Bockover  <abockover@novell.com>
525
526         * src/gptrarray.c: Added g_ptr_array_set_size implementation
527
528         * test/ptrarray.c: Added test for g_ptr_array_set_size
529
530 2006-08-17  Miguel de Icaza  <miguel@novell.com>
531
532         * src/glib.h: A handful of extra macros
533
534         * configure.in, src/eglib-config.h.in: Set some system-specific
535         settings that are probed at configure time.
536
537 2006-08-17  Aaron Bockover  <abockover@novell.com>
538
539         * src/gptrarray.c: Added beginnings of GPtrArray (alloc, free, add, iterate)
540
541         * src/glib.h: Added GPtrArray signatures
542
543         * src/Makefile.am: Added gptrarray.c to build
544
545         * test/ptrarray.c:
546         * test/tests.h:
547         * test/driver.c:
548         * test/Makefile.am: Add ptrarray tests for available functionality
549
550 2006-08-17  Aaron Bockover  <abockover@novell.com>
551         
552         * test/test.h: 
553         * test/test.c: Added group iterator/test driver functionality
554         
555         * test/driver.c: Added groups to run using new test functionality
556         
557         * test/slist.h:
558         * test/hashtable.h:
559         * test/string-util.h: Test group definitions for string util/hashtable
560
561         * test/slist.c:
562         * test/str.c: 
563         * test/hash.c: Added test definition table 
564
565         * test/Makefile.am: Added -Wall -Werror -D_FORTIFY_SOURCE=2
566
567         * src/gstr.c: Added implementation for g_str_has_prefix, g_str_has_suffix
568
569         * src/glib.h: Added missing function signatures
570
571         * src/Makefile.am: added -D_FORTIFY_SOURCE=2 
572
573 2006-08-17  Duncan Mak  <duncan@a-chinaman.com>
574
575         * src/gslist.c (g_slist_remove_link): I misread the function
576         signature. Re-implemented.
577         (g_slist_delete_link): Implemented.
578         (g_slist_reverse): Implemented.
579         (g_slist_insert_sorted): Implemented.
580
581 2006-08-17  Duncan Mak  <duncan@a-chinaman.com>
582
583         * src/gslist.c (g_slist_find): 
584         (g_slist_length):
585         (g_slist_remove):
586         (g_slist_remove_link): Implemented.
587
588         * test/slist.c: Tests for GSList.
589
590 2006-08-17  Raja R Harinath  <harinath@gmail.com>
591
592         * src/gslist.c (g_slist_free_1): New.  Free a single list node.
593         (g_slist_free): Use it to free the list nodes.  Don't free the
594         data, since the list doesn't own it.
595         (g_slist_append): Convert into a one-liner.
596         (g_slist_foreach): Remove redundant null check.
597         (g_slist_last): Actually return the last node.
598         (g_slist_copy): Simplify.
599         * src/gslist.h (g_slist_free_1): Add.
600
601 2006-08-16  Duncan Mak  <duncan@a-chinaman.com>
602
603         * src/gslist.c:
604
605         * src/gslist.h: First attempt at implementing GSList, incomplete.
606
607         * src/Makefile.am (libeglib_la_SOURCES): add gslist.c
608         * src/glib.h: Add GFunc definition. #include the new gslist.h.
609
610 2006-08-16  Miguel de Icaza  <miguel@novell.com>
611
612         * src/Makefile.am: Added -Wall,-Werror, corrected lots of
613         mistakes.
614
615         * src/gstring.c: Gstring implementation.
616
617         * test/str.c (test_gstring): string tests.
618
619 2006-08-16  Aaron Bockover  <abockover@novell.com>
620
621         * src/gstr.c: Added g_strsplit implementation
622
623         * test/driver.c: Run the split test
624
625         * test/str.c: Added a test for g_strsplit
626
627         * Makefile.am:
628         * src/Makefile.am:
629         * test/Makefile.am: Added MAINTAINERCLEANFILES
630
631 2006-08-16  Miguel de Icaza  <miguel@novell.com>
632
633         * src/gouput.c: Implement some output routines, update missing
634         progress. 
635
636         * test: Add test driver, and initial tests. 
637
638 2006-08-15  Miguel de Icaza  <miguel@novell.com>
639
640         * src/ghashtable.c: Implement most of this, it is completely
641         untested at this point.
642