kinetic-c  v0.12.0
Seagate Kinetic Protocol Client Library for C
Functions
byte_array.c File Reference
#include "byte_array.h"
#include <assert.h>
#include <string.h>
#include <stdio.h>
#include <stdarg.h>
#include <stdlib.h>
#include <sys/param.h>

Go to the source code of this file.

Functions

static ByteBufferappend_formatted_cstring_va_list (ByteBuffer *buffer, const char *format, va_list args)
 
ByteArray ByteArray_Create (void *data, size_t len)
 
ByteArray ByteArray_CreateWithCString (const char *str)
 
void ByteArray_FillWithDummyData (ByteArray array)
 
ByteArray ByteArray_GetSlice (ByteArray array, size_t start, size_t len)
 
void ByteBuffer_Reset (ByteBuffer *buffer)
 
ByteBuffer ByteBuffer_Create (void *data, size_t max_len, size_t used)
 
ByteBuffer ByteBuffer_CreateWithArray (ByteArray array)
 
ByteBuffer ByteBuffer_CreateAndAppend (void *data, size_t max_len, const void *value, size_t value_len)
 
ByteBuffer ByteBuffer_CreateAndAppendArray (void *data, size_t max_len, const ByteArray value)
 
ByteBuffer ByteBuffer_CreateAndAppendCString (void *data, size_t max_len, const char *value)
 
ByteBuffer ByteBuffer_CreateAndAppendDummyData (void *data, size_t max_len, size_t len)
 
long ByteBuffer_BytesRemaining (const ByteBuffer buffer)
 
ByteArray ByteBuffer_Consume (ByteBuffer *buffer, size_t max_len)
 
ByteBufferByteBuffer_Append (ByteBuffer *buffer, const void *data, size_t len)
 
ByteBufferByteBuffer_AppendArray (ByteBuffer *buffer, const ByteArray array)
 
ByteBufferByteBuffer_AppendBuffer (ByteBuffer *buffer, const ByteBuffer bufferToAppend)
 
ByteBufferByteBuffer_AppendCString (ByteBuffer *buffer, const char *str)
 
ByteBufferByteBuffer_AppendFormattedCString (ByteBuffer *buffer, const char *format,...)
 
ByteBuffer ByteBuffer_CreateAndAppendFormattedCString (void *data, size_t max_len, const char *format,...)
 
ByteBufferByteBuffer_AppendDummyData (ByteBuffer *buffer, size_t len)
 
bool ByteBuffer_IsNull (ByteBuffer const buffer)
 
ByteBuffer ByteBuffer_Malloc (size_t size)
 
ByteBuffer ByteBuffer_MallocAndAppend (const void *data, size_t len)
 
void ByteBuffer_Free (ByteBuffer buffer)
 

Function Documentation

static ByteBuffer * append_formatted_cstring_va_list ( ByteBuffer buffer,
const char *  format,
va_list  args 
)
static
ByteArray ByteArray_Create ( void *  data,
size_t  len 
)

Definition at line 31 of file byte_array.c.

References ByteArray::data.

ByteArray ByteArray_CreateWithCString ( const char *  str)

Definition at line 38 of file byte_array.c.

References ByteArray::data.

void ByteArray_FillWithDummyData ( ByteArray  array)

Definition at line 45 of file byte_array.c.

References ByteArray::data, and ByteArray::len.

ByteArray ByteArray_GetSlice ( ByteArray  array,
size_t  start,
size_t  len 
)

Definition at line 52 of file byte_array.c.

References ByteArray::data, and ByteArray::len.

void ByteBuffer_Reset ( ByteBuffer buffer)

Definition at line 62 of file byte_array.c.

References ByteBuffer::bytesUsed.

ByteBuffer ByteBuffer_Create ( void *  data,
size_t  max_len,
size_t  used 
)

Definition at line 68 of file byte_array.c.

ByteBuffer ByteBuffer_CreateWithArray ( ByteArray  array)

Definition at line 78 of file byte_array.c.

References ByteBuffer::array.

ByteBuffer ByteBuffer_CreateAndAppend ( void *  data,
size_t  max_len,
const void *  value,
size_t  value_len 
)

Definition at line 83 of file byte_array.c.

References ByteBuffer_Append(), and ByteBuffer_Create().

ByteBuffer ByteBuffer_CreateAndAppendArray ( void *  data,
size_t  max_len,
const ByteArray  value 
)

Definition at line 90 of file byte_array.c.

References ByteBuffer_AppendArray(), and ByteBuffer_Create().

ByteBuffer ByteBuffer_CreateAndAppendCString ( void *  data,
size_t  max_len,
const char *  value 
)

Definition at line 97 of file byte_array.c.

References ByteBuffer_AppendCString(), and ByteBuffer_Create().

ByteBuffer ByteBuffer_CreateAndAppendDummyData ( void *  data,
size_t  max_len,
size_t  len 
)

Definition at line 104 of file byte_array.c.

References ByteBuffer_AppendDummyData(), and ByteBuffer_Create().

long ByteBuffer_BytesRemaining ( const ByteBuffer  buffer)
ByteArray ByteBuffer_Consume ( ByteBuffer buffer,
size_t  max_len 
)
ByteBuffer* ByteBuffer_Append ( ByteBuffer buffer,
const void *  data,
size_t  len 
)
ByteBuffer* ByteBuffer_AppendArray ( ByteBuffer buffer,
const ByteArray  array 
)
ByteBuffer* ByteBuffer_AppendBuffer ( ByteBuffer buffer,
const ByteBuffer  bufferToAppend 
)
ByteBuffer* ByteBuffer_AppendCString ( ByteBuffer buffer,
const char *  str 
)
ByteBuffer* ByteBuffer_AppendFormattedCString ( ByteBuffer buffer,
const char *  format,
  ... 
)
ByteBuffer ByteBuffer_CreateAndAppendFormattedCString ( void *  data,
size_t  max_len,
const char *  format,
  ... 
)

Definition at line 221 of file byte_array.c.

References append_formatted_cstring_va_list(), and ByteBuffer_Create().

ByteBuffer* ByteBuffer_AppendDummyData ( ByteBuffer buffer,
size_t  len 
)
bool ByteBuffer_IsNull ( ByteBuffer const  buffer)

Definition at line 249 of file byte_array.c.

References ByteBuffer::array, and ByteArray::data.

ByteBuffer ByteBuffer_Malloc ( size_t  size)

Definition at line 254 of file byte_array.c.

References ByteBuffer_Create().

ByteBuffer ByteBuffer_MallocAndAppend ( const void *  data,
size_t  len 
)

Definition at line 262 of file byte_array.c.

References ByteBuffer_Append(), ByteBuffer_IsNull(), and ByteBuffer_Malloc().

void ByteBuffer_Free ( ByteBuffer  buffer)

Definition at line 272 of file byte_array.c.

References ByteBuffer::array, and ByteArray::data.