From 22ca66b25cac35f13f4113bddb739c56dd4ffeed Mon Sep 17 00:00:00 2001 From: Alex Duan <417921451@qq.com> Date: Thu, 13 Feb 2025 13:16:39 +0800 Subject: [PATCH] fix: restore cur_name.h --- include/os/osDir.h | 1 + include/util/cus_name.h | 42 ++++++++++++++++++++++++++ include/util/tdef.h | 26 +--------------- source/client/src/clientEnv.c | 4 +-- source/dnode/mgmt/exe/dmMain.c | 2 +- source/os/src/osSysinfo.c | 2 +- tools/shell/src/shellArguments.c | 1 + tools/taos-tools/src/benchCommandOpt.c | 2 +- tools/taos-tools/src/taosdump.c | 2 +- 9 files changed, 50 insertions(+), 32 deletions(-) create mode 100644 include/util/cus_name.h diff --git a/include/os/osDir.h b/include/os/osDir.h index 351275113c..99d3ebccde 100644 --- a/include/os/osDir.h +++ b/include/os/osDir.h @@ -31,6 +31,7 @@ extern "C" { #endif +#include "cus_name.h" #ifdef WINDOWS diff --git a/include/util/cus_name.h b/include/util/cus_name.h new file mode 100644 index 0000000000..fe05491742 --- /dev/null +++ b/include/util/cus_name.h @@ -0,0 +1,42 @@ +/* + * 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_ + +// +// support OEM +// +#ifndef TD_PRODUCT_NAME +#ifdef TD_ENTERPRISE +#define TD_PRODUCT_NAME "TDengine Enterprise Edition" +#else +#define TD_PRODUCT_NAME "TDengine Community Edition" +#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 + +#endif // _CUS_NAME_H_ diff --git a/include/util/tdef.h b/include/util/tdef.h index 0b722bfeb2..ccc4a6bafc 100644 --- a/include/util/tdef.h +++ b/include/util/tdef.h @@ -17,6 +17,7 @@ #define _TD_UTIL_DEF_H_ #include "os.h" +#include "cur_name.h" #ifdef __cplusplus extern "C" { @@ -79,31 +80,6 @@ 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" -#else -#define TD_PRODUCT_NAME "TDengine Community Edition" -#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 e9381a1096..0d4af75d04 100644 --- a/source/client/src/clientEnv.c +++ b/source/client/src/clientEnv.c @@ -39,9 +39,7 @@ #include "tconv.h" -#ifndef CUS_PROMPT -#define CUS_PROMPT "taos" -#endif +#include "cus_name.h" #define TSC_VAR_NOT_RELEASE 1 #define TSC_VAR_RELEASED 0 diff --git a/source/dnode/mgmt/exe/dmMain.c b/source/dnode/mgmt/exe/dmMain.c index edc15da02c..51e4d86acb 100644 --- a/source/dnode/mgmt/exe/dmMain.c +++ b/source/dnode/mgmt/exe/dmMain.c @@ -27,7 +27,7 @@ #include "dmUtil.h" #include "tcs.h" #include "qworker.h" -#include "tdef.h" +#include "cus_name.h" // 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\"}'." diff --git a/source/os/src/osSysinfo.c b/source/os/src/osSysinfo.c index d101c6b6d9..6cb0e00b82 100644 --- a/source/os/src/osSysinfo.c +++ b/source/os/src/osSysinfo.c @@ -16,7 +16,7 @@ #define _DEFAULT_SOURCE #include "os.h" #include "taoserror.h" - +#include "cus_name.h" #define PROCESS_ITEM 12 #define UUIDLEN37 37 diff --git a/tools/shell/src/shellArguments.c b/tools/shell/src/shellArguments.c index 997c6485ea..ba210850eb 100644 --- a/tools/shell/src/shellArguments.c +++ b/tools/shell/src/shellArguments.c @@ -17,6 +17,7 @@ #include #endif +#include "cus_name.h" #include "shellInt.h" #include "version.h" diff --git a/tools/taos-tools/src/benchCommandOpt.c b/tools/taos-tools/src/benchCommandOpt.c index d62e2712c1..8c18b54eac 100644 --- a/tools/taos-tools/src/benchCommandOpt.c +++ b/tools/taos-tools/src/benchCommandOpt.c @@ -10,7 +10,7 @@ * FITNESS FOR A PARTICULAR PURPOSE. */ - #include // include/util/ + #include "cus_name.h" // include/util/ #include #include "benchLog.h" #include diff --git a/tools/taos-tools/src/taosdump.c b/tools/taos-tools/src/taosdump.c index 43c9f3a0aa..d27812b67a 100644 --- a/tools/taos-tools/src/taosdump.c +++ b/tools/taos-tools/src/taosdump.c @@ -11,7 +11,7 @@ #define _GNU_SOURCE -#include // include/util/ +#include "cus_name.h" // include/util/ #include "dump.h" #include "dumpUtil.h" #ifdef WEBSOCKET