forked from loafle/openapi-generator-original
Update samples
This commit is contained in:
@@ -8,6 +8,10 @@
|
||||
#include "../model/api_response.h"
|
||||
#include "../model/pet.h"
|
||||
|
||||
#undef stdin
|
||||
#undef stderr
|
||||
#undef stdout
|
||||
|
||||
// Enum STATUS for PetAPI_findPetsByStatus
|
||||
typedef enum { openapi_petstore_findPetsByStatus_STATUS_NULL = 0, openapi_petstore_findPetsByStatus_STATUS_available, openapi_petstore_findPetsByStatus_STATUS_pending, openapi_petstore_findPetsByStatus_STATUS_sold } openapi_petstore_findPetsByStatus_status_e;
|
||||
|
||||
|
||||
@@ -7,6 +7,10 @@
|
||||
#include "../include/binary.h"
|
||||
#include "../model/order.h"
|
||||
|
||||
#undef stdin
|
||||
#undef stderr
|
||||
#undef stdout
|
||||
|
||||
|
||||
// Delete purchase order by ID
|
||||
//
|
||||
|
||||
@@ -7,6 +7,10 @@
|
||||
#include "../include/binary.h"
|
||||
#include "../model/user.h"
|
||||
|
||||
#undef stdin
|
||||
#undef stderr
|
||||
#undef stdout
|
||||
|
||||
|
||||
// Create user
|
||||
//
|
||||
|
||||
@@ -16,6 +16,10 @@
|
||||
typedef struct api_response_t api_response_t;
|
||||
|
||||
|
||||
#undef stdin
|
||||
#undef stderr
|
||||
#undef stdout
|
||||
|
||||
|
||||
|
||||
typedef struct api_response_t {
|
||||
|
||||
@@ -16,6 +16,10 @@
|
||||
typedef struct category_t category_t;
|
||||
|
||||
|
||||
#undef stdin
|
||||
#undef stderr
|
||||
#undef stdout
|
||||
|
||||
|
||||
|
||||
typedef struct category_t {
|
||||
|
||||
@@ -16,6 +16,10 @@
|
||||
typedef struct order_t order_t;
|
||||
|
||||
|
||||
#undef stdin
|
||||
#undef stderr
|
||||
#undef stdout
|
||||
|
||||
// Enum STATUS for order
|
||||
|
||||
typedef enum { openapi_petstore_order_STATUS_NULL = 0, openapi_petstore_order_STATUS_placed, openapi_petstore_order_STATUS_approved, openapi_petstore_order_STATUS_delivered } openapi_petstore_order_STATUS_e;
|
||||
|
||||
@@ -18,6 +18,10 @@ typedef struct pet_t pet_t;
|
||||
#include "category.h"
|
||||
#include "tag.h"
|
||||
|
||||
#undef stdin
|
||||
#undef stderr
|
||||
#undef stdout
|
||||
|
||||
// Enum STATUS for pet
|
||||
|
||||
typedef enum { openapi_petstore_pet_STATUS_NULL = 0, openapi_petstore_pet_STATUS_available, openapi_petstore_pet_STATUS_pending, openapi_petstore_pet_STATUS_sold } openapi_petstore_pet_STATUS_e;
|
||||
|
||||
@@ -16,6 +16,10 @@
|
||||
typedef struct tag_t tag_t;
|
||||
|
||||
|
||||
#undef stdin
|
||||
#undef stderr
|
||||
#undef stdout
|
||||
|
||||
|
||||
|
||||
typedef struct tag_t {
|
||||
|
||||
@@ -16,6 +16,10 @@
|
||||
typedef struct user_t user_t;
|
||||
|
||||
|
||||
#undef stdin
|
||||
#undef stderr
|
||||
#undef stdout
|
||||
|
||||
|
||||
|
||||
typedef struct user_t {
|
||||
|
||||
@@ -476,7 +476,7 @@ size_t writeDataCallback(void *buffer, size_t size, size_t nmemb, void *userp) {
|
||||
size_t size_this_time = nmemb * size;
|
||||
apiClient_t *apiClient = (apiClient_t *)userp;
|
||||
apiClient->dataReceived = (char *)realloc( apiClient->dataReceived, apiClient->dataReceivedLen + size_this_time + 1);
|
||||
memcpy(apiClient->dataReceived + apiClient->dataReceivedLen, buffer, size_this_time);
|
||||
memcpy((char *)apiClient->dataReceived + apiClient->dataReceivedLen, buffer, size_this_time);
|
||||
apiClient->dataReceivedLen += size_this_time;
|
||||
((char*)apiClient->dataReceived)[apiClient->dataReceivedLen] = '\0'; // the space size of (apiClient->dataReceived) = dataReceivedLen + 1
|
||||
if (apiClient->data_callback_func) {
|
||||
|
||||
Reference in New Issue
Block a user