2 * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the License);
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an AS IS BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 #ifndef __NI_COMMON_H__
18 #define __NI_COMMON_H__
23 #define DWORD uint32_t
27 * Common flags passed to crossgen()
29 #define NI_FLAGS_ENABLER2R 0x0001
30 #define NI_FLAGS_APPNI 0x0002
31 #define NI_FLAGS_COMPATIBILITY 0x0004
32 #define NI_FLAGS_VERBOSE 0x0008
33 #define NI_FLAGS_INSTRUMENT 0x1000
35 typedef std::function<void (std::string)> afterCreate;
39 NI_ERROR_INVALID_PARAMETER = -1,
40 NI_ERROR_ALREADY_EXIST = -2,
41 NI_ERROR_NO_SUCH_FILE = -3,
42 NI_ERROR_INVALID_PACKAGE = -4,
43 NI_ERROR_NOT_SUPPORTED = -5,
44 NI_ERROR_CORE_NI_FILE = -6,
49 * @brief initialize NICommon
50 * @return ni_error_e 0 on success, otherwise a negative error value
52 ni_error_e initNICommon();
55 * @brief finalize NICommon
56 * @details Before re-initialize NICommon, you have to finalize current NICommon first.
58 void finalizeNICommon();
61 * @brief create native images for platform DLLs (.NETCore + TizenFX)
62 * @param[i] flags additional flags for the image generator
65 ni_error_e createNIPlatform(DWORD flags);
68 * @brief create a native image for a single DLL
69 * @param[i] dllPath path to input DLL
70 * @param[i] flags additional flags for the image generator
73 ni_error_e createNIDll(const std::string& dllPath, DWORD flags);
77 * @brief create native images for all DLLs under directories
78 * @param[i] rootPaths paths to directories
79 * @param[i] flags additional flags for the image generator
82 ni_error_e createNIUnderDirs(const std::string rootPaths, DWORD flags);
85 * @brief create native images for all DLLs in a package
86 * @param[i] pkgId package ID
87 * @param[i] flags additional flags for the image generator
90 ni_error_e createNIUnderPkgRoot(const std::string& pkgId, DWORD flags);
93 * @brief remove platform native images (.NETCore + TizenFX)
95 void removeNIPlatform();
98 * @brief remove native images under directories
99 * @param[i] rootPaths paths to directories
101 void removeNIUnderDirs(const std::string rootPaths);
104 * @brief remove native images of a package
105 * @param[i] pkgId package ID
108 ni_error_e removeNIUnderPkgRoot(const std::string& pkgId);
111 * @brief regenerate native images of all installed applications
112 * @param[i] flags additional flags for the image generator
115 ni_error_e regenerateAppNI(DWORD flags);
118 * @brief regenerate native image of TAC for all shared assembly.
119 * @param[i] flags additional flags for the image generator
122 ni_error_e regenerateTACNI(DWORD flags);
124 #endif /* __NI_COMMON_H__ */