blob: b7d3f08b6552148bba9bc297e24ae17c984ff959 [file] [log] [blame]
Fredrik Lundh0fdb90c2001-01-19 09:45:02 +00001/* Unicode name database interface */
Marc-André Lemburg808d9b12000-06-28 16:37:24 +00002
Fredrik Lundh0fdb90c2001-01-19 09:45:02 +00003#ifndef Py_UCNHASH_H
4#define Py_UCNHASH_H
5#ifdef __cplusplus
6extern "C" {
7#endif
Marc-André Lemburg808d9b12000-06-28 16:37:24 +00008
Fredrik Lundh0fdb90c2001-01-19 09:45:02 +00009/* revised ucnhash CAPI interface (exported through a PyCObject) */
Marc-André Lemburg808d9b12000-06-28 16:37:24 +000010
Fredrik Lundh0fdb90c2001-01-19 09:45:02 +000011typedef struct {
Marc-André Lemburg808d9b12000-06-28 16:37:24 +000012
Fredrik Lundh0fdb90c2001-01-19 09:45:02 +000013 /* Size of this struct */
14 int size;
15
16 /* Get name for a given character code. Returns non-zero if
Martin v. Löwis480f1bb2006-03-09 23:38:20 +000017 success, zero if not. Does not set Python exceptions.
18 If self is NULL, data come from the default version of the database.
19 If it is not NULL, it should be a unicodedata.db_X_Y_Z object */
20 int (*getname)(PyObject *self, Py_UCS4 code, char* buffer, int buflen);
Fredrik Lundh0fdb90c2001-01-19 09:45:02 +000021
22 /* Get character code for a given name. Same error handling
23 as for getname. */
Martin v. Löwis480f1bb2006-03-09 23:38:20 +000024 int (*getcode)(PyObject *self, const char* name, int namelen, Py_UCS4* code);
Fredrik Lundh0fdb90c2001-01-19 09:45:02 +000025
26} _PyUnicode_Name_CAPI;
27
28#ifdef __cplusplus
29}
30#endif
31#endif /* !Py_UCNHASH_H */