• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /**
2  * Copyright (c) 2021-2025 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  * http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #ifndef PANDA_PLUGINS_ETS_RUNTIME_ETS_VM_API_H_
17 #define PANDA_PLUGINS_ETS_RUNTIME_ETS_VM_API_H_
18 
19 #include <string>
20 #include <functional>
21 
22 #include "libpandabase/macros.h"
23 
24 namespace ark {
25 namespace base_options {
26 class Options;
27 }  // namespace base_options
28 
29 class RuntimeOptions;
30 }  // namespace ark
31 
32 namespace ark::ets {
33 
34 PANDA_PUBLIC_API bool CreateRuntime(const std::string &stdlibAbc, const std::string &pathAbc, bool useJit, bool useAot);
35 
36 PANDA_PUBLIC_API bool CreateRuntime(std::function<bool(base_options::Options *, RuntimeOptions *)> const &addOptions);
37 
38 PANDA_PUBLIC_API bool DestroyRuntime();
39 
40 PANDA_PUBLIC_API std::pair<bool, int> ExecuteModule(std::string_view name);
41 
42 PANDA_PUBLIC_API bool BindNative(const char *classDescriptor, const char *methodName, void *impl);
43 
44 PANDA_PUBLIC_API void LogError(const std::string &msg);
45 }  // namespace ark::ets
46 
47 #endif
48