Home | History | Annotate | Download | only in Modules

Lines Matching refs:code

46 _getrecord_ex(Py_UCS4 code)
49 if (code >= 0x110000)
52 index = index1[(code>>SHIFT)];
53 index = index2[(index<<SHIFT)+(code&((1<<SHIFT)-1))];
405 int code, index, count, i;
416 code = (int)c;
424 if (code < 0 || code >= 0x110000)
427 index = decomp_index1[(code>>DECOMP_SHIFT)];
429 (code&((1<<DECOMP_SHIFT)-1))];
433 is prefix code (from*/
464 get_decomp_record(PyObject *self, Py_UCS4 code, int *index, int *prefix, int *count)
466 if (code >= 0x110000) {
468 } else if (self && get_old_record(self, code)->category_changed==0) {
473 *index = decomp_index1[(code>>DECOMP_SHIFT)];
475 (code&((1<<DECOMP_SHIFT)-1))];
479 is prefix code (from*/
528 Py_UNICODE code = stack[--stackptr];
539 if (SBase <= code && code < (SBase+SCount)) {
540 int SIndex = code - SBase;
555 Py_UCS4 value = ((PreviousDBVersion*)self)->normalization(code);
563 get_decomp_record(self, code
568 *o++ = code;
575 code = decomp_data[index + (--count)];
576 stack[stackptr++] = code;
613 find_nfc_index(PyObject *self, struct reindex* nfc, Py_UNICODE code)
618 if (code < start)
620 if (code <= start + nfc[index].count) {
621 int delta = code - start;
634 Py_UNICODE code;
644 this code needs to be reviewed. */
671 code = SBase + (LIndex*VCount+VIndex)*TCount;
675 code += *i-TBase;
678 *o++ = code;
715 code = comp_data[(index1<<COMP_SHIFT)+
717 if (code == 0)
721 *i = code;
831 /* database code (cut and pasted from the unidb package) */
880 is_unified_ideograph(Py_UCS4 code)
883 (0x3400 <= code && code <= 0x4DB5) || /* CJK Ideograph Extension A */
884 (0x4E00 <= code && code <= 0x9FCB) || /* CJK Ideograph, Unicode 5.2 */
885 (0x20000 <= code && code <= 0x2A6D6) || /* CJK Ideograph Extension B */
886 (0x2A700 <= code && code <= 0x2B734)); /* CJK Ideograph Extension C */
890 _getucname(PyObject *self, Py_UCS4 code, char* buffer, int buflen)
897 if (code >= 0x110000)
901 const change_record *old = get_old_record(self, code);
908 if (SBase <= code && code < SBase+SCount) {
910 int SIndex = code - SBase;
930 if (is_unified_ideograph(code)) {
934 sprintf(buffer, "CJK UNIFIED IDEOGRAPH-%X", code);
939 offset = phrasebook_offset1[(code>>phrasebook_shift)];
941 (code&((1<<phrasebook_shift)-1))];
980 _cmpname(PyObject *self, int code, const char* name, int namelen)
982 /* check if code corresponds to the given name */
985 if (!_getucname(self, code, buffer, sizeof(buffer)))
1015 _getcode(PyObject* self, const char* name, int namelen, Py_UCS4* code)
1032 *code = SBase + (L*VCount+V)*TCount + T;
1059 *code = v;
1073 *code = v;
1085 *code = v;
1149 Py_UCS4 code;
1157 if (!_getcode(self, name, namelen, &code)) {
1164 if (code >= 0x10000) {
1165 str[0] = 0xd800 + ((code - 0x10000) >> 10);
1166 str[1] = 0xdc00 + ((code - 0x10000) & 0x3ff);
1170 str[0] = (Py_UNICODE) code;