Teonet library  0.4.7
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
teodb_com.c File Reference
#include <stdlib.h>
#include <string.h>
#include "teodb_com.h"

Functions

teo_db_dataprepare_request_data (const void *key, size_t key_len, const void *data, size_t data_len, uint32_t id, size_t *tdd_len)
 Prepare teonet db data. More...
 

Function Documentation

teo_db_data* prepare_request_data ( const void *  key,
size_t  key_len,
const void *  data,
size_t  data_len,
uint32_t  id,
size_t *  tdd_len 
)

Prepare teonet db data.

Parameters
keyKey
key_lenKey length
dataPointer to value
data_lenValue length
idRequest ID
tdd_lenPointer to variable to hold result packet length
Returns
Result packet, should be free after use
Examples:
teodb_ex.c.

References teo_db_data::data_length, teo_db_data::id, teo_db_data::key_data, teo_db_data::key_length, and malloc().

Referenced by event_cb(), get_cb(), and teo::Teonet::TeoDB::prepareRequest().