mirror of
https://github.com/emqx/neuron.git
synced 2026-10-30 07:45:59 +08:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0fe5c37dcd | ||
|
|
7498cf9399 | ||
|
|
feacf066cc | ||
|
|
8b11ae008e | ||
|
|
a6e190b349 | ||
|
|
108a9d3e57 | ||
|
|
dd2d535c55 | ||
|
|
dcbd9ebd87 | ||
|
|
2a5d3b7443 | ||
|
|
83f544a506 | ||
|
|
1f11c23d59 | ||
|
|
9d5f20c77a | ||
|
|
8bdc80bf86 | ||
|
|
166efb1e90 | ||
|
|
f879058d27 | ||
|
|
556b1f7ceb |
@@ -8,7 +8,7 @@ on:
|
||||
- published
|
||||
|
||||
env:
|
||||
VERSION: 2.6.5
|
||||
VERSION: 2.6.6
|
||||
UI_VERSION: 2.6.3
|
||||
BRANCH: v2.6
|
||||
|
||||
|
||||
+1
-2
@@ -103,7 +103,7 @@ add_library(neuron-base SHARED)
|
||||
target_sources(neuron-base PRIVATE ${NEURON_BASE_SOURCES} ${NEURON_SRC_PARSE})
|
||||
target_include_directories(neuron-base
|
||||
PRIVATE include/neuron src)
|
||||
target_link_libraries(neuron-base libssl.a libcrypto.a)
|
||||
target_link_libraries(neuron-base atomic libssl.a libcrypto.a)
|
||||
target_link_libraries(neuron-base nng libzlog.so jansson jwt
|
||||
${CMAKE_THREAD_LIBS_INIT})
|
||||
add_dependencies(neuron-base neuron-version)
|
||||
@@ -130,7 +130,6 @@ set(NEURON_SOURCES
|
||||
src/adapter/driver/driver.c
|
||||
plugins/restful/handle.c
|
||||
plugins/restful/log_handle.c
|
||||
plugins/restful/file_handle.c
|
||||
plugins/restful/metric_handle.c
|
||||
plugins/restful/normal_handle.c
|
||||
plugins/restful/rw_handle.c
|
||||
|
||||
@@ -316,6 +316,8 @@ static int ekuiper_plugin_request(neu_plugin_t * plugin,
|
||||
case NEU_REQ_UPDATE_GROUP: {
|
||||
break;
|
||||
}
|
||||
case NEU_REQ_DEL_GROUP:
|
||||
break;
|
||||
case NEU_REQ_SUBSCRIBE_GROUP:
|
||||
case NEU_REQ_UPDATE_SUBSCRIBE_GROUP: {
|
||||
neu_req_subscribe_t *sub_info = data;
|
||||
|
||||
@@ -601,6 +601,14 @@ int handle_unsubscribe_group(neu_plugin_t * plugin,
|
||||
return 0;
|
||||
}
|
||||
|
||||
int handle_del_group(neu_plugin_t *plugin, neu_req_del_group_t *req)
|
||||
{
|
||||
route_tbl_del(&plugin->route_tbl, req->driver, req->group);
|
||||
plog_notice(plugin, "del route driver:%s group:%s", req->driver,
|
||||
req->group);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int handle_update_group(neu_plugin_t *plugin, neu_req_update_group_t *req)
|
||||
{
|
||||
route_tbl_update_group(&plugin->route_tbl, req->driver, req->group,
|
||||
|
||||
@@ -49,6 +49,7 @@ int handle_unsubscribe_group(neu_plugin_t * plugin,
|
||||
neu_req_unsubscribe_t *unsub_info);
|
||||
|
||||
int handle_update_group(neu_plugin_t *plugin, neu_req_update_group_t *req);
|
||||
int handle_del_group(neu_plugin_t *plugin, neu_req_del_group_t *cmd);
|
||||
|
||||
int handle_update_driver(neu_plugin_t *plugin, neu_req_update_node_t *req);
|
||||
int handle_del_driver(neu_plugin_t *plugin, neu_reqresp_node_deleted_t *req);
|
||||
|
||||
@@ -368,6 +368,9 @@ static int mqtt_plugin_request(neu_plugin_t *plugin, neu_reqresp_head_t *head,
|
||||
case NEU_REQ_UPDATE_GROUP:
|
||||
error = handle_update_group(plugin, data);
|
||||
break;
|
||||
case NEU_REQ_DEL_GROUP:
|
||||
error = handle_del_group(plugin, data);
|
||||
break;
|
||||
case NEU_REQ_UPDATE_NODE:
|
||||
error = handle_update_driver(plugin, data);
|
||||
break;
|
||||
|
||||
@@ -1,191 +0,0 @@
|
||||
/**
|
||||
* NEURON IIoT System for Industry 4.0
|
||||
* Copyright (C) 2020-2022 EMQ Technologies Co., Ltd All rights reserved.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 3 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with this program; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
**/
|
||||
|
||||
#include <dirent.h>
|
||||
#include <errno.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <strings.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/types.h>
|
||||
#include <time.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <nng/nng.h>
|
||||
#include <nng/supplemental/http/http.h>
|
||||
|
||||
#include "define.h"
|
||||
#include "handle.h"
|
||||
#include "utils/http.h"
|
||||
|
||||
#include "plugin.h"
|
||||
#include "utils/log.h"
|
||||
#include "json/neu_json_error.h"
|
||||
#include "json/neu_json_fn.h"
|
||||
|
||||
#include "file_handle.h"
|
||||
#include "log_handle.h"
|
||||
#include "parser/neu_json_file.h"
|
||||
|
||||
void handle_file_info(nng_aio *aio)
|
||||
{
|
||||
char dir_path[128] = { 0 };
|
||||
|
||||
int n_file = 0;
|
||||
struct dirent *files = { 0 };
|
||||
char * f_name[256] = { 0 };
|
||||
char c_time[32] = { 0 };
|
||||
char m_time[32] = { 0 };
|
||||
|
||||
neu_json_get_file_list_resp_t file_resp = { 0 };
|
||||
char * result = NULL;
|
||||
|
||||
NEU_VALIDATE_JWT(aio);
|
||||
|
||||
if (neu_http_get_param_str(aio, "dir_path", dir_path, sizeof(dir_path)) <=
|
||||
0) {
|
||||
NEU_JSON_RESPONSE_ERROR(NEU_ERR_PARAM_IS_WRONG, {
|
||||
neu_http_response(aio, error_code.error, result_error);
|
||||
});
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/*check whether the directory exists*/
|
||||
if (0 != access(dir_path, F_OK)) {
|
||||
NEU_JSON_RESPONSE_ERROR(NEU_ERR_FILE_NOT_EXIST, {
|
||||
neu_http_response(aio, error_code.error, result_error);
|
||||
});
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/*open directory*/
|
||||
DIR *dir = opendir(dir_path);
|
||||
if (dir == NULL) {
|
||||
nlog_error("open a directory failed");
|
||||
NEU_JSON_RESPONSE_ERROR(NEU_ERR_FILE_OPEN_FAILURE, {
|
||||
neu_http_response(aio, error_code.error, result_error);
|
||||
});
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/*read directory*/
|
||||
while ((files = readdir(dir)) != NULL) {
|
||||
if (strcmp(files->d_name, ".") == 0 ||
|
||||
strcmp(files->d_name, "..") == 0) {
|
||||
continue;
|
||||
}
|
||||
|
||||
f_name[n_file] = files->d_name;
|
||||
++n_file;
|
||||
}
|
||||
|
||||
/*handle response*/
|
||||
file_resp.n_file = n_file;
|
||||
file_resp.file = calloc(file_resp.n_file, sizeof(neu_json_get_file_resp_t));
|
||||
|
||||
for (int i = 0; i < file_resp.n_file; i++) {
|
||||
char file_path[512] = { 0 };
|
||||
struct stat statbuf;
|
||||
|
||||
sprintf(file_path, "%s/%s", dir_path, f_name[i]);
|
||||
stat(file_path, &statbuf);
|
||||
|
||||
strncpy(c_time, ctime(&statbuf.st_ctim.tv_sec),
|
||||
strlen(ctime(&statbuf.st_ctim.tv_sec)) - 1);
|
||||
strncpy(m_time, ctime(&statbuf.st_mtim.tv_sec),
|
||||
strlen(ctime(&statbuf.st_mtim.tv_sec)) - 1);
|
||||
|
||||
file_resp.file[i].name = f_name[i];
|
||||
file_resp.file[i].size = statbuf.st_size;
|
||||
file_resp.file[i].ctime = c_time;
|
||||
file_resp.file[i].mtime = m_time;
|
||||
}
|
||||
|
||||
neu_json_encode_by_fn(&file_resp, neu_json_encode_get_file_list_resp,
|
||||
&result);
|
||||
|
||||
closedir(dir);
|
||||
neu_http_ok(aio, result);
|
||||
free(result);
|
||||
free(file_resp.file);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
void handle_download_file(nng_aio *aio)
|
||||
{
|
||||
char file_name[NEU_FILE_PATH_LEN] = { 0 };
|
||||
char file_path[256] = { 0 };
|
||||
char http_resp[256] = { 0 };
|
||||
|
||||
int rv = 0;
|
||||
void * file_data = NULL;
|
||||
size_t file_len = 0;
|
||||
char * p = NULL;
|
||||
|
||||
NEU_VALIDATE_JWT(aio);
|
||||
|
||||
if (neu_http_get_param_str(aio, "file_path", file_path,
|
||||
sizeof(file_path)) <= 0) {
|
||||
NEU_JSON_RESPONSE_ERROR(NEU_ERR_PARAM_IS_WRONG, {
|
||||
neu_http_response(aio, error_code.error, result_error);
|
||||
});
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/*check whether the file exists*/
|
||||
rv = access(file_path, F_OK);
|
||||
if (0 != rv) {
|
||||
NEU_JSON_RESPONSE_ERROR(NEU_ERR_FILE_NOT_EXIST, {
|
||||
neu_http_response(aio, error_code.error, result_error);
|
||||
});
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/*read file content*/
|
||||
rv = read_file(file_path, &file_data, &file_len);
|
||||
if (0 != rv) {
|
||||
NEU_JSON_RESPONSE_ERROR(
|
||||
rv, { neu_http_response(aio, error_code.error, result_error); });
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/*extract file name*/
|
||||
p = strchr(file_path, '/');
|
||||
while (strchr(p, '/') != NULL) {
|
||||
p = strchr(p, '/') + 1;
|
||||
}
|
||||
|
||||
if (p != NULL) {
|
||||
strcpy(file_name, p);
|
||||
}
|
||||
|
||||
/*handle http response*/
|
||||
sprintf(http_resp, "%s%s", "attachment; filename=", file_name);
|
||||
rv = neu_http_response_file(aio, file_data, file_len, http_resp);
|
||||
free(file_data);
|
||||
nlog_notice("download file %s, rv: %d", file_name, rv);
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
/**
|
||||
* NEURON IIoT System for Industry 4.0
|
||||
* Copyright (C) 2020-2022 EMQ Technologies Co., Ltd All rights reserved.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 3 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with this program; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
**/
|
||||
|
||||
#ifndef _NEU_FILE_HANDLE_H_
|
||||
#define _NEU_FILE_HANDLE_H_
|
||||
|
||||
#include <nng/nng.h>
|
||||
|
||||
void handle_download_file(nng_aio *aio);
|
||||
void handle_file_info(nng_aio *aio);
|
||||
|
||||
#endif
|
||||
@@ -26,7 +26,6 @@
|
||||
|
||||
#include "adapter_handle.h"
|
||||
#include "datatag_handle.h"
|
||||
#include "file_handle.h"
|
||||
#include "global_config_handle.h"
|
||||
#include "group_config_handle.h"
|
||||
#include "log_handle.h"
|
||||
@@ -111,12 +110,6 @@ static struct neu_http_handler cors_handler[] = {
|
||||
{
|
||||
.url = "/api/v2/log/level",
|
||||
},
|
||||
{
|
||||
.url = "/api/v2/file",
|
||||
},
|
||||
{
|
||||
.url = "/api/v2/file/info",
|
||||
},
|
||||
{
|
||||
.url = "/api/v2/global/config",
|
||||
},
|
||||
@@ -377,18 +370,6 @@ static struct neu_http_handler rest_handlers[] = {
|
||||
.url = "/api/v2/version",
|
||||
.value.handler = handle_get_version,
|
||||
},
|
||||
{
|
||||
.method = NEU_HTTP_METHOD_GET,
|
||||
.type = NEU_HTTP_HANDLER_FUNCTION,
|
||||
.url = "/api/v2/file",
|
||||
.value.handler = handle_download_file,
|
||||
},
|
||||
{
|
||||
.method = NEU_HTTP_METHOD_GET,
|
||||
.type = NEU_HTTP_HANDLER_FUNCTION,
|
||||
.url = "/api/v2/file/info",
|
||||
.value.handler = handle_file_info,
|
||||
},
|
||||
{
|
||||
.method = NEU_HTTP_METHOD_GET,
|
||||
.type = NEU_HTTP_HANDLER_FUNCTION,
|
||||
|
||||
@@ -941,7 +941,10 @@ static int adapter_loop(enum neu_event_io_type type, int fd, void *usr_data)
|
||||
error.error = neu_adapter_driver_del_group(
|
||||
(neu_adapter_driver_t *) adapter, cmd->group);
|
||||
} else {
|
||||
error.error = NEU_ERR_GROUP_NOT_ALLOW;
|
||||
adapter->module->intf_funs->request(
|
||||
adapter->plugin, (neu_reqresp_head_t *) header, &header[1]);
|
||||
neu_msg_free(msg);
|
||||
break;
|
||||
}
|
||||
|
||||
if (error.error == NEU_ERR_SUCCESS) {
|
||||
|
||||
@@ -91,6 +91,7 @@ static void read_group(int64_t timestamp, int64_t timeout,
|
||||
neu_driver_cache_t *cache, const char *group,
|
||||
UT_array *tags, UT_array *tag_values);
|
||||
static void read_report_group(int64_t timestamp, int64_t timeout,
|
||||
neu_tag_cache_type_e cache_type,
|
||||
neu_driver_cache_t *cache, const char *group,
|
||||
UT_array *tags, UT_array *tag_values);
|
||||
static void update(neu_adapter_t *adapter, const char *group, const char *tag,
|
||||
@@ -225,8 +226,9 @@ static void update_im(neu_adapter_t *adapter, const char *group,
|
||||
data->group = strdup(group);
|
||||
utarray_new(data->tags, neu_resp_tag_value_meta_icd());
|
||||
|
||||
read_report_group(global_timestamp, 0, driver->cache, group, tags,
|
||||
data->tags);
|
||||
read_report_group(global_timestamp, 0,
|
||||
neu_adapter_get_tag_cache_type(&driver->adapter),
|
||||
driver->cache, group, tags, data->tags);
|
||||
|
||||
if (utarray_len(data->tags) > 0) {
|
||||
group_t *find = NULL;
|
||||
@@ -1474,6 +1476,7 @@ static int report_callback(void *usr_data)
|
||||
read_report_group(global_timestamp,
|
||||
neu_group_get_interval(group->group) *
|
||||
NEU_DRIVER_TAG_CACHE_EXPIRE_TIME,
|
||||
neu_adapter_get_tag_cache_type(&group->driver->adapter),
|
||||
group->driver->cache, group->name, tags, data->tags);
|
||||
|
||||
nlog_info("report group: %s, all tags: %d, report tags: %d", group->name,
|
||||
@@ -1495,6 +1498,12 @@ static int report_callback(void *usr_data)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
utarray_foreach(data->tags, neu_resp_tag_value_meta_t *, tag_value)
|
||||
{
|
||||
if (tag_value->value.type == NEU_TYPE_PTR) {
|
||||
free(tag_value->value.value.ptr.ptr);
|
||||
}
|
||||
}
|
||||
utarray_free(data->tags);
|
||||
free(data->group);
|
||||
free(data->driver);
|
||||
@@ -1643,6 +1652,7 @@ static int read_callback(void *usr_data)
|
||||
}
|
||||
|
||||
static void read_report_group(int64_t timestamp, int64_t timeout,
|
||||
neu_tag_cache_type_e cache_type,
|
||||
neu_driver_cache_t *cache, const char *group,
|
||||
UT_array *tags, UT_array *tag_values)
|
||||
{
|
||||
@@ -1735,7 +1745,8 @@ static void read_report_group(int64_t timestamp, int64_t timeout,
|
||||
break;
|
||||
}
|
||||
|
||||
if (!neu_tag_attribute_test(tag, NEU_ATTRIBUTE_STATIC) &&
|
||||
if (cache_type != NEU_TAG_CACHE_TYPE_NEVER &&
|
||||
!neu_tag_attribute_test(tag, NEU_ATTRIBUTE_STATIC) &&
|
||||
(timestamp - value.timestamp) > timeout && timeout > 0) {
|
||||
tag_value.value.type = NEU_TYPE_ERROR;
|
||||
tag_value.value.value.i32 = NEU_ERR_PLUGIN_TAG_VALUE_EXPIRED;
|
||||
|
||||
@@ -982,9 +982,24 @@ static int manager_loop(enum neu_event_io_type type, int fd, void *usr_data)
|
||||
neu_msg_exchange(header);
|
||||
reply(manager, header, &e);
|
||||
} else {
|
||||
UT_array *apps = neu_subscribe_manager_find(
|
||||
manager->subscribe_manager, cmd->driver, cmd->group);
|
||||
|
||||
forward_msg(manager, header, header->receiver);
|
||||
neu_subscribe_manager_remove(manager->subscribe_manager,
|
||||
cmd->driver, cmd->group);
|
||||
|
||||
if (NULL == apps) {
|
||||
break;
|
||||
}
|
||||
|
||||
// notify app node about group deletion
|
||||
utarray_foreach(apps, neu_app_subscribe_t *, app)
|
||||
{
|
||||
forward_msg_copy(manager, header, app->app_name);
|
||||
}
|
||||
|
||||
utarray_free(apps);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -703,7 +703,6 @@ int neu_manager_subscribe(neu_manager_t *manager, const char *app,
|
||||
// this is not an elegant solution due to the current architecture
|
||||
if (params && 0 == strcmp(adapter->module->module_name, "MQTT")) {
|
||||
neu_json_elem_t elem = { .name = "topic", .t = NEU_JSON_STR };
|
||||
neu_json_decode((char *) params, 1, &elem);
|
||||
neu_parse_param(params, NULL, 1, &elem);
|
||||
if (elem.v.val_str && 0 == strlen(elem.v.val_str)) {
|
||||
free(elem.v.val_str);
|
||||
|
||||
@@ -1,81 +0,0 @@
|
||||
/**
|
||||
* NEURON IIoT System for Industry 4.0
|
||||
* Copyright (C) 2020-2022 EMQ Technologies Co., Ltd All rights reserved.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 3 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with this program; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
**/
|
||||
|
||||
/*
|
||||
* DO NOT EDIT THIS FILE MANUALLY!
|
||||
* It was automatically generated by `json-autotype`.
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "json/json.h"
|
||||
|
||||
#include "neu_json_file.h"
|
||||
|
||||
int neu_json_encode_get_file_list_resp(void *json_object, void *param)
|
||||
{
|
||||
int ret = 0;
|
||||
neu_json_get_file_list_resp_t *resp =
|
||||
(neu_json_get_file_list_resp_t *) param;
|
||||
|
||||
void * file_list_array = neu_json_array();
|
||||
neu_json_get_file_resp_t *p_file = resp->file;
|
||||
|
||||
for (int i = 0; i < resp->n_file; i++) {
|
||||
neu_json_elem_t file_elems[] = {
|
||||
{
|
||||
.name = "name",
|
||||
.t = NEU_JSON_STR,
|
||||
.v.val_str = p_file->name,
|
||||
},
|
||||
{
|
||||
.name = "size",
|
||||
.t = NEU_JSON_INT,
|
||||
.v.val_int = p_file->size,
|
||||
},
|
||||
{
|
||||
.name = "ctime",
|
||||
.t = NEU_JSON_STR,
|
||||
.v.val_str = p_file->ctime,
|
||||
},
|
||||
{
|
||||
.name = "mtime",
|
||||
.t = NEU_JSON_STR,
|
||||
.v.val_str = p_file->mtime,
|
||||
},
|
||||
};
|
||||
|
||||
file_list_array = neu_json_encode_array(file_list_array, file_elems,
|
||||
NEU_JSON_ELEM_SIZE(file_elems));
|
||||
|
||||
p_file++;
|
||||
}
|
||||
|
||||
neu_json_elem_t resp_elems[] = { {
|
||||
.name = "files",
|
||||
.t = NEU_JSON_OBJECT,
|
||||
.v.val_object = file_list_array,
|
||||
} };
|
||||
|
||||
ret = neu_json_encode_field(json_object, resp_elems,
|
||||
NEU_JSON_ELEM_SIZE(resp_elems));
|
||||
|
||||
return ret;
|
||||
}
|
||||
@@ -1,52 +0,0 @@
|
||||
/**
|
||||
* NEURON IIoT System for Industry 4.0
|
||||
* Copyright (C) 2020-2022 EMQ Technologies Co., Ltd All rights reserved.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 3 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with this program; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
**/
|
||||
|
||||
/*
|
||||
* DO NOT EDIT THIS FILE MANUALLY!
|
||||
* It was automatically generated by `json-autotype`.
|
||||
*/
|
||||
|
||||
#ifndef _NEU_JOSN_API_NEU_JSON_FILE_H_
|
||||
#define _NEU_JSON_API_NEU_JSON_FILE_H_
|
||||
|
||||
#include "json/json.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct {
|
||||
char *name;
|
||||
int size;
|
||||
char *ctime;
|
||||
char *mtime;
|
||||
} neu_json_get_file_resp_t;
|
||||
|
||||
typedef struct {
|
||||
int n_file;
|
||||
neu_json_get_file_resp_t *file;
|
||||
} neu_json_get_file_list_resp_t;
|
||||
|
||||
int neu_json_encode_get_file_list_resp(void *json_object, void *param);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user