Webcom C SDK
Webcom datasync protocol data types, messages manipulation
enum  wc_data_msg_type_t { WC_DATA_MSG_ACTION = 1, WC_DATA_MSG_PUSH, WC_DATA_MSG_RESPONSE }
 
enum  wc_action_type_t {
  WC_ACTION_PUT = 1, WC_ACTION_MERGE, WC_ACTION_LISTEN, WC_ACTION_UNLISTEN,
  WC_ACTION_AUTHENTICATE, WC_ACTION_UNAUTHENTICATE, WC_ACTION_ON_DISCONNECT_PUT, WC_ACTION_ON_DISCONNECT_MERGE,
  WC_ACTION_ON_DISCONNECT_CANCEL
}
 
enum  wc_push_type_t { WC_PUSH_AUTH_REVOKED = 1, WC_PUSH_LISTEN_REVOKED, WC_PUSH_DATA_UPDATE_PUT, WC_PUSH_DATA_UPDATE_MERGE }
 
enum  wc_ctrl_msg_type_t { WC_CTRL_MSG_HANDSHAKE = 1, WC_CTRL_MSG_CONNECTION_SHUTDOWN }
 
enum  wc_msg_type_t { WC_MSG_CTRL = 1, WC_MSG_DATA }
 
typedef void * wc_action_unauth_t
 
void wc_datasync_msg_init (wc_msg_t *msg)
 
void wc_datasync_msg_free (wc_msg_t *msg)
 
char * wc_datasync_msg_to_json_str (wc_msg_t *msg)
 

Detailed Description

Typedef Documentation

◆ wc_action_unauth_t

typedef void* wc_action_unauth_t

Enumeration Type Documentation

◆ wc_action_type_t

Enumerator
WC_ACTION_PUT 
WC_ACTION_MERGE 
WC_ACTION_LISTEN 
WC_ACTION_UNLISTEN 
WC_ACTION_AUTHENTICATE 
WC_ACTION_UNAUTHENTICATE 
WC_ACTION_ON_DISCONNECT_PUT 
WC_ACTION_ON_DISCONNECT_MERGE 
WC_ACTION_ON_DISCONNECT_CANCEL 

◆ wc_ctrl_msg_type_t

Enumerator
WC_CTRL_MSG_HANDSHAKE 
WC_CTRL_MSG_CONNECTION_SHUTDOWN 

◆ wc_data_msg_type_t

Enumerator
WC_DATA_MSG_ACTION 
WC_DATA_MSG_PUSH 
WC_DATA_MSG_RESPONSE 

◆ wc_msg_type_t

Enumerator
WC_MSG_CTRL 
WC_MSG_DATA 

◆ wc_push_type_t

Enumerator
WC_PUSH_AUTH_REVOKED 
WC_PUSH_LISTEN_REVOKED 
WC_PUSH_DATA_UPDATE_PUT 
WC_PUSH_DATA_UPDATE_MERGE 

Function Documentation

◆ wc_datasync_msg_free()

void wc_datasync_msg_free ( wc_msg_t msg)

frees the memory allocated for a message structure

This function frees every chunk of memory used by this message (strings, JSON fragments, ...). Note: this does not free the space used by the wc_msg_t structure itself, you have to manually free() it after using this function if if was malloc()'ed.

Parameters
msgthe message structure to be freed

◆ wc_datasync_msg_init()

void wc_datasync_msg_init ( wc_msg_t msg)

does the internal initialization of a message structure

Parameters
msgpointer to the message to initialize

◆ wc_datasync_msg_to_json_str()

char* wc_datasync_msg_to_json_str ( wc_msg_t msg)

makes a JSON string representation of a Webcom message

Parameters
msgthe webcom message
Returns
a newly malloc'd JSON string (must be manually free'd after use), or NULL if out of memory