running out of memory.
@@
+@RET@ FcBool
+@FUNC@ FcCharSetDelChar
+@TYPE1@ FcCharSet * @ARG1@ fcs
+@TYPE2@ FcChar32% @ARG2@ ucs4
+@PURPOSE@ Add a character to a charset
+@DESC@
+<function>FcCharSetDelChar</function> deletes a single unicode char from the set,
+returning FcFalse on failure, either as a result of a constant set or from
+running out of memory.
+@@
+
@RET@ FcCharSet *
@FUNC@ FcCharSetCopy
@TYPE1@ FcCharSet * @ARG1@ src
FcPublic FcBool
FcCharSetAddChar (FcCharSet *fcs, FcChar32 ucs4);
+FcPublic FcBool
+FcCharSetDelChar (FcCharSet *fcs, FcChar32 ucs4);
+
FcPublic FcCharSet*
FcCharSetCopy (FcCharSet *src);
return FcTrue;
}
+FcBool
+FcCharSetDelChar (FcCharSet *fcs, FcChar32 ucs4)
+{
+ FcCharLeaf *leaf;
+ FcChar32 *b;
+
+ if (fcs->ref == FC_REF_CONSTANT)
+ return FcFalse;
+ leaf = FcCharSetFindLeaf (fcs, ucs4);
+ if (!leaf)
+ return FcTrue;
+ b = &leaf->map[(ucs4 & 0xff) >> 5];
+ *b &= ~(1 << (ucs4 & 0x1f));
+ /* We don't bother removing the leaf if it's empty */
+ return FcTrue;
+}
+
/*
* An iterator for the leaves of a charset
*/