diff --git a/interfaces/kits/cj/BUILD.gn b/interfaces/kits/cj/BUILD.gn index ef420c16767917c7922e592505dcd855e5330594..31cbee11f5f1747a0e14b8250ba50aa541369665 100644 --- a/interfaces/kits/cj/BUILD.gn +++ b/interfaces/kits/cj/BUILD.gn @@ -29,6 +29,8 @@ ohos_shared_library("cj_config_policy_ffi") { "bounds_checking_function:libsec_shared", "hilog:libhilog", "hisysevent:libhisysevent", + "napi:cj_bind_ffi", + "napi:cj_bind_native", ] sources = [ "../../../frameworks/dfx/hisysevent_adapter/hisysevent_adapter.cpp", @@ -46,7 +48,7 @@ ohos_shared_library("cj_config_policy_ffi") { if (current_os == "mingw") { defines += [ "WINDOWS_PLATFORM" ] } - + innerapi_tags = [ "platformsdk" ] subsystem_name = "customization" part_name = "config_policy" } diff --git a/interfaces/kits/cj/src/config_policy_ffi.h b/interfaces/kits/cj/src/config_policy_ffi.h index 415125665b72730ca37a325772df080241c934fb..17ffea9fa12915e408b6b9a2f61a2876c99d9b7b 100644 --- a/interfaces/kits/cj/src/config_policy_ffi.h +++ b/interfaces/kits/cj/src/config_policy_ffi.h @@ -16,27 +16,10 @@ #ifndef CONFIG_POLICY_FFI_H #define CONFIG_POLICY_FFI_H -#include - -#define FFI_EXPORT __attribute__((visibility("default"))) +#include "ffi_remote_data.h" +#include "cj_common_ffi.h" extern "C" { - const int32_t SUCCESS_CODE = 0; - struct CArrString { - char** head; - int64_t size; - }; - - struct RetDataCArrString { - int32_t code; - CArrString data; - }; - - struct RetDataCString { - int32_t code; - char* data; - }; - FFI_EXPORT RetDataCArrString CJ_GetCfgDirList(); FFI_EXPORT RetDataCArrString CJ_GetCfgFiles(const char* relPath); FFI_EXPORT RetDataCString CJ_GetOneCfgFile(const char* relPath); diff --git a/interfaces/kits/cj/src/config_policy_mock.cpp b/interfaces/kits/cj/src/config_policy_mock.cpp index c53d335d1acfa0ceeeba6e794a9a1e2339a241af..a0791c127100bbbdd9661698ead429b2568716b5 100644 --- a/interfaces/kits/cj/src/config_policy_mock.cpp +++ b/interfaces/kits/cj/src/config_policy_mock.cpp @@ -13,6 +13,8 @@ * limitations under the License. */ +#define FFI_EXPORT __attribute__((visibility("default"))) + extern "C" { FFI_EXPORT int CJ_GetCfgDirList = 0; FFI_EXPORT int CJ_GetCfgFiles = 0;