Diffusion C API  5.9.24
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
update.h File Reference

Functions which are used for updating topics. More...

Functions

UPDATE_Tupdate_create (const UPDATE_ACTION_T action, const UPDATE_TYPE_T type, const CONTENT_T *content)
 Create a new UPDATE_T structure for updating topic content. More...
 
void update_free (UPDATE_T *update)
 Free all memory associated with an UPDATE_T. More...
 
BUF_Tupdate_marshal (const UPDATE_T *update)
 Serialise an UPDATE_T to bytes for transmission to Diffusion. More...
 
char * buf_read_update (const char *data, UPDATE_T **update)
 Read an UPDATE_T structure from a char array. More...
 
UPDATE_Tupdate_unmarshal (const char *str)
 Deserialise bytes from Diffusion to an UPDATE_T structure. More...
 
UPDATE_Tupdate_dup (const UPDATE_T *src)
 Create a deep copy of an UPDATE_T structure. More...
 

Detailed Description

Functions which are used for updating 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.

Function Documentation

char* buf_read_update ( const char *  data,
UPDATE_T **  update 
)

Read an UPDATE_T structure from a char array.

Parameters
dataThe char array containing the serialised UPDATE_T
updateThe location to store a newly allocated UPDATE_T
Returns
A pointer to the first char following the serialised UPDATE_T in the char array, or NULL on error.
UPDATE_T* update_create ( const UPDATE_ACTION_T  action,
const UPDATE_TYPE_T  type,
const CONTENT_T content 
)

Create a new UPDATE_T structure for updating topic content.

Parameters
actionThe operation that will be performed on the target topic data (refresh, update, match).
typeThe type of update being performed (typically, Content change).
contentThe data to be sent to Diffusion.
Returns
A new UPDATE_T structure, or NULL on error.
UPDATE_T* update_dup ( const UPDATE_T src)

Create a deep copy of an UPDATE_T structure.

Parameters
srcThe UPDATE_T to copy.
Returns
A newly allocated UPDATE_T, or NULL on error.
void update_free ( UPDATE_T update)

Free all memory associated with an UPDATE_T.

Parameters
updateThe UPDATE_T to be freed.
BUF_T* update_marshal ( const UPDATE_T update)

Serialise an UPDATE_T to bytes for transmission to Diffusion.

Parameters
updateThe UPDATE_T to be mashalled.
Returns
A pointer to a newly allocated BUF_T containing the serialised data, or NULL if an error occurs.
UPDATE_T* update_unmarshal ( const char *  str)

Deserialise bytes from Diffusion to an UPDATE_T structure.

Parameters
strThe bytes to be unmarshalled.
Returns
A pointer to a newly allcoated UPDATE_T, or NULL if an error occurs.