Main Page   Data Structures   File List   Data Fields   Globals   Examples  

shbuf_status Struct Reference

Structure encapsulating the status of a shared buffer. More...

#include <shbuf.h>


Data Fields

unsigned long read_idx
 Where to read the next bytes from.

unsigned long length
 Amount of bytes currently in the buffer.

unsigned long backlog
 Length of current backlog in bytes.

unsigned long backlog_target
 Try to keep so many bytes as backlog.

unsigned long write_count
 Simple counter, incremented on every write.

unsigned long read_count
 Simple counter, incremented on every read.

int ignore_read_inc
 Boolean; when this flag is set, the next call to shbuf_inc_read_pointer() will be ignored and this flag will be disabled again.

int ignore_write_inc
 Corresponding here.


Detailed Description

Structure encapsulating the status of a shared buffer.

It contains some indexes which specify the current fill level of the buffer.

Typical buffer layout:

                   <---backlog--> <---length---->
 +----------------+--------------+---------------+------------------+
 |                |              |               |                  |
 |                |   BACKLOG    |   DATA        |                  |
 |                |              |               |                  |
 +----------------+--------------+---------------+------------------+
 ^                ^              ^               ^                  ^
 0                |              read_idx        |               size
                  read_idx-backlog               |
                                                 read_idx+length
 

Note: In reality it is not so simple as it looks in this graphic, since you always need to think about buffer wrap arounds.

Definition at line 235 of file shbuf.h.


Field Documentation

unsigned long shbuf_status::backlog
 

Length of current backlog in bytes.

Definition at line 238 of file shbuf.h.

unsigned long shbuf_status::backlog_target
 

Try to keep so many bytes as backlog.

Definition at line 239 of file shbuf.h.

int shbuf_status::ignore_read_inc
 

Boolean; when this flag is set, the next call to shbuf_inc_read_pointer() will be ignored and this flag will be disabled again.

Definition at line 243 of file shbuf.h.

int shbuf_status::ignore_write_inc
 

Corresponding here.

Definition at line 247 of file shbuf.h.

unsigned long shbuf_status::length
 

Amount of bytes currently in the buffer.

Definition at line 237 of file shbuf.h.

unsigned long shbuf_status::read_count
 

Simple counter, incremented on every read.

Definition at line 242 of file shbuf.h.

unsigned long shbuf_status::read_idx
 

Where to read the next bytes from.

Definition at line 236 of file shbuf.h.

unsigned long shbuf_status::write_count
 

Simple counter, incremented on every write.

Definition at line 241 of file shbuf.h.


The documentation for this struct was generated from the following file:
Generated on Thu Sep 11 18:52:22 2003 for libshbuf by doxygen1.2.18