From 69db8176b644ec469e66b21d2e4034e8c4a06e87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EB=B0=A9=EC=A7=84=EC=98=81?= Date: Thu, 13 Jan 2022 01:42:58 +0900 Subject: [PATCH] keyword conflict with zebos list_creat(), list_free() (#11190) * keyword conflict with zebos list_creat(), list_free() * keyword conflict in zebos list_create list_free --- .../languages/CLibcurlClientCodegen.java | 4 +- .../resources/C-libcurl/api-body.mustache | 34 +++++------ .../resources/C-libcurl/apiClient.c.mustache | 6 +- .../resources/C-libcurl/api_pet_test.mustache | 4 +- .../C-libcurl/api_store_test.mustache | 2 +- .../main/resources/C-libcurl/list.c.mustache | 6 +- .../main/resources/C-libcurl/list.h.mustache | 4 +- .../resources/C-libcurl/model-body.mustache | 12 ++-- .../cpp-tizen-client/api-body.mustache | 2 +- .../cpp-tizen-client/requestinfo.mustache | 2 +- samples/client/petstore/c/api/PetAPI.c | 56 +++++++++---------- samples/client/petstore/c/api/StoreAPI.c | 14 ++--- samples/client/petstore/c/api/UserAPI.c | 12 ++-- samples/client/petstore/c/include/list.h | 4 +- samples/client/petstore/c/model/pet.c | 8 +-- samples/client/petstore/c/src/apiClient.c | 6 +- samples/client/petstore/c/src/list.c | 6 +- .../client/petstore/c/unit-test/test_pet.c | 8 +-- .../petstore/c/unit-tests/manual-PetAPI.c | 4 +- .../petstore/c/unit-tests/manual-StoreAPI.c | 2 +- .../petstore/cpp-tizen/src/PetManager.cpp | 16 +++--- .../petstore/cpp-tizen/src/RequestInfo.h | 2 +- .../petstore/cpp-tizen/src/StoreManager.cpp | 8 +-- .../petstore/cpp-tizen/src/UserManager.cpp | 16 +++--- 24 files changed, 119 insertions(+), 119 deletions(-) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CLibcurlClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CLibcurlClientCodegen.java index e7aa24c603d..da9b8d200be 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CLibcurlClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CLibcurlClientCodegen.java @@ -519,9 +519,9 @@ public class CLibcurlClientCodegen extends DefaultCodegen implements CodegenConf } else if (ModelUtils.isBooleanSchema(schema)) { example = "1"; } else if (ModelUtils.isArraySchema(schema)) { - example = "list_create()"; + example = "list_createList()"; } else if (ModelUtils.isMapSchema(schema)) { - example = "list_create()"; + example = "list_createList()"; } else if (ModelUtils.isObjectSchema(schema)) { return null; // models are managed at moustache level } else { diff --git a/modules/openapi-generator/src/main/resources/C-libcurl/api-body.mustache b/modules/openapi-generator/src/main/resources/C-libcurl/api-body.mustache index 9d73ff5591a..7ee11c71fbc 100644 --- a/modules/openapi-generator/src/main/resources/C-libcurl/api-body.mustache +++ b/modules/openapi-generator/src/main/resources/C-libcurl/api-body.mustache @@ -101,11 +101,11 @@ end: {{#returnType}}{{#returnTypeIsPrimitive}}{{#returnSimpleType}}{{{.}}}*{{/returnSimpleType}}{{^returnSimpleType}}{{#isArray}}{{{.}}}_t*{{/isArray}}{{#isMap}}{{{.}}}{{/isMap}}{{/returnSimpleType}}{{/returnTypeIsPrimitive}}{{^returnTypeIsPrimitive}}{{{.}}}_t*{{/returnTypeIsPrimitive}}{{/returnType}}{{^returnType}}void{{/returnType}} {{{classname}}}_{{{operationId}}}(apiClient_t *apiClient{{#allParams}}, {{#isPrimitiveType}}{{#isNumber}}{{{dataType}}}{{/isNumber}}{{#isLong}}{{{dataType}}}{{/isLong}}{{#isInteger}}{{{dataType}}}{{/isInteger}}{{#isDouble}}{{{dataType}}}{{/isDouble}}{{#isFloat}}{{{dataType}}}{{/isFloat}}{{#isBoolean}}{{dataType}}{{/isBoolean}}{{#isEnum}}{{#isString}}{{projectName}}_{{operationId}}_{{baseName}}_e{{/isString}}{{/isEnum}}{{^isEnum}}{{#isString}}{{{dataType}}} *{{/isString}}{{/isEnum}}{{#isByteArray}}{{{dataType}}} *{{/isByteArray}}{{#isDate}}{{{dataType}}}{{/isDate}}{{#isDateTime}}{{{dataType}}}{{/isDateTime}}{{#isFile}}{{{dataType}}}{{/isFile}}{{#isFreeFormObject}}{{dataType}}_t *{{/isFreeFormObject}}{{/isPrimitiveType}}{{^isArray}}{{^isPrimitiveType}}{{#isModel}}{{#isEnum}}{{datatypeWithEnum}}_e{{/isEnum}}{{^isEnum}}{{{dataType}}}_t *{{/isEnum}}{{/isModel}}{{^isModel}}{{#isEnum}}{{datatypeWithEnum}}_e{{/isEnum}}{{/isModel}}{{#isUuid}}{{dataType}} *{{/isUuid}}{{#isEmail}}{{dataType}}{{/isEmail}}{{/isPrimitiveType}}{{/isArray}}{{#isContainer}}{{#isArray}}{{dataType}}_t *{{/isArray}}{{#isMap}}{{dataType}}{{/isMap}}{{/isContainer}} {{{paramName}}} {{/allParams}}) { - list_t *localVarQueryParameters = {{#hasQueryParams}}list_create();{{/hasQueryParams}}{{^hasQueryParams}}NULL;{{/hasQueryParams}} - list_t *localVarHeaderParameters = {{#hasHeaderParams}}list_create();{{/hasHeaderParams}}{{^hasHeaderParams}}NULL;{{/hasHeaderParams}} - list_t *localVarFormParameters = {{#hasFormParams}}list_create();{{/hasFormParams}}{{^hasFormParams}}NULL;{{/hasFormParams}} - list_t *localVarHeaderType = {{#hasProduces}}list_create();{{/hasProduces}}{{^hasProduces}}NULL;{{/hasProduces}} - list_t *localVarContentType = {{#hasConsumes}}list_create();{{/hasConsumes}}{{^hasConsumes}}NULL;{{/hasConsumes}} + list_t *localVarQueryParameters = {{#hasQueryParams}}list_createList();{{/hasQueryParams}}{{^hasQueryParams}}NULL;{{/hasQueryParams}} + list_t *localVarHeaderParameters = {{#hasHeaderParams}}list_createList();{{/hasHeaderParams}}{{^hasHeaderParams}}NULL;{{/hasHeaderParams}} + list_t *localVarFormParameters = {{#hasFormParams}}list_createList();{{/hasFormParams}}{{^hasFormParams}}NULL;{{/hasFormParams}} + list_t *localVarHeaderType = {{#hasProduces}}list_createList();{{/hasProduces}}{{^hasProduces}}NULL;{{/hasProduces}} + list_t *localVarContentType = {{#hasConsumes}}list_createList();{{/hasConsumes}}{{^hasConsumes}}NULL;{{/hasConsumes}} char *localVarBodyParameters = NULL; // create the path @@ -341,7 +341,7 @@ end: //primitive return type not simple cJSON *{{paramName}}localVarJSON = cJSON_Parse(apiClient->dataReceived); cJSON *{{{paramName}}}VarJSON; - list_t *elementToReturn = list_create(); + list_t *elementToReturn = list_createList(); cJSON_ArrayForEach({{{paramName}}}VarJSON, {{paramName}}localVarJSON){ keyValuePair_t *keyPair = keyValuePair_create(strdup({{{paramName}}}VarJSON->string), cJSON_Print({{{paramName}}}VarJSON)); list_addElement(elementToReturn, keyPair); @@ -356,7 +356,7 @@ end: if(!cJSON_IsArray({{classname}}localVarJSON)) { return 0;//nonprimitive container } - list_t *elementToReturn = list_create(); + list_t *elementToReturn = list_createList(); cJSON *{{{paramName}}}VarJSON; cJSON_ArrayForEach({{{paramName}}}VarJSON, {{classname}}localVarJSON) { @@ -388,11 +388,11 @@ end: apiClient->dataReceived = NULL; apiClient->dataReceivedLen = 0; } - {{#hasQueryParams}}list_free(localVarQueryParameters);{{/hasQueryParams}} - {{#hasHeaderParams}}list_free(localVarHeaderParameters);{{/hasHeaderParams}} - {{#hasFormParams}}list_free(localVarFormParameters);{{/hasFormParams}} - {{#hasProduces}}list_free(localVarHeaderType);{{/hasProduces}} - {{#hasConsumes}}list_free(localVarContentType);{{/hasConsumes}} + {{#hasQueryParams}}list_freeList(localVarQueryParameters);{{/hasQueryParams}} + {{#hasHeaderParams}}list_freeList(localVarHeaderParameters);{{/hasHeaderParams}} + {{#hasFormParams}}list_freeList(localVarFormParameters);{{/hasFormParams}} + {{#hasProduces}}list_freeList(localVarHeaderType);{{/hasProduces}} + {{#hasConsumes}}list_freeList(localVarContentType);{{/hasConsumes}} free(localVarPath); {{#pathParams}} free(localVarToReplace_{{paramName}}); @@ -526,11 +526,11 @@ end: apiClient->dataReceived = NULL; apiClient->dataReceivedLen = 0; } - {{#hasQueryParams}}list_free(localVarQueryParameters);{{/hasQueryParams}} - {{#hasHeaderParams}}list_free(localVarHeaderParameters);{{/hasHeaderParams}} - {{#hasFormParams}}list_free(localVarFormParameters);{{/hasFormParams}} - {{#hasProduces}}list_free(localVarHeaderType);{{/hasProduces}} - {{#hasConsumes}}list_free(localVarContentType);{{/hasConsumes}} + {{#hasQueryParams}}list_freeList(localVarQueryParameters);{{/hasQueryParams}} + {{#hasHeaderParams}}list_freeList(localVarHeaderParameters);{{/hasHeaderParams}} + {{#hasFormParams}}list_freeList(localVarFormParameters);{{/hasFormParams}} + {{#hasProduces}}list_freeList(localVarHeaderType);{{/hasProduces}} + {{#hasConsumes}}list_freeList(localVarContentType);{{/hasConsumes}} free(localVarPath); {{#pathParams}} free(localVarToReplace_{{paramName}}); diff --git a/modules/openapi-generator/src/main/resources/C-libcurl/apiClient.c.mustache b/modules/openapi-generator/src/main/resources/C-libcurl/apiClient.c.mustache index 38656a5615b..e324c5f966c 100644 --- a/modules/openapi-generator/src/main/resources/C-libcurl/apiClient.c.mustache +++ b/modules/openapi-generator/src/main/resources/C-libcurl/apiClient.c.mustache @@ -74,7 +74,7 @@ apiClient_t *apiClient_create_with_base_path(const char *basePath {{/isOAuth}} {{#isApiKey}} if(apiKeys_{{name}}!= NULL) { - apiClient->apiKeys_{{name}} = list_create(); + apiClient->apiKeys_{{name}} = list_createList(); listEntry_t *listEntry = NULL; list_ForEach(listEntry, apiKeys_{{name}}) { keyValuePair_t *pair = listEntry->data; @@ -126,7 +126,7 @@ void apiClient_free(apiClient_t *apiClient) { } keyValuePair_free(pair); } - list_free(apiClient->apiKeys_{{name}}); + list_freeList(apiClient->apiKeys_{{name}}); } {{/isApiKey}} {{/authMethods}} @@ -530,7 +530,7 @@ void apiClient_invoke(apiClient_t *apiClient, res = curl_easy_perform(handle); - curl_slist_free_all(headers); + curl_slist_freeList_all(headers); free(targetUrl); diff --git a/modules/openapi-generator/src/main/resources/C-libcurl/api_pet_test.mustache b/modules/openapi-generator/src/main/resources/C-libcurl/api_pet_test.mustache index 13014042f80..ffdb0363e47 100644 --- a/modules/openapi-generator/src/main/resources/C-libcurl/api_pet_test.mustache +++ b/modules/openapi-generator/src/main/resources/C-libcurl/api_pet_test.mustache @@ -42,7 +42,7 @@ int main() { char *exampleUrl2 = malloc(strlen(EXAMPLE_URL_2) + 1); strcpy(exampleUrl2, EXAMPLE_URL_2); - list_t *photoUrls = list_create(); + list_t *photoUrls = list_createList(); list_addElement(photoUrls, exampleUrl1); list_addElement(photoUrls, exampleUrl2); @@ -55,7 +55,7 @@ int main() { strcpy(exampleTag2Name, EXAMPLE_TAG_2_NAME); tag_t *exampleTag2 = tag_create(EXAMPLE_TAG_2_ID, exampleTag2Name); - list_t *tags = list_create(); + list_t *tags = list_createList(); list_addElement(tags, exampleTag1); list_addElement(tags, exampleTag2); diff --git a/modules/openapi-generator/src/main/resources/C-libcurl/api_store_test.mustache b/modules/openapi-generator/src/main/resources/C-libcurl/api_store_test.mustache index 159c02e5976..0f652aa09c0 100644 --- a/modules/openapi-generator/src/main/resources/C-libcurl/api_store_test.mustache +++ b/modules/openapi-generator/src/main/resources/C-libcurl/api_store_test.mustache @@ -89,6 +89,6 @@ int main() { list_ForEach(listEntry, elementToReturn) { keyValuePair_free(listEntry->data); } - list_free(elementToReturn); + list_freeList(elementToReturn); } diff --git a/modules/openapi-generator/src/main/resources/C-libcurl/list.c.mustache b/modules/openapi-generator/src/main/resources/C-libcurl/list.c.mustache index dfa2e567501..786812158a2 100644 --- a/modules/openapi-generator/src/main/resources/C-libcurl/list.c.mustache +++ b/modules/openapi-generator/src/main/resources/C-libcurl/list.c.mustache @@ -23,7 +23,7 @@ void listEntry_printAsInt(listEntry_t *listEntry, void *additionalData) { printf("%i\n", *((int *) (listEntry->data))); } -list_t *list_create() { +list_t *list_createList() { list_t *createdList = malloc(sizeof(list_t)); if(createdList == NULL) { // TODO Malloc Failure @@ -88,7 +88,7 @@ void list_iterateThroughListBackward(list_t *list, } } -void list_free(list_t *list) { +void list_freeList(list_t *list) { if(list){ list_iterateThroughListForward(list, listEntry_free, NULL); free(list); @@ -196,5 +196,5 @@ void clear_and_free_string_list(list_t *list) free(list_item); list_item = NULL; } - list_free(list); + list_freeList(list); } \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/C-libcurl/list.h.mustache b/modules/openapi-generator/src/main/resources/C-libcurl/list.h.mustache index 4c613214094..96c5832b02b 100644 --- a/modules/openapi-generator/src/main/resources/C-libcurl/list.h.mustache +++ b/modules/openapi-generator/src/main/resources/C-libcurl/list.h.mustache @@ -23,8 +23,8 @@ typedef struct list_t { #define list_ForEach(element, list) for(element = (list != NULL) ? (list)->firstEntry : NULL; element != NULL; element = element->nextListEntry) -list_t* list_create(); -void list_free(list_t* listToFree); +list_t* List(); +void list_freeListList(list_t* listToFree); void list_addElement(list_t* list, void* dataToAddInList); listEntry_t* list_getElementAt(list_t *list, long indexOfElement); diff --git a/modules/openapi-generator/src/main/resources/C-libcurl/model-body.mustache b/modules/openapi-generator/src/main/resources/C-libcurl/model-body.mustache index 1f28e05e909..18968d2c7c0 100644 --- a/modules/openapi-generator/src/main/resources/C-libcurl/model-body.mustache +++ b/modules/openapi-generator/src/main/resources/C-libcurl/model-body.mustache @@ -294,7 +294,7 @@ void {{classname}}_free({{classname}}_t *{{classname}}) { list_ForEach(listEntry, {{classname}}->{{name}}) { free(listEntry->data); } - list_free({{classname}}->{{name}}); + list_freeList({{classname}}->{{name}}); {{classname}}->{{name}} = NULL; } {{/isPrimitiveType}} @@ -303,7 +303,7 @@ void {{classname}}_free({{classname}}_t *{{classname}}) { list_ForEach(listEntry, {{classname}}->{{name}}) { {{complexType}}_free(listEntry->data); } - list_free({{classname}}->{{name}}); + list_freeList({{classname}}->{{name}}); {{classname}}->{{name}} = NULL; } {{/isPrimitiveType}} @@ -316,7 +316,7 @@ void {{classname}}_free({{classname}}_t *{{classname}}) { free (localKeyValue->value); keyValuePair_free(localKeyValue); } - list_free({{classname}}->{{name}}); + list_freeList({{classname}}->{{name}}); {{classname}}->{{name}} = NULL; } {{/isMap}} @@ -699,7 +699,7 @@ fail: if(!cJSON_IsArray({{{name}}})) { goto end;//primitive container } - {{{name}}}List = list_create(); + {{{name}}}List = list_createList(); cJSON_ArrayForEach({{{name}}}_local, {{{name}}}) { @@ -742,7 +742,7 @@ fail: goto end; //nonprimitive container } - {{{name}}}List = list_create(); + {{{name}}}List = list_createList(); cJSON_ArrayForEach({{{name}}}_local_nonprimitive,{{{name}}} ) { @@ -762,7 +762,7 @@ fail: if(!cJSON_IsObject({{{name}}})) { goto end;//primitive map container } - {{{name}}}List = list_create(); + {{{name}}}List = list_createList(); keyValuePair_t *localMapKeyPair; cJSON_ArrayForEach({{{name}}}_local_map, {{{name}}}) { diff --git a/modules/openapi-generator/src/main/resources/cpp-tizen-client/api-body.mustache b/modules/openapi-generator/src/main/resources/cpp-tizen-client/api-body.mustache index a9b960e76eb..9239b3762f0 100644 --- a/modules/openapi-generator/src/main/resources/cpp-tizen-client/api-body.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-tizen-client/api-body.mustache @@ -299,7 +299,7 @@ static bool {{nickname}}Helper(char * accessToken, mBody, headerList, p_chunk, &code, errormsg); bool retval = {{nickname}}Processor(*p_chunk, code, errormsg, userData,reinterpret_cast(handler)); - curl_slist_free_all(headerList); + curl_slist_freeList_all(headerList); if (p_chunk) { if(p_chunk->memory) { free(p_chunk->memory); diff --git a/modules/openapi-generator/src/main/resources/cpp-tizen-client/requestinfo.mustache b/modules/openapi-generator/src/main/resources/cpp-tizen-client/requestinfo.mustache index eb47133b853..5966669be45 100644 --- a/modules/openapi-generator/src/main/resources/cpp-tizen-client/requestinfo.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-tizen-client/requestinfo.mustache @@ -45,7 +45,7 @@ public: ~RequestInfo() { - curl_slist_free_all(headerList); + curl_slist_freeList_all(headerList); if (this->p_chunk) { if((this->p_chunk)->memory) { free((this->p_chunk)->memory); diff --git a/samples/client/petstore/c/api/PetAPI.c b/samples/client/petstore/c/api/PetAPI.c index 28aab6c189d..b5d6f2d6180 100644 --- a/samples/client/petstore/c/api/PetAPI.c +++ b/samples/client/petstore/c/api/PetAPI.c @@ -64,7 +64,7 @@ PetAPI_addPet(apiClient_t *apiClient, pet_t * body ) list_t *localVarHeaderParameters = NULL; list_t *localVarFormParameters = NULL; list_t *localVarHeaderType = NULL; - list_t *localVarContentType = list_create(); + list_t *localVarContentType = list_createList(); char *localVarBodyParameters = NULL; // create the path @@ -109,7 +109,7 @@ end: - list_free(localVarContentType); + list_freeList(localVarContentType); free(localVarPath); if (localVarSingleItemJSON_body) { cJSON_Delete(localVarSingleItemJSON_body); @@ -125,7 +125,7 @@ void PetAPI_deletePet(apiClient_t *apiClient, long petId , char * api_key ) { list_t *localVarQueryParameters = NULL; - list_t *localVarHeaderParameters = list_create(); + list_t *localVarHeaderParameters = list_createList(); list_t *localVarFormParameters = NULL; list_t *localVarHeaderType = NULL; list_t *localVarContentType = NULL; @@ -185,7 +185,7 @@ end: apiClient->dataReceivedLen = 0; } - list_free(localVarHeaderParameters); + list_freeList(localVarHeaderParameters); @@ -210,10 +210,10 @@ end: list_t* PetAPI_findPetsByStatus(apiClient_t *apiClient, list_t * status ) { - list_t *localVarQueryParameters = list_create(); + list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; list_t *localVarFormParameters = NULL; - list_t *localVarHeaderType = list_create(); + list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; @@ -252,7 +252,7 @@ PetAPI_findPetsByStatus(apiClient_t *apiClient, list_t * status ) if(!cJSON_IsArray(PetAPIlocalVarJSON)) { return 0;//nonprimitive container } - list_t *elementToReturn = list_create(); + list_t *elementToReturn = list_createList(); cJSON *VarJSON; cJSON_ArrayForEach(VarJSON, PetAPIlocalVarJSON) { @@ -272,10 +272,10 @@ PetAPI_findPetsByStatus(apiClient_t *apiClient, list_t * status ) apiClient->dataReceived = NULL; apiClient->dataReceivedLen = 0; } - list_free(localVarQueryParameters); + list_freeList(localVarQueryParameters); - list_free(localVarHeaderType); + list_freeList(localVarHeaderType); free(localVarPath); return elementToReturn; @@ -292,10 +292,10 @@ end: list_t* PetAPI_findPetsByTags(apiClient_t *apiClient, list_t * tags ) { - list_t *localVarQueryParameters = list_create(); + list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; list_t *localVarFormParameters = NULL; - list_t *localVarHeaderType = list_create(); + list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; @@ -334,7 +334,7 @@ PetAPI_findPetsByTags(apiClient_t *apiClient, list_t * tags ) if(!cJSON_IsArray(PetAPIlocalVarJSON)) { return 0;//nonprimitive container } - list_t *elementToReturn = list_create(); + list_t *elementToReturn = list_createList(); cJSON *VarJSON; cJSON_ArrayForEach(VarJSON, PetAPIlocalVarJSON) { @@ -354,10 +354,10 @@ PetAPI_findPetsByTags(apiClient_t *apiClient, list_t * tags ) apiClient->dataReceived = NULL; apiClient->dataReceivedLen = 0; } - list_free(localVarQueryParameters); + list_freeList(localVarQueryParameters); - list_free(localVarHeaderType); + list_freeList(localVarHeaderType); free(localVarPath); return elementToReturn; @@ -377,7 +377,7 @@ PetAPI_getPetById(apiClient_t *apiClient, long petId ) list_t *localVarQueryParameters = NULL; list_t *localVarHeaderParameters = NULL; list_t *localVarFormParameters = NULL; - list_t *localVarHeaderType = list_create(); + list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; @@ -440,7 +440,7 @@ PetAPI_getPetById(apiClient_t *apiClient, long petId ) - list_free(localVarHeaderType); + list_freeList(localVarHeaderType); free(localVarPath); free(localVarToReplace_petId); @@ -460,7 +460,7 @@ PetAPI_updatePet(apiClient_t *apiClient, pet_t * body ) list_t *localVarHeaderParameters = NULL; list_t *localVarFormParameters = NULL; list_t *localVarHeaderType = NULL; - list_t *localVarContentType = list_create(); + list_t *localVarContentType = list_createList(); char *localVarBodyParameters = NULL; // create the path @@ -511,7 +511,7 @@ end: - list_free(localVarContentType); + list_freeList(localVarContentType); free(localVarPath); if (localVarSingleItemJSON_body) { cJSON_Delete(localVarSingleItemJSON_body); @@ -528,9 +528,9 @@ PetAPI_updatePetWithForm(apiClient_t *apiClient, long petId , char * name , char { list_t *localVarQueryParameters = NULL; list_t *localVarHeaderParameters = NULL; - list_t *localVarFormParameters = list_create(); + list_t *localVarFormParameters = list_createList(); list_t *localVarHeaderType = NULL; - list_t *localVarContentType = list_create(); + list_t *localVarContentType = list_createList(); char *localVarBodyParameters = NULL; // create the path @@ -601,9 +601,9 @@ end: } - list_free(localVarFormParameters); + list_freeList(localVarFormParameters); - list_free(localVarContentType); + list_freeList(localVarContentType); free(localVarPath); free(localVarToReplace_petId); if (keyForm_name) { @@ -634,9 +634,9 @@ PetAPI_uploadFile(apiClient_t *apiClient, long petId , char * additionalMetadata { list_t *localVarQueryParameters = NULL; list_t *localVarHeaderParameters = NULL; - list_t *localVarFormParameters = list_create(); - list_t *localVarHeaderType = list_create(); - list_t *localVarContentType = list_create(); + list_t *localVarFormParameters = list_createList(); + list_t *localVarHeaderType = list_createList(); + list_t *localVarContentType = list_createList(); char *localVarBodyParameters = NULL; // create the path @@ -715,9 +715,9 @@ PetAPI_uploadFile(apiClient_t *apiClient, long petId , char * additionalMetadata } - list_free(localVarFormParameters); - list_free(localVarHeaderType); - list_free(localVarContentType); + list_freeList(localVarFormParameters); + list_freeList(localVarHeaderType); + list_freeList(localVarContentType); free(localVarPath); free(localVarToReplace_petId); if (keyForm_additionalMetadata) { diff --git a/samples/client/petstore/c/api/StoreAPI.c b/samples/client/petstore/c/api/StoreAPI.c index 80921ad0f07..8086a57a64c 100644 --- a/samples/client/petstore/c/api/StoreAPI.c +++ b/samples/client/petstore/c/api/StoreAPI.c @@ -86,7 +86,7 @@ StoreAPI_getInventory(apiClient_t *apiClient) list_t *localVarQueryParameters = NULL; list_t *localVarHeaderParameters = NULL; list_t *localVarFormParameters = NULL; - list_t *localVarHeaderType = list_create(); + list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; @@ -114,7 +114,7 @@ StoreAPI_getInventory(apiClient_t *apiClient) //primitive return type not simple cJSON *localVarJSON = cJSON_Parse(apiClient->dataReceived); cJSON *VarJSON; - list_t *elementToReturn = list_create(); + list_t *elementToReturn = list_createList(); cJSON_ArrayForEach(VarJSON, localVarJSON){ keyValuePair_t *keyPair = keyValuePair_create(strdup(VarJSON->string), cJSON_Print(VarJSON)); list_addElement(elementToReturn, keyPair); @@ -129,7 +129,7 @@ StoreAPI_getInventory(apiClient_t *apiClient) - list_free(localVarHeaderType); + list_freeList(localVarHeaderType); free(localVarPath); return elementToReturn; @@ -149,7 +149,7 @@ StoreAPI_getOrderById(apiClient_t *apiClient, long orderId ) list_t *localVarQueryParameters = NULL; list_t *localVarHeaderParameters = NULL; list_t *localVarFormParameters = NULL; - list_t *localVarHeaderType = list_create(); + list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; @@ -212,7 +212,7 @@ StoreAPI_getOrderById(apiClient_t *apiClient, long orderId ) - list_free(localVarHeaderType); + list_freeList(localVarHeaderType); free(localVarPath); free(localVarToReplace_orderId); @@ -231,7 +231,7 @@ StoreAPI_placeOrder(apiClient_t *apiClient, order_t * body ) list_t *localVarQueryParameters = NULL; list_t *localVarHeaderParameters = NULL; list_t *localVarFormParameters = NULL; - list_t *localVarHeaderType = list_create(); + list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; @@ -286,7 +286,7 @@ StoreAPI_placeOrder(apiClient_t *apiClient, order_t * body ) - list_free(localVarHeaderType); + list_freeList(localVarHeaderType); free(localVarPath); if (localVarSingleItemJSON_body) { diff --git a/samples/client/petstore/c/api/UserAPI.c b/samples/client/petstore/c/api/UserAPI.c index 33e94203928..de32d2eef0d 100644 --- a/samples/client/petstore/c/api/UserAPI.c +++ b/samples/client/petstore/c/api/UserAPI.c @@ -328,7 +328,7 @@ UserAPI_getUserByName(apiClient_t *apiClient, char * username ) list_t *localVarQueryParameters = NULL; list_t *localVarHeaderParameters = NULL; list_t *localVarFormParameters = NULL; - list_t *localVarHeaderType = list_create(); + list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; @@ -387,7 +387,7 @@ UserAPI_getUserByName(apiClient_t *apiClient, char * username ) - list_free(localVarHeaderType); + list_freeList(localVarHeaderType); free(localVarPath); free(localVarToReplace_username); @@ -403,10 +403,10 @@ end: char* UserAPI_loginUser(apiClient_t *apiClient, char * username , char * password ) { - list_t *localVarQueryParameters = list_create(); + list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; list_t *localVarFormParameters = NULL; - list_t *localVarHeaderType = list_create(); + list_t *localVarHeaderType = list_createList(); list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; @@ -467,10 +467,10 @@ UserAPI_loginUser(apiClient_t *apiClient, char * username , char * password ) apiClient->dataReceived = NULL; apiClient->dataReceivedLen = 0; } - list_free(localVarQueryParameters); + list_freeList(localVarQueryParameters); - list_free(localVarHeaderType); + list_freeList(localVarHeaderType); free(localVarPath); if(keyQuery_username){ diff --git a/samples/client/petstore/c/include/list.h b/samples/client/petstore/c/include/list.h index 4c613214094..06c1740dc11 100644 --- a/samples/client/petstore/c/include/list.h +++ b/samples/client/petstore/c/include/list.h @@ -23,8 +23,8 @@ typedef struct list_t { #define list_ForEach(element, list) for(element = (list != NULL) ? (list)->firstEntry : NULL; element != NULL; element = element->nextListEntry) -list_t* list_create(); -void list_free(list_t* listToFree); +list_t* list_creatList(); +void list_freeList(list_t* listToFree); void list_addElement(list_t* list, void* dataToAddInList); listEntry_t* list_getElementAt(list_t *list, long indexOfElement); diff --git a/samples/client/petstore/c/model/pet.c b/samples/client/petstore/c/model/pet.c index 73e4f3505f8..a9f9c27ee47 100644 --- a/samples/client/petstore/c/model/pet.c +++ b/samples/client/petstore/c/model/pet.c @@ -62,14 +62,14 @@ void pet_free(pet_t *pet) { list_ForEach(listEntry, pet->photo_urls) { free(listEntry->data); } - list_free(pet->photo_urls); + list_freeList(pet->photo_urls); pet->photo_urls = NULL; } if (pet->tags) { list_ForEach(listEntry, pet->tags) { tag_free(listEntry->data); } - list_free(pet->tags); + list_freeList(pet->tags); pet->tags = NULL; } free(pet); @@ -210,7 +210,7 @@ pet_t *pet_parseFromJSON(cJSON *petJSON){ if(!cJSON_IsArray(photo_urls)) { goto end;//primitive container } - photo_urlsList = list_create(); + photo_urlsList = list_createList(); cJSON_ArrayForEach(photo_urls_local, photo_urls) { @@ -230,7 +230,7 @@ pet_t *pet_parseFromJSON(cJSON *petJSON){ goto end; //nonprimitive container } - tagsList = list_create(); + tagsList = list_createList(); cJSON_ArrayForEach(tags_local_nonprimitive,tags ) { diff --git a/samples/client/petstore/c/src/apiClient.c b/samples/client/petstore/c/src/apiClient.c index ce2f522cda2..4ecf10c2b8e 100644 --- a/samples/client/petstore/c/src/apiClient.c +++ b/samples/client/petstore/c/src/apiClient.c @@ -46,7 +46,7 @@ apiClient_t *apiClient_create_with_base_path(const char *basePath apiClient->progress_data = NULL; apiClient->response_code = 0; if(apiKeys_api_key!= NULL) { - apiClient->apiKeys_api_key = list_create(); + apiClient->apiKeys_api_key = list_createList(); listEntry_t *listEntry = NULL; list_ForEach(listEntry, apiKeys_api_key) { keyValuePair_t *pair = listEntry->data; @@ -80,7 +80,7 @@ void apiClient_free(apiClient_t *apiClient) { } keyValuePair_free(pair); } - list_free(apiClient->apiKeys_api_key); + list_freeList(apiClient->apiKeys_api_key); } if(apiClient->accessToken) { free(apiClient->accessToken); @@ -447,7 +447,7 @@ void apiClient_invoke(apiClient_t *apiClient, res = curl_easy_perform(handle); - curl_slist_free_all(headers); + curl_slist_freeList_all(headers); free(targetUrl); diff --git a/samples/client/petstore/c/src/list.c b/samples/client/petstore/c/src/list.c index dfa2e567501..786812158a2 100644 --- a/samples/client/petstore/c/src/list.c +++ b/samples/client/petstore/c/src/list.c @@ -23,7 +23,7 @@ void listEntry_printAsInt(listEntry_t *listEntry, void *additionalData) { printf("%i\n", *((int *) (listEntry->data))); } -list_t *list_create() { +list_t *list_createList() { list_t *createdList = malloc(sizeof(list_t)); if(createdList == NULL) { // TODO Malloc Failure @@ -88,7 +88,7 @@ void list_iterateThroughListBackward(list_t *list, } } -void list_free(list_t *list) { +void list_freeList(list_t *list) { if(list){ list_iterateThroughListForward(list, listEntry_free, NULL); free(list); @@ -196,5 +196,5 @@ void clear_and_free_string_list(list_t *list) free(list_item); list_item = NULL; } - list_free(list); + list_freeList(list); } \ No newline at end of file diff --git a/samples/client/petstore/c/unit-test/test_pet.c b/samples/client/petstore/c/unit-test/test_pet.c index ba45422f912..1b4f548729a 100644 --- a/samples/client/petstore/c/unit-test/test_pet.c +++ b/samples/client/petstore/c/unit-test/test_pet.c @@ -27,8 +27,8 @@ pet_t* instantiate_pet(int include_optional) { // false, not to have infinite recursion instantiate_category(0), "doggie", - list_create(), - list_create(), + list_createList(), + list_createList(), openapi_petstore_pet_STATUS_available ); } else { @@ -36,8 +36,8 @@ pet_t* instantiate_pet(int include_optional) { 56, NULL, "doggie", - list_create(), - list_create(), + list_createList(), + list_createList(), openapi_petstore_pet_STATUS_available ); } diff --git a/samples/client/petstore/c/unit-tests/manual-PetAPI.c b/samples/client/petstore/c/unit-tests/manual-PetAPI.c index f82c5353891..3090521dc62 100644 --- a/samples/client/petstore/c/unit-tests/manual-PetAPI.c +++ b/samples/client/petstore/c/unit-tests/manual-PetAPI.c @@ -36,7 +36,7 @@ int main() { char *exampleUrl2 = malloc(strlen(EXAMPLE_URL_2) + 1); strcpy(exampleUrl2, EXAMPLE_URL_2); - list_t *photoUrls = list_create(); + list_t *photoUrls = list_createList(); list_addElement(photoUrls, exampleUrl1); list_addElement(photoUrls, exampleUrl2); @@ -49,7 +49,7 @@ int main() { strcpy(exampleTag2Name, EXAMPLE_TAG_2_NAME); tag_t *exampleTag2 = tag_create(EXAMPLE_TAG_2_ID, exampleTag2Name); - list_t *tags = list_create(); + list_t *tags = list_createList(); list_addElement(tags, exampleTag1); list_addElement(tags, exampleTag2); diff --git a/samples/client/petstore/c/unit-tests/manual-StoreAPI.c b/samples/client/petstore/c/unit-tests/manual-StoreAPI.c index ce29f77b961..c6e3d3bacb4 100644 --- a/samples/client/petstore/c/unit-tests/manual-StoreAPI.c +++ b/samples/client/petstore/c/unit-tests/manual-StoreAPI.c @@ -98,7 +98,7 @@ int main() { free(pair->value); keyValuePair_free(pair); } - list_free(elementToReturn); + list_freeList(elementToReturn); apiClient_free(apiClient5); apiClient_unsetupGlobalEnv(); diff --git a/samples/client/petstore/cpp-tizen/src/PetManager.cpp b/samples/client/petstore/cpp-tizen/src/PetManager.cpp index 2f273a21e10..01695962eeb 100644 --- a/samples/client/petstore/cpp-tizen/src/PetManager.cpp +++ b/samples/client/petstore/cpp-tizen/src/PetManager.cpp @@ -138,7 +138,7 @@ static bool addPetHelper(char * accessToken, mBody, headerList, p_chunk, &code, errormsg); bool retval = addPetProcessor(*p_chunk, code, errormsg, userData,reinterpret_cast(handler)); - curl_slist_free_all(headerList); + curl_slist_freeList_all(headerList); if (p_chunk) { if(p_chunk->memory) { free(p_chunk->memory); @@ -274,7 +274,7 @@ static bool deletePetHelper(char * accessToken, mBody, headerList, p_chunk, &code, errormsg); bool retval = deletePetProcessor(*p_chunk, code, errormsg, userData,reinterpret_cast(handler)); - curl_slist_free_all(headerList); + curl_slist_freeList_all(headerList); if (p_chunk) { if(p_chunk->memory) { free(p_chunk->memory); @@ -418,7 +418,7 @@ static bool findPetsByStatusHelper(char * accessToken, mBody, headerList, p_chunk, &code, errormsg); bool retval = findPetsByStatusProcessor(*p_chunk, code, errormsg, userData,reinterpret_cast(handler)); - curl_slist_free_all(headerList); + curl_slist_freeList_all(headerList); if (p_chunk) { if(p_chunk->memory) { free(p_chunk->memory); @@ -562,7 +562,7 @@ static bool findPetsByTagsHelper(char * accessToken, mBody, headerList, p_chunk, &code, errormsg); bool retval = findPetsByTagsProcessor(*p_chunk, code, errormsg, userData,reinterpret_cast(handler)); - curl_slist_free_all(headerList); + curl_slist_freeList_all(headerList); if (p_chunk) { if(p_chunk->memory) { free(p_chunk->memory); @@ -714,7 +714,7 @@ static bool getPetByIdHelper(char * accessToken, mBody, headerList, p_chunk, &code, errormsg); bool retval = getPetByIdProcessor(*p_chunk, code, errormsg, userData,reinterpret_cast(handler)); - curl_slist_free_all(headerList); + curl_slist_freeList_all(headerList); if (p_chunk) { if(p_chunk->memory) { free(p_chunk->memory); @@ -852,7 +852,7 @@ static bool updatePetHelper(char * accessToken, mBody, headerList, p_chunk, &code, errormsg); bool retval = updatePetProcessor(*p_chunk, code, errormsg, userData,reinterpret_cast(handler)); - curl_slist_free_all(headerList); + curl_slist_freeList_all(headerList); if (p_chunk) { if(p_chunk->memory) { free(p_chunk->memory); @@ -982,7 +982,7 @@ static bool updatePetWithFormHelper(char * accessToken, mBody, headerList, p_chunk, &code, errormsg); bool retval = updatePetWithFormProcessor(*p_chunk, code, errormsg, userData,reinterpret_cast(handler)); - curl_slist_free_all(headerList); + curl_slist_freeList_all(headerList); if (p_chunk) { if(p_chunk->memory) { free(p_chunk->memory); @@ -1134,7 +1134,7 @@ static bool uploadFileHelper(char * accessToken, mBody, headerList, p_chunk, &code, errormsg); bool retval = uploadFileProcessor(*p_chunk, code, errormsg, userData,reinterpret_cast(handler)); - curl_slist_free_all(headerList); + curl_slist_freeList_all(headerList); if (p_chunk) { if(p_chunk->memory) { free(p_chunk->memory); diff --git a/samples/client/petstore/cpp-tizen/src/RequestInfo.h b/samples/client/petstore/cpp-tizen/src/RequestInfo.h index 6424d6c856d..02b1f59df74 100644 --- a/samples/client/petstore/cpp-tizen/src/RequestInfo.h +++ b/samples/client/petstore/cpp-tizen/src/RequestInfo.h @@ -45,7 +45,7 @@ public: ~RequestInfo() { - curl_slist_free_all(headerList); + curl_slist_freeList_all(headerList); if (this->p_chunk) { if((this->p_chunk)->memory) { free((this->p_chunk)->memory); diff --git a/samples/client/petstore/cpp-tizen/src/StoreManager.cpp b/samples/client/petstore/cpp-tizen/src/StoreManager.cpp index e107ff84434..0ae59157af1 100644 --- a/samples/client/petstore/cpp-tizen/src/StoreManager.cpp +++ b/samples/client/petstore/cpp-tizen/src/StoreManager.cpp @@ -130,7 +130,7 @@ static bool deleteOrderHelper(char * accessToken, mBody, headerList, p_chunk, &code, errormsg); bool retval = deleteOrderProcessor(*p_chunk, code, errormsg, userData,reinterpret_cast(handler)); - curl_slist_free_all(headerList); + curl_slist_freeList_all(headerList); if (p_chunk) { if(p_chunk->memory) { free(p_chunk->memory); @@ -254,7 +254,7 @@ static bool getInventoryHelper(char * accessToken, mBody, headerList, p_chunk, &code, errormsg); bool retval = getInventoryProcessor(*p_chunk, code, errormsg, userData,reinterpret_cast(handler)); - curl_slist_free_all(headerList); + curl_slist_freeList_all(headerList); if (p_chunk) { if(p_chunk->memory) { free(p_chunk->memory); @@ -406,7 +406,7 @@ static bool getOrderByIdHelper(char * accessToken, mBody, headerList, p_chunk, &code, errormsg); bool retval = getOrderByIdProcessor(*p_chunk, code, errormsg, userData,reinterpret_cast(handler)); - curl_slist_free_all(headerList); + curl_slist_freeList_all(headerList); if (p_chunk) { if(p_chunk->memory) { free(p_chunk->memory); @@ -565,7 +565,7 @@ static bool placeOrderHelper(char * accessToken, mBody, headerList, p_chunk, &code, errormsg); bool retval = placeOrderProcessor(*p_chunk, code, errormsg, userData,reinterpret_cast(handler)); - curl_slist_free_all(headerList); + curl_slist_freeList_all(headerList); if (p_chunk) { if(p_chunk->memory) { free(p_chunk->memory); diff --git a/samples/client/petstore/cpp-tizen/src/UserManager.cpp b/samples/client/petstore/cpp-tizen/src/UserManager.cpp index ab3a7e40964..12b3633f5d4 100644 --- a/samples/client/petstore/cpp-tizen/src/UserManager.cpp +++ b/samples/client/petstore/cpp-tizen/src/UserManager.cpp @@ -137,7 +137,7 @@ static bool createUserHelper(char * accessToken, mBody, headerList, p_chunk, &code, errormsg); bool retval = createUserProcessor(*p_chunk, code, errormsg, userData,reinterpret_cast(handler)); - curl_slist_free_all(headerList); + curl_slist_freeList_all(headerList); if (p_chunk) { if(p_chunk->memory) { free(p_chunk->memory); @@ -286,7 +286,7 @@ static bool createUsersWithArrayInputHelper(char * accessToken, mBody, headerList, p_chunk, &code, errormsg); bool retval = createUsersWithArrayInputProcessor(*p_chunk, code, errormsg, userData,reinterpret_cast(handler)); - curl_slist_free_all(headerList); + curl_slist_freeList_all(headerList); if (p_chunk) { if(p_chunk->memory) { free(p_chunk->memory); @@ -435,7 +435,7 @@ static bool createUsersWithListInputHelper(char * accessToken, mBody, headerList, p_chunk, &code, errormsg); bool retval = createUsersWithListInputProcessor(*p_chunk, code, errormsg, userData,reinterpret_cast(handler)); - curl_slist_free_all(headerList); + curl_slist_freeList_all(headerList); if (p_chunk) { if(p_chunk->memory) { free(p_chunk->memory); @@ -565,7 +565,7 @@ static bool deleteUserHelper(char * accessToken, mBody, headerList, p_chunk, &code, errormsg); bool retval = deleteUserProcessor(*p_chunk, code, errormsg, userData,reinterpret_cast(handler)); - curl_slist_free_all(headerList); + curl_slist_freeList_all(headerList); if (p_chunk) { if(p_chunk->memory) { free(p_chunk->memory); @@ -717,7 +717,7 @@ static bool getUserByNameHelper(char * accessToken, mBody, headerList, p_chunk, &code, errormsg); bool retval = getUserByNameProcessor(*p_chunk, code, errormsg, userData,reinterpret_cast(handler)); - curl_slist_free_all(headerList); + curl_slist_freeList_all(headerList); if (p_chunk) { if(p_chunk->memory) { free(p_chunk->memory); @@ -866,7 +866,7 @@ static bool loginUserHelper(char * accessToken, mBody, headerList, p_chunk, &code, errormsg); bool retval = loginUserProcessor(*p_chunk, code, errormsg, userData,reinterpret_cast(handler)); - curl_slist_free_all(headerList); + curl_slist_freeList_all(headerList); if (p_chunk) { if(p_chunk->memory) { free(p_chunk->memory); @@ -990,7 +990,7 @@ static bool logoutUserHelper(char * accessToken, mBody, headerList, p_chunk, &code, errormsg); bool retval = logoutUserProcessor(*p_chunk, code, errormsg, userData,reinterpret_cast(handler)); - curl_slist_free_all(headerList); + curl_slist_freeList_all(headerList); if (p_chunk) { if(p_chunk->memory) { free(p_chunk->memory); @@ -1133,7 +1133,7 @@ static bool updateUserHelper(char * accessToken, mBody, headerList, p_chunk, &code, errormsg); bool retval = updateUserProcessor(*p_chunk, code, errormsg, userData,reinterpret_cast(handler)); - curl_slist_free_all(headerList); + curl_slist_freeList_all(headerList); if (p_chunk) { if(p_chunk->memory) { free(p_chunk->memory);