Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
csst-pipeline
csst_proto
Commits
99cd6137
Commit
99cd6137
authored
Nov 02, 2023
by
Universebenzene
Browse files
Fix cextern helloworld
parent
5590255b
Pipeline
#1465
passed with stage
in 0 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
cextern/helloworld.c
View file @
99cd6137
// Simple C program to display "Hello World"
// Simple C program to display "Hello World"
// Header file for input output functions
// Header file for input output functions
#include
<
stdio
.h>
#include
<
Python
.h>
// main function -
static
PyObject
*
_helloworld
(
PyObject
*
self
,
PyObject
*
args
)
// where the execution of program begins
int
main
()
{
{
printf
(
"Hello World
\n
"
);
return
Py_None
;
}
// prints hello world
static
PyMethodDef
Methods
[]
=
{
printf
(
"Hello World"
);
{
"helloworld"
,
_helloworld
,
METH_NOARGS
,
"Prints Hello World"
},
{
NULL
,
NULL
,
0
,
NULL
}
};
return
0
;
// Our Module Definition struct
}
static
struct
PyModuleDef
Module
=
{
\ No newline at end of file
PyModuleDef_HEAD_INIT
,
"helloworld"
,
"prints Hello World"
,
-
1
,
Methods
};
// Initializes our module using our above struct
PyMODINIT_FUNC
PyInit_helloworld
(
void
)
{
return
PyModule_Create
(
&
Module
);
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment