Example #1
0
// Calculates the total number of bytes needed to store the message.
//
// message - The message.
//
// Returns the number of bytes required to store the message.
size_t sky_lua_aggregate_message_sizeof(sky_lua_aggregate_message *message)
{
    size_t sz = 0;
    sz += minipack_sizeof_map(SKY_LUA_AGGREGATE_KEY_COUNT);
    sz += minipack_sizeof_raw((&SKY_LUA_AGGREGATE_KEY_SOURCE)->slen) + (&SKY_LUA_AGGREGATE_KEY_SOURCE)->slen;
    sz += minipack_sizeof_raw(blength(message->source)) + blength(message->source);
    return sz;
}
Example #2
0
// Calculates the total number of bytes needed to store the message.
//
// message - The message.
//
// Returns the number of bytes required to store the message.
size_t sky_multi_message_sizeof(sky_multi_message *message)
{
    size_t sz = 0;
    sz += minipack_sizeof_map(SKY_MULTI_KEY_COUNT);
    sz += minipack_sizeof_raw((&SKY_MULTI_KEY_COUNT_STR)->slen) + (&SKY_MULTI_KEY_COUNT_STR)->slen;
    sz += minipack_sizeof_uint(message->message_count);
    return sz;
}
Example #3
0
// Calculates the total number of bytes needed to store the message.
//
// message - The message.
//
// Returns the number of bytes required to store the message.
size_t sky_lua_map_reduce_message_sizeof(sky_lua_map_reduce_message *message)
{
    size_t sz = 0;
    sz += minipack_sizeof_map(SKY_LUA_MAP_REDUCE_KEY_COUNT);
    sz += minipack_sizeof_raw(blength(&SKY_LUA_MAP_REDUCE_KEY_SOURCE)) + blength(&SKY_LUA_MAP_REDUCE_KEY_SOURCE);
    sz += minipack_sizeof_raw(blength(message->source)) + blength(message->source);
    return sz;
}
Example #4
0
File: action.c Project: fxstein/sky
// Calculates the total number of bytes needed to store the action.
//
// action - The action.
//
// Returns the number of bytes required to store the action.
size_t sky_action_sizeof(sky_action *action)
{
    size_t sz = 0;
    sz += minipack_sizeof_map(SKY_ACTION_KEY_COUNT);
    sz += minipack_sizeof_raw((&SKY_ACTION_ID_STR)->slen) + (&SKY_ACTION_ID_STR)->slen;
    sz += minipack_sizeof_uint(action->id);
    sz += minipack_sizeof_raw((&SKY_ACTION_NAME_STR)->slen) + (&SKY_ACTION_NAME_STR)->slen;
    sz += blength(action->name);
    return sz;
}
Example #5
0
// Calculates the total number of bytes needed to store the property.
//
// property - The property.
//
// Returns the number of bytes required to store the property.
size_t sky_property_sizeof(sky_property *property)
{
    size_t sz = 0;
    sz += minipack_sizeof_map(2);
    sz += minipack_sizeof_raw(strlen("id")) + strlen("id");
    sz += minipack_sizeof_int(property->id);
    sz += minipack_sizeof_raw(strlen("type")) + strlen("type");
    sz += minipack_sizeof_uint(property->type);
    sz += minipack_sizeof_raw(strlen("dataType")) + strlen("dataType");
    sz += blength(property->data_type);
    sz += minipack_sizeof_raw(strlen("name")) + strlen("name");
    sz += blength(property->name);
    return sz;
}