Commit 99cd6137 authored by Universebenzene's avatar Universebenzene
Browse files

Fix cextern helloworld

parent 5590255b
Pipeline #1465 passed with stage
in 0 seconds
// Simple C program to display "Hello World"
// Header file for input output functions
#include <stdio.h>
#include <Python.h>
// main function -
// where the execution of program begins
int main()
static PyObject* _helloworld(PyObject* self, PyObject* args)
{
printf("Hello World\n");
return Py_None;
}
static PyMethodDef Methods[] = {
{ "helloworld", _helloworld, METH_NOARGS, "Prints Hello World" },
{ NULL, NULL, 0, NULL }
};
// prints hello world
printf("Hello World");
// Our Module Definition struct
static struct PyModuleDef Module = {
PyModuleDef_HEAD_INIT,
"helloworld",
"prints Hello World",
-1,
Methods
};
return 0;
// Initializes our module using our above struct
PyMODINIT_FUNC PyInit_helloworld(void)
{
return PyModule_Create(&Module);
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment