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

fifo.c File Reference


Detailed Description

A FIFO.

Items are put on one end and retrieved on the other, in the order they were put.

Author:
Raphael Manfredi
Date:
2004

#include "common.h"
#include "fifo.h"
#include "walloc.h"
#include "override.h"

Data Structures

struct  fifo_real
 The real FIFO structure (the advertised fifo_t is just a facade). More...


Typedefs

typedef fifo_real fifo_real_t
 The real FIFO structure (the advertised fifo_t is just a facade).


Functions

 RCSID ("$Id:fifo.c, v 1.3 2005/06/25 01:37:42 daichik Exp $")
fifo_tfifo_make (void)
 Create new FIFO.

void fifo_free (fifo_t *f)
 Destroy FIFO.

void fifo_free_all (fifo_t *f, fifo_free_t cb, gpointer udata)
 Destroy FIFO, invoking freeing callback on all items still held.

gint fifo_count (fifo_t *f)
 Returns amount of items queued in FIFO.

void fifo_put (fifo_t *f, gconstpointer data)
 Add entry to FIFO.

gpointer fifo_remove (fifo_t *f)
 Remove entry from FIFO.


Typedef Documentation

typedef struct fifo_real fifo_real_t
 

The real FIFO structure (the advertised fifo_t is just a facade).


Function Documentation

gint fifo_count fifo_t f  ) 
 

Returns amount of items queued in FIFO.

void fifo_free fifo_t f  ) 
 

Destroy FIFO.

void fifo_free_all fifo_t f,
fifo_free_t  cb,
gpointer  udata
 

Destroy FIFO, invoking freeing callback on all items still held.

Parameters:
f the FIFO to free
cb the freeing callback to invoke on all items.
udata the extra user data passed as-is to the freeing callback.

fifo_t* fifo_make void   ) 
 

Create new FIFO.

void fifo_put fifo_t f,
gconstpointer  data
 

Add entry to FIFO.

gpointer fifo_remove fifo_t f  ) 
 

Remove entry from FIFO.

Returns:
the oldest item still held in FIFO, NULL if no item remains.

RCSID "$Id:fifo.  c,
v 1.3 2005/06/25 01:37:42 daichik Exp $" 
 


Generated on Sun Feb 12 10:50:00 2006 for Gtk-Gnutella by doxygen 1.3.6