GTS Library Reference Manual |
---|
#include <gts.h> struct GtsFifo; GtsFifo* gts_fifo_new (void); void gts_fifo_push (GtsFifo *fifo,gpointer data);gpointer gts_fifo_pop (GtsFifo *fifo);gpointer gts_fifo_top (GtsFifo *fifo);guint gts_fifo_size (GtsFifo *fifo); void gts_fifo_foreach (GtsFifo *fifo, GtsFunc func,gpointer data);gboolean gts_fifo_is_empty (GtsFifo *fifo); void gts_fifo_reverse (GtsFifo *fifo); void gts_fifo_write (GtsFifo *fifo,FILE *fp); void gts_fifo_destroy (GtsFifo *fifo);
void gts_fifo_push (GtsFifo *fifo,gpointer data);
Push data into fifo.
fifo : | a GtsFifo. |
data : | data to add to fifo. |
gpointer gts_fifo_pop (GtsFifo *fifo);
Removes the first element from fifo.
fifo : | a GtsFifo. |
Returns : | the first element in fifo or NULL if fifo is empty. |
gpointer gts_fifo_top (GtsFifo *fifo);
fifo : | a GtsFifo. |
Returns : | the first element in fifo or NULL if fifo is empty. |
guint gts_fifo_size (GtsFifo *fifo);
fifo : | a GtsFifo. |
Returns : | the number of elements in fifo. |
void gts_fifo_foreach (GtsFifo *fifo, GtsFunc func,gpointer data);
Calls func in order for each item in fifo, passing data.
fifo : | a GtsFifo. |
func : | a GtsFunc. |
data : | user data to be passed to func. |
gboolean gts_fifo_is_empty (GtsFifo *fifo);
fifo : | a GtsFifo. |
Returns : | TRUE if fifo is empty, FALSE otherwise. |
void gts_fifo_reverse (GtsFifo *fifo);
Reverses the order of elements in fifo.
fifo : | a GtsFifo. |
void gts_fifo_write (GtsFifo *fifo,FILE *fp);
Writes the content of fifo in fp.
fifo : | a GtsFifo. |
fp : | a file pointer. |
<<< Extended binary heaps | Vectors and matrices >>> |