Gregory P. Smith | e3f6393 | 2015-04-26 00:41:00 +0000 | [diff] [blame] | 1 | #ifndef Py_STRHEX_H |
| 2 | #define Py_STRHEX_H |
| 3 | |
| 4 | #ifdef __cplusplus |
| 5 | extern "C" { |
| 6 | #endif |
| 7 | |
Serhiy Storchaka | 9fab79b | 2016-09-11 11:03:14 +0300 | [diff] [blame] | 8 | #ifndef Py_LIMITED_API |
Gregory P. Smith | e3f6393 | 2015-04-26 00:41:00 +0000 | [diff] [blame] | 9 | /* Returns a str() containing the hex representation of argbuf. */ |
| 10 | PyAPI_FUNC(PyObject*) _Py_strhex(const char* argbuf, const Py_ssize_t arglen); |
| 11 | /* Returns a bytes() containing the ASCII hex representation of argbuf. */ |
| 12 | PyAPI_FUNC(PyObject*) _Py_strhex_bytes(const char* argbuf, const Py_ssize_t arglen); |
Gregory P. Smith | 0c2f930 | 2019-05-29 11:46:58 -0700 | [diff] [blame] | 13 | /* These variants include support for a separator between every N bytes: */ |
| 14 | PyAPI_FUNC(PyObject*) _Py_strhex_with_sep(const char* argbuf, const Py_ssize_t arglen, const PyObject* sep, const int bytes_per_group); |
| 15 | PyAPI_FUNC(PyObject*) _Py_strhex_bytes_with_sep(const char* argbuf, const Py_ssize_t arglen, const PyObject* sep, const int bytes_per_group); |
Serhiy Storchaka | 9fab79b | 2016-09-11 11:03:14 +0300 | [diff] [blame] | 16 | #endif /* !Py_LIMITED_API */ |
Gregory P. Smith | e3f6393 | 2015-04-26 00:41:00 +0000 | [diff] [blame] | 17 | |
| 18 | #ifdef __cplusplus |
| 19 | } |
| 20 | #endif |
| 21 | |
| 22 | #endif /* !Py_STRHEX_H */ |