fehQlibs 26
Qlibs
Loading...
Searching...
No Matches
Data Structures | Macros | Typedefs | Functions | Variables
buffer.h File Reference
#include <sys/types.h>
Include dependency graph for buffer.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  buffer
 

Macros

#define BUFFER_INIT(op, fd, buf, len)   { (buf), 0, (len), (fd), (op) }
 
#define BUFFER_SMALL   256
 
#define BUFFER_INSIZE   8192
 
#define BUFFER_OUTSIZE   8192
 
#define BUFFER_MTUSIZE   1450
 
#define buffer_PUTC(s, c)
 
#define buffer_PEEK(s)   ( (s)->x + (s)->n )
 
#define buffer_SEEK(s, len)   ( ( (s)->p -= (len) ) , ( (s)->n += (len) ) )
 
#define buffer_GETC(s, c)
 

Typedefs

typedef struct buffer buffer
 

Functions

void buffer_init (buffer *, ssize_t(*op)(), int, char *, size_t)
 
int buffer_flush (buffer *)
 
int buffer_put (buffer *, const char *, size_t)
 
int buffer_putalign (buffer *, const char *, size_t)
 
int buffer_putflush (buffer *, const char *, size_t)
 
int buffer_puts (buffer *, const char *)
 
int buffer_putsalign (buffer *, const char *)
 
int buffer_putsflush (buffer *, const char *)
 
int buffer_get (buffer *, char *, size_t)
 
int buffer_bget (buffer *, char *, size_t)
 
int buffer_feed (buffer *)
 
char * buffer_peek (buffer *)
 
void buffer_seek (buffer *, size_t)
 
int buffer_copy (buffer *, buffer *)
 
ssize_t buffer_unixread (int, char *, size_t)
 
ssize_t buffer_unixwrite (int, char *, size_t)
 

Variables

bufferbuffer_0
 
bufferbuffer_1
 
bufferbuffer_2
 
bufferbuffer_0small
 
bufferbuffer_1small
 
bufferbuffer_2small
 

Macro Definition Documentation

◆ buffer_GETC

#define buffer_GETC (   s,
 
)
Value:
( ((s)->p > 0) \
? ( *(c) = (s)->x[(s)->n], buffer_SEEK((s),1), 1 ) \
: buffer_get((s),(c),1) \
)
int buffer_get(buffer *, char *, size_t)
Definition: buffer.c:121
#define buffer_SEEK(s, len)
Definition: buffer.h:43

Definition at line 45 of file buffer.h.

◆ BUFFER_INIT

#define BUFFER_INIT (   op,
  fd,
  buf,
  len 
)    { (buf), 0, (len), (fd), (op) }

Definition at line 13 of file buffer.h.

◆ BUFFER_INSIZE

#define BUFFER_INSIZE   8192

Definition at line 15 of file buffer.h.

◆ BUFFER_MTUSIZE

#define BUFFER_MTUSIZE   1450

Definition at line 17 of file buffer.h.

◆ BUFFER_OUTSIZE

#define BUFFER_OUTSIZE   8192

Definition at line 16 of file buffer.h.

◆ buffer_PEEK

#define buffer_PEEK (   s)    ( (s)->x + (s)->n )

Definition at line 42 of file buffer.h.

◆ buffer_PUTC

#define buffer_PUTC (   s,
 
)
Value:
( ((s)->n != (s)->p) \
? ( (s)->x[(s)->p++] = (c), 0 ) \
: buffer_put((s),&(c),1) \
)
int buffer_put(buffer *, const char *, size_t)
Definition: buffer.c:185

Definition at line 29 of file buffer.h.

◆ buffer_SEEK

#define buffer_SEEK (   s,
  len 
)    ( ( (s)->p -= (len) ) , ( (s)->n += (len) ) )

Definition at line 43 of file buffer.h.

◆ BUFFER_SMALL

#define BUFFER_SMALL   256

Definition at line 14 of file buffer.h.

Typedef Documentation

◆ buffer

typedef struct buffer buffer

Function Documentation

◆ buffer_bget()

int buffer_bget ( buffer s,
char *  buf,
size_t  len 
)

Definition at line 110 of file buffer.c.

Here is the call graph for this function:

◆ buffer_copy()

int buffer_copy ( buffer bout,
buffer bin 
)

Definition at line 62 of file buffer.c.

Here is the call graph for this function:

◆ buffer_feed()

int buffer_feed ( buffer s)

Definition at line 97 of file buffer.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ buffer_flush()

int buffer_flush ( buffer s)

Definition at line 161 of file buffer.c.

Here is the caller graph for this function:

◆ buffer_get()

int buffer_get ( buffer s,
char *  buf,
size_t  len 
)

Definition at line 121 of file buffer.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ buffer_init()

void buffer_init ( buffer s,
ssize_t(*)()  op,
int  fd,
char *  buf,
size_t  len 
)

Definition at line 13 of file buffer.c.

Here is the caller graph for this function:

◆ buffer_peek()

char * buffer_peek ( buffer s)

Definition at line 132 of file buffer.c.

◆ buffer_put()

int buffer_put ( buffer s,
const char *  buf,
size_t  len 
)

Definition at line 185 of file buffer.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ buffer_putalign()

int buffer_putalign ( buffer s,
const char *  buf,
size_t  len 
)

Definition at line 171 of file buffer.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ buffer_putflush()

int buffer_putflush ( buffer s,
const char *  buf,
size_t  len 
)

Definition at line 207 of file buffer.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ buffer_puts()

int buffer_puts ( buffer s,
const char *  buf 
)

Definition at line 218 of file buffer.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ buffer_putsalign()

int buffer_putsalign ( buffer s,
const char *  buf 
)

Definition at line 213 of file buffer.c.

Here is the call graph for this function:

◆ buffer_putsflush()

int buffer_putsflush ( buffer s,
const char *  buf 
)

Definition at line 223 of file buffer.c.

Here is the call graph for this function:

◆ buffer_seek()

void buffer_seek ( buffer s,
size_t  len 
)

Definition at line 137 of file buffer.c.

◆ buffer_unixread()

ssize_t buffer_unixread ( int  fd,
char *  buf,
size_t  len 
)

Definition at line 28 of file buffer.c.

Here is the call graph for this function:

◆ buffer_unixwrite()

ssize_t buffer_unixwrite ( int  fd,
char *  buf,
size_t  len 
)

Definition at line 33 of file buffer.c.

Variable Documentation

◆ buffer_0

buffer* buffer_0
extern

Definition at line 40 of file buffer.c.

◆ buffer_0small

buffer* buffer_0small
extern

Definition at line 52 of file buffer.c.

◆ buffer_1

buffer* buffer_1
extern

Definition at line 44 of file buffer.c.

◆ buffer_1small

buffer* buffer_1small
extern

Definition at line 56 of file buffer.c.

◆ buffer_2

buffer* buffer_2
extern

Definition at line 48 of file buffer.c.

◆ buffer_2small

buffer* buffer_2small
extern

Definition at line 60 of file buffer.c.