提交 caf93340 编写于 作者: S Shengliang Guan

[TD-992]

上级 86fd70c2
......@@ -51,7 +51,6 @@ extern "C" {
#include "osLz4.h"
#include "osMath.h"
#include "osMemory.h"
#include "osPthread.h"
#include "osRand.h"
#include "osSemphone.h"
#include "osSocket.h"
......
......@@ -85,7 +85,7 @@ int tsem_destroy(dispatch_semaphore_t *sem);
#define TAOS_OS_FUNC_SOCKET_SETSOCKETOPT
#define TAOS_OS_FUNC_SYSINFO
#define TAOS_OS_FUNC_TIMER
#define TAOS_OS_FUNC_UTIL
#define TAOS_OS_FUNC_STRING_STR2INT64
// specific
#define htobe64 htonll
......
......@@ -51,11 +51,11 @@ int taosFSendFileImp(FILE* out_file, FILE* in_file, int64_t* offset, int32_t
#endif
#endif
int32_t taosFileRename(char *fullPath, char *suffix, char delimiter, char **dstPath);
// TAOS_OS_FUNC_FILE_GETTMPFILEPATH
void taosGetTmpfilePath(const char *fileNamePrefix, char *dstPath);
int32_t taosFileRename(char *fullPath, char *suffix, char delimiter, char **dstPath);
#ifdef __cplusplus
}
#endif
......
/*
* 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 TDENGINE_OS_PTHREAD_H
#define TDENGINE_OS_PTHREAD_H
#ifdef __cplusplus
extern "C" {
#endif
// TAOS_OS_FUNC_PTHREAD
bool taosCheckPthreadValid(pthread_t thread);
int64_t taosGetPthreadId();
#ifdef __cplusplus
}
#endif
#endif
......@@ -28,6 +28,10 @@ extern "C" {
#define tsem_destroy sem_destroy
#endif
// TAOS_OS_FUNC_PTHREAD
bool taosCheckPthreadValid(pthread_t thread);
int64_t taosGetPthreadId();
#ifdef __cplusplus
}
#endif
......
......@@ -29,7 +29,7 @@ extern "C" {
#define taosGetlineImp(lineptr, n, stream) getline(lineptr, n , stream)
#endif
#ifndef TAOS_OS_FUNC_WCHAR
#ifndef TAOS_OS_FUNC_STRING_WCHAR
#define twcslen wcslen
#endif
......@@ -39,7 +39,7 @@ extern "C" {
(dst)[(size)-1] = 0; \
} while (0);
// TAOS_OS_FUNC_UTIL
// TAOS_OS_FUNC_STRING_STR2INT64
int64_t tsosStr2int64(char *str);
// USE_LIBICONV
......
......@@ -32,7 +32,7 @@ void taosPrintOsInfo();
int taosSystem(const char * cmd) ;
void taosKillSystem();
// TAOS_OS_FUNC_CORE
// TAOS_OS_FUNC_SYSINFO_CORE
void taosSetCoreDump();
#ifdef __cplusplus
......
......@@ -48,7 +48,7 @@
extern "C" {
#endif
#define TAOS_OS_FUNC_WCHAR
#define TAOS_OS_FUNC_STRING_WCHAR
#define TAOS_OS_FUNC_FILE
#define TAOS_OS_FUNC_SLEEP
#define TAOS_OS_FUNC_TIMER
......@@ -65,7 +65,7 @@ extern "C" {
int32_t BUILDIN_CTZL(uint64_t val);
int32_t BUILDIN_CTZ(uint32_t val);
#define TAOS_OS_FUNC_UTIL
#define TAOS_OS_FUNC_STRING_STR2INT64
#ifdef _TD_GO_DLL_
int64_t tsosStr2int64(char *str);
uint64_t htonll(uint64_t val);
......
......@@ -18,7 +18,16 @@
#include "tglobal.h"
#include "taosdef.h"
#ifndef TAOS_OS_FUNC_WCHAR
#ifndef TAOS_OS_FUNC_STRING_STR2INT64
int64_t tsosStr2int64(char *str) {
char *endptr = NULL;
return strtoll(str, &endptr, 10);
}
#endif
#ifndef TAOS_OS_FUNC_STRING_WCHAR
int tasoUcs4Compare(void* f1_ucs4, void *f2_ucs4, int bytes) {
return wcsncmp((wchar_t *)f1_ucs4, (wchar_t *)f2_ucs4, bytes / TSDB_NCHAR_SIZE);
......@@ -120,4 +129,4 @@ char *taosCharsetReplace(char *charsetstr) {
}
return strdup(charsetstr);
}
\ No newline at end of file
}
/*
* 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/>.
*/
#define _DEFAULT_SOURCE
#include "os.h"
#ifndef TAOS_OS_FUNC_UTIL
int64_t tsosStr2int64(char *str) {
char *endptr = NULL;
return strtoll(str, &endptr, 10);
}
#endif
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册