Emulex Logo
OneCoreā„¢ Storage SDK Release 11.2
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
ocs_textbuf.c File Reference
#include "ocs.h"
#include "ocs_textbuf.h"

Go to the source code of this file.

Functions

static int32_t ocs_segment_remaining (ocs_textbuf_segment_t *segment)
 
static ocs_textbuf_segment_t * ocs_textbuf_segment_alloc (ocs_textbuf_t *textbuf)
 
static void ocs_textbuf_segment_free (ocs_t *ocs, ocs_textbuf_segment_t *segment)
 
static ocs_textbuf_segment_t * ocs_textbuf_get_segment (ocs_textbuf_t *textbuf, uint32_t idx)
 
uint8_t * ocs_textbuf_get_buffer (ocs_textbuf_t *textbuf)
 
int32_t ocs_textbuf_get_length (ocs_textbuf_t *textbuf)
 
int32_t ocs_textbuf_get_written (ocs_textbuf_t *textbuf)
 
uint8_t * ocs_textbuf_ext_get_buffer (ocs_textbuf_t *textbuf, uint32_t idx)
 
int32_t ocs_textbuf_ext_get_length (ocs_textbuf_t *textbuf, uint32_t idx)
 
int32_t ocs_textbuf_ext_get_written (ocs_textbuf_t *textbuf, uint32_t idx)
 
uint32_t ocs_textbuf_initialized (ocs_textbuf_t *textbuf)
 
int32_t ocs_textbuf_alloc (ocs_t *ocs, ocs_textbuf_t *textbuf, uint32_t length)
 
int32_t ocs_textbuf_init (ocs_t *ocs, ocs_textbuf_t *textbuf, void *buffer, uint32_t length)
 
void ocs_textbuf_free (ocs_t *ocs, ocs_textbuf_t *textbuf)
 
void ocs_textbuf_printf (ocs_textbuf_t *textbuf, const char *fmt,...)
 Helper function to dump message. More...
 
void ocs_textbuf_vprintf (ocs_textbuf_t *textbuf, const char *fmt, va_list ap)
 
void ocs_textbuf_putc (ocs_textbuf_t *textbuf, uint8_t c)
 
void ocs_textbuf_puts (ocs_textbuf_t *textbuf, char *s)
 
void ocs_textbuf_buffer (ocs_textbuf_t *textbuf, uint8_t *buffer, uint32_t buffer_length)
 
void ocs_textbuf_copy (ocs_textbuf_t *textbuf, uint8_t *buffer, uint32_t buffer_length)
 
int32_t ocs_textbuf_remaining (ocs_textbuf_t *textbuf)
 
void ocs_textbuf_reset (ocs_textbuf_t *textbuf)
 

Function Details

static int32_t ocs_segment_remaining ( ocs_textbuf_segment_t *  segment)
static

Definition at line 396 of file ocs_textbuf.c.

int32_t ocs_textbuf_alloc ( ocs_t *  ocs,
ocs_textbuf_t *  textbuf,
uint32_t  length 
)

Definition at line 105 of file ocs_textbuf.c.

void ocs_textbuf_buffer ( ocs_textbuf_t *  textbuf,
uint8_t *  buffer,
uint32_t  buffer_length 
)

Definition at line 335 of file ocs_textbuf.c.

void ocs_textbuf_copy ( ocs_textbuf_t *  textbuf,
uint8_t *  buffer,
uint32_t  buffer_length 
)

Definition at line 370 of file ocs_textbuf.c.

uint8_t* ocs_textbuf_ext_get_buffer ( ocs_textbuf_t *  textbuf,
uint32_t  idx 
)

Definition at line 66 of file ocs_textbuf.c.

int32_t ocs_textbuf_ext_get_length ( ocs_textbuf_t *  textbuf,
uint32_t  idx 
)

Definition at line 75 of file ocs_textbuf.c.

int32_t ocs_textbuf_ext_get_written ( ocs_textbuf_t *  textbuf,
uint32_t  idx 
)

Definition at line 84 of file ocs_textbuf.c.

void ocs_textbuf_free ( ocs_t *  ocs,
ocs_textbuf_t *  textbuf 
)

Definition at line 213 of file ocs_textbuf.c.

uint8_t* ocs_textbuf_get_buffer ( ocs_textbuf_t *  textbuf)

Definition at line 42 of file ocs_textbuf.c.

int32_t ocs_textbuf_get_length ( ocs_textbuf_t *  textbuf)

Definition at line 48 of file ocs_textbuf.c.

static ocs_textbuf_segment_t * ocs_textbuf_get_segment ( ocs_textbuf_t *  textbuf,
uint32_t  idx 
)
static

Definition at line 172 of file ocs_textbuf.c.

int32_t ocs_textbuf_get_written ( ocs_textbuf_t *  textbuf)

Definition at line 54 of file ocs_textbuf.c.

int32_t ocs_textbuf_init ( ocs_t *  ocs,
ocs_textbuf_t *  textbuf,
void *  buffer,
uint32_t  length 
)

Definition at line 190 of file ocs_textbuf.c.

uint32_t ocs_textbuf_initialized ( ocs_textbuf_t *  textbuf)

Definition at line 94 of file ocs_textbuf.c.

void ocs_textbuf_printf ( ocs_textbuf_t *  textbuf,
const char *  fmt,
  ... 
)

Helper function to dump message.

Parameters
textbufpointer to driver dump text buffer. If valid, dump message to textbuf If NULL, dump message to kernel dmesg
Returns
none

Definition at line 238 of file ocs_textbuf.c.

void ocs_textbuf_putc ( ocs_textbuf_t *  textbuf,
uint8_t  c 
)

Definition at line 308 of file ocs_textbuf.c.

void ocs_textbuf_puts ( ocs_textbuf_t *  textbuf,
char *  s 
)

Definition at line 325 of file ocs_textbuf.c.

int32_t ocs_textbuf_remaining ( ocs_textbuf_t *  textbuf)

Definition at line 386 of file ocs_textbuf.c.

void ocs_textbuf_reset ( ocs_textbuf_t *  textbuf)

Definition at line 406 of file ocs_textbuf.c.

static ocs_textbuf_segment_t * ocs_textbuf_segment_alloc ( ocs_textbuf_t *  textbuf)
static

Definition at line 129 of file ocs_textbuf.c.

static void ocs_textbuf_segment_free ( ocs_t *  ocs,
ocs_textbuf_segment_t *  segment 
)
static

Definition at line 161 of file ocs_textbuf.c.

void ocs_textbuf_vprintf ( ocs_textbuf_t *  textbuf,
const char *  fmt,
va_list  ap 
)

Definition at line 254 of file ocs_textbuf.c.