summaryrefslogtreecommitdiff
path: root/src/fclist.c
diff options
context:
space:
mode:
authorBehdad Esfahbod <behdad@behdad.org>2008-08-13 02:24:42 -0400
committerBehdad Esfahbod <behdad@behdad.org>2009-02-13 16:53:56 -0800
commit29874098537e763e8e4cd3fefb1ecc0f36b808a5 (patch)
tree89c21bdd57d49373ab772d23c55fd40b9ab9320a /src/fclist.c
parent77c0d8bce86ca088782d5631617c0ef681d91312 (diff)
downloadfontconfig-29874098537e763e8e4cd3fefb1ecc0f36b808a5.tar.gz
Implement fc-list --verbose (#13015)
A private FcObjectGetSet() is implemented that provides an FcObjectSet of all registered elements. FcFontSetList() is then modified to use the object set from FcObjectGetSet() if provided object-set is NULL. Alternatively FcObjectGetSet() can be made public. In that case fc-list can use that as a base if --verbose is included, and also add any elements provided by the user (though that has no effect, as all elements from the cache are already registered). Currently fc-list ignores user-provided elements if --verbose is specified.
Diffstat (limited to 'src/fclist.c')
-rw-r--r--src/fclist.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/fclist.c b/src/fclist.c
index a0306ca..2a53b79 100644
--- a/src/fclist.c
+++ b/src/fclist.c
@@ -457,6 +457,7 @@ FcFontSetList (FcConfig *config,
FcListHashTable table;
int i;
FcListBucket *bucket;
+ int destroy_os = 0;
if (!config)
{
@@ -468,6 +469,13 @@ FcFontSetList (FcConfig *config,
goto bail0;
}
FcListHashTableInit (&table);
+
+ if (!os)
+ {
+ os = FcObjectGetSet ();
+ destroy_os = 1;
+ }
+
/*
* Walk all available fonts adding those that
* match to the hash table
@@ -532,6 +540,8 @@ bail2:
bail1:
FcListHashTableCleanup (&table);
bail0:
+ if (destroy_os)
+ FcObjectSetDestroy (os);
return 0;
}