FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
python-static-importer-demo/staticmod.cpp at main · itamaro/python-static-importer-demo · GitHub
itamaro
python-static-importer-demo
Repository navigation
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
python-static-importer-demo
/
staticmod.cpp
Copy path
More file actions
More file actions
Latest commit
History
History
History
34 lines (29 loc) · 1011 Bytes
Breadcrumbs
python-static-importer-demo
/
staticmod.cpp
Copy path
File metadata and controls
34 lines (29 loc) · 1011 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#
include
<
Python.h
>
//
Definition for the staticmod.say_hello function
static
PyObject*
staticmod_say_hello
(PyObject* self, PyObject* args) {
printf
(
"
Hello from staticmod!
\n
"
);
Py_RETURN_NONE;
}
//
Method definition object for the staticmod module
static
PyMethodDef Staticmod_methods[] = {
{
"
say_hello
"
, staticmod_say_hello,
METH_NOARGS
,
"
Says hello from staticmod.
"
},
{
NULL
,
NULL
,
0
,
NULL
}
//
Sentinel
};
static
PyModuleDef_Slot Staticmod_slots[] = {
{Py_mod_gil, Py_MOD_GIL_NOT_USED},
{Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
{
0
,
NULL
}
};
//
Module definition object for the staticmod module
static
struct
PyModuleDef
staticmodmodule = {
.
m_base
= PyModuleDef_HEAD_INIT,
.
m_name
=
"
staticmod
"
,
.
m_doc
=
NULL
,
.
m_size
=
0
,
.
m_methods
= Staticmod_methods,
.
m_slots
= Staticmod_slots,
};
//
Function to initialize the staticmod module
PyMODINIT_FUNC
PyInit_staticmod
(
void
) {
return
PyModuleDef_Init
(&staticmodmodule);
}
Back
|
FazBrowse Home
|
New Git URL