Yi Kong | 7119932 | 2022-08-30 15:53:45 +0800 | [diff] [blame] | 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 | |
| 8 | #ifndef Py_BUILD_CORE |
| 9 | # error "this header requires Py_BUILD_CORE define" |
| 10 | #endif |
| 11 | |
| 12 | /* revised ucnhash CAPI interface (exported through a "wrapper") */ |
| 13 | |
| 14 | #define PyUnicodeData_CAPSULE_NAME "unicodedata._ucnhash_CAPI" |
| 15 | |
| 16 | typedef struct { |
| 17 | |
| 18 | /* Get name for a given character code. |
| 19 | Returns non-zero if success, zero if not. |
| 20 | Does not set Python exceptions. */ |
| 21 | int (*getname)(Py_UCS4 code, char* buffer, int buflen, |
| 22 | int with_alias_and_seq); |
| 23 | |
| 24 | /* Get character code for a given name. |
| 25 | Same error handling as for getname(). */ |
| 26 | int (*getcode)(const char* name, int namelen, Py_UCS4* code, |
| 27 | int with_named_seq); |
| 28 | |
| 29 | } _PyUnicode_Name_CAPI; |
| 30 | |
| 31 | #ifdef __cplusplus |
| 32 | } |
| 33 | #endif |
| 34 | #endif /* !Py_INTERNAL_UCNHASH_H */ |