1// Licensed to the .NET Foundation under one or more agreements.
2// The .NET Foundation licenses this file to you under the MIT license.
3// See the LICENSE file in the project root for more information.
4
5//
6// APIs for hosting CoreCLR
7//
8
9#ifndef __CORECLR_HOST_H__
10#define __CORECLR_HOST_H__
11
12// For each hosting API, we define a function prototype and a function pointer
13// The prototype is useful for implicit linking against the dynamic coreclr
14// library and the pointer for explicit dynamic loading (dlopen, LoadLibrary)
15#define CORECLR_HOSTING_API(function, ...) \
16 extern "C" int function(__VA_ARGS__); \
17 typedef int (*function##_ptr)(__VA_ARGS__)
18
19CORECLR_HOSTING_API(coreclr_initialize,
20 const char* exePath,
21 const char* appDomainFriendlyName,
22 int propertyCount,
23 const char** propertyKeys,
24 const char** propertyValues,
25 void** hostHandle,
26 unsigned int* domainId);
27
28CORECLR_HOSTING_API(coreclr_shutdown,
29 void* hostHandle,
30 unsigned int domainId);
31
32CORECLR_HOSTING_API(coreclr_shutdown_2,
33 void* hostHandle,
34 unsigned int domainId,
35 int* latchedExitCode);
36
37CORECLR_HOSTING_API(coreclr_create_delegate,
38 void* hostHandle,
39 unsigned int domainId,
40 const char* entryPointAssemblyName,
41 const char* entryPointTypeName,
42 const char* entryPointMethodName,
43 void** delegate);
44
45CORECLR_HOSTING_API(coreclr_execute_assembly,
46 void* hostHandle,
47 unsigned int domainId,
48 int argc,
49 const char** argv,
50 const char* managedAssemblyPath,
51 unsigned int* exitCode);
52
53#undef CORECLR_HOSTING_API
54
55#endif // __CORECLR_HOST_H__
56