FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
python-ldap/Modules/ldapmodule.c at main · python-ldap/python-ldap · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
python-ldap
/
python-ldap
Public
Notifications
You must be signed in to change notification settings
Fork
135
Star
441
Code
Issues
82
Pull requests
17
Actions
Projects
Security and quality
3
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
python-ldap
/
Modules
/
ldapmodule.c
Copy path
More file actions
More file actions
Latest commit
History
History
History
70 lines (53 loc) · 1.51 KB
Breadcrumbs
python-ldap
/
Modules
/
ldapmodule.c
Copy path
File metadata and controls
70 lines (53 loc) · 1.51 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
/* See https://www.python-ldap.org/ for details. */
#include
"pythonldap.h"
#define
_STR
(
x
) #x
#define
STR
(
x
) _STR(x)
LDAPAPIInfo
ldap_version_info
=
{
.
ldapai_info_version
=
LDAP_API_INFO_VERSION
,
};
static
char
version_str
[]
=
STR
(
LDAPMODULE_VERSION
);
static
char
author_str
[]
=
STR
(
LDAPMODULE_AUTHOR
);
static
char
license_str
[]
=
STR
(
LDAPMODULE_LICENSE
);
static
void
init_pkginfo
(
PyObject
*
m
)
{
PyModule_AddStringConstant
(
m
,
"__version__"
,
version_str
);
PyModule_AddStringConstant
(
m
,
"__author__"
,
author_str
);
PyModule_AddStringConstant
(
m
,
"__license__"
,
license_str
);
}
/* dummy module methods */
static
PyMethodDef
methods
[]
=
{
{
NULL
,
NULL
}
};
static
struct
PyModuleDef
ldap_moduledef
=
{
PyModuleDef_HEAD_INIT
,
"_ldap"
,
/* m_name */
""
,
/* m_doc */
-1
,
/* m_size */
methods
,
/* m_methods */
};
/* module initialisation */
PyMODINIT_FUNC
PyInit__ldap
()
{
PyObject
*
m
,
*
d
;
/* Create the module and add the functions */
m
=
PyModule_Create
(
&
ldap_moduledef
);
/* Initialize LDAP class */
if
(
PyType_Ready
(
&
LDAP_Type
)
<
0
) {
Py_DECREF
(
m
);
return
NULL
;
}
/* Add some symbolic constants to the module */
d
=
PyModule_GetDict
(
m
);
init_pkginfo
(
m
);
if
(
LDAPinit_constants
(
m
)
==
-1
) {
return
NULL
;
}
LDAPinit_functions
(
d
);
LDAPinit_control
(
d
);
/* Check for errors */
if
(
PyErr_Occurred
())
Py_FatalError
(
"can't initialize module _ldap"
);
return
m
;
}
Back
|
FazBrowse Home
|
New Git URL