Main Page | Modules | Alphabetical List | Data Structures | File List | Data Fields | Globals | Related Pages

aging.h File Reference

#include "glib-missing.h"

Go to the source code of this file.

Typedefs

typedef void(* aging_free_t )(gpointer value, gpointer udata)

Functions

gpointer aging_make (gint delay, GHashFunc hash, GEqualFunc eq, aging_free_t kfree, gpointer kdata, aging_free_t vfree, gpointer vdata)
 Create new aging container.

void aging_destroy (gpointer obj)
 Destroy container, freeing all keys and values.

gpointer aging_lookup (gpointer obj, gpointer key)
 Lookup value in table.

void aging_insert (gpointer obj, gpointer key, gpointer value)
 Add value to the table.

void aging_remove (gpointer obj, gpointer key)
 Remove value associated with key, dispose of items (key and value) stored in the hash table, but leave the function parameter alone.


Typedef Documentation

typedef void(* aging_free_t)(gpointer value, gpointer udata)
 


Function Documentation

void aging_destroy gpointer  obj  ) 
 

Destroy container, freeing all keys and values.

void aging_insert gpointer  obj,
gpointer  key,
gpointer  value
 

Add value to the table.

If it was already present, its lifetime is augmented by the aging delay.

The key argument is freed immediately if there is a free routine for keys and the key was present in the table.

The previous value is freed and replaced by the new one if there is an insertion conflict and the value pointers are different.

gpointer aging_lookup gpointer  obj,
gpointer  key
 

Lookup value in table.

gpointer aging_make gint  delay,
GHashFunc  hash,
GEqualFunc  eq,
aging_free_t  kfree,
gpointer  kdata,
aging_free_t  vfree,
gpointer  vdata
 

Create new aging container.

Parameters:
delay the aging delay, in seconds, for entries
hash the hashing function for the keys in the hash table
eq the equality function for the keys in the hash table
kfree the key freeing callback, NULL if none.
kdata the extra parameter to pass to the key-freeing callback
vfree the value freeing callback, NULL if none.
vdata the extra parameter to pass to the value-freeing callback
Returns:
opaque handle to the container.

void aging_remove gpointer  obj,
gpointer  key
 

Remove value associated with key, dispose of items (key and value) stored in the hash table, but leave the function parameter alone.


Generated on Sun Feb 12 10:49:59 2006 for Gtk-Gnutella by doxygen 1.3.6