Buffer object


Classes

struct  ix_buffer_t

Functions

ix_buffer_tix_buffer_new (unsigned char *pbuf, unsigned int len)
int ix_buffer_resize (ix_buffer_t *pb, unsigned int len)
unsigned char * ix_buffer_reset (ix_buffer_t *pb)
unsigned char * ix_buffer_renew (ix_buffer_t *pb)
int ix_buffer_add (ix_buffer_t *pb, char *padr, size_t len)
int ix_buffer_len (ix_buffer_t *pb)
unsigned char * ix_buffer_freeadr (ix_buffer_t *pb, unsigned int *pfree)
unsigned char * ix_buffer_adr (ix_buffer_t *pb)
void ix_buffer_free (ix_buffer_t *pb)

Detailed Description

This module describes the methods to deal with buffers

Function Documentation

int ix_buffer_add ( ix_buffer_t pb,
char *  padr,
size_t  len 
)

add memory to buffer object

Parameters:
pb Handle of buffer object
padr Adress of memory to add, if NULL add only len to used length
len Length of memory buffer to add
Returns:
  • !0: Error
  • 0: OK

unsigned char* ix_buffer_adr ( ix_buffer_t pb  ) 

Retrieve adress of buffer memory

Parameters:
pb Handle of buffer object
Returns:
  • Adress
  • NULL: Error

void ix_buffer_free ( ix_buffer_t pb  ) 

Free buffer object and object memory

Parameters:
pb Handle of buffer object

unsigned char* ix_buffer_freeadr ( ix_buffer_t pb,
unsigned int *  pfree 
)

address of free memory in buffer

Parameters:
pb Handle of buffer object
pfree pointer where size of free space of buffer is stored
Returns:
  • Free Adress
  • NULL: Error

int ix_buffer_len ( ix_buffer_t pb  ) 

acutal length of memory in buffer object

Parameters:
pb Handle of buffer object
Returns:
  • actual length
  • <0: Error

ix_buffer_t* ix_buffer_new ( unsigned char *  pbuf,
unsigned int  len 
)

create new buffer object

Parameters:
pbuf Pointer to memory buffer (on heap!) or NULL (memory is allocated)
len Length of memory buffer
Returns:
  • Handle of buffer object
  • NULL: Error

unsigned char* ix_buffer_renew ( ix_buffer_t pb  ) 

renew memory with maxlen

Parameters:
pb Handle of buffer object
Returns:
  • Memory of existing buffer

unsigned char* ix_buffer_reset ( ix_buffer_t pb  ) 

reset used length of buffer

Parameters:
pb Handle of buffer object
Returns:
  • pointer to buffer
  • NULL: error

int ix_buffer_resize ( ix_buffer_t pb,
unsigned int  len 
)

resize memory of buffer object

Parameters:
pb Handle of buffer object
len Length of memory buffer to resize to
Returns:
  • !0: Error
  • 0: OK


Generated on 4 Mar 2014 for ixtools by  doxygen 1.4.7