From 400254820cf1b20423d5e25cd3dcab007403c0a5 Mon Sep 17 00:00:00 2001 From: Alex Duan <417921451@qq.com> Date: Thu, 13 Feb 2025 13:00:46 +0800 Subject: [PATCH] fix: remove cur_name.h content to tdef.h and del cur_name.h --- include/os/osDir.h | 3 --- include/util/cus_name.h | 31 -------------------------- include/util/tdef.h | 17 ++++++++++++++ source/client/src/clientEnv.c | 3 --- source/common/src/tglobal.c | 3 --- source/dnode/mgmt/exe/dmMain.c | 16 +------------ source/os/src/osSysinfo.c | 7 ------ tools/shell/src/shellArguments.c | 7 ------ tools/taos-tools/inc/dump.h | 17 +------------- tools/taos-tools/src/benchCommandOpt.c | 3 ++- tools/taos-tools/src/benchSys.c | 16 ------------- tools/taos-tools/src/taosdump.c | 1 + 12 files changed, 22 insertions(+), 102 deletions(-) delete mode 100644 include/util/cus_name.h diff --git a/include/os/osDir.h b/include/os/osDir.h index c0d8530b4f..351275113c 100644 --- a/include/os/osDir.h +++ b/include/os/osDir.h @@ -31,9 +31,6 @@ extern "C" { #endif -#if defined(CUS_NAME) || defined(CUS_PROMPT) || defined(CUS_EMAIL) -#include "cus_name.h" -#endif #ifdef WINDOWS diff --git a/include/util/cus_name.h b/include/util/cus_name.h deleted file mode 100644 index 16f677f855..0000000000 --- a/include/util/cus_name.h +++ /dev/null @@ -1,31 +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 . - */ - -#ifndef _CUS_NAME_H_ -#define _CUS_NAME_H_ - -#ifndef CUS_NAME -#define CUS_NAME "TDengine" -#endif - -#ifndef CUS_PROMPT -#define CUS_PROMPT "taos" -#endif - -#ifndef CUS_EMAIL -#define CUS_EMAIL "" -#endif - -#endif // _CUS_NAME_H_ diff --git a/include/util/tdef.h b/include/util/tdef.h index f08697b0d4..0b722bfeb2 100644 --- a/include/util/tdef.h +++ b/include/util/tdef.h @@ -79,6 +79,10 @@ extern const int32_t TYPE_BYTES[21]; #define TSDB_DEFAULT_PASS "taosdata" #endif + +// +// support OEM +// #ifndef TD_PRODUCT_NAME #ifdef TD_ENTERPRISE #define TD_PRODUCT_NAME "TDengine Enterprise Edition" @@ -87,6 +91,19 @@ extern const int32_t TYPE_BYTES[21]; #endif #endif +#ifndef CUS_NAME +#define CUS_NAME "TDengine" +#endif + +#ifndef CUS_PROMPT +#define CUS_PROMPT "taos" +#endif + +#ifndef CUS_EMAIL +#define CUS_EMAIL "" +#endif + + #define TSDB_TRUE 1 #define TSDB_FALSE 0 #define TSDB_OK 0 diff --git a/source/client/src/clientEnv.c b/source/client/src/clientEnv.c index b69585a356..e9381a1096 100644 --- a/source/client/src/clientEnv.c +++ b/source/client/src/clientEnv.c @@ -38,9 +38,6 @@ #include "tversion.h" #include "tconv.h" -#if defined(CUS_NAME) || defined(CUS_PROMPT) || defined(CUS_EMAIL) -#include "cus_name.h" -#endif #ifndef CUS_PROMPT #define CUS_PROMPT "taos" diff --git a/source/common/src/tglobal.c b/source/common/src/tglobal.c index 562256f311..223418feed 100644 --- a/source/common/src/tglobal.c +++ b/source/common/src/tglobal.c @@ -28,9 +28,6 @@ #include "tutil.h" -#if defined(CUS_NAME) || defined(CUS_PROMPT) || defined(CUS_EMAIL) -#include "cus_name.h" -#endif #define CONFIG_PATH_LEN (TSDB_FILENAME_LEN + 12) #define CONFIG_FILE_LEN (CONFIG_PATH_LEN + 32) diff --git a/source/dnode/mgmt/exe/dmMain.c b/source/dnode/mgmt/exe/dmMain.c index b5eeb78b5e..edc15da02c 100644 --- a/source/dnode/mgmt/exe/dmMain.c +++ b/source/dnode/mgmt/exe/dmMain.c @@ -27,22 +27,8 @@ #include "dmUtil.h" #include "tcs.h" #include "qworker.h" +#include "tdef.h" -#if defined(CUS_NAME) || defined(CUS_PROMPT) || defined(CUS_EMAIL) -#include "cus_name.h" -#else -#ifndef CUS_NAME -#define CUS_NAME "TDengine" -#endif - -#ifndef CUS_PROMPT -#define CUS_PROMPT "taos" -#endif - -#ifndef CUS_EMAIL -#define CUS_EMAIL "" -#endif -#endif // clang-format off #define DM_APOLLO_URL "The apollo string to use when configuring the server, such as: -a 'jsonFile:./tests/cfg.json', cfg.json text can be '{\"fqdn\":\"td1\"}'." #define DM_CFG_DIR "Configuration directory." diff --git a/source/os/src/osSysinfo.c b/source/os/src/osSysinfo.c index 526f1a33e4..d101c6b6d9 100644 --- a/source/os/src/osSysinfo.c +++ b/source/os/src/osSysinfo.c @@ -17,13 +17,6 @@ #include "os.h" #include "taoserror.h" -#if defined(CUS_NAME) || defined(CUS_PROMPT) || defined(CUS_EMAIL) -#include "cus_name.h" -#else -#ifndef CUS_PROMPT -#define CUS_PROMPT "taos" -#endif -#endif #define PROCESS_ITEM 12 #define UUIDLEN37 37 diff --git a/tools/shell/src/shellArguments.c b/tools/shell/src/shellArguments.c index 88918a14ac..997c6485ea 100644 --- a/tools/shell/src/shellArguments.c +++ b/tools/shell/src/shellArguments.c @@ -20,13 +20,6 @@ #include "shellInt.h" #include "version.h" -#if defined(CUS_NAME) || defined(CUS_PROMPT) || defined(CUS_EMAIL) -#include "cus_name.h" -#else -#ifndef CUS_PROMPT -#define CUS_PROMPT "taos" -#endif -#endif #define TAOS_CONSOLE_PROMPT_CONTINUE " -> " diff --git a/tools/taos-tools/inc/dump.h b/tools/taos-tools/inc/dump.h index 1050676af3..d08da38ee7 100644 --- a/tools/taos-tools/inc/dump.h +++ b/tools/taos-tools/inc/dump.h @@ -38,6 +38,7 @@ #include #include +#include #include #ifdef WEBSOCKET @@ -49,22 +50,6 @@ // ---------------- define ---------------- // -#if defined(CUS_NAME) || defined(CUS_PROMPT) || defined(CUS_EMAIL) -#include -#else -#ifndef CUS_NAME - #define CUS_NAME "TDengine" -#endif - -#ifndef CUS_PROMPT - #define CUS_PROMPT "taos" -#endif - -#ifndef CUS_EMAIL - #define CUS_EMAIL "" -#endif -#endif - // use 256 as normal buffer length #define BUFFER_LEN 256 diff --git a/tools/taos-tools/src/benchCommandOpt.c b/tools/taos-tools/src/benchCommandOpt.c index 1c072e0105..d62e2712c1 100644 --- a/tools/taos-tools/src/benchCommandOpt.c +++ b/tools/taos-tools/src/benchCommandOpt.c @@ -10,7 +10,8 @@ * FITNESS FOR A PARTICULAR PURPOSE. */ -#include + #include // include/util/ + #include #include "benchLog.h" #include diff --git a/tools/taos-tools/src/benchSys.c b/tools/taos-tools/src/benchSys.c index 1a229f2cbd..4e512a5e72 100644 --- a/tools/taos-tools/src/benchSys.c +++ b/tools/taos-tools/src/benchSys.c @@ -21,23 +21,7 @@ #endif #endif -extern char version[]; -#if defined(CUS_NAME) || defined(CUS_PROMPT) || defined(CUS_EMAIL) -#include "cus_name.h" -#else -#ifndef CUS_NAME -#define CUS_NAME "TDengine" -#endif - -#ifndef CUS_PROMPT -#define CUS_PROMPT "taos" -#endif - -#ifndef CUS_EMAIL -#define CUS_EMAIL "" -#endif -#endif #ifdef WINDOWS char g_configDir[MAX_PATH_LEN] = {0}; // "C:\\TDengine\\cfg"}; diff --git a/tools/taos-tools/src/taosdump.c b/tools/taos-tools/src/taosdump.c index abe885054b..43c9f3a0aa 100644 --- a/tools/taos-tools/src/taosdump.c +++ b/tools/taos-tools/src/taosdump.c @@ -11,6 +11,7 @@ #define _GNU_SOURCE +#include // include/util/ #include "dump.h" #include "dumpUtil.h" #ifdef WEBSOCKET