1
- extern " C" {
1
+ extern " C"
2
+ {
2
3
#include " pyinit.h"
3
4
}
4
5
@@ -20,7 +21,8 @@ extern "C" {
20
21
* Returns the relevant Python entry function. We need to invoke different
21
22
* functions depending on which Faasm function index we're dealing with.
22
23
*/
23
- const char * getPythonFunctionName () {
24
+ const char * getPythonFunctionName ()
25
+ {
24
26
char * entryFunc = faasmGetPythonEntry ();
25
27
26
28
if (strlen (entryFunc) == 0 ) {
@@ -34,7 +36,8 @@ const char* getPythonFunctionName() {
34
36
* Returns the working dir we need to be in to import the Python module
35
37
* for the required function.
36
38
*/
37
- const char * getPythonWorkingDir (const char * user, const char * funcName) {
39
+ const char * getPythonWorkingDir (const char * user, const char * funcName)
40
+ {
38
41
auto workingDir = new char [60 ];
39
42
40
43
#ifdef __wasm__
@@ -50,7 +53,8 @@ const char* getPythonWorkingDir(const char* user, const char* funcName) {
50
53
* Returns the name of the python module to execute. If executing in wasm this
51
54
* will be different to when executing natively.
52
55
*/
53
- const char * getPythonModuleName (const char * funcName) {
56
+ const char * getPythonModuleName (const char * funcName)
57
+ {
54
58
#ifdef __wasm__
55
59
return " function" ;
56
60
#else
@@ -61,7 +65,8 @@ const char* getPythonModuleName(const char* funcName) {
61
65
/* *
62
66
* Initialise CPython using a Faasm zygote to avoid doing so repeatedly
63
67
*/
64
- FAASM_ZYGOTE () {
68
+ FAASM_ZYGOTE ()
69
+ {
65
70
Py_InitializeEx (0 );
66
71
67
72
// 21/12/2022 - Numpy support is broken
@@ -90,7 +95,8 @@ FAASM_ZYGOTE() {
90
95
return 0 ;
91
96
}
92
97
93
- int main (int argc, char * argv[]) {
98
+ int main (int argc, char * argv[])
99
+ {
94
100
// With this line uncommented, this file can be run as a normal executable
95
101
// for testing setEmulatedMessageFromJson(R"({"user": "python", "function":
96
102
// "py_func", "py_user": "python", "py_func": "lang_test", "py_entry":
0 commit comments