pycore_strhex.h 937 B

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