pycore_ucnhash.h 898 B

12345678910111213141516171819202122232425262728293031323334
  1. /* Unicode name database interface */
  2. #ifndef Py_INTERNAL_UCNHASH_H
  3. #define Py_INTERNAL_UCNHASH_H
  4. #ifdef __cplusplus
  5. extern "C" {
  6. #endif
  7. #ifndef Py_BUILD_CORE
  8. # error "this header requires Py_BUILD_CORE define"
  9. #endif
  10. /* revised ucnhash CAPI interface (exported through a "wrapper") */
  11. #define PyUnicodeData_CAPSULE_NAME "unicodedata._ucnhash_CAPI"
  12. typedef struct {
  13. /* Get name for a given character code.
  14. Returns non-zero if success, zero if not.
  15. Does not set Python exceptions. */
  16. int (*getname)(Py_UCS4 code, char* buffer, int buflen,
  17. int with_alias_and_seq);
  18. /* Get character code for a given name.
  19. Same error handling as for getname(). */
  20. int (*getcode)(const char* name, int namelen, Py_UCS4* code,
  21. int with_named_seq);
  22. } _PyUnicode_Name_CAPI;
  23. #ifdef __cplusplus
  24. }
  25. #endif
  26. #endif /* !Py_INTERNAL_UCNHASH_H */