From 1b4c2faf268d7fd5aa664640ff7b3d89b810ca3e Mon Sep 17 00:00:00 2001 From: Minglei Jin Date: Thu, 17 Oct 2024 09:43:18 +0800 Subject: [PATCH] tcs/stream: merge stream apis into tcs main module --- source/libs/tcs/inc/tcsInt.h | 2 -- source/libs/tcs/src/tcs.c | 14 ++++++++++++++ source/libs/tcs/src/tcsStream.c | 29 ----------------------------- 3 files changed, 14 insertions(+), 31 deletions(-) delete mode 100644 source/libs/tcs/src/tcsStream.c diff --git a/source/libs/tcs/inc/tcsInt.h b/source/libs/tcs/inc/tcsInt.h index b24a47aa98..a7e304b544 100644 --- a/source/libs/tcs/inc/tcsInt.h +++ b/source/libs/tcs/inc/tcsInt.h @@ -26,8 +26,6 @@ extern "C" { #endif -extern int8_t tsS3Ablob; - typedef enum { TOS_PROTO_NIL, TOS_PROTO_S3, diff --git a/source/libs/tcs/src/tcs.c b/source/libs/tcs/src/tcs.c index db02ca21fa..1716228d5c 100644 --- a/source/libs/tcs/src/tcs.c +++ b/source/libs/tcs/src/tcs.c @@ -24,6 +24,8 @@ STcs tcs; +extern int8_t tsS3Ablob; + int32_t tcsInit() { int32_t code = 0; @@ -105,3 +107,15 @@ int32_t tcsGetObjectBlock(const char* object_name, int64_t offset, int64_t size, } void tcsDeleteObjectsByPrefix(const char* prefix) { return tcs.DeleteObjectsByPrefix(prefix); } + +int32_t tcsPutObjectFromFile2(const char* file, const char* object, int8_t withcp) { + return tcs.PutObjectFromFile2(file, object, withcp); +} + +int32_t tcsGetObjectsByPrefix(const char* prefix, const char* path) { return tcs.GetObjectsByPrefix(prefix, path); } + +int32_t tcsDeleteObjects(const char* object_name[], int nobject) { return tcs.DeleteObjects(object_name, nobject); } + +int32_t tcsGetObjectToFile(const char* object_name, const char* fileName) { + return tcs.GetObjectToFile(object_name, fileName); +} diff --git a/source/libs/tcs/src/tcsStream.c b/source/libs/tcs/src/tcsStream.c deleted file mode 100644 index 7cd4647ddd..0000000000 --- a/source/libs/tcs/src/tcsStream.c +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright (c) 2019 TAOS Data, Inc. - * - * 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 . - */ - -#include "tcs.h" -#include "tcsInt.h" - -int32_t tcsPutObjectFromFile2(const char* file, const char* object, int8_t withcp) { - return tcs.PutObjectFromFile2(file, object, withcp); -} - -int32_t tcsGetObjectsByPrefix(const char* prefix, const char* path) { return tcs.GetObjectsByPrefix(prefix, path); } - -int32_t tcsDeleteObjects(const char* object_name[], int nobject) { return tcs.DeleteObjects(object_name, nobject); } - -int32_t tcsGetObjectToFile(const char* object_name, const char* fileName) { - return tcs.GetObjectToFile(object_name, fileName); -}