Commit 52960d05 authored by Behdad Esfahbod's avatar Behdad Esfahbod

Add new public API: FcCharSetDelChar()

parent 9d8d0226
......@@ -51,6 +51,17 @@ returning FcFalse on failure, either as a result of a constant set or from
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
......
......@@ -423,6 +423,9 @@ FcCharSetDestroy (FcCharSet *fcs);
FcPublic FcBool
FcCharSetAddChar (FcCharSet *fcs, FcChar32 ucs4);
FcPublic FcBool
FcCharSetDelChar (FcCharSet *fcs, FcChar32 ucs4);
FcPublic FcCharSet*
FcCharSetCopy (FcCharSet *src);
......
......@@ -262,6 +262,23 @@ FcCharSetAddChar (FcCharSet *fcs, FcChar32 ucs4)
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
*/
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment