Learn how to evaluate and integrate the VNC SDK

We're here if you need help.

DataBuffer.h

Access memory owned by the SDK, or pass data to the SDK. (more...)

Functions

Modifier and Type Name and Description
function vnc_DataBuffer *

vnc_DataBuffer_create(const void *data, int sizeBytes)

Creates a data buffer containing a copy of the given data.

function const void *

vnc_DataBuffer_getData(const vnc_DataBuffer *buffer, int *bufferSize)

Gets the data contained in the buffer.

function void

vnc_DataBuffer_destroy(vnc_DataBuffer *buffer)

Destroys the data buffer.

Detailed description

Access memory owned by the SDK, or pass data to the SDK.

Data buffers are used by various SDK functions to encapsulate arbitrarily-sized pieces of data, for example, strings or RSA keys.

Given a vnc_DataBuffer, the contained data can be accessed via the vnc_DataBuffer_getData() function, which also gives the size of the stored data.

Functions

vnc_DataBuffer *vnc_DataBuffer_create(const void *data, int sizeBytes)

Creates a data buffer containing a copy of the given data.

Return
Returns a new vnc_DataBuffer on success, or NULL on error. If an error is returned, vnc_getLastError() can be used to get the error code.
Parameters
  • data -

    A pointer to untyped data.

  • sizeBytes -

    The size of the data.

Return Value
  • InvalidArgument -

    data is NULL and sizeBytes is non-zero

const void *vnc_DataBuffer_getData(const vnc_DataBuffer *buffer, int *bufferSize)

Gets the data contained in the buffer.

Return
A pointer to the data stored in the data buffer, or NULL if the size of the data buffer is zero.
Parameters
  • buffer -

    The buffer.

  • bufferSize -

    An optional output parameter used to return the size of the data in the data buffer.

void vnc_DataBuffer_destroy(vnc_DataBuffer *buffer)

Destroys the data buffer.

Parameters
  • buffer -

    The buffer.

×