Commit d62b85af authored by Behdad Esfahbod's avatar Behdad Esfahbod

[fclang] Implement FcLangSetGetLangs() (#18846)

parent cdfb7658
......@@ -123,6 +123,14 @@ function returns FcLangDiffentTerritory. If <parameter>ls</parameter>
has no matching language, this function returns FcLangDifferentLang.
@RET@ FcStrSet *
@FUNC@ FcLangSetGetLangs
@TYPE1@ const FcLangSet * @ARG1@ ls
@PURPOSE@ get the list of languages in the langset
Returns a string set of all languages in <parameter>langset</parameter>.
@RET@ FcStrSet *
@FUNC@ FcGetLangs
@TYPE1@ void
......@@ -597,6 +597,9 @@ FcLangSetEqual (const FcLangSet *lsa, const FcLangSet *lsb);
FcPublic FcChar32
FcLangSetHash (const FcLangSet *ls);
FcPublic FcStrSet *
FcLangSetGetLangs (const FcLangSet *ls);
/* fclist.c */
FcPublic FcObjectSet *
FcObjectSetCreate (void);
......@@ -744,6 +744,38 @@ FcLangSetSerialize(FcSerialize *serialize, const FcLangSet *l)
*l_serialize = *l;
return l_serialize;
FcStrSet *
FcLangSetGetLangs (const FcLangSet *ls)
FcStrSet *langs;
int i;
langs = FcStrSetCreate();
if (!langs)
return 0;
for (i = 0; i < NUM_LANG_CHAR_SET; i++)
if (FcLangSetBitGet (ls, i))
FcStrSetAdd (langs, fcLangCharSets[i].lang);
if (ls->extra)
FcStrList *list = FcStrListCreate (ls->extra);
FcChar8 *extra;
if (list)
while ((extra = FcStrListNext (list)))
FcStrSetAdd (langs, extra);
FcStrListDone (list);
return langs;
#define __fclang__
#include "fcaliastail.h"
#include "fcftaliastail.h"
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