OCT 1. 整理代码,重构sds库源码结构

This commit is contained in:
huangxin 2022-11-23 10:41:05 +08:00
parent 814d744ceb
commit 28d0eb893e
13 changed files with 12 additions and 16 deletions

View File

@ -23,11 +23,10 @@ AUX_SOURCE_DIRECTORY(mq C_SRC)
AUX_SOURCE_DIRECTORY(cmdline C_SRC)
AUX_SOURCE_DIRECTORY(crypto C_SRC)
AUX_SOURCE_DIRECTORY(hardware C_SRC)
AUX_SOURCE_DIRECTORY(vector C_SRC)
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})

View File

@ -6,7 +6,7 @@
#include <string.h>
#include <uv.h>
#include <zlog.h>
#include <sds.h>
#include <sds/sds.h>
#include "uthash/uthash.h"
#include "config.h"
@ -14,7 +14,6 @@
#include "user_errno.h"
#include "crypto.h"
#include "hardware.h"
#include "zvector/zvector.h"
#define CFG_INT_VALUE(p) (p->value.longValue)
#define CFG_BOOL_VALUE(p) (p->value.longValue == FALSE ? FALSE : TRUE)

View File

@ -4,7 +4,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <uv.h>
#include <sds.h>
#include <sds/sds.h>
#include "misc.h"
#include "user_errno.h"

View File

@ -4,7 +4,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <uv.h>
#include <sds.h>
#include <sds/sds.h>
#include "hardware.h"
#include "user_errno.h"

View File

@ -4,7 +4,7 @@
#include <stdlib.h>
#include <uv.h>
#include <string.h>
#include <sds.h>
#include <sds/sds.h>
#include "hardware.h"
#include "task_manager.h"

View File

@ -2,7 +2,7 @@
// Created by xajhu on 2021/7/1 0001.
//
#include "zvector/zvector.h"
#include <zvector/zvector.h>
#ifndef DAEMON_AGENT_INCLUDE_CONFIG_H
#define DAEMON_AGENT_INCLUDE_CONFIG_H

View File

@ -36,9 +36,8 @@
#include <ctype.h>
#include <assert.h>
#include <limits.h>
#include "sds.h"
#include "sdsalloc.h"
#include <sds/sds.h>
#include <sds/sdsalloc.h>
hiredisAllocFuncs hiredisAllocFns = {
.mallocFn = malloc,

View File

@ -3,7 +3,7 @@
//
#include <jemalloc/jemalloc.h>
#include <uv.h>
#include <sds.h>
#include <sds/sds.h>
#include "msg_queue.h"
#include "s2j/s2j.h"

View File

@ -15,7 +15,6 @@
#ifdef OPENDHCPD_ON
#include "user_errno.h"
#include "libs/misc/sdsalloc.h"
#endif
#ifdef OPENDHCPDDNS_ON
@ -59,8 +58,7 @@ int main(int argc, char **argv) {
if(ret == ERR_MENU_EXIT) {
user_uninit();
exit(0);
}
if (ret != ERR_SUCCESS) {
} else if (ret != ERR_SUCCESS) {
printf("Application setup error(%d), please used --help to show usage, exited!!!\n", ret);
user_uninit();
exit(0);
@ -79,6 +77,7 @@ int main(int argc, char **argv) {
}
user_uninit();
return 0;
return ret;
#endif
}