From 09c4b073ca0bdf8d208cbcc7e84a7d33629213d2 Mon Sep 17 00:00:00 2001 From: Dmitri Pal Date: Thu, 2 Jul 2009 12:52:32 -0400 Subject: Changing function names for collection API. Patch prepends prefix "col_" to all functions related to collection. This caused some formatiing issues so the alignement was addressed too. --- common/collection/collection_stack.c | 180 ++++++++++++++++++----------------- 1 file changed, 94 insertions(+), 86 deletions(-) (limited to 'common/collection/collection_stack.c') diff --git a/common/collection/collection_stack.c b/common/collection/collection_stack.c index 70211220c..9290b4e4f 100644 --- a/common/collection/collection_stack.c +++ b/common/collection/collection_stack.c @@ -25,36 +25,36 @@ #include "trace.h" /* Function that creates a stack object */ -int create_stack(struct collection_item **stack) +int col_create_stack(struct collection_item **stack) { int error = EOK; - TRACE_FLOW_STRING("create_stack", "Entry point."); + TRACE_FLOW_STRING("col_create_stack", "Entry point."); - error = create_collection(stack, COL_NAME_STACK, COL_CLASS_STACK); + error = col_create_collection(stack, COL_NAME_STACK, COL_CLASS_STACK); - TRACE_FLOW_STRING("create_stack", "Exit."); + TRACE_FLOW_STRING("col_create_stack", "Exit."); return error; } /* Function that destroys a stack object */ -void destroy_stack(struct collection_item *stack) +void col_destroy_stack(struct collection_item *stack) { - TRACE_FLOW_STRING("destroy_stack", "Entry point."); + TRACE_FLOW_STRING("col_destroy_stack", "Entry point."); - destroy_collection(stack); + col_destroy_collection(stack); - TRACE_FLOW_STRING("destroy_stack", "Exit"); + TRACE_FLOW_STRING("col_destroy_stack", "Exit"); } -int push_str_property(struct collection_item *stack, - const char *property, char *string, int length) +int col_push_str_property(struct collection_item *stack, + const char *property, char *string, int length) { int error = EOK; - TRACE_FLOW_STRING("push_str_property", "Entry point."); + TRACE_FLOW_STRING("col_push_str_property", "Entry point."); /* Check that stack is not empty */ if (stack == NULL) { @@ -63,24 +63,26 @@ int push_str_property(struct collection_item *stack, } /* Make sure it is a stack */ - if (!is_of_class(stack, COL_CLASS_STACK)) { + if (!col_is_of_class(stack, COL_CLASS_STACK)) { TRACE_ERROR_STRING("Wrong class", ""); return EINVAL; } - error = add_str_property(stack, NULL, property, string, length); + error = col_add_str_property(stack, NULL, property, string, length); - TRACE_FLOW_STRING("push_str_property", "Exit."); + TRACE_FLOW_STRING("col_push_str_property", "Exit."); return error; } /* Push a binary property to stack. */ -int push_binary_property(struct collection_item *stack, - const char *property, void *binary_data, int length) +int col_push_binary_property(struct collection_item *stack, + const char *property, + void *binary_data, + int length) { int error = EOK; - TRACE_FLOW_STRING("push_binary_property", "Entry point."); + TRACE_FLOW_STRING("col_push_binary_property", "Entry point."); /* Check that stack is not empty */ if (stack == NULL) { @@ -89,25 +91,26 @@ int push_binary_property(struct collection_item *stack, } /* Make sure it is a stack */ - if (!is_of_class(stack, COL_CLASS_STACK)) { + if (!col_is_of_class(stack, COL_CLASS_STACK)) { TRACE_ERROR_STRING("Wrong class", ""); return EINVAL; } - error = add_binary_property(stack, NULL, property, binary_data, length); + error = col_add_binary_property(stack, NULL, property, binary_data, length); - TRACE_FLOW_STRING("push_binary_property", "Exit."); + TRACE_FLOW_STRING("col_push_binary_property", "Exit."); return error; } /* Push an int property to stack. */ -int push_int_property(struct collection_item *stack, - const char *property, int number) +int col_push_int_property(struct collection_item *stack, + const char *property, + int number) { int error = EOK; - TRACE_FLOW_STRING("push_int_property", "Entry point."); + TRACE_FLOW_STRING("col_push_int_property", "Entry point."); /* Check that stack is not empty */ if (stack == NULL) { @@ -116,24 +119,25 @@ int push_int_property(struct collection_item *stack, } /* Make sure it is a stack */ - if (!is_of_class(stack, COL_CLASS_STACK)) { + if (!col_is_of_class(stack, COL_CLASS_STACK)) { TRACE_ERROR_STRING("Wrong class", ""); return EINVAL; } - error = add_int_property(stack, NULL, property, number); + error = col_add_int_property(stack, NULL, property, number); - TRACE_FLOW_STRING("push_int_property", "Exit."); + TRACE_FLOW_STRING("col_push_int_property", "Exit."); return error; } /* Push an unsigned int property to stack. */ -int push_unsigned_property(struct collection_item *stack, - const char *property, unsigned int number) +int col_push_unsigned_property(struct collection_item *stack, + const char *property, + unsigned int number) { int error = EOK; - TRACE_FLOW_STRING("push_unsigned_property", "Entry point."); + TRACE_FLOW_STRING("col_push_unsigned_property", "Entry point."); /* Check that stack is not empty */ if (stack == NULL) { @@ -142,25 +146,26 @@ int push_unsigned_property(struct collection_item *stack, } /* Make sure it is a stack */ - if (!is_of_class(stack, COL_CLASS_STACK)) { + if (!col_is_of_class(stack, COL_CLASS_STACK)) { TRACE_ERROR_STRING("Wrong class", ""); return EINVAL; } - error = add_unsigned_property(stack, NULL, property, number); + error = col_add_unsigned_property(stack, NULL, property, number); - TRACE_FLOW_STRING("push_unsigned_property", "Exit."); + TRACE_FLOW_STRING("col_push_unsigned_property", "Exit."); return error; } /* Push a long property. */ -int push_long_property(struct collection_item *stack, - const char *property, long number) +int col_push_long_property(struct collection_item *stack, + const char *property, + long number) { int error = EOK; - TRACE_FLOW_STRING("push_long_property", "Entry point."); + TRACE_FLOW_STRING("col_push_long_property", "Entry point."); /* Check that stack is not empty */ if (stack == NULL) { @@ -169,24 +174,25 @@ int push_long_property(struct collection_item *stack, } /* Make sure it is a stack */ - if (!is_of_class(stack, COL_CLASS_STACK)) { + if (!col_is_of_class(stack, COL_CLASS_STACK)) { TRACE_ERROR_STRING("Wrong class", ""); return EINVAL; } - error = add_long_property(stack, NULL, property, number); + error = col_add_long_property(stack, NULL, property, number); - TRACE_FLOW_STRING("push_long_property", "Exit."); + TRACE_FLOW_STRING("col_push_long_property", "Exit."); return error; } /* Push an unsigned long property. */ -int push_ulong_property(struct collection_item *stack, - const char *property, unsigned long number) +int col_push_ulong_property(struct collection_item *stack, + const char *property, + unsigned long number) { int error = EOK; - TRACE_FLOW_STRING("push_ulong_property", "Entry point."); + TRACE_FLOW_STRING("col_push_ulong_property", "Entry point."); /* Check that stack is not empty */ if (stack == NULL) { @@ -195,24 +201,25 @@ int push_ulong_property(struct collection_item *stack, } /* Make sure it is a stack */ - if (!is_of_class(stack, COL_CLASS_STACK)) { + if (!col_is_of_class(stack, COL_CLASS_STACK)) { TRACE_ERROR_STRING("Wrong class", ""); return EINVAL; } - error = add_ulong_property(stack, NULL, property, number); + error = col_add_ulong_property(stack, NULL, property, number); - TRACE_FLOW_STRING("push_ulong_property", "Exit."); + TRACE_FLOW_STRING("col_push_ulong_property", "Exit."); return error; } /* Push a double property. */ -int push_double_property(struct collection_item *stack, - const char *property, double number) +int col_push_double_property(struct collection_item *stack, + const char *property, + double number) { int error = EOK; - TRACE_FLOW_STRING("push_double_property", "Entry point."); + TRACE_FLOW_STRING("col_push_double_property", "Entry point."); /* Check that stack is not empty */ if (stack == NULL) { @@ -221,24 +228,25 @@ int push_double_property(struct collection_item *stack, } /* Make sure it is a stack */ - if (!is_of_class(stack, COL_CLASS_STACK)) { + if (!col_is_of_class(stack, COL_CLASS_STACK)) { TRACE_ERROR_STRING("Wrong class", ""); return EINVAL; } - error = add_double_property(stack, NULL, property, number); + error = col_add_double_property(stack, NULL, property, number); - TRACE_FLOW_STRING("push_double_property", "Exit."); + TRACE_FLOW_STRING("col_push_double_property", "Exit."); return error; } /* Push a bool property. */ -int push_bool_property(struct collection_item *stack, - const char *property, unsigned char logical) +int col_push_bool_property(struct collection_item *stack, + const char *property, + unsigned char logical) { int error = EOK; - TRACE_FLOW_STRING("push_bool_property", "Entry point."); + TRACE_FLOW_STRING("col_push_bool_property", "Entry point."); /* Check that stack is not empty */ if (stack == NULL) { @@ -247,27 +255,27 @@ int push_bool_property(struct collection_item *stack, } /* Make sure it is a stack */ - if (!is_of_class(stack, COL_CLASS_STACK)) { + if (!col_is_of_class(stack, COL_CLASS_STACK)) { TRACE_ERROR_STRING("Wrong class", ""); return EINVAL; } - error = add_bool_property(stack, NULL, property, logical); + error = col_add_bool_property(stack, NULL, property, logical); TRACE_FLOW_STRING("push_double_property", "Exit."); return error; } /* Push any property */ -int push_any_property(struct collection_item *stack, - const char *property, - int type, - void *data, - int length) +int col_push_any_property(struct collection_item *stack, + const char *property, + int type, + void *data, + int length) { int error = EOK; - TRACE_FLOW_STRING("push_bool_property", "Entry point."); + TRACE_FLOW_STRING("col_push_any_property", "Entry point."); /* Check that stack is not empty */ if (stack == NULL) { @@ -276,24 +284,24 @@ int push_any_property(struct collection_item *stack, } /* Make sure it is a stack */ - if (!is_of_class(stack, COL_CLASS_STACK)) { + if (!col_is_of_class(stack, COL_CLASS_STACK)) { TRACE_ERROR_STRING("Wrong class", ""); return EINVAL; } - error = add_any_property(stack, NULL, property, type, data, length); + error = col_add_any_property(stack, NULL, property, type, data, length); - TRACE_FLOW_STRING("push_bool_property", "Exit."); + TRACE_FLOW_STRING("col_push_any_property", "Exit."); return error; } /* Push item */ -int push_item(struct collection_item *stack, - struct collection_item *item) +int col_push_item(struct collection_item *stack, + struct collection_item *item) { int error = EOK; - TRACE_FLOW_STRING("push_item", "Entry point."); + TRACE_FLOW_STRING("col_push_item", "Entry point."); /* Check that stack is not empty */ if (stack == NULL) { @@ -302,29 +310,29 @@ int push_item(struct collection_item *stack, } /* Make sure it is a stack */ - if (!is_of_class(stack, COL_CLASS_STACK)) { + if (!col_is_of_class(stack, COL_CLASS_STACK)) { TRACE_ERROR_STRING("Wrong class", ""); return EINVAL; } - error = insert_item_into_current(stack, - item, - COL_DSP_END, - NULL, - 0, - COL_INSERT_NOCHECK); + error = col_insert_item_into_current(stack, + item, + COL_DSP_END, + NULL, + 0, + COL_INSERT_NOCHECK); - TRACE_FLOW_STRING("push_item", "Exit."); + TRACE_FLOW_STRING("col_push_item", "Exit."); return error; } /* Pop_item */ -int pop_item(struct collection_item *stack, - struct collection_item **item) +int col_pop_item(struct collection_item *stack, + struct collection_item **item) { int error = EOK; - TRACE_FLOW_STRING("pop_item", "Entry point."); + TRACE_FLOW_STRING("col_pop_item", "Entry point."); /* Check that stack is not empty */ if (stack == NULL) { @@ -333,18 +341,18 @@ int pop_item(struct collection_item *stack, } /* Make sure it is a stack */ - if (!is_of_class(stack, COL_CLASS_STACK)) { + if (!col_is_of_class(stack, COL_CLASS_STACK)) { TRACE_ERROR_STRING("Wrong class", ""); return EINVAL; } - error = extract_item_from_current(stack, - COL_DSP_END, - NULL, - 0, - 0, - item); + error = col_extract_item_from_current(stack, + COL_DSP_END, + NULL, + 0, + 0, + item); - TRACE_FLOW_STRING("pop_item", "Exit."); + TRACE_FLOW_STRING("col_pop_item", "Exit."); return error; } -- cgit