flux-fifo

flux-fifo —

Synopsis




#define     FLUX_FIFO                       (fifo)
struct      FluxFifoNode;
enum        FluxFifoMode;
struct      FluxFifo;
FluxFifo*   flux_fifo_new                   (guint buffers_min,
                                             guint buffers_max,
                                             guint buf_size);
void        flux_fifo_finalize              (FluxObject *fifo);
gint        flux_fifo_get_free_max          (FluxFifo *fifo);
void        flux_fifo_enqueue               (FluxFifo *fifo,
                                             void *source,
                                             guint len);
gint        flux_fifo_dequeue               (FluxFifo *fifo,
                                             void *dest,
                                             guint len);
void*       flux_fifo_dequeue_dup           (FluxFifo *fifo,
                                             guint len);
gint        flux_fifo_peek                  (FluxFifo *fifo,
                                             void *dest,
                                             guint len);
gint        flux_fifo_drop                  (FluxFifo *fifo,
                                             guint len);
gint        flux_fifo_drop_all              (FluxFifo *fib);
void        flux_fifo_reset                 (FluxFifo *fib);
void        flux_fifo_flush                 (FluxFifo *fifo);
gint        flux_fifo_for_data              (FluxFifo *fifo,
                                             guint len,
                                             FluxByteIteratorFunc *func,
                                             void *user_data);
void        flux_fifo_set_mode              (FluxFifo *fifo,
                                             FluxFifoMode mode);
void        flux_fifo_set_cipher            (FluxFifo *fifo,
                                             FluxCipher *cipher);
void        flux_fifo_set_compression       (FluxFifo *fifo,
                                             guint compression);
gfloat      flux_fifo_get_compression_ratio (FluxFifo *fifo);
#define     flux_fifo_get_used              (fib)
#define     flux_fifo_get_free_current      (fib)
#define     flux_fifo_get_free_min          (fib)
#define     FLUX_FIFO_FOR_DATA              (fib, lim, p, len)

Description

Details

FLUX_FIFO()

#define FLUX_FIFO(fifo) ((FluxFifo *) (fifo))

fifo :

struct FluxFifoNode

struct FluxFifoNode {

  FluxFifoNode *prev, *next;
  gchar *data;
};


enum FluxFifoMode

typedef enum
{
  FLUX_FIFO_MODE_SIMPLE,
  FLUX_FIFO_MODE_ENCODE,
  FLUX_FIFO_MODE_DECODE
}
FluxFifoMode;


struct FluxFifo

struct FluxFifo {

  FluxObject object;

  FluxFifoMode mode;

  FluxFifoNode *node_out, *node_in;
  FluxFifoNode *node_cur;
  guint byte_out, byte_in;
  guint enqueued;
  guint buf_size;
  guint i;
  gint buffers_min, buffers_max, buffers_cur;

  FluxCipher *cipher;

  guint    compression_level;
  gboolean have_compression;
  z_stream zs;
};


flux_fifo_new ()

FluxFifo*   flux_fifo_new                   (guint buffers_min,
                                             guint buffers_max,
                                             guint buf_size);

buffers_min :
buffers_max :
buf_size :
Returns :

flux_fifo_finalize ()

void        flux_fifo_finalize              (FluxObject *fifo);

fifo :

flux_fifo_get_free_max ()

gint        flux_fifo_get_free_max          (FluxFifo *fifo);

fifo :
Returns :

flux_fifo_enqueue ()

void        flux_fifo_enqueue               (FluxFifo *fifo,
                                             void *source,
                                             guint len);

fifo :
source :
len :

flux_fifo_dequeue ()

gint        flux_fifo_dequeue               (FluxFifo *fifo,
                                             void *dest,
                                             guint len);

fifo :
dest :
len :
Returns :

flux_fifo_dequeue_dup ()

void*       flux_fifo_dequeue_dup           (FluxFifo *fifo,
                                             guint len);

fifo :
len :

flux_fifo_peek ()

gint        flux_fifo_peek                  (FluxFifo *fifo,
                                             void *dest,
                                             guint len);

fifo :
dest :
len :
Returns :

flux_fifo_drop ()

gint        flux_fifo_drop                  (FluxFifo *fifo,
                                             guint len);

fifo :
len :
Returns :

flux_fifo_drop_all ()

gint        flux_fifo_drop_all              (FluxFifo *fib);

fib :
Returns :

flux_fifo_reset ()

void        flux_fifo_reset                 (FluxFifo *fib);

fib :

flux_fifo_flush ()

void        flux_fifo_flush                 (FluxFifo *fifo);

fifo :

flux_fifo_for_data ()

gint        flux_fifo_for_data              (FluxFifo *fifo,
                                             guint len,
                                             FluxByteIteratorFunc *func,
                                             void *user_data);

fifo :
len :
func :
user_data :
Returns :

flux_fifo_set_mode ()

void        flux_fifo_set_mode              (FluxFifo *fifo,
                                             FluxFifoMode mode);

fifo :
mode :

flux_fifo_set_cipher ()

void        flux_fifo_set_cipher            (FluxFifo *fifo,
                                             FluxCipher *cipher);

fifo :
cipher :

flux_fifo_set_compression ()

void        flux_fifo_set_compression       (FluxFifo *fifo,
                                             guint compression);

fifo :
compression :

flux_fifo_get_compression_ratio ()

gfloat      flux_fifo_get_compression_ratio (FluxFifo *fifo);

fifo :
Returns :

flux_fifo_get_used()

#define   flux_fifo_get_used(fib)         ((fib)->enqueued)

fib :

flux_fifo_get_free_current()

#define   flux_fifo_get_free_current(fib) flux_fifo_get_free_max (fib)

fib :

flux_fifo_get_free_min()

#define   flux_fifo_get_free_min(fib)     flux_fifo_get_free_max (fib)

fib :

FLUX_FIFO_FOR_DATA()

#define     FLUX_FIFO_FOR_DATA(fib, lim, p, len)

fib :
lim :
p :
len :