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

aging.h File Reference

#include "common.h"
#include "glib-missing.h"

Go to the source code of this file.

Typedefs

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

Functions

agingaging_make (gint delay, GHashFunc hash, GEqualFunc eq, aging_free_t kfree)
 Create new aging container.
void aging_destroy (struct aging *)
 Destroy container, freeing all keys and values.
gpointer aging_lookup (struct aging *, gpointer key)
 Lookup value in table.
void aging_insert (struct aging *, gpointer key, gpointer value)
 Add value to the table.
void aging_remove (struct aging *, 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 struct aging  ) 
 

Destroy container, freeing all keys and values.

void aging_insert struct aging ag,
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 struct aging ,
gpointer  key
 

Lookup value in table.

struct aging* aging_make gint  delay,
GHashFunc  hash,
GEqualFunc  eq,
aging_free_t  kfree
 

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.
Returns:
opaque handle to the container.

void aging_remove struct aging ,
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 Sat Jun 30 17:53:25 2007 for gtk-gnutella by  doxygen 1.3.9.1