Lines Matching refs:code
42 * The new implementation of the normalization code loads its data from
97 typedef void EnumTrieFn(void *context, uint32_t code, Norm *norm);
110 * set a flag for each code point that was seen in decompositions -
122 * after processCombining() this contains for each code point in combiningCPs[]
131 * Structure for a triple of code points, stored in combiningTriplesMem.
132 * The lead and trail code points combine into the the combined one,
137 * code point in the combiningCPs[] array.
139 * They are not sorted by code points.
210 /* set the minimum code points for no/maybe quick check values to the end of the BMP */
225 createNorm(uint32_t code) {
229 i=utrie_get32(normTrie, (UChar32)code, NULL);
235 if(!utrie_set32(normTrie, (UChar32)code, (uint32_t)(p-norms))) {
245 getNorm(uint32_t code) {
248 i=utrie_get32(normTrie, (UChar32)code, NULL);
257 getCCFromCP(uint32_t code) {
258 Norm *norm=getNorm(code);
267 * enumerate all code points with their Norm structs and call a function for each
268 * return the number of code points with data
273 UChar32 code;
277 for(code=0; code<=0x10ffff;) {
278 i=utrie_get32(normTrie, code, &isInBlockZero);
280 code+=UTRIE_DATA_BLOCK_LENGTH;
283 fn(context, (uint32_t)code, norms+i);
286 ++code;
308 * Insert an entry into combiningCPs[] for the new code point code with its flags.
309 * The flags indicate if code combines forward, backward, or both.
312 * 1. code points that combine forward
313 * 2. code points that combine forward and backward
314 * 3. code points that combine backward
316 * Search for code in the entire array.
323 * Within each section, the code points are not sorted.
326 addCombiningCP(uint32_t code, uint8_t flags) {
330 newEntry=code|((uint32_t)flags<<24);
332 /* search for this code point */
334 if(code==(combiningCPs[i]&0xffffff)) {
357 fprintf(stderr, "error: gennorm combining code points - trying to use more than %ld units\n",
373 /* move the following code points up one and insert newEntry at i */
384 * Find the index in combiningCPs[] where code point code is stored.
385 * @param code code point to look for
386 * @param isLead is code a forward combining code point?
387 * @return index in combiningCPs[] where code is stored
390 findCombiningCP(uint32_t code, UBool isLead) {
401 /* search for this code point */
403 if(code==(combiningCPs[i]&0xffffff)) {
422 * set combiningFlags for the two code points
462 /* findCombiningCP() must always find the code point */
481 /* calculate the length of the combining data for this lead code point in the combiningTable */
483 /* count 2 to 3 16-bit units per composition entry (back-index, code point) */
523 /* store the combining data for this lead code point in the combiningTable */
565 * c must be a Hangul syllable code point.
603 decompStoreNewNF(uint32_t code, Norm *norm) {
627 /* decompose each code point */
673 addCombiningTriple(s32[0], s32[1], code);
710 decompWithSingleFn(void *context, uint32_t code, Norm *norm) {
805 * process the data for one code point listed in UnicodeData;
806 * UnicodeData itself never maps a code point to both NFD and NFKD
809 storeNorm(uint32_t code, Norm *norm) {
819 p=createNorm(code);
827 decompStoreNewNF(code, norm);
829 /* has this code point been used in previous decompositions? */
830 if(HAVE_SEEN(code)) {
832 decompSingle.c=code;
843 setQCFlags(uint32_t code, uint8_t qcFlags) {
859 createNorm(code)->qcFlags|=qcFlags;
861 /* adjust the minimum code point for quick check no/maybe */
862 if(code<0xffff) {
863 if((qcFlags&_NORM_QC_NFC) && (uint16_t)code<indexes[_NORM_INDEX_MIN_NFC_NO_MAYBE]) {
864 indexes[_NORM_INDEX_MIN_NFC_NO_MAYBE]=(uint16_t)code;
866 if((qcFlags&_NORM_QC_NFKC) && (uint16_t)code<indexes[_NORM_INDEX_MIN_NFKC_NO_MAYBE]) {
867 indexes[_NORM_INDEX_MIN_NFKC_NO_MAYBE]=(uint16_t)code;
869 if((qcFlags&_NORM_QC_NFD) && (uint16_t)code<indexes[_NORM_INDEX_MIN_NFD_NO_MAYBE]) {
870 indexes[_NORM_INDEX_MIN_NFD_NO_MAYBE]=(uint16_t)code;
872 if((qcFlags&_NORM_QC_NFKD) && (uint16_t)code<indexes[_NORM_INDEX_MIN_NFKD_NO_MAYBE]) {
873 indexes[_NORM_INDEX_MIN_NFKD_NO_MAYBE]=(uint16_t)code;
878 uset_add(nfdQCNoSet, (UChar32)code);
883 setCompositionExclusion(uint32_t code) {
885 createNorm(code)->combiningFlags|=0x80;
1020 /* get the i-th code point and its combining class */
1031 /* move the previous code point here and go back */
1057 postParseFn(void *context, uint32_t code, Norm *norm) {
1072 /* verify that code has a decomposition if and only if the quick check flags say "no" on NF(K)D */
1074 fprintf(stderr, "gennorm warning: U+%04lx has NFD[%d] but quick check 0x%02x\n", (long)code, norm->lenNFD, norm->qcFlags);
1077 fprintf(stderr, "gennorm warning: U+%04lx has NFD[%d] NFKD[%d] but quick check 0x%02x\n", (long)code, norm->lenNFD, norm->lenNFKD, norm->qcFlags);
1088 fprintf(stderr, "gennorm warning: U+%04lx combines forward but udataCC==%u\n", (long)code, norm->udataCC);
1093 code);
1098 printf("U+%04lx combines backward but udataCC==0\n", (long)code);
1103 printf("U+%04lx combines both ways\n", (long)code);
1110 * add the current character (code) to the set of canonical starters of its norm->nfd[0]
1119 /* nfd[0].canonStart.add(code) */
1123 otherNorm->canonStart=uset_open(code, code);
1129 uset_add(otherNorm->canonStart, code);
1130 if(!uset_contains(otherNorm->canonStart, code)) {
1131 fprintf(stderr, "gennorm error: uset_add(setOf(U+%4x), U+%4x)\n", (int)c, (int)code);
1235 extra[beforeZero]|=(UChar)(count-start); /* set the decomp length as the number of UTF-16 code units */
1248 extra[beforeZero]|=(UChar)((count-start)<<8); /* set the decomp length as the number of UTF-16 code units */
1338 if (len==0 && start==end) { /* a range (len==0) with a single code point */
1346 makeCanonSetFn(void *context, uint32_t code, Norm *norm) {
1352 /* does the set contain exactly one code point? */
1356 if(code<=0xffff) {
1360 table[tableLength++]=(uint16_t)code;
1363 /* single-code point BMP result for BMP code point */
1374 table[tableLength++]=(uint16_t)(code>>16);
1375 table[tableLength++]=(uint16_t)code;
1378 /* single-code point result for supplementary code point */
1411 /* combine the lead and trail code points; return <0 if they do not combine */
1417 /* search for all triples with c as lead code point */
1421 /* triples are not sorted by code point but for each lead CP there is one contiguous block */
1424 /* check each triple for this code point */
1435 * Starting from the canonical decomposition s[0..length[ of a single code point,
1436 * is the code point c consumed in an NFC/FCC recomposition?
1489 * i.e., the decomposition recomposes completely back into the original code point.
1491 * combining with following code points.
1529 /* search for all triples with c as lead code point */
1534 /* triples are not sorted by code point but for each lead CP there is one contiguous block */
1537 /* check each triple for this code point */
1541 /* this trail code point combines with c and has cc<trailCC */
1585 * (a) unassigned code points get "not skippable"==false because they
1604 * see if any of the second code points in the list
1696 * "or" [verb!] together data bits 15..10 of all of the 1024 supplementary code points
1972 /* the quick check minimum code points are already set */
2027 /* delete lead surrogate code unit values */
2037 "gennorm error: deleting lead surrogate code unit values failed - %s\n",