File tree 3 files changed +58
-0
lines changed
3 files changed +58
-0
lines changed Original file line number Diff line number Diff line change 113
113
'src/node_dir.cc' ,
114
114
'src/node_dotenv.cc' ,
115
115
'src/node_env_var.cc' ,
116
+ 'src/node_embedding_api.cc' ,
117
+ 'src/node_embedding_api.h' ,
116
118
'src/node_errors.cc' ,
117
119
'src/node_external_reference.cc' ,
118
120
'src/node_file.cc' ,
Original file line number Diff line number Diff line change
1
+ //
2
+ // Description: C-based API for embedding Node.js.
3
+ //
4
+ // !!! WARNING !!! WARNING !!! WARNING !!!
5
+ // This is a new API and is subject to change.
6
+ // While it is C-based, it is not ABI safe yet.
7
+ // Consider all functions and data structures as experimental.
8
+ // !!! WARNING !!! WARNING !!! WARNING !!!
9
+ //
10
+ // This file contains the C-based API for embedding Node.js in a host
11
+ // application. The API is designed to be used by applications that want to
12
+ // embed Node.js as a shared library (.so or .dll) and can interop with
13
+ // C-based API.
14
+ //
15
+
16
+
17
+ #include " node_embedding_api.h"
18
+ #include " node.h"
19
+
20
+ EXTERN_C_START
21
+
22
+ int32_t NAPI_CDECL node_embedding_main (int32_t argc, char * argv[]) {
23
+ return node::Start (argc, argv);
24
+ }
25
+
26
+ EXTERN_C_END
Original file line number Diff line number Diff line change
1
+ //
2
+ // Description: C-based API for embedding Node.js.
3
+ //
4
+ // !!! WARNING !!! WARNING !!! WARNING !!!
5
+ // This is a new API and is subject to change.
6
+ // While it is C-based, it is not ABI safe yet.
7
+ // Consider all functions and data structures as experimental.
8
+ // !!! WARNING !!! WARNING !!! WARNING !!!
9
+ //
10
+ // This file contains the C-based API for embedding Node.js in a host
11
+ // application. The API is designed to be used by applications that want to
12
+ // embed Node.js as a shared library (.so or .dll) and can interop with
13
+ // C-based API.
14
+ //
15
+
16
+ #ifndef SRC_NODE_EMBEDDING_API_H_
17
+ #define SRC_NODE_EMBEDDING_API_H_
18
+
19
+ #include "node_api.h"
20
+
21
+ #define NODE_EMBEDDING_VERSION 1
22
+
23
+ EXTERN_C_START
24
+
25
+ // Runs Node.js main function. It is the same as running Node.js from CLI.
26
+ NAPI_EXTERN int32_t NAPI_CDECL node_embedding_main (int32_t argc , char * argv []);
27
+
28
+ EXTERN_C_END
29
+
30
+ #endif // SRC_NODE_EMBEDDING_API_H_
You can’t perform that action at this time.
0 commit comments