From 0f22cf1d2ed3a0a1d3817e33c8d31ffb3e686192 Mon Sep 17 00:00:00 2001 From: Shengliang Guan Date: Wed, 20 Apr 2022 19:13:22 +0800 Subject: [PATCH] refactor: rename shell.h --- tools/shell/inc/shellCommand.h | 2 +- tools/shell/inc/{shell.h => shellInt.h} | 12 ++++-------- tools/shell/src/backup/shellCheck.c | 2 +- tools/shell/src/backup/shellDarwin.c | 2 +- tools/shell/src/backup/shellImport.c | 2 +- tools/shell/src/backup/shellWindows.c | 2 +- tools/shell/src/shellCommand.c | 2 +- tools/shell/src/shellEngine.c | 2 +- tools/shell/src/shellMain.c | 3 +-- 9 files changed, 12 insertions(+), 17 deletions(-) rename tools/shell/inc/{shell.h => shellInt.h} (90%) diff --git a/tools/shell/inc/shellCommand.h b/tools/shell/inc/shellCommand.h index 49f7dc0133..82a7cfbf8f 100644 --- a/tools/shell/inc/shellCommand.h +++ b/tools/shell/inc/shellCommand.h @@ -16,7 +16,7 @@ #ifndef _TD_SHELL_COMMAND_H_ #define _TD_SHELL_COMMAND_H_ -#include "shell.h" +#include "shellInt.h" #define LEFT 1 #define RIGHT 2 diff --git a/tools/shell/inc/shell.h b/tools/shell/inc/shellInt.h similarity index 90% rename from tools/shell/inc/shell.h rename to tools/shell/inc/shellInt.h index 866cd63bdb..fe142a4c7d 100644 --- a/tools/shell/inc/shell.h +++ b/tools/shell/inc/shellInt.h @@ -21,14 +21,10 @@ #include "taos.h" #include "taosdef.h" -#define MAX_USERNAME_SIZE 64 -#define MAX_DBNAME_SIZE 64 -#define MAX_IP_SIZE 20 -#define MAX_HISTORY_SIZE 1000 -#define MAX_COMMAND_SIZE 1048586 -#define HISTORY_FILE ".taos_history" - -#define DEFAULT_RES_SHOW_NUM 100 +#define MAX_HISTORY_SIZE 1000 +#define MAX_COMMAND_SIZE 1048586 +#define HISTORY_FILE ".taos_history" +#define DEFAULT_RES_SHOW_NUM 100 typedef struct SShellHistory { char* hist[MAX_HISTORY_SIZE]; diff --git a/tools/shell/src/backup/shellCheck.c b/tools/shell/src/backup/shellCheck.c index d1f0683fea..9e23e9d026 100644 --- a/tools/shell/src/backup/shellCheck.c +++ b/tools/shell/src/backup/shellCheck.c @@ -18,7 +18,7 @@ #define _DEFAULT_SOURCE #include "os.h" -#include "shell.h" +#include "shellInt.h" #include "shellCommand.h" #include "tglobal.h" #include "tutil.h" diff --git a/tools/shell/src/backup/shellDarwin.c b/tools/shell/src/backup/shellDarwin.c index 93335776ba..d9807409f7 100644 --- a/tools/shell/src/backup/shellDarwin.c +++ b/tools/shell/src/backup/shellDarwin.c @@ -17,7 +17,7 @@ #include "os.h" -#include "shell.h" +#include "shellInt.h" #include "shellCommand.h" #include "tbase64.h" diff --git a/tools/shell/src/backup/shellImport.c b/tools/shell/src/backup/shellImport.c index 130c72a20b..2eeee616b4 100644 --- a/tools/shell/src/backup/shellImport.c +++ b/tools/shell/src/backup/shellImport.c @@ -18,7 +18,7 @@ #define _DEFAULT_SOURCE #include "os.h" -#include "shell.h" +#include "shellInt.h" #include "shellCommand.h" #include "tglobal.h" #include "tutil.h" diff --git a/tools/shell/src/backup/shellWindows.c b/tools/shell/src/backup/shellWindows.c index 92ac7fd721..53bcb84cc8 100644 --- a/tools/shell/src/backup/shellWindows.c +++ b/tools/shell/src/backup/shellWindows.c @@ -14,7 +14,7 @@ #include #include "../../../../include/client/taos.h" #include "os.h" -#include "shell.h" +#include "shellInt.h" #include "shellCommand.h" extern char configDir[]; diff --git a/tools/shell/src/shellCommand.c b/tools/shell/src/shellCommand.c index 546b19f83c..c9cd57fc17 100644 --- a/tools/shell/src/shellCommand.c +++ b/tools/shell/src/shellCommand.c @@ -17,7 +17,7 @@ #include "shellCommand.h" #include "os.h" -#include "shell.h" +#include "shellInt.h" #include diff --git a/tools/shell/src/shellEngine.c b/tools/shell/src/shellEngine.c index 36d2866fb5..e1a1924b2d 100644 --- a/tools/shell/src/shellEngine.c +++ b/tools/shell/src/shellEngine.c @@ -19,7 +19,7 @@ #define _DEFAULT_SOURCE #include "os.h" -#include "shell.h" +#include "shellInt.h" #include "shellCommand.h" #include "taosdef.h" #include "taoserror.h" diff --git a/tools/shell/src/shellMain.c b/tools/shell/src/shellMain.c index 1ee42358f6..83b0f48677 100644 --- a/tools/shell/src/shellMain.c +++ b/tools/shell/src/shellMain.c @@ -16,7 +16,6 @@ #define __USE_XOPEN #include "shellCommand.h" #include "tglobal.h" -#include "tlog.h" #include #include @@ -407,7 +406,7 @@ void *shellLoopQuery(void *arg) { char *command = taosMemoryMalloc(MAX_COMMAND_SIZE); if (command == NULL) { - uError("failed to malloc command"); + printf("failed to malloc command\n"); return NULL; }