summaryrefslogtreecommitdiff
path: root/glib/gqueue.c
Commit message (Collapse)AuthorAgeFilesLines
* glib: Add SPDX license headers automaticallyPhilip Withnall2022-05-181-0/+2
| | | | | | | | | | | | | | Add SPDX license (but not copyright) headers to all files which follow a certain pattern in their existing non-machine-readable header comment. This commit was entirely generated using the command: ``` git ls-files glib/*.[ch] | xargs perl -0777 -pi -e 's/\n \*\n \* This library is free software; you can redistribute it and\/or\n \* modify it under the terms of the GNU Lesser General Public/\n \*\n \* SPDX-License-Identifier: LGPL-2.1-or-later\n \*\n \* This library is free software; you can redistribute it and\/or\n \* modify it under the terms of the GNU Lesser General Public/igs' ``` Signed-off-by: Philip Withnall <pwithnall@endlessos.org> Helps: #1415
* docs: mark macros, flags, enums with percent signGabor Karsay2022-03-041-2/+2
|
* Add some notes on complexity in glib/gqueue.cEmmanuel Fleury2020-09-021-1/+2
| | | | Related to issue #3
* gqueue: Remove a redundant branchPhilip Withnall2019-05-021-2/+4
| | | | | | | queue->tail->next cannot be non-NULL, as pushing onto the end of the queue is handled by the call to g_queue_push_tail_link() above. Signed-off-by: Philip Withnall <withnall@endlessm.com>
* queue: add g_queue_insert_before_link() and g_queue_insert_after_link()Christian Hergert2019-05-011-0/+67
| | | | | | This adds two new helpers that allow for inserting pre-allocated GList elements to the queue similar to existing helpers. This may be advantagous in some situations such as statically allocated GList elements.
* Add g_queue_clear_full APITapasweni Pathak2018-12-221-0/+22
| | | | Closes https://gitlab.gnome.org/GNOME/glib/merge_requests/378.
* gqueue: Fix -Wsign-compare warningsPhilip Withnall2018-07-101-3/+3
| | | | Signed-off-by: Philip Withnall <withnall@endlessm.com>
* gqueue: Document to use GAsyncQueue for thread-safe queuingPhilip Withnall2018-05-151-0/+3
| | | | | Signed-off-by: Philip Withnall <withnall@endlessm.com> Reviewed-by: nobody
* glib: document restrictions on various foreach() functionsDan Winship2017-11-161-0/+6
| | | | | | | | Some foreach() functions allow you to modify the object they are iterating, and others don't, but the docs were not generally clear about this. https://bugzilla.gnome.org/show_bug.cgi?id=724383
* glib/: LGPLv2+ -> LGPLv2.1+Sébastien Wilmet2017-05-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | All glib/*.{c,h} files have been processed, as well as gtester-report. 12 of those files are not licensed under LGPL: gbsearcharray.h gconstructor.h glibintl.h gmirroringtable.h gscripttable.h gtranslit-data.h gunibreak.h gunichartables.h gunicomp.h gunidecomp.h valgrind.h win_iconv.c Some of them are generated files, some are licensed under a BSD-style license and win_iconv.c is in the public domain. Sub-directories inside glib/: deprecated/: processed in a previous commit glib-mirroring-tab/: already LGPLv2.1+ gnulib/: not modified, the code is copied from gnulib libcharset/: a copy pcre/: a copy tests/: processed in a previous commit https://bugzilla.gnome.org/show_bug.cgi?id=776504
* Simplify code that uses g_queue_insert_before() and insert_after()Sébastien Wilmet2014-11-091-4/+1
| | | | | | | g_queue_insert_before() and g_queue_insert_after() now accept a NULL sibling. https://bugzilla.gnome.org/show_bug.cgi?id=736620
* GQueue: accept a NULL sibling for insert_before() and insert_after()Sébastien Wilmet2014-11-091-11/+24
| | | | | | | | | It simplifies a little bit some code that inserts data relative to a GList location, that might be NULL for the tail of the queue. A NULL sibling is probably less useful for insert_after(), so it's more for consistency with insert_before(). https://bugzilla.gnome.org/show_bug.cgi?id=736620
* docs: use "Returns:" consistentlyWilliam Jon McCann2014-02-191-14/+14
| | | | Instead of "Return value:".
* Eradicate links and xrefsMatthias Clasen2014-02-081-2/+2
| | | | These are all replaced by markdown ref links.
* Docs: Don't use the emphasis tagMatthias Clasen2014-01-311-10/+8
| | | | | Most of the time, the text read just as well without the extra boldness.
* Docs: Don't use the note tagMatthias Clasen2014-01-311-5/+2
| | | | More markup avoidance.
* Updated FSF's addressDaniel Mustieles2014-01-311-3/+1
|
* GQueue: documentation and formatting fixesMatthias Clasen2014-01-191-157/+158
|
* Fix malformed GTK-Doc comment blocks: add missing colons.Dieter Verfaillie2012-04-051-1/+1
| | | | | | | | Found these thanks to improved gobject-introspection GTK-Doc comment block/annotation parser from: https://bugzilla.gnome.org/show_bug.cgi?id=672254 https://bugzilla.gnome.org/show_bug.cgi?id=673385
* Added API g_queue_free_full().Ravi Sankar Guntur2011-12-161-0/+24
| | | | | | | | | | | | | | g_queue_free_full(), to free a Queue including its dynamically-allocated elements. On similar lines to List and Slist. void g_queue_free_full (GQueue *queue, GDestroyNotify free_func); Test case covering g_queue_free_full() is added. Added export symbol to glib.symbols. Closes Bug: https://bugzilla.gnome.org/show_bug.cgi?id=657433 Signed-off-by: Ravi Sankar Guntur <ravi.g@samsung.com>
* Don't #include <glib/gslice.h> from gmem.hRyan Lortie2011-09-181-0/+1
| | | | | | It looks like this was done just to help people port from gmem to gslice, but nothing in this header actually requires gslice.h to be included.
* Move GQueue docs inlineMatthias Clasen2011-07-171-0/+25
|
* Fix doc typosMatthias Clasen2011-06-041-1/+1
| | | | Now with fewer broken links...
* Have g_queue_remove() return a booleanMatthew Barnes2011-06-031-4/+15
| | | | | | | | | | | | | g_queue_remove() should return a boolean so callers can verify that an element was found and removed, as in the following example: if (g_queue_remove (queue, referenced_object)) g_object_unref (referenced_object); Similarly, g_queue_remove_all() should return the number of elements found and removed. https://bugzilla.gnome.org/show_bug.cgi?id=632294
* Reword awkward sentence in the docsMatthias Clasen2010-12-031-1/+1
| | | | | Pointed out in bug 636305, the docs for g_queue_remove_all() had several grammatical errors and sounded awkward.
* Remove excessive header inclusionsMatthias Clasen2010-09-031-2/+4
|
* glib/: fully remove galias hacksRyan Lortie2010-07-071-4/+0
|
* Add G_QUEUE_INIT, g_queue_init(), and g_queue_clear() to better supportMatthew Barnes2007-03-061-1/+41
| | | | | | | | | | | | 2007-03-06 Matthew Barnes <mbarnes@redhat.com> * glib/gqueue.h: * glib/gqueue.c: Add G_QUEUE_INIT, g_queue_init(), and g_queue_clear() to better support statically allocated queues. (#413244) svn path=/trunk/; revision=5378
* prepared deprecation of GMemChunk and GAllocator. added g_slice_*() API toTim Janik2005-11-011-35/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Tue Nov 1 16:24:20 2005 Tim Janik <timj@imendio.com> * glib/gmem.[hc]: prepared deprecation of GMemChunk and GAllocator. added g_slice_*() API to allocate and cache small bits of memory. an actuall allocator implementation for g_slice_*() is still pending. * glib/gthread.[hc]: changes from a patch by Matthias Clasen. changed GRealThread list to use in-structure *next; fields instead of GSList, in order for thread iteration to not depenend on g_slice_*() indirectly. _g_thread_mem_private_get(): _g_thread_mem_private_set(): added accessors for private memory, needed because the ordinary GPrivate implementation relies on GArray and GSList and therefore indirectly on working g_slice_*() allocations. * glib/gthread.[hc]: g_thread_foreach(): new public API function to loop over all existing threads. * glib/gdataset.c: * glib/gstring.c: * glib/gcache.c: * glib/garray.c: * glib/gqueue.c: * glib/gslist.c: * glib/glist.c: * glib/ghash.c: * glib/gtree.c: * glib/ghook.c: * glib/gmain.c: * glib/gnode.c: removed GAllocator and free list usages and accompanying locks. use g_slice_*() API to allocate and cache small bits of memory. * glib/ghook.h: removed GMemChunk field from public API. * glib/gslist.h: * glib/glist.h: deprecate allocator API, provide _free1() for consistency. * glib/gnode.h: deprecate allocator API. * glib/gmain.c: reordered GPollRec fields so g_slice_free_chain() can be used for poll rec lists. * glib/grel.c: removed mem chunk usage, and allocated tuples via g_slice_*(). g_relation_destroy(): free all tuples from the all_tuples hash table, this effectively maintains the life time track keeping of tuples. g_relation_delete_tuple(): free tuples which are removed from the all_tuples hash table. this fixes a temporary leak that was present in the memchunk code until the destruction of the relation.
* Doc fixesMatthias Clasen2005-09-201-1/+1
|
* Clarify docs a little. (#311727, Tristan van Berkom)Matthias Clasen2005-08-151-2/+2
| | | | | | | 2005-08-15 Matthias Clasen <mclasen@redhat.com> * glib/gqueue.c (g_queue_find_custom): Clarify docs a little. (#311727, Tristan van Berkom)
* Make PLT-reduction work with gcc4, and don't include everything inMatthias Clasen2005-03-141-1/+4
| | | | | | | | | | | | | | | | | 2005-03-13 Matthias Clasen <mclasen@redhat.com> Make PLT-reduction work with gcc4, and don't include everything in galias.h: * glib/glib.symbols: Group symbols by header and source file. * glib/makegalias.pl: Protect definitions by the same preprocessor symbols used to guard the headers. Move the alias declarations to a separate file which is produced when calling makegalias.pl -def * glib/Makefile.am (galiasdef.c): Add a rule to generate this file. * glib/*.c: Include galias.h after the other GLib headers, include galiasdef.c at the bottom.
* Use a memchunk for sizeof(GQueue)-sized chunks. (#167984, Fabrício BarrosMatthias Clasen2005-02-211-2/+2
| | | | | | | 2005-02-20 Matthias Clasen <mclasen@redhat.com> * glib/gqueue.c (g_queue_new): Use a memchunk for sizeof(GQueue)-sized chunks. (#167984, Fabrício Barros Cabral)
* Return -1 if queue is NULL. (#159530, Philippe Blain)Matthias Clasen2004-12-041-1/+1
| | | | | | | 2004-12-04 Matthias Clasen <mclasen@redhat.com> * glib/gqueue.c (g_queue_link_index): Return -1 if queue is NULL. (#159530, Philippe Blain)
* Implement the same PLT reduction technique used in GTK+:Matthias Clasen2004-09-161-0/+1
| | | | | | Thu Sep 16 02:03:15 2004 Matthias Clasen <maclas@gmx.de> Implement the same PLT reduction technique used in GTK+:
* Add some tests for off-by-one errors.Matthias Clasen2004-04-221-1/+1
| | | | | | | | | 2004-04-22 Matthias Clasen <mclasen@redhat.com> * tests/queue-test.c (main): Add some tests for off-by-one errors. * glib/gqueue.c (g_queue_pop_nth_link): Fix an off-by-one error. (#139703, Philippe Blain)
* Documentation updates.Matthias Clasen2004-02-271-3/+3
|
* Some documentation fixes.Soeren Sandmann2004-02-211-12/+6
| | | | | | Sat Feb 21 15:42:39 2004 Soeren Sandmann <sandmann@daimi.au.dk> * glib/gqueue.c: Some documentation fixes.
* Extend GQueue API to match the GList API. (#118439).Soeren Sandmann2004-02-211-9/+651
| | | | | | | | | Sat Feb 21 13:45:08 2004 Soeren Sandmann <sandmann@daimi.au.dk> * glib/gqueue.[ch]: Extend GQueue API to match the GList API. (#118439). * tests/queue-test.c: Update test suite to cover the new API.
* Patch from Sven Neumann to make the include order consistent. (#71704)Owen Taylor2002-12-041-3/+1
| | | | | | | Tue Dec 3 20:22:27 2002 Owen Taylor <otaylor@redhat.com> * glib/*.c: Patch from Sven Neumann to make the include order consistent. (#71704)
* Trivial s/foo/foo_/ fixes to make <glib.h> includable with -WshadowSoeren Sandmann2002-11-081-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | Fri Nov 8 19:44:20 2002 Soeren Sandmann <sandmann@daimi.au.dk> * docs/reference/glib/tmpl/arrays.sgml: * docs/reference/glib/tmpl/arrays_byte.sgml: * docs/reference/glib/tmpl/arrays_pointer.sgml: * docs/reference/glib/tmpl/date.sgml: * docs/reference/glib/tmpl/linked_lists_double.sgml: * docs/reference/glib/tmpl/linked_lists_single.sgml: * docs/reference/glib/tmpl/main.sgml: * docs/reference/glib/tmpl/queue.sgml: * docs/reference/glib/tmpl/random_numbers.sgml: * docs/reference/glib/tmpl/relations.sgml: * docs/reference/glib/tmpl/scanner.sgml: * docs/reference/gobject/tmpl/gtype.sgml: * docs/reference/gobject/tmpl/value_arrays.sgml glib/garray.h: * glib/gdate.h glib/giochannel.h glib/glist.h glib/gmain.c: * glib/gmain.h glib/gqueue.c glib/gqueue.h glib/grand.c glib/grand.h: * glib/grel.h glib/gslist.h glib/gtimer.h gobject/gvaluearray.h: Trivial s/foo/foo_/ fixes to make <glib.h> includable with -Wshadow without warnings (#91680)
* documentation update. add documentation. update docs. Remove references toMatthias Clasen2001-10-021-0/+105
| | | | | | | | | * glib/gstrfuncs.c, glib/giochannel.c: documentation update. * glib/gqueue.c: add documentation. * glib/tmpl/iochannel.sgml, glib/tmpl/macros_misc.sgml, glib/tmpl/queue.sgml: update docs. * glib/tmpl/modules.sgml, glib/tmpl/threads.sgml: Remove references to glib-config.
* Ok, I'm a moron. When I originally implemented ENABLE_GC_FRIENDLY, ISebastian Wilhelmi2000-12-191-0/+4
| | | | | | | | | | | | 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.
* applied patch from Andreas Persenius <ndap@swipnet.se> that updates theTim Janik2000-07-261-3/+3
| | | | | | | | 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.
* Add configure test for garbage collector friendliness for GLib. IfSebastian Wilhelmi2000-04-171-0/+5
| | | | | | | | | | | | | | 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.
* Renamed g_queue_create to g_queue_new in conformance to all other GLibSebastian Wilhelmi2000-04-171-1/+1
| | | | | | | | 2000-04-17 Sebastian Wilhelmi <wilhelmi@ira.uka.de> * glib.h, gqueue.c, tests/queue-test.c (main): Renamed g_queue_create to g_queue_new in conformance to all other GLib data types.
* We want the next and prev pointer of the inserted link to be NULL.Sebastian Wilhelmi2000-03-131-4/+4
| | | | | | | 2000-03-13 Sebastian Wilhelmi <wilhelmi@ira.uka.de> * gqueue.c (g_queue_push_tail_link, g_queue_push_head_link): We want the next and prev pointer of the inserted link to be NULL.
* 18:36. incorporated proposed cleanups from gtk-devel-list.Tim Janik1999-07-241-81/+181
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Add copyright, clean up code a bit.Jeff Garzik1999-03-171-70/+80
| | | | | | | 1999-03-17 Jeff Garzik <jgarzik@pobox.com> * gstack.c, gqueue.c: Add copyright, clean up code a bit.
* Added stack, queue ADTs and related tests.Jeff Garzik1999-03-091-0/+144
Tue Mar 9 14:37:32 1999 Jeff Garzik <jgarzik@pobox.com> * Makefile.am, glib.h, gstack.c, gqueue.c, tests/Makefile.am, tests/queue-test.c, tests/stack-test.c: Added stack, queue ADTs and related tests. * glib.h, glist.c: New g_list_delete() function.