add comment for header and fix some wrong return value
[platform/core/dotnet/launcher.git] / NativeLauncher / inc / dotnet_launcher_plugin.h
1 /*
2  * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
3  *
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
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
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.
15  */
16
17 #ifndef __DOTNET_LAUNCHER_PLUGIN_H__
18 #define __DOTNET_LAUNCHER_PLUGIN_H__
19
20 #include "coreclr_host.h"
21
22 extern "C"
23 {
24         /**
25          * @brief initialize plugin code
26          * @param[in] mode mode of plugin ("default", "inhouse", etc)
27          */
28         void plugin_initialize(const char* mode);
29
30         /**
31          * @brief preload libraries. this fuction is called in the candidate process only
32          */
33         void plugin_preload();
34
35         /**
36          * @brief set appInfo to plugin
37          * @param[in] appID application ID to launch
38          * @param[in] assemblyPath assembly path which has entry point
39          */
40         void plugin_set_app_info(const char* appId,
41                                                          const char* assemblyPath);
42
43         /**
44          * @brief set coreclr info to plugin
45          * @param[in] hostHandle host handle of coreclr
46          * @param[in] domainId current domain ID
47          * @param[in] coreclr_create_delegate_ptr function pointer of coreclr_create_delegate
48          *            delegate function can be used to preload managed code
49          */
50         void plugin_set_coreclr_info(void* hostHandle,
51                                                                  unsigned int domainId,
52                                                                  coreclr_create_delegate_ptr delegateFunc);
53
54         /**
55          * @brief return additional pathes to find platform assembly.
56          * @return ":" seperated pathes
57          */
58         char* plugin_get_dll_path();
59
60         /**
61          * @brief function will be called before invoking managed code
62          */
63         void plugin_before_execute();
64
65         /**
66          * @brief function will be called when application is terminated
67          */
68         void plugin_finalize();
69 }
70
71 #endif /* __DOTNET_LAUNCHER_PLUGIN_H__ */