| 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 |
extern _PyUnicode_Name_CAPI* _PyUnicode_GetNameCAPI(void); |
| 32 |
|
| 33 |
#ifdef __cplusplus |
| 34 |
} |
| 35 |
#endif |
| 36 |
#endif /* !Py_INTERNAL_UCNHASH_H */ |