Lines Matching refs:fcs

33     FcCharSet	*fcs;
35 fcs = (FcCharSet *) malloc (sizeof (FcCharSet));
36 if (!fcs)
38 FcRefInit (&fcs->ref, 1);
39 fcs->num = 0;
40 fcs->leaves_offset = 0;
41 fcs->numbers_offset = 0;
42 return fcs;
48 FcCharSet *fcs = (FcCharSet *) vbuf;
52 FcRefSetConst (&fcs->ref);
53 fcs->num = 0;
54 fcs->leaves_offset = 0;
55 fcs->numbers_offset = 0;
57 return fcs;
67 FcCharSetDestroy (FcCharSet *fcs)
71 if (fcs)
73 if (FcRefIsConst (&fcs->ref))
75 FcCacheObjectDereference (fcs);
78 if (FcRefDec (&fcs->ref) != 1)
80 for (i = 0; i < fcs->num; i++)
81 free (FcCharSetLeaf (fcs, i));
82 if (fcs->num)
84 free (FcCharSetLeaves (fcs));
85 free (FcCharSetNumbers (fcs));
87 free (fcs);
99 FcCharSetFindLeafForward (const FcCharSet *fcs, int start, FcChar16 num)
101 FcChar16 *numbers = FcCharSetNumbers(fcs);
104 int high = fcs->num - 1;
119 if (high < 0 || (high < fcs->num && numbers[high] < num))
131 FcCharSetFindLeafPos (const FcCharSet *fcs, FcChar32 ucs4)
133 return FcCharSetFindLeafForward (fcs, 0, ucs4 >> 8);
137 FcCharSetFindLeaf (const FcCharSet *fcs, FcChar32 ucs4)
139 int pos = FcCharSetFindLeafPos (fcs, ucs4);
141 return FcCharSetLeaf(fcs, pos);
148 FcCharSetPutLeaf (FcCharSet *fcs,
153 intptr_t *leaves = FcCharSetLeaves (fcs);
154 FcChar16 *numbers = FcCharSetNumbers (fcs);
160 if (FC_IS_ZERO_OR_POWER_OF_TWO (fcs->num))
162 if (!fcs->num)
179 unsigned int alloced = fcs->num;
194 fcs->numbers_offset = FcPtrToOffset (fcs, numbers);
199 fcs->numbers_offset = FcPtrToOffset (fcs, numbers);
203 for (i = 0; i < fcs->num; i++) {
209 fcs->leaves_offset = FcPtrToOffset (fcs, leaves);
210 fcs->numbers_offset = FcPtrToOffset (fcs, numbers);
214 (fcs->num - pos) * sizeof (*leaves));
216 (fcs->num - pos) * sizeof (*numbers));
219 fcs->num++;
229 FcCharSetFindLeafCreate (FcCharSet *fcs, FcChar32 ucs4)
234 pos = FcCharSetFindLeafPos (fcs, ucs4);
236 return FcCharSetLeaf(fcs, pos);
243 if (!FcCharSetPutLeaf (fcs, ucs4, leaf, pos))
252 FcCharSetInsertLeaf (FcCharSet *fcs, FcChar32 ucs4, FcCharLeaf *leaf)
256 pos = FcCharSetFindLeafPos (fcs, ucs4);
259 free (FcCharSetLeaf (fcs, pos));
260 FcCharSetLeaves(fcs)[pos] = FcPtrToOffset (FcCharSetLeaves(fcs),
265 return FcCharSetPutLeaf (fcs, ucs4, leaf, pos);
269 FcCharSetAddChar (FcCharSet *fcs, FcChar32 ucs4)
274 if (fcs == NULL || FcRefIsConst (&fcs->ref))
276 leaf = FcCharSetFindLeafCreate (fcs, ucs4);
285 FcCharSetDelChar (FcCharSet *fcs, FcChar32 ucs4)
290 if (fcs == NULL || FcRefIsConst (&fcs->ref))
292 leaf = FcCharSetFindLeaf (fcs, ucs4);
316 FcCharSetIterSet (const FcCharSet *fcs, FcCharSetIter *iter)
318 int pos = FcCharSetFindLeafPos (fcs, iter->ucs4);
323 if (pos == fcs->num)
329 iter->ucs4 = (FcChar32) FcCharSetNumbers(fcs)[pos] << 8;
331 iter->leaf = FcCharSetLeaf(fcs, pos);
336 FcCharSetIterNext (const FcCharSet *fcs, FcCharSetIter *iter)
339 if (pos >= fcs->num)
346 iter->ucs4 = (FcChar32) FcCharSetNumbers(fcs)[pos] << 8;
347 iter->leaf = FcCharSetLeaf(fcs, pos);
354 FcCharSetIterStart (const FcCharSet *fcs, FcCharSetIter *iter)
358 FcCharSetIterSet (fcs, iter);
398 FcCharSetAddLeaf (FcCharSet *fcs,
402 FcCharLeaf *new = FcCharSetFindLeafCreate (fcs, ucs4);
418 FcCharSet *fcs;
423 fcs = FcCharSetCreate ();
424 if (!fcs)
434 if (!FcCharSetAddLeaf (fcs, ai.ucs4, ai.leaf))
448 if (!FcCharSetAddLeaf (fcs, bi.ucs4, bi.leaf))
464 if (!FcCharSetAddLeaf (fcs, ai.ucs4, &leaf))
471 return fcs;
473 FcCharSetDestroy (fcs);
591 FcCharSetHasChar (const FcCharSet *fcs, FcChar32 ucs4)
595 if (!fcs)
597 leaf = FcCharSetFindLeaf (fcs, ucs4);
1109 FcCharSetHash (FcCharSet *fcs)
1115 for (i = 0; i < fcs->num; i++)
1116 hash = ((hash << 1) | (hash >> 31)) ^ FcCharLeafHash (FcCharSetLeaf(fcs,i));
1118 for (i = 0; i < fcs->num; i++)
1119 hash = ((hash << 1) | (hash >> 31)) ^ FcCharSetNumbers(fcs)[i];
1140 FcCharSetFreezeBase (FcCharSetFreezer *freezer, FcCharSet *fcs)
1142 FcChar32 hash = FcCharSetHash (fcs);
1151 ent->set.num == fcs->num &&
1153 FcCharSetNumbers(fcs),
1154 fcs->num * sizeof (FcChar16)))
1159 for (i = 0; i < fcs->num; i++)
1160 if (FcCharSetLeaf(&ent->set, i) != FcCharSetLeaf(fcs, i))
1168 fcs->num * sizeof (FcCharLeaf *) +
1169 fcs->num * sizeof (FcChar16));
1177 ent->set.num = fcs->num;
1178 if (fcs->num)
1184 fcs->num * sizeof (intptr_t));
1187 for (i = 0; i < fcs->num; i++)
1189 FcCharSetLeaf (fcs, i));
1191 FcCharSetNumbers (fcs),
1192 fcs->num * sizeof (FcChar16));
1220 FcCharSetFreeze (FcCharSetFreezer *freezer, const FcCharSet *fcs)
1230 for (i = 0; i < fcs->num; i++)
1232 l = FcCharSetFreezeLeaf (freezer, FcCharSetLeaf(fcs, i));
1235 if (!FcCharSetInsertLeaf (b, FcCharSetNumbers(fcs)[i] << 8, l))
1239 if (!FcCharSetFreezeOrig (freezer, fcs, n))
1245 freezer->leaves_seen += fcs->num;