Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
bddec203
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
bddec203
编写于
9月 22, 2021
作者:
H
Hongze Cheng
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
refact
上级
3b227a5f
变更
13
隐藏空白更改
内联
并排
Showing
13 changed file
with
131 addition
and
91 deletion
+131
-91
include/os/os.h
include/os/os.h
+6
-19
include/os/osMemory.h
include/os/osMemory.h
+35
-0
include/util/talgo.h
include/util/talgo.h
+0
-0
include/util/tcoding.h
include/util/tcoding.h
+0
-5
include/util/tlist.h
include/util/tlist.h
+0
-0
src/CMakeLists.txt
src/CMakeLists.txt
+2
-0
src/common/CMakeLists.txt
src/common/CMakeLists.txt
+11
-8
src/os/CMakeLists.txt
src/os/CMakeLists.txt
+7
-14
src/os/source/os.c
src/os/source/os.c
+14
-0
src/util/CMakeLists.txt
src/util/CMakeLists.txt
+11
-44
src/util/CMakeLists.txt.in
src/util/CMakeLists.txt.in
+44
-0
src/util/source/talgo.c
src/util/source/talgo.c
+1
-1
src/util/source/tlist.c
src/util/source/tlist.c
+0
-0
未找到文件。
include/os/os.h
浏览文件 @
bddec203
...
@@ -20,26 +20,13 @@
...
@@ -20,26 +20,13 @@
extern
"C"
{
extern
"C"
{
#endif
#endif
#include "osInc.h"
#include <stdbool.h>
#include "osDef.h"
#include <stdint.h>
#include "osAtomic.h"
#include <stdlib.h>
#include "osDir.h"
#include <string.h>
#include "osFile.h"
#include <assert.h>
#include "osLz4.h"
#include "osMath.h"
#include "osMemory.h"
#include "osRand.h"
#include "osSemaphore.h"
#include "osSignal.h"
#include "osSleep.h"
#include "osSocket.h"
#include "osString.h"
#include "osSysinfo.h"
#include "osTime.h"
#include "osTimer.h"
#include "osSystem.h"
void
osInit
();
#include "osMemory.h"
#ifdef __cplusplus
#ifdef __cplusplus
}
}
...
...
include/os/osMemory.h
0 → 100644
浏览文件 @
bddec203
/*
* Copyright (c) 2019 TAOS Data, Inc. <jhtao@taosdata.com>
*
* This program is free software: you can use, redistribute, and/or modify
* it under the terms of the GNU Affero General Public License, version 3
* or later ("AGPL"), as published by the Free Software Foundation.
*
* 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.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _TD_OS_MEMORY_H_
#define _TD_OS_MEMORY_H_
#ifdef __cplusplus
extern
"C"
{
#endif
#define tfree(x) \
do { \
if (x) { \
free((void *)x); \
x = 0; \
} \
} while (0)
#ifdef __cplusplus
}
#endif
#endif
/*_TD_OS_MEMORY_H_*/
src/util/inc
/talgo.h
→
include/util
/talgo.h
浏览文件 @
bddec203
文件已移动
src/util/inc
/tcoding.h
→
include/util
/tcoding.h
浏览文件 @
bddec203
...
@@ -19,11 +19,6 @@
...
@@ -19,11 +19,6 @@
extern
"C"
{
extern
"C"
{
#endif
#endif
#include <stdint.h>
#include <string.h>
#include "tutil.h"
// TODO: move this to a platform file
// TODO: move this to a platform file
#define ENCODE_LIMIT (((uint8_t)1) << 7)
#define ENCODE_LIMIT (((uint8_t)1) << 7)
static
const
int32_t
TNUMBER
=
1
;
static
const
int32_t
TNUMBER
=
1
;
...
...
src/util/inc
/tlist.h
→
include/util
/tlist.h
浏览文件 @
bddec203
文件已移动
src/CMakeLists.txt
浏览文件 @
bddec203
add_subdirectory
(
os
)
add_subdirectory
(
os
)
add_subdirectory
(
util
)
# add_subdirectory(common)
src/common/CMakeLists.txt
浏览文件 @
bddec203
CMAKE_MINIMUM_REQUIRED
(
VERSION 2.8...3.20
)
aux_source_directory
(
source COMMON_SRC
)
PROJECT
(
TDengine
)
add_library
(
common
${
COMMON_SRC
}
)
target_include_directories
(
INCLUDE_DIRECTORIES
(
inc
)
common
AUX_SOURCE_DIRECTORY
(
src SRC
)
PUBLIC
"
${
CMAKE_SOURCE_DIR
}
/include/common"
PRIVATE
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/include"
ADD_LIBRARY
(
common
${
SRC
}
)
)
TARGET_LINK_LIBRARIES
(
common tutil
)
target_include_directories
(
common
PRIVATE util
)
\ No newline at end of file
src/os/CMakeLists.txt
浏览文件 @
bddec203
CMAKE_MINIMUM_REQUIRED
(
VERSION 2.8...3.20
)
aux_source_directory
(
source OS_SRC
)
PROJECT
(
TDengine
)
add_library
(
os
${
OS_SRC
}
)
target_include_directories
(
IF
(
TD_LINUX
)
os
ADD_SUBDIRECTORY
(
src/linux
)
PUBLIC
"
${
CMAKE_SOURCE_DIR
}
/include/os"
ELSEIF
(
TD_DARWIN
)
PRIVATE
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/include"
ADD_SUBDIRECTORY
(
src/darwin
)
)
ELSEIF
(
TD_WINDOWS
)
\ No newline at end of file
ADD_SUBDIRECTORY
(
src/windows
)
ENDIF
()
ADD_SUBDIRECTORY
(
src/detail
)
ADD_SUBDIRECTORY
(
tests
)
src/os/source/os.c
0 → 100644
浏览文件 @
bddec203
/*
* Copyright (c) 2019 TAOS Data, Inc. <jhtao@taosdata.com>
*
* This program is free software: you can use, redistribute, and/or modify
* it under the terms of the GNU Affero General Public License, version 3
* or later ("AGPL"), as published by the Free Software Foundation.
*
* 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.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
\ No newline at end of file
src/util/CMakeLists.txt
浏览文件 @
bddec203
CMAKE_MINIMUM_REQUIRED
(
VERSION 2.8...3.20
)
aux_source_directory
(
source UTIL_SRC
)
PROJECT
(
TDengine
)
add_library
(
util
${
UTIL_SRC
}
)
target_include_directories
(
INCLUDE_DIRECTORIES
(
${
TD_COMMUNITY_DIR
}
/src/rpc/inc
)
util
INCLUDE_DIRECTORIES
(
${
TD_COMMUNITY_DIR
}
/src/sync/inc
)
PUBLIC
"
${
CMAKE_SOURCE_DIR
}
/include/util"
INCLUDE_DIRECTORIES
(
${
TD_COMMUNITY_DIR
}
/deps/rmonotonic/inc
)
PRIVATE
"
${
CMAKE_SOURCE_DIR
}
/include"
INCLUDE_DIRECTORIES
(
${
TD_COMMUNITY_DIR
}
/deps/TSZ/sz/include
)
)
target_link_libraries
(
AUX_SOURCE_DIRECTORY
(
src SRC
)
util
ADD_LIBRARY
(
tutil
${
SRC
}
)
PRIVATE os
)
TARGET_LINK_LIBRARIES
(
tutil pthread os lz4 z rmonotonic
${
VAR_TSZ
}
)
\ No newline at end of file
IF
(
TD_LINUX
)
TARGET_LINK_LIBRARIES
(
tutil m rt
)
ADD_SUBDIRECTORY
(
tests
)
FIND_PATH
(
ICONV_INCLUDE_EXIST iconv.h /usr/include/ /usr/local/include/
)
IF
(
ICONV_INCLUDE_EXIST
)
FIND_PATH
(
ICONV_LIBRARY_A_EXIST libiconv.a /usr/lib/ /usr/local/lib/ /lib64
)
FIND_PATH
(
ICONV_LIBRARY_SO_EXIST libiconv.so /usr/lib/ /usr/local/lib/ /lib64
)
IF
(
ICONV_LIBRARY_A_EXIST OR ICONV_LIBRARY_SO_EXIST
)
MESSAGE
(
STATUS
"Use the installed libiconv library"
)
TARGET_LINK_LIBRARIES
(
tutil iconv
)
ELSE
()
# libiconv library is already included in GLIBC,
MESSAGE
(
STATUS
"Use the iconv functions in GLIBC"
)
ENDIF
()
ELSE
()
MESSAGE
(
STATUS
"Failed to find iconv, use default encoding method"
)
ENDIF
()
ELSEIF
(
TD_WINDOWS
)
TARGET_LINK_LIBRARIES
(
tutil iconv regex winmm IPHLPAPI ws2_32 wepoll
)
ELSEIF
(
TD_DARWIN
)
TARGET_LINK_LIBRARIES
(
tutil m
)
TARGET_LINK_LIBRARIES
(
tutil iconv
)
ENDIF
()
IF
(
TD_STORAGE
)
TARGET_LINK_LIBRARIES
(
tutil storage
)
ENDIF
()
src/util/CMakeLists.txt.in
0 → 100644
浏览文件 @
bddec203
CMAKE_MINIMUM_REQUIRED(VERSION 2.8...3.20)
PROJECT(TDengine)
INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/rpc/inc)
INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/sync/inc)
INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/deps/rmonotonic/inc)
INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/deps/TSZ/sz/include)
AUX_SOURCE_DIRECTORY(src SRC)
ADD_LIBRARY(tutil ${SRC})
TARGET_LINK_LIBRARIES(tutil pthread os lz4 z rmonotonic ${VAR_TSZ} )
IF (TD_LINUX)
TARGET_LINK_LIBRARIES(tutil m rt)
ADD_SUBDIRECTORY(tests)
FIND_PATH(ICONV_INCLUDE_EXIST iconv.h /usr/include/ /usr/local/include/)
IF (ICONV_INCLUDE_EXIST)
FIND_PATH(ICONV_LIBRARY_A_EXIST libiconv.a /usr/lib/ /usr/local/lib/ /lib64)
FIND_PATH(ICONV_LIBRARY_SO_EXIST libiconv.so /usr/lib/ /usr/local/lib/ /lib64)
IF (ICONV_LIBRARY_A_EXIST OR ICONV_LIBRARY_SO_EXIST)
MESSAGE(STATUS "Use the installed libiconv library")
TARGET_LINK_LIBRARIES(tutil iconv)
ELSE ()
# libiconv library is already included in GLIBC,
MESSAGE(STATUS "Use the iconv functions in GLIBC")
ENDIF ()
ELSE ()
MESSAGE(STATUS "Failed to find iconv, use default encoding method")
ENDIF ()
ELSEIF (TD_WINDOWS)
TARGET_LINK_LIBRARIES(tutil iconv regex winmm IPHLPAPI ws2_32 wepoll)
ELSEIF(TD_DARWIN)
TARGET_LINK_LIBRARIES(tutil m)
TARGET_LINK_LIBRARIES(tutil iconv)
ENDIF()
IF (TD_STORAGE)
TARGET_LINK_LIBRARIES(tutil storage)
ENDIF ()
src/util/s
rc
/talgo.c
→
src/util/s
ource
/talgo.c
浏览文件 @
bddec203
...
@@ -14,7 +14,7 @@
...
@@ -14,7 +14,7 @@
*/
*/
#include "os.h"
#include "os.h"
#include "tutil.h"
#include "talgo.h"
#include "talgo.h"
#define doswap(__left, __right, __size, __buf) do {\
#define doswap(__left, __right, __size, __buf) do {\
...
...
src/util/s
rc
/tlist.c
→
src/util/s
ource
/tlist.c
浏览文件 @
bddec203
文件已移动
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录