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
This commit is contained in:
방진영 2022-01-13 01:42:58 +09:00 committed by GitHub
parent 1bfed460c5
commit 69db8176b6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
24 changed files with 119 additions and 119 deletions

View File

@ -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 {

View File

@ -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}});

View File

@ -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);

View File

@ -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);

View File

@ -89,6 +89,6 @@ int main() {
list_ForEach(listEntry, elementToReturn) {
keyValuePair_free(listEntry->data);
}
list_free(elementToReturn);
list_freeList(elementToReturn);
}

View File

@ -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);
}

View File

@ -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);

View File

@ -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}}})
{

View File

@ -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<void(*)()>(handler));
curl_slist_free_all(headerList);
curl_slist_freeList_all(headerList);
if (p_chunk) {
if(p_chunk->memory) {
free(p_chunk->memory);

View File

@ -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);

View File

@ -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) {

View File

@ -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) {

View File

@ -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){

View File

@ -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);

View File

@ -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 )
{

View File

@ -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);

View File

@ -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);
}

View File

@ -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
);
}

View File

@ -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);

View File

@ -98,7 +98,7 @@ int main() {
free(pair->value);
keyValuePair_free(pair);
}
list_free(elementToReturn);
list_freeList(elementToReturn);
apiClient_free(apiClient5);
apiClient_unsetupGlobalEnv();

View File

@ -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<void(*)()>(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<void(*)()>(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<void(*)()>(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<void(*)()>(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<void(*)()>(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<void(*)()>(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<void(*)()>(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<void(*)()>(handler));
curl_slist_free_all(headerList);
curl_slist_freeList_all(headerList);
if (p_chunk) {
if(p_chunk->memory) {
free(p_chunk->memory);

View File

@ -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);

View File

@ -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<void(*)()>(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<void(*)()>(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<void(*)()>(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<void(*)()>(handler));
curl_slist_free_all(headerList);
curl_slist_freeList_all(headerList);
if (p_chunk) {
if(p_chunk->memory) {
free(p_chunk->memory);

View File

@ -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<void(*)()>(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<void(*)()>(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<void(*)()>(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<void(*)()>(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<void(*)()>(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<void(*)()>(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<void(*)()>(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<void(*)()>(handler));
curl_slist_free_all(headerList);
curl_slist_freeList_all(headerList);
if (p_chunk) {
if(p_chunk->memory) {
free(p_chunk->memory);