| 1 |
#ifndef Py_INTERNAL_STRHEX_H |
| 2 |
#define Py_INTERNAL_STRHEX_H |
| 3 |
#ifdef __cplusplus |
| 4 |
extern "C" { |
| 5 |
#endif |
| 6 |
|
| 7 |
#ifndef Py_BUILD_CORE |
| 8 |
# error "this header requires Py_BUILD_CORE define" |
| 9 |
#endif |
| 10 |
|
| 11 |
// Returns a str() containing the hex representation of argbuf. |
| 12 |
// Export for '_hashlib' shared extension. |
| 13 |
PyAPI_FUNC(PyObject*) _Py_strhex(const |
| 14 |
char* argbuf, |
| 15 |
const Py_ssize_t arglen); |
| 16 |
|
| 17 |
// Returns a bytes() containing the ASCII hex representation of argbuf. |
| 18 |
extern PyObject* _Py_strhex_bytes( |
| 19 |
const char* argbuf, |
| 20 |
const Py_ssize_t arglen); |
| 21 |
|
| 22 |
// These variants include support for a separator between every N bytes: |
| 23 |
extern PyObject* _Py_strhex_with_sep( |
| 24 |
const char* argbuf, |
| 25 |
const Py_ssize_t arglen, |
| 26 |
PyObject* sep, |
| 27 |
const int bytes_per_group); |
| 28 |
|
| 29 |
// Export for 'binascii' shared extension |
| 30 |
PyAPI_FUNC(PyObject*) _Py_strhex_bytes_with_sep( |
| 31 |
const char* argbuf, |
| 32 |
const Py_ssize_t arglen, |
| 33 |
PyObject* sep, |
| 34 |
const int bytes_per_group); |
| 35 |
|
| 36 |
#ifdef __cplusplus |
| 37 |
} |
| 38 |
#endif |
| 39 |
#endif /* !Py_INTERNAL_STRHEX_H */ |