Diffusion C API
5.9.24
|
Defines functions that operate on the CONTENT_T data structure, which is used to wrap data used in updates to topics. More...
Functions | |
CONTENT_T * | content_create (const CONTENT_ENCODING_T encoding, const BUF_T *data) |
Create a new CONTENT_T structure. More... | |
void | content_free (CONTENT_T *content) |
Free all memory associated with a CONTENT_T. More... | |
BUF_T * | content_marshal (const CONTENT_T *content) |
Serialise a CONTENT_T to bytes for transmission to Diffusion. More... | |
char * | buf_read_content (const char *data, CONTENT_T **const content) |
Read a CONTENT_T structure from a char array. More... | |
char * | buf_read_into_content (const char *data, CONTENT_T *content) |
Read a CONTENT_T structure from a char array. More... | |
CONTENT_T * | content_unmarshal (const char *str) |
Deserialise bytes from Diffusion to a CONTENT_T structure. More... | |
CONTENT_T * | content_dup (const CONTENT_T *src) |
Create a deep-copy duplicate of a CONTENT_T structure. More... | |
char * | content_to_string (const CONTENT_T *content) |
Utility function for taking a copy of the data in a CONTENT_T, and returning it as a NULL-terminated string. More... | |
Defines functions that operate on the CONTENT_T data structure, which is used to wrap data used in updates to topics.
Copyright © 2014, 2015 Push Technology Ltd., All Rights Reserved.
Use is subject to license terms.
NOTICE: All information contained herein is, and remains the property of Push Technology. The intellectual and technical concepts contained herein are proprietary to Push Technology and may be covered by U.S. and Foreign Patents, patents in process, and are protected by trade secret or copyright law.
char* buf_read_content | ( | const char * | data, |
CONTENT_T **const | content | ||
) |
Read a CONTENT_T structure from a char array.
If content is NULL the data will be serialised but omitted.
data | The char array containing the serialised CONTENT_T |
content | The location to store a newly allocated CONTENT_T |
char* buf_read_into_content | ( | const char * | data, |
CONTENT_T * | content | ||
) |
Read a CONTENT_T structure from a char array.
The destination CONTENT_T structure must exist (ie, cannot be NULL) and will be replaced with the deserialised data.
data | The char darray containing the serialised CONTENT_T |
content | The location of an existing CONTENT_T structure. |
CONTENT_T* content_create | ( | const CONTENT_ENCODING_T | encoding, |
const BUF_T * | data | ||
) |
Create a new CONTENT_T structure.
encoding | The encoding type (only NONE is supported at the moment). |
data | A pointer to a BUF_T containing data to be wrapped in the CONTENT_T. The BUF_T is copied, so the source can be freed by the caller. |
Create a deep-copy duplicate of a CONTENT_T structure.
src | The CONTENT_T to be copied. |
void content_free | ( | CONTENT_T * | content | ) |
Free all memory associated with a CONTENT_T.
content | The CONTENT_T to be freed. |
Serialise a CONTENT_T to bytes for transmission to Diffusion.
content | The CONTENT_T to be marshalled. |
char* content_to_string | ( | const CONTENT_T * | content | ) |
Utility function for taking a copy of the data in a CONTENT_T, and returning it as a NULL-terminated string.
content | The source CONTENT_T |
CONTENT_T* content_unmarshal | ( | const char * | str | ) |
Deserialise bytes from Diffusion to a CONTENT_T structure.
str | The bytes to be unmarshalled. |