summaryrefslogtreecommitdiff
path: root/gslist.c
Commit message (Collapse)AuthorAgeFilesLines
* Move glib library into a subdirectory, make all GLib include files includeOwen Taylor2001-06-261-728/+0
| | | | | | | | | | | | Tue Jun 26 11:43:46 2001 Owen Taylor <otaylor@redhat.com> * configure.in Makefile.am *.[ch] glib/*.[ch] glib/Makefile.am: Move glib library into a subdirectory, make all GLib include files include as <glib/glist.h> * tests/testglib.c tests/testgdate.c tests/testgdateparser.c tests/timeloop.c tests/timeloop-basic.c: Move all tests into the tests/ subdirectory.
* Make foreach() safe against removal of the _current_ element. While thisOwen Taylor2001-05-031-1/+2
| | | | | | | | | | Thu May 3 06:38:28 2001 Owen Taylor <otaylor@redhat.com> * g[s]list.c (g_[s]list_foreach) docs/Changes-2.0.txt: Make foreach() safe against removal of the _current_ element. While this could break some code, the new behavior is consistent with the rest of GLib/GTK+ and probably is what people expect in most cases. (Suggested by Paul Kuykendall, #50071)
* removed archaic gpointer derived_data; relict and added a GData memberTim Janik2001-03-181-11/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Wed Mar 14 18:46:54 2001 Tim Janik <timj@gtk.org> * gscanner.[hc]: removed archaic gpointer derived_data; relict and added a GData member instead. * glist.[hc]: added g_list_remove_all(). * gslist.[hc]: added g_slist_remove_all(). Sat Mar 17 23:18:36 2001 Tim Janik <timj@gtk.org> * gobject.c (g_object_get_property): minor bug-fix. * gbsearcharray.[hc]: provide a macro for static initialization and functions g_bsearch_array_new() and g_bsearch_array_destroy() for dynamic allocations. * gboxed.c: introduce G_TYPE_GSTRING, boxed type for GString. * gclosure.[hc]: naming corrections. Fri Mar 9 16:42:08 2001 Tim Janik <timj@gtk.org> * gvaluetypes.[hc]: moved g_strdup_value_contents() into this file as a public function (was static in gobject.c before). it's a bit odd to have that function here, especially since it requires extra includes, but then it doesn't very well fit somewhere else either. * gparamspecs.c: added default/max/min checks to param spec creation functions.
* changed prototype of g_boxed_type_register_static() to contain an optionalTim Janik2001-03-071-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Wed Mar 7 09:36:33 2001 Tim Janik <timj@gtk.org> * gboxed.[hc]: changed prototype of g_boxed_type_register_static() to contain an optional init function and a hint at whether the boxed structure uses ref counting internally. added g_value_set_boxed_take_ownership(). made G_TYPE_BOXED an abstract value type. * genums.[hc]: made G_TYPE_ENUM and G_TYPE_FLAGS abstract value types. * glib-genmarshal.c: argument type changes, preparation for third-party arg specification. * gobject.[hc]: cleaned up get/set property code. added g_strdup_value_contents() to improve warnings. * gparam.[hc]: added g_param_value_convert(), taking over responsibility of the old g_value_convert(). added G_PARAM_LAX_VALIDATION flag so validation alterations may be valid a part of the property setting process. * gparamspecs.[hc]: made value comparisons stable (for sort applications). added GParamSpecValueArray, a param spec for value arrays and GParamSpecClosure. nuked the value exchange functions and GParamSpecCCallback. * gtype.[hc]: catch unintialized usages of the type system with g_return_val_if_uninitialized(). introduced G_TYPE_FLAG_VALUE_ABSTRACT to flag types that introduce a value table, but can't be used for g_value_init(). cleaned up reserved type ids. * gvalue.[hc]: code cleanups and saner checking. nuked the value exchange API. implemented value transformations, we can't really "convert" values, rather transforms are an anylogy to C casts, real conversions need a param spec for validation, which is why g_param_value_convert() does real conversions now. * gvaluearray.[hc]: new files that implement a GValueArray, a struct that can hold inhomogeneous arrays of value (to that extend that it also allowes undefined values, i.e. G_VALUE_TYPE(value)==0). this is exposed to the type system as a boxed type. * gvaluetransform.c: new file implementing most of the former value exchange functions as single-sided transformations. * gvaluetypes.[hc]: nuked G_TYPE_CCALLBACK, added g_value_set_string_take_ownership(). * *.h: s/G_IS_VALUE_/G_VALUE_HOLDS_/. * *.[hc]: many fixes and cleanups. * many warning improvements. Tue Feb 27 18:35:15 2001 Tim Janik <timj@gtk.org> * gobject.c (g_object_get_valist): urg, pass G_VALUE_NOCOPY_CONTENTS into G_VALUE_LCOPY(), this needs proper documenting. * gparam.c: fixed G_PARAM_USER_MASK. * gtype.c (type_data_make_W): (type_data_last_unref_Wm): fixed invalid memory freeing. * gobject.c (g_object_last_unref): destroy signal handlers associated with object, right before finalization. * gsignal.c (g_signal_parse_name): catch destroyed nodes or signals that don't actually support details. * gobject.[hc]: got rid of property trailers. nuked GObject properties "data" and the "signal" variants. (g_object_connect): new convenience function to do multiple signal connections at once. (g_object_disconnect): likewise, for disconnections. * gparam.[hc] (g_param_spec_pool_lookup): took out trailer support. * gvalue.[hc]: marked g_value_fits_pointer() and g_value_peek_pointer() as private (the latter got renamed from g_value_get_as_pointer()). Wed Mar 7 09:32:06 2001 Tim Janik <timj@gtk.org> * glib-object.h: add gvaluearray.h. * gstring.[hc]: fixup naming of g_string_sprint*. * gtypes.h: fixed GCompareDataFunc naming. Wed Mar 7 09:33:27 2001 Tim Janik <timj@gtk.org> * gobject/Makefile.am: shuffled rules to avoid excessive rebuilds. * gobject/gobject-sections.txt: updates. * gobject/tmpl/*: bunch of updates, added another patch from Eric Lemings <eric.b.lemings@lmco.com>.
* Ok, I'm a moron. When I originally implemented ENABLE_GC_FRIENDLY, ISebastian Wilhelmi2000-12-191-1/+1
| | | | | | | | | | | | 2000-12-19 Sebastian Wilhelmi <wilhelmi@ira.uka.de> * gslist.c, glist.c: Ok, I'm a moron. When I originally implemented ENABLE_GC_FRIENDLY, I forgot to include config.h into the affected files. Now that Alex did that for those two, inevitable typos surfaced, which are now fixed. * garray.c, ghash.c, gqueue.c, gtree.c: Include config.h as well, as ENABLE_GC_FRIENDLY should be known.
* Added --disable-mem-pools option.Alexander Larsson2000-12-191-0/+39
| | | | | | | | | | | | | 2000-12-19 Alexander Larsson <alexl@redhat.com> * configure.in: Added --disable-mem-pools option. * glist.c: * gslist.c: * gnode.c: * gmem.c: Disable free list and memory chunks if DISABLE_MEM_POOLS is defined.
* Patch from David Benson <daveb@idealab.com> to add user_data support toJonathan Blandford2000-11-201-11/+38
| | | | | | | | | | | | | | | | | | | | Mon Nov 20 18:55:17 2000 Jonathan Blandford <jrb@redhat.com> * gtree.[hc]: Patch from David Benson <daveb@idealab.com> to add user_data support to gtree functions. Mon Nov 13 18:35:52 2000 Jonathan Blandford <jrb@redhat.com> * gtypes.h (GCompareFuncData): new func type to let you use user data when comparing nodes. * gslist.c (g_list_sort_with_data): new function to sort with user_data. * glist.c (g_list_sort_with_data): new function to sort with user_data. * garray.[ch]: Added convenience functions to sort arrays.
* applied patch from Andreas Persenius <ndap@swipnet.se> that updates theTim Janik2000-07-261-4/+4
| | | | | | | | Wed Jul 26 12:59:31 2000 Tim Janik <timj@gtk.org> * *.[hc]: applied patch from Andreas Persenius <ndap@swipnet.se> that updates the license headers to the GNU Lesser General Public License, as well as updating the copyright year to 2000.
* fixed SIZEOF_LONG==4 assumption with ENABLE_MEM_CHECK, from Art HaasTim Janik2000-05-191-2/+2
| | | | | | | | | | | | | | | | | Fri May 19 09:00:44 2000 Tim Janik <timj@gtk.org> * gmem.c (g_free): fixed SIZEOF_LONG==4 assumption with ENABLE_MEM_CHECK, from Art Haas <ahaas@neosoft.com>. * gslist.c (g_slist_reverse): shut up compiler. * gscanner.c (g_scanner_get_token_ll): removed inline assignment. * garray.c: remove index>=0 checks for unsigned indices. * gmain.c (g_idle_prepare): timeout assignment fix. * gtree.c (g_tree_node_rotate_right): shut up compiler.
* Changed the 'data' parameters from gpointer to gconstpointer for theSebastian Wilhelmi2000-04-181-9/+9
| | | | | | | | | 2000-04-18 Sebastian Wilhelmi <wilhelmi@ira.uka.de> * glib.h, glist.h, gslist.h: Changed the 'data' parameters from gpointer to gconstpointer for the functions g_(list|slist)_(remove|find|find_custom|index), as they do not change this parameter. This fixes bug #4836.
* Add configure test for garbage collector friendliness for GLib. IfSebastian Wilhelmi2000-04-171-2/+14
| | | | | | | | | | | | | | 2000-04-17 Sebastian Wilhelmi <wilhelmi@ira.uka.de> * configure.in, acconfig.h: Add configure test for garbage collector friendliness for GLib. If enabled, ENABLE_GC_FRIENDLY will be defined. * garray.c, ghash.c, glist.c, gmain.c, gmem.c, gnode.c, gqueue.c, gslist.c, gtree.c: If ENABLE_GC_FRIENDLY is defined, NULLify all memory released by the user, but cached by GLib. This lets a garbage collector have a more correct view of the actually used memory.
* minor optimization.Tim Janik2000-03-011-16/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Wed Mar 1 10:39:39 2000 Tim Janik <timj@gtk.org> * gslist.c (g_slist_reverse): minor optimization. * testglib.c (g_node_test): added a couple of tests for g_node_copy(). * glib.h: * gnode.c (g_node_copy): new function to copy subtrees, supplied by dbsears@ix.netcom.com. changed iterator to walk the children list backwards, so we get down from O(n^2) to O(n). * gnode.c (g_node_first_sibling): applied patch from dbsears@ix.netcom.com to optimize access if node->parent is present. * gutils.c (g_get_any_init): backed out HAVE_PW_GECOS check around assignment of g_real_name, sicne HAVE_PW_GECOS is never defined and thus breaks the original code. * merged changes from 1.2.7. Sat Feb 19 19:43:29 2000 Tim Janik <timj@gtk.org> * testgmodule.c (main): added test to check that not yet bound symbols in shared libraries of the main module are retrievable, from David Gero. Fri Jan 28 11:37:41 2000 Owen Taylor <otaylor@redhat.com> Bug #4156 - Changes vaguely modelled after Scott Gifford's patch * gtimer.c (g_timer_elapsed): Never report negative times - clip times to 0. * gmain.c (g_timeout_prepare): Guard against unexpected clock shifts by never setting a timeout of more than data->interval msecs.
* Add a cast.Tor Lillqvist1999-08-171-16/+35
| | | | | | | | | * glib.h (g_trash_stack_push): Add a cast. * gslist.c * glist.c: Make the inline functions static inline, and add separate extern wrappers. Not all compilers produce callable entry points for inline functions, even if gcc does.
* 18:36. incorporated proposed cleanups from gtk-devel-list.Tim Janik1999-07-241-3/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Sat Jul 24 20:11:35 1999 Tim Janik <timj@gtk.org> * merged GLib 1.3.0 with glib-1.2.3 from Fri Jul 16 22:18:36. * incorporated proposed cleanups from gtk-devel-list. * bumped version number to GLib-1.3.1 * glib.h: * gqueue.c: * gstring.c: * glist.c: removed string tokenisation (we got g_strsplit() and g_strjoin() already) and readline functions. s/g_list_delete/g_list_delete_link. implemented g_slist_delete_link. removed notion of g_ATEXIT() macro in glib.h, this is an *internal* macro, g_atexit() is provided for public consumption. added GTrashStack inline utility functions. reimplement double eneded queues. removed GStack implementation, people can use a queue or a (singly) linked list for this task. deprecated g_strescape(), we need the SunOS variants here. * gdate.c: added DEBUG_MSG() macro to wrap old messages. * *.*: CVS merges. * upgrade to libtool 1.3.3.
* inserted additional note to look for ChangeLog and AUTHORS file for a logCST 1999 Shawn T. Amundson1999-02-241-0/+7
| | | | | | | Wed Feb 24 00:08:42 CST 1999 Shawn T. Amundson <amundson@gtk.org> * *.[ch]: inserted additional note to look for ChangeLog and AUTHORS file for a log of modifications.
* s/G_LOCK_DECLARE/G_LOCK_DEFINE/ throuhout glib. Added G_LOCK_EXTERN macroSebastian Wilhelmi1999-02-101-1/+1
| | | | | | | 1999-02-10 Sebastian Wilhelmi <wilhelmi@ira.uka.de> * glib.h: s/G_LOCK_DECLARE/G_LOCK_DEFINE/ throuhout glib. Added G_LOCK_EXTERN macro to declare a lock externally.
* pools of 128 items instead of 1024 items.Elliot Lee1999-02-091-1/+1
| | | | pools of 128 items instead of 1024 items.
* version bump to 1.1.8, binary age 0, interface age 0.Tim Janik1998-12-161-11/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Wed Dec 16 03:16:58 1998 Tim Janik <timj@gtk.org> * configure.in: version bump to 1.1.8, binary age 0, interface age 0. * glib.h: changed g_lock() to G_LOCK(), g_unlock() to G_UNLOCK() and g_trylock() to G_TRYLOCK(), since these are macros that expand to nothing with --disable-threads. changed G_LOCK_DEFINE() to G_LOCK_DECLARE() and introduced G_LOCK_DECLARE_STATIC() to achive the results of static G_LOCK_DECLARE(). changed semantics of g_thread_supported to g_thread_supported() so it can be used as a function like g_module_supported(). the actuall definition is still a macro that expands into a variable for performance reasons though. various indentation and coding style cleanups. * configure.in: added --enable-threads that defaults to yes. * gmutex.c: changed tests g_thread_supported to g_thread_supported (), changed variable settings of g_thread_supported to g_threads_got_initialized. garray.c: gcache.c: gdataset.c: gdate.c: ghash.c: glist.c: gmain.c: gnode.c: gslist.c: gstring.c: gtree.c: gutils.c: changed s/g_lock/G_LOCK/, s/g_unlock/G_UNLOCK/, s/static G_LOCK_DEFINE/G_LOCK_DECLARE_STATIC/.
* Make sure all calls to g_node_validate_allocator are withinOwen Taylor1998-12-151-1/+1
| | | | | | | | | | | | | | Tue Dec 15 10:40:09 1998 Owen Taylor <otaylor@redhat.com> * gnode.c glist.c gslist.c: Make sure all calls to g_node_validate_allocator are within current_allocator lock, so we have consistency on that point. (Should not really matter, but this way we match the comments) * glist.c (g_list_free_1): Removed some lines that should never have been committed. (For debugging)
* This commit merges the glib-threads branch into the mainOwen Taylor1998-12-151-4/+33
| | | | | | | | | | | branch. See the ChangeLog for details of the changes. In brief overview: - The set of threading functions can be set - A default implementation is provided in -lgthread - All static data structures are locked using these functions if g_thread_init() is called.
* removed the GListAllocator type and its g_*_allocator_*() functionTim Janik1998-11-241-41/+70
| | | | | | | | | | | | | | | | | | | | Tue Nov 24 09:40:00 1998 Tim Janik <timj@gtk.org> * glib.h: removed the GListAllocator type and its g_*_allocator_*() function variants (which weren't working anyways) in favour of a generic GAllocator type. new functions: g_allocator_new, g_allocator_free, g_slist_push_allocator, g_slist_pop_allocator, g_list_push_allocator, g_list_pop_allocator, g_node_push_allocator and g_node_pop_allocator. * gstring.c: removed bogus slist allocator code. * gtree.c: maintain own list of free tree nodes and don't waste GSLists for that, removed bogus slist allocator code. * glist.c: use GAllocators for node allocation. * gslist.c: use GAllocators for node allocation. * gnode.c: use GAllocators for node allocation. * gdataset.c: cleanups wrt automatic initialization.
* new function g_slist_copy() to duplicate a list with all its dataTim Janik1998-11-231-0/+25
| | | | | | | | | Sun Nov 22 17:07:03 1998 Tim Janik <timj@gtk.org> * glib.h: * gslist.c: new function g_slist_copy() to duplicate a list with all its data pointers. * glist.c: new function g_list_copy.
* Added g_list_sort() and g_slist_sort() to merge sort GLists and GSLists.Owen Taylor1998-11-131-0/+55
| | | | | | | | | | | Fri Nov 13 15:17:34 1998 Owen Taylor <otaylor@redhat.com> * glist.c gslist.c glib.h: Added g_list_sort() and g_slist_sort() to merge sort GLists and GSLists. Submitted by Sven Over <sven.over@ob.kamp.net> over a year ago! * testglib.c: Test the new sort functions.
* Initial revisionOwen Taylor1998-06-101-0/+456