Fredrik Lundh | 0fdb90c | 2001-01-19 09:45:02 +0000 | [diff] [blame] | 1 | /* Unicode name database interface */ |
Martin v. Löwis | 4d0d471 | 2010-12-03 20:14:31 +0000 | [diff] [blame] | 2 | #ifndef Py_LIMITED_API |
Fredrik Lundh | 0fdb90c | 2001-01-19 09:45:02 +0000 | [diff] [blame] | 3 | #ifndef Py_UCNHASH_H |
| 4 | #define Py_UCNHASH_H |
| 5 | #ifdef __cplusplus |
| 6 | extern "C" { |
| 7 | #endif |
Marc-André Lemburg | 808d9b1 | 2000-06-28 16:37:24 +0000 | [diff] [blame] | 8 | |
Benjamin Peterson | b173f78 | 2009-05-05 22:31:58 +0000 | [diff] [blame] | 9 | /* revised ucnhash CAPI interface (exported through a "wrapper") */ |
| 10 | |
| 11 | #define PyUnicodeData_CAPSULE_NAME "unicodedata.ucnhash_CAPI" |
Marc-André Lemburg | 808d9b1 | 2000-06-28 16:37:24 +0000 | [diff] [blame] | 12 | |
Fredrik Lundh | 0fdb90c | 2001-01-19 09:45:02 +0000 | [diff] [blame] | 13 | typedef struct { |
Marc-André Lemburg | 808d9b1 | 2000-06-28 16:37:24 +0000 | [diff] [blame] | 14 | |
Fredrik Lundh | 0fdb90c | 2001-01-19 09:45:02 +0000 | [diff] [blame] | 15 | /* Size of this struct */ |
| 16 | int size; |
| 17 | |
| 18 | /* Get name for a given character code. Returns non-zero if |
Martin v. Löwis | 480f1bb | 2006-03-09 23:38:20 +0000 | [diff] [blame] | 19 | success, zero if not. Does not set Python exceptions. |
| 20 | If self is NULL, data come from the default version of the database. |
Martin v. Löwis | 5bd7c02 | 2006-03-10 11:20:04 +0000 | [diff] [blame] | 21 | If it is not NULL, it should be a unicodedata.ucd_X_Y_Z object */ |
Ezio Melotti | 931b8aa | 2011-10-21 21:57:36 +0300 | [diff] [blame] | 22 | int (*getname)(PyObject *self, Py_UCS4 code, char* buffer, int buflen, |
| 23 | int with_alias_and_seq); |
Fredrik Lundh | 0fdb90c | 2001-01-19 09:45:02 +0000 | [diff] [blame] | 24 | |
| 25 | /* Get character code for a given name. Same error handling |
| 26 | as for getname. */ |
Ezio Melotti | 931b8aa | 2011-10-21 21:57:36 +0300 | [diff] [blame] | 27 | int (*getcode)(PyObject *self, const char* name, int namelen, Py_UCS4* code, |
| 28 | int with_named_seq); |
Fredrik Lundh | 0fdb90c | 2001-01-19 09:45:02 +0000 | [diff] [blame] | 29 | |
| 30 | } _PyUnicode_Name_CAPI; |
| 31 | |
| 32 | #ifdef __cplusplus |
| 33 | } |
| 34 | #endif |
| 35 | #endif /* !Py_UCNHASH_H */ |
Martin v. Löwis | 4d0d471 | 2010-12-03 20:14:31 +0000 | [diff] [blame] | 36 | #endif /* !Py_LIMITED_API */ |