jpayne@69: /* Unicode name database interface */ jpayne@69: #ifndef Py_LIMITED_API jpayne@69: #ifndef Py_UCNHASH_H jpayne@69: #define Py_UCNHASH_H jpayne@69: #ifdef __cplusplus jpayne@69: extern "C" { jpayne@69: #endif jpayne@69: jpayne@69: /* revised ucnhash CAPI interface (exported through a "wrapper") */ jpayne@69: jpayne@69: #define PyUnicodeData_CAPSULE_NAME "unicodedata.ucnhash_CAPI" jpayne@69: jpayne@69: typedef struct { jpayne@69: jpayne@69: /* Size of this struct */ jpayne@69: int size; jpayne@69: jpayne@69: /* Get name for a given character code. Returns non-zero if jpayne@69: success, zero if not. Does not set Python exceptions. jpayne@69: If self is NULL, data come from the default version of the database. jpayne@69: If it is not NULL, it should be a unicodedata.ucd_X_Y_Z object */ jpayne@69: int (*getname)(PyObject *self, Py_UCS4 code, char* buffer, int buflen, jpayne@69: int with_alias_and_seq); jpayne@69: jpayne@69: /* Get character code for a given name. Same error handling jpayne@69: as for getname. */ jpayne@69: int (*getcode)(PyObject *self, const char* name, int namelen, Py_UCS4* code, jpayne@69: int with_named_seq); jpayne@69: jpayne@69: } _PyUnicode_Name_CAPI; jpayne@69: jpayne@69: #ifdef __cplusplus jpayne@69: } jpayne@69: #endif jpayne@69: #endif /* !Py_UCNHASH_H */ jpayne@69: #endif /* !Py_LIMITED_API */