Fredrik Lundh | 0fdb90c | 2001-01-19 09:45:02 +0000 | [diff] [blame] | 1 | /* Unicode name database interface */ |
Marc-André Lemburg | 808d9b1 | 2000-06-28 16:37:24 +0000 | [diff] [blame] | 2 | |
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 | |
Fredrik Lundh | 0fdb90c | 2001-01-19 09:45:02 +0000 | [diff] [blame] | 9 | /* revised ucnhash CAPI interface (exported through a PyCObject) */ |
Marc-André Lemburg | 808d9b1 | 2000-06-28 16:37:24 +0000 | [diff] [blame] | 10 | |
Fredrik Lundh | 0fdb90c | 2001-01-19 09:45:02 +0000 | [diff] [blame] | 11 | typedef struct { |
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 | /* Size of this struct */ |
| 14 | int size; |
| 15 | |
| 16 | /* Get name for a given character code. Returns non-zero if |
| 17 | success, zero if not. Does not set Python exceptions. */ |
| 18 | int (*getname)(Py_UCS4 code, char* buffer, int buflen); |
| 19 | |
| 20 | /* Get character code for a given name. Same error handling |
| 21 | as for getname. */ |
| 22 | int (*getcode)(const char* name, int namelen, Py_UCS4* code); |
| 23 | |
| 24 | } _PyUnicode_Name_CAPI; |
| 25 | |
| 26 | #ifdef __cplusplus |
| 27 | } |
| 28 | #endif |
| 29 | #endif /* !Py_UCNHASH_H */ |