summaryrefslogtreecommitdiff
path: root/fc-glyphname
diff options
context:
space:
mode:
authorCarl Worth <cworth@cworth.org>2003-08-15 19:45:20 +0000
committerCarl Worth <cworth@cworth.org>2003-08-15 19:45:20 +0000
commit34cd0514a215d65af6822eba2c2f0cd04eb0065f (patch)
treec67c425f6540c2ee5b6227a0c247ea2395b817c5 /fc-glyphname
parent18906a876aa13550b1a10550ceeef6df0c4473ec (diff)
Added new FcFini function for cleaning up all memory. Fixed a few memory
leaks. fc-list now calls FcFini, (and is now leak-free according to valgrind)
Diffstat (limited to 'fc-glyphname')
-rw-r--r--fc-glyphname/fc-glyphname.c35
1 files changed, 28 insertions, 7 deletions
diff --git a/fc-glyphname/fc-glyphname.c b/fc-glyphname/fc-glyphname.c
index fb18fea..769f4be 100644
--- a/fc-glyphname/fc-glyphname.c
+++ b/fc-glyphname/fc-glyphname.c
@@ -24,6 +24,27 @@
#include "fcint.h"
+static int
+rawindex (FcGlyphName *gn);
+
+static void
+scan (FILE *f, char *filename);
+
+static int
+isprime (int i);
+
+static void
+find_hash (void);
+
+static FcChar32
+FcHashGlyphName (const FcChar8 *name);
+
+static void
+insert (FcGlyphName *gn, FcGlyphName **table, FcChar32 h);
+
+static void
+dump (FcGlyphName **table, char *name);
+
static FcGlyphName *
FcAllocGlyphName (FcChar32 ucs, FcChar8 *name)
{
@@ -55,7 +76,7 @@ FcGlyphName *name_to_ucs[MAX_GLYPHNAME*2];
FcGlyphName *ucs_to_name[MAX_GLYPHNAME*2];
int hash, rehash;
-int
+static int
rawindex (FcGlyphName *gn)
{
int i;
@@ -66,7 +87,7 @@ rawindex (FcGlyphName *gn)
return -1;
}
-void
+static void
scan (FILE *f, char *filename)
{
char buf[MAX_NAMELEN];
@@ -122,7 +143,7 @@ isqrt (int a)
return h;
}
-int
+static int
isprime (int i)
{
int l, t;
@@ -146,7 +167,7 @@ isprime (int i)
* Find a prime pair that leaves at least 25% of the hash table empty
*/
-void
+static void
find_hash (void)
{
int h;
@@ -160,7 +181,7 @@ find_hash (void)
rehash = h-2;
}
-FcChar32
+static FcChar32
FcHashGlyphName (const FcChar8 *name)
{
FcChar32 h = 0;
@@ -173,7 +194,7 @@ FcHashGlyphName (const FcChar8 *name)
return h;
}
-void
+static void
insert (FcGlyphName *gn, FcGlyphName **table, FcChar32 h)
{
int i, r = 0;
@@ -189,7 +210,7 @@ insert (FcGlyphName *gn, FcGlyphName **table, FcChar32 h)
table[i] = gn;
}
-void
+static void
dump (FcGlyphName **table, char *name)
{
int i;