From 7dd6f65e9863ebed12bbb08e7646b2d9c4f31e44 Mon Sep 17 00:00:00 2001 From: xiekaiming Date: Tue, 12 Mar 2024 19:02:45 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dlite=E4=BA=A7=E5=93=81?= =?UTF-8?q?=E6=9E=84=E5=BB=BA=E5=A4=B1=E8=B4=A5=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: xiekaiming --- .../config_policy/src/config_policy_utils.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/frameworks/config_policy/src/config_policy_utils.c b/frameworks/config_policy/src/config_policy_utils.c index f48113a..e5cc67f 100644 --- a/frameworks/config_policy/src/config_policy_utils.c +++ b/frameworks/config_policy/src/config_policy_utils.c @@ -27,6 +27,8 @@ #endif static const size_t MIN_APPEND_LEN = 32; + +#ifndef __LITEOS__ // set min opkey length static const unsigned int MIN_OPKEY_LEN = 3; // ':' split different x rules, example:":relPath,mode[,extra][:]" @@ -42,6 +44,7 @@ typedef struct { size_t strLen; // strlen(p), less than size char *p; // just init to NULL, by malloc } StringHolder; +#endif typedef struct { int segCount; // count of char * in segs @@ -140,7 +143,6 @@ static char *GetOpkeyPath(int type) FreeIf(result); return NULL; } -#endif // __LITEOS__ static SplitedStr *SplitStr(char *str, char delim) { @@ -163,6 +165,7 @@ static SplitedStr *SplitStr(char *str, char delim) } return result; } +#endif // __LITEOS__ static void FreeSplitedStr(SplitedStr *p) { @@ -261,12 +264,6 @@ static SplitedStr *GetFollowXPathByMode(const char *relPath, int followMode, con SplitedStr *result = expandVal ? SplitStr(expandVal, ',') : NULL; return result; } -#else -static SplitedStr *GetFollowXPathByMode(const char *relPath, int followMode, const char *extra) -{ - return NULL; -} -#endif static char *TrimInplace(char *str, bool moveToStart) { @@ -374,6 +371,12 @@ static char *ExpandStr(char *src, const char *def, QueryFunc queryFunc) } return sh.p; } +#else +static SplitedStr *GetFollowXPathByMode(const char *relPath, int followMode, const char *extra) +{ + return NULL; +} +#endif static void GetCfgDirRealPolicyValue(CfgDir *res) { -- Gitee