Main Page | Data Structures | File List | Data Fields | Globals

gcontainer.h File Reference

#include <glib.h>

Go to the source code of this file.

Data Structures

struct  GContainer
 Generic wrapper around glib Pointer Array and Doubly/Singly Linked List objects. More...

struct  GIterator
 An Iterator over a GContainer object. More...


Enumerations

enum  GContType { GCONT_PTR_ARRAY, GCONT_LIST, GCONT_SLIST }
 Describe a generic glib container type. More...


Functions

GContainerg_container_new (GContType type)
GContainerg_container_new_from_data (GContType type, void *data)
void g_container_add (GContainer *container, const gpointer data)
gboolean g_container_remove (GContainer *container, const gpointer data)
gboolean g_container_remove_fast (GContainer *container, const gpointer data)
gpointer g_container_remove_index (GContainer *container, guint index)
gpointer g_container_remove_index_fast (GContainer *container, guint index)
gpointer g_container_index (const GContainer *container, guint index)
gboolean g_container_get_iter (GIterator *iter, const GContainer *container)
gboolean g_container_get_iter_last (GIterator *iter, const GContainer *container)
gpointer g_iterator_get (const GIterator *iter)
gpointer g_iterator_next (GIterator *iter)
gpointer g_iterator_prev (GIterator *iter)
gboolean g_iterator_hasNext (const GIterator *iter)
gboolean g_iterator_hasPrev (const GIterator *iter)
void * g_container_free (GContainer *container, gboolean freeAssoc)
 Free the memory allocated to a GContainer.

void g_container_copy (GContainer *dest, GContainer *src)
 Copy the contents of one GContainer into another (not overwriting).

void g_container_convert (GContType type, GContainer *container)
 Convert the underlying container type of a GContainer.

void g_container_destroy (GContainer *array)
 Free a GContainer and all the pointers it stores.

void g_container_destroy_type (GContType type, void *array)
 Free an array of specified type and all the pointers it stores.


Enumeration Type Documentation

enum GContType
 

Describe a generic glib container type.

Enumeration values:
GCONT_PTR_ARRAY 
GCONT_LIST 
GCONT_SLIST 

Definition at line 30 of file gcontainer.h.


Function Documentation

void g_container_add GContainer container,
const gpointer  data
 

Definition at line 80 of file gcontainer.c.

References GContainer::data, ERROR, GCONT_LIST, GCONT_PTR_ARRAY, GCONT_SLIST, GContainer::len, and GContainer::type.

Referenced by g_container_convert(), g_container_copy(), and lutil_gsplit().

void g_container_convert GContType  type,
GContainer container
 

Convert the underlying container type of a GContainer.

Definition at line 321 of file gcontainer.c.

References GContainer::data, ERROR, g_container_add(), g_container_free(), g_container_get_iter(), g_container_new(), g_iterator_hasNext(), g_iterator_next(), GCONT_LIST, GCONT_PTR_ARRAY, GCONT_SLIST, and GContainer::type.

void g_container_copy GContainer dest,
GContainer src
 

Copy the contents of one GContainer into another (not overwriting).

Copy the contents of one GContainer into another. Note that this function will not overwrite any other data in dest - instead, it will simply append the contents of src onto dest.

Definition at line 366 of file gcontainer.c.

References ERROR, g_container_add(), g_container_get_iter(), g_iterator_hasNext(), and g_iterator_next().

Referenced by luau_copyProgInfo(), and luau_copyUpdate().

void g_container_destroy GContainer array  ) 
 

Free a GContainer and all the pointers it stores.

Free both a GContainer and all the data stored within it. Convenient to use on the GPtrArray returned from .

  • array is the array to destroy

Definition at line 388 of file gcontainer.c.

References ERROR, g_container_free(), g_container_get_iter(), g_iterator_hasNext(), and g_iterator_next().

Referenced by g_container_destroy_type(), and luau_versioncmp().

void g_container_destroy_type GContType  type,
void *  array
 

Free an array of specified type and all the pointers it stores.

Definition at line 407 of file gcontainer.c.

References ERROR, g_container_destroy(), and g_container_new_from_data().

void* g_container_free GContainer container,
gboolean  freeAssoc
 

Free the memory allocated to a GContainer.

Definition at line 297 of file gcontainer.c.

References GContainer::data, ERROR, GCONT_LIST, GCONT_PTR_ARRAY, GCONT_SLIST, and GContainer::type.

Referenced by g_container_convert(), g_container_destroy(), luau_checkKeyword(), luau_copyProgInfo(), luau_copyUpdate(), and luau_keywordsString().

gboolean g_container_get_iter GIterator iter,
const GContainer container
 

Definition at line 197 of file gcontainer.c.

References GContainer::data, GIterator::data, ERROR, GCONT_LIST, GCONT_PTR_ARRAY, GCONT_SLIST, GIterator::index, GContainer::type, and GIterator::type.

Referenced by g_container_convert(), g_container_copy(), g_container_destroy(), lutil_findString(), and lutil_strjoin().

gboolean g_container_get_iter_last GIterator iter,
const GContainer container
 

Definition at line 217 of file gcontainer.c.

References GContainer::data, GIterator::data, ERROR, GCONT_LIST, GCONT_PTR_ARRAY, GCONT_SLIST, GIterator::index, GContainer::len, GContainer::type, and GIterator::type.

gpointer g_container_index const GContainer container,
guint  index
 

Definition at line 178 of file gcontainer.c.

References GContainer::data, ERROR, GCONT_LIST, GCONT_PTR_ARRAY, GCONT_SLIST, GContainer::len, and GContainer::type.

Referenced by luau_versioncmp(), and lutil_strjoin().

GContainer* g_container_new GContType  type  ) 
 

Definition at line 34 of file gcontainer.c.

References GContainer::data, ERROR, GCONT_LIST, GCONT_PTR_ARRAY, GCONT_SLIST, GContainer::len, and GContainer::type.

Referenced by g_container_convert(), and lutil_gsplit().

GContainer* g_container_new_from_data GContType  type,
void *  data
 

Definition at line 55 of file gcontainer.c.

References GContainer::data, ERROR, GCONT_LIST, GCONT_PTR_ARRAY, GCONT_SLIST, GContainer::len, and GContainer::type.

Referenced by g_container_destroy_type(), luau_checkKeyword(), luau_copyProgInfo(), luau_copyUpdate(), and luau_keywordsString().

gboolean g_container_remove GContainer container,
const gpointer  data
 

Definition at line 94 of file gcontainer.c.

References GContainer::data, ERROR, GCONT_LIST, GCONT_PTR_ARRAY, GCONT_SLIST, GContainer::len, and GContainer::type.

Referenced by g_container_remove_fast().

gboolean g_container_remove_fast GContainer container,
const gpointer  data
 

Definition at line 123 of file gcontainer.c.

References GContainer::data, g_container_remove(), GCONT_PTR_ARRAY, GContainer::len, and GContainer::type.

gpointer g_container_remove_index GContainer container,
guint  index
 

Definition at line 137 of file gcontainer.c.

References GContainer::data, ERROR, GCONT_LIST, GCONT_PTR_ARRAY, GCONT_SLIST, GContainer::len, and GContainer::type.

Referenced by g_container_remove_index_fast().

gpointer g_container_remove_index_fast GContainer container,
guint  index
 

Definition at line 164 of file gcontainer.c.

References GContainer::data, ERROR, g_container_remove_index(), GCONT_PTR_ARRAY, GContainer::len, and GContainer::type.

gpointer g_iterator_get const GIterator iter  ) 
 

Definition at line 238 of file gcontainer.c.

References GIterator::data, ERROR, GCONT_LIST, GCONT_PTR_ARRAY, GCONT_SLIST, GIterator::index, and GIterator::type.

Referenced by g_iterator_next(), and g_iterator_prev().

gboolean g_iterator_hasNext const GIterator iter  ) 
 

Definition at line 268 of file gcontainer.c.

References GIterator::data, ERROR, GCONT_LIST, GCONT_PTR_ARRAY, GCONT_SLIST, GIterator::index, and GIterator::type.

Referenced by g_container_convert(), g_container_copy(), g_container_destroy(), lutil_findString(), and lutil_strjoin().

gboolean g_iterator_hasPrev const GIterator iter  ) 
 

Definition at line 282 of file gcontainer.c.

References GIterator::data, ERROR, GCONT_LIST, GCONT_PTR_ARRAY, GCONT_SLIST, GIterator::index, and GIterator::type.

gpointer g_iterator_next GIterator iter  ) 
 

Definition at line 252 of file gcontainer.c.

References g_iterator_get(), and iterNext().

Referenced by g_container_convert(), g_container_copy(), g_container_destroy(), lutil_findString(), and lutil_strjoin().

gpointer g_iterator_prev GIterator iter  ) 
 

Definition at line 261 of file gcontainer.c.

References g_iterator_get(), and iterPrev().


Generated on Mon Apr 12 22:17:11 2004 for luau by doxygen 1.3.2