mirror of
https://github.com/emqx/neuron.git
synced 2026-10-17 04:40:42 +08:00
Fix auto-code generation header file with #include json/json.h
This commit is contained in:
@@ -1,10 +0,0 @@
|
||||
{
|
||||
"mqtt_req": {
|
||||
"function": 2,
|
||||
"uuid": "554f5fd8-f437-11eb-975c-7704b9e17821"
|
||||
},
|
||||
"mqtt_resp": {
|
||||
"function": 2,
|
||||
"uuid": "554f5fd8-f437-11eb-975c-7704b9e17821"
|
||||
}
|
||||
}
|
||||
@@ -25,6 +25,8 @@
|
||||
#ifndef _NEU_JSON_API_NEU_JSON_ERROR_H_
|
||||
#define _NEU_JSON_API_NEU_JSON_ERROR_H_
|
||||
|
||||
#include "json/json.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
@@ -25,6 +25,8 @@
|
||||
#ifndef _NEU_JSON_API_NEU_JSON_GROUP_CONFIG_H_
|
||||
#define _NEU_JSON_API_NEU_JSON_GROUP_CONFIG_H_
|
||||
|
||||
#include "json/json.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
@@ -25,6 +25,8 @@
|
||||
#ifndef _NEU_JSON_API_NEU_JSON_NODE_H_
|
||||
#define _NEU_JSON_API_NEU_JSON_NODE_H_
|
||||
|
||||
#include "json/json.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
@@ -73,8 +75,8 @@ typedef struct {
|
||||
int neu_json_encode_get_nodes_resp(void *json_object, void *param);
|
||||
|
||||
typedef struct {
|
||||
int64_t id;
|
||||
char * name;
|
||||
int64_t id;
|
||||
} neu_json_update_node_req_t;
|
||||
|
||||
int neu_json_decode_update_node_req(char * buf,
|
||||
|
||||
@@ -25,6 +25,8 @@
|
||||
#ifndef _NEU_JSON_API_NEU_JSON_PLUGIN_H_
|
||||
#define _NEU_JSON_API_NEU_JSON_PLUGIN_H_
|
||||
|
||||
#include "json/json.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
@@ -25,12 +25,12 @@
|
||||
#ifndef _NEU_JSON_API_NEU_JSON_RW_H_
|
||||
#define _NEU_JSON_API_NEU_JSON_RW_H_
|
||||
|
||||
#include "json/json.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "json/json.h"
|
||||
|
||||
typedef struct {
|
||||
int64_t id;
|
||||
enum neu_json_type t;
|
||||
|
||||
@@ -25,6 +25,8 @@
|
||||
#ifndef _NEU_JSON_API_NEU_JSON_TAG_H_
|
||||
#define _NEU_JSON_API_NEU_JSON_TAG_H_
|
||||
|
||||
#include "json/json.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
@@ -25,6 +25,8 @@
|
||||
#ifndef _NEU_JSON_API_NEU_JSON_TTY_H_
|
||||
#define _NEU_JSON_API_NEU_JSON_TTY_H_
|
||||
|
||||
#include "json/json.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
@@ -207,20 +207,20 @@ int neu_json_decode_update_node_req(char * buf,
|
||||
neu_json_update_node_req_t *req =
|
||||
calloc(1, sizeof(neu_json_update_node_req_t));
|
||||
neu_json_elem_t req_elems[] = { {
|
||||
.name = "id",
|
||||
.t = NEU_JSON_INT,
|
||||
},
|
||||
{
|
||||
.name = "name",
|
||||
.t = NEU_JSON_STR,
|
||||
},
|
||||
{
|
||||
.name = "id",
|
||||
.t = NEU_JSON_INT,
|
||||
} };
|
||||
ret = neu_json_decode(buf, NEU_JSON_ELEM_SIZE(req_elems), req_elems);
|
||||
if (ret != 0) {
|
||||
goto decode_fail;
|
||||
}
|
||||
|
||||
req->id = req_elems[0].v.val_int;
|
||||
req->name = req_elems[1].v.val_str;
|
||||
req->name = req_elems[0].v.val_str;
|
||||
req->id = req_elems[1].v.val_int;
|
||||
|
||||
*result = req;
|
||||
return ret;
|
||||
|
||||
Reference in New Issue
Block a user