FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
pythonnet/src/monoclr/clrmod.c at master · attackgithub/pythonnet · GitHub
attackgithub
pythonnet
Repository navigation
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
pythonnet
/
src
/
monoclr
/
clrmod.c
Copy path
More file actions
More file actions
Latest commit
History
History
History
70 lines (60 loc) · 1.49 KB
Breadcrumbs
pythonnet
/
src
/
monoclr
/
clrmod.c
Copy path
File metadata and controls
70 lines (60 loc) · 1.49 KB
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#include
"pynetclr.h"
/* List of functions defined in the module */
static
PyMethodDef
clr_methods
[]
=
{
{
NULL
,
NULL
,
0
,
NULL
}
/* Sentinel */
};
PyDoc_STRVAR
(
clr_module_doc
,
"clr facade module to initialize the CLR. It's later "
"replaced by the real clr module. This module has a facade "
"attribute to make it distinguishable from the real clr module."
);
static
PyNet_Args
*
pn_args
;
char
*
*
environ
=
NULL
;
#if
PY_MAJOR_VERSION
>=
3
static
struct
PyModuleDef
clrdef
=
{
PyModuleDef_HEAD_INIT
,
"clr"
,
/* m_name */
clr_module_doc
,
/* m_doc */
-1
,
/* m_size */
clr_methods
,
/* m_methods */
NULL
,
/* m_reload */
NULL
,
/* m_traverse */
NULL
,
/* m_clear */
NULL
,
/* m_free */
};
#endif
static
PyObject
*
_initclr
()
{
PyObject
*
m
;
/* Create the module and add the functions */
#if
PY_MAJOR_VERSION
>=
3
m
=
PyModule_Create
(
&
clrdef
);
#else
m
=
Py_InitModule3
(
"clr"
,
clr_methods
,
clr_module_doc
);
#endif
if
(
m
==
NULL
)
return
NULL
;
PyModule_AddObject
(
m
,
"facade"
,
Py_True
);
Py_INCREF
(
Py_True
);
pn_args
=
PyNet_Init
(
1
);
if
(
pn_args
->
error
)
{
return
NULL
;
}
if
(
NULL
!=
pn_args
->
module
)
return
pn_args
->
module
;
return
m
;
}
#if
PY_MAJOR_VERSION
>=
3
PyMODINIT_FUNC
PyInit_clr
(
void
)
{
return
_initclr
();
}
#else
PyMODINIT_FUNC
initclr
(
void
)
{
_initclr
();
}
#endif
Back
|
FazBrowse Home
|
New Git URL