From 15a30c3cea1237aa35764250c53dba73f278843d Mon Sep 17 00:00:00 2001 From: xiekaiming Date: Tue, 12 Mar 2024 17:22:41 +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, 9 insertions(+), 8 deletions(-) diff --git a/frameworks/config_policy/src/config_policy_utils.c b/frameworks/config_policy/src/config_policy_utils.c index 46a8b6d..8c10486 100644 --- a/frameworks/config_policy/src/config_policy_utils.c +++ b/frameworks/config_policy/src/config_policy_utils.c @@ -27,10 +27,10 @@ #endif static const size_t MIN_APPEND_LEN = 32; + #ifndef __LITEOS__ // set min opkey length static const unsigned int MIN_OPKEY_LEN = 3; -#endif // ':' split different x rules, example:":relPath,mode[,extra][:]" // ',' split different param for x rules // ":-" split for key:-value @@ -44,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 @@ -142,7 +143,6 @@ static char *GetOpkeyPath(int type) FreeIf(result); return NULL; } -#endif // __LITEOS__ static SplitedStr *SplitStr(char *str, char delim) { @@ -165,6 +165,7 @@ static SplitedStr *SplitStr(char *str, char delim) } return result; } +#endif // __LITEOS__ static void FreeSplitedStr(SplitedStr *p) { @@ -263,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) { @@ -376,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