forked from xmlsec/python-xmlsec
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathutils.pxd
More file actions
33 lines (20 loc) · 746 Bytes
/
utils.pxd
File metadata and controls
33 lines (20 loc) · 746 Bytes
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
from lxml.includes.tree cimport const_xmlChar
cdef inline const_xmlChar* _b(text):
if text is None:
return NULL
if isinstance(text, str):
text = text.encode('utf8')
return text
return text
cdef inline _u(const_xmlChar* text):
return text.decode('utf8') if text != NULL else None
cdef extern from "xmlsec.h": # xmlsec/xmlsec.h
int xmlSecInit() nogil
int xmlSecShutdown() nogil
cdef extern from "xmlsec.h": # xmlsec/errors.h
int xmlSecErrorsDefaultCallbackEnableOutput(int) nogil
cdef extern from "xmlsec.h": # xmlsec/app.h
int xmlSecCryptoInit() nogil
int xmlSecCryptoShutdown() nogil
int xmlSecCryptoAppInit(char* name) nogil
int xmlSecCryptoAppShutdown() nogil