OCT 1. 整理代码,重构sds库源码结构
This commit is contained in:
parent
814d744ceb
commit
28d0eb893e
|
@ -23,11 +23,10 @@ AUX_SOURCE_DIRECTORY(mq C_SRC)
|
||||||
AUX_SOURCE_DIRECTORY(cmdline C_SRC)
|
AUX_SOURCE_DIRECTORY(cmdline C_SRC)
|
||||||
AUX_SOURCE_DIRECTORY(crypto C_SRC)
|
AUX_SOURCE_DIRECTORY(crypto C_SRC)
|
||||||
AUX_SOURCE_DIRECTORY(hardware C_SRC)
|
AUX_SOURCE_DIRECTORY(hardware C_SRC)
|
||||||
AUX_SOURCE_DIRECTORY(vector C_SRC)
|
|
||||||
|
|
||||||
SET(CMAKE_C_STANDARD 99)
|
SET(CMAKE_C_STANDARD 99)
|
||||||
|
|
||||||
SET_SOURCE_FILES_PROPERTIES(vector/zvector.c PROPERTIES COMPILE_FLAGS "-Wall -Wextra -flto")
|
SET_SOURCE_FILES_PROPERTIES(misc/zvector.c PROPERTIES COMPILE_FLAGS "-Wall -Wextra -flto")
|
||||||
|
|
||||||
ADD_DEFINITIONS(-DBUILD_VERSION="${GIT_VERSION}" ${COMMON_DEFINE})
|
ADD_DEFINITIONS(-DBUILD_VERSION="${GIT_VERSION}" ${COMMON_DEFINE})
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <uv.h>
|
#include <uv.h>
|
||||||
#include <zlog.h>
|
#include <zlog.h>
|
||||||
#include <sds.h>
|
#include <sds/sds.h>
|
||||||
|
|
||||||
#include "uthash/uthash.h"
|
#include "uthash/uthash.h"
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
@ -14,7 +14,6 @@
|
||||||
#include "user_errno.h"
|
#include "user_errno.h"
|
||||||
#include "crypto.h"
|
#include "crypto.h"
|
||||||
#include "hardware.h"
|
#include "hardware.h"
|
||||||
#include "zvector/zvector.h"
|
|
||||||
|
|
||||||
#define CFG_INT_VALUE(p) (p->value.longValue)
|
#define CFG_INT_VALUE(p) (p->value.longValue)
|
||||||
#define CFG_BOOL_VALUE(p) (p->value.longValue == FALSE ? FALSE : TRUE)
|
#define CFG_BOOL_VALUE(p) (p->value.longValue == FALSE ? FALSE : TRUE)
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <uv.h>
|
#include <uv.h>
|
||||||
#include <sds.h>
|
#include <sds/sds.h>
|
||||||
|
|
||||||
#include "misc.h"
|
#include "misc.h"
|
||||||
#include "user_errno.h"
|
#include "user_errno.h"
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <uv.h>
|
#include <uv.h>
|
||||||
#include <sds.h>
|
#include <sds/sds.h>
|
||||||
|
|
||||||
#include "hardware.h"
|
#include "hardware.h"
|
||||||
#include "user_errno.h"
|
#include "user_errno.h"
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <uv.h>
|
#include <uv.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <sds.h>
|
#include <sds/sds.h>
|
||||||
|
|
||||||
#include "hardware.h"
|
#include "hardware.h"
|
||||||
#include "task_manager.h"
|
#include "task_manager.h"
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
// Created by xajhu on 2021/7/1 0001.
|
// Created by xajhu on 2021/7/1 0001.
|
||||||
//
|
//
|
||||||
|
|
||||||
#include "zvector/zvector.h"
|
#include <zvector/zvector.h>
|
||||||
|
|
||||||
#ifndef DAEMON_AGENT_INCLUDE_CONFIG_H
|
#ifndef DAEMON_AGENT_INCLUDE_CONFIG_H
|
||||||
#define DAEMON_AGENT_INCLUDE_CONFIG_H
|
#define DAEMON_AGENT_INCLUDE_CONFIG_H
|
||||||
|
|
|
@ -36,9 +36,8 @@
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
#include "sds.h"
|
#include <sds/sds.h>
|
||||||
#include "sdsalloc.h"
|
#include <sds/sdsalloc.h>
|
||||||
|
|
||||||
|
|
||||||
hiredisAllocFuncs hiredisAllocFns = {
|
hiredisAllocFuncs hiredisAllocFns = {
|
||||||
.mallocFn = malloc,
|
.mallocFn = malloc,
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
//
|
//
|
||||||
#include <jemalloc/jemalloc.h>
|
#include <jemalloc/jemalloc.h>
|
||||||
#include <uv.h>
|
#include <uv.h>
|
||||||
#include <sds.h>
|
#include <sds/sds.h>
|
||||||
|
|
||||||
#include "msg_queue.h"
|
#include "msg_queue.h"
|
||||||
#include "s2j/s2j.h"
|
#include "s2j/s2j.h"
|
||||||
|
|
|
@ -15,7 +15,6 @@
|
||||||
|
|
||||||
#ifdef OPENDHCPD_ON
|
#ifdef OPENDHCPD_ON
|
||||||
#include "user_errno.h"
|
#include "user_errno.h"
|
||||||
#include "libs/misc/sdsalloc.h"
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef OPENDHCPDDNS_ON
|
#ifdef OPENDHCPDDNS_ON
|
||||||
|
@ -59,8 +58,7 @@ int main(int argc, char **argv) {
|
||||||
if(ret == ERR_MENU_EXIT) {
|
if(ret == ERR_MENU_EXIT) {
|
||||||
user_uninit();
|
user_uninit();
|
||||||
exit(0);
|
exit(0);
|
||||||
}
|
} else if (ret != ERR_SUCCESS) {
|
||||||
if (ret != ERR_SUCCESS) {
|
|
||||||
printf("Application setup error(%d), please used --help to show usage, exited!!!\n", ret);
|
printf("Application setup error(%d), please used --help to show usage, exited!!!\n", ret);
|
||||||
user_uninit();
|
user_uninit();
|
||||||
exit(0);
|
exit(0);
|
||||||
|
@ -79,6 +77,7 @@ int main(int argc, char **argv) {
|
||||||
}
|
}
|
||||||
|
|
||||||
user_uninit();
|
user_uninit();
|
||||||
return 0;
|
|
||||||
|
return ret;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue