int log_context_property_to_string()

in v2/src/log_context_property_to_string.c [125:148]


int log_context_property_to_string(char* buffer, size_t buffer_size, const LOG_CONTEXT_PROPERTY_VALUE_PAIR* property_value_pairs, size_t property_value_pair_count)
{
    int result;

    if (
        /*Codes_SRS_LOG_CONTEXT_PROPERTY_TO_STRING_42_027: [ If buffer is NULL then log_context_property_to_string shall fail and return a negative value. ]*/
        buffer == NULL ||
        /*Codes_SRS_LOG_CONTEXT_PROPERTY_TO_STRING_42_028: [ If buffer_size is 0 then log_context_property_to_string shall return 0. ]*/
        buffer_size == 0 ||
        /*Codes_SRS_LOG_CONTEXT_PROPERTY_TO_STRING_42_029: [ If property_value_pairs is NULL then log_context_property_to_string shall fail and return a negative value. ]*/
        property_value_pairs == NULL ||
        /*Codes_SRS_LOG_CONTEXT_PROPERTY_TO_STRING_42_030: [ If property_value_pair_count is 0 then log_context_property_to_string shall fail and return a negative value. ]*/
        property_value_pair_count == 0
        )
    {
        result = -1;
    }
    else
    {
        result = log_n_properties(buffer, buffer_size, property_value_pairs, property_value_pair_count, 0, NULL);
    }

    return result;
}