X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fgroff-font.c;h=2787a793c9d35a53c34aa686f7c83b8bad6fd1ba;hb=ff2389320fc25c3598a2fa75ea30f50f260b3ba6;hp=e4df2cff7c94788222323fc06eab5d610b251750;hpb=7b98b3a4f58f6dc5a8e9cbc188b627966d5e652d;p=pspp diff --git a/src/groff-font.c b/src/groff-font.c index e4df2cff7c..2787a793c9 100644 --- a/src/groff-font.c +++ b/src/groff-font.c @@ -19,7 +19,7 @@ #include #include "font.h" -#include +#include "error.h" #include #include #include @@ -48,12 +48,6 @@ static void add_kern (struct font_desc * font, int ch1, int ch2, int adjust); /* Typical whitespace characters for tokenizing. */ static const char whitespace[] = " \t\n\r\v"; -void -groff_init (void) -{ - space_index = font_char_name_to_index ("space"); -} - /* Some notes on the groff_font(8) manpage: DESC file format: A typical PostScript `res' would be 72000, with @@ -92,7 +86,7 @@ groff_read_font (const char *fn) char *key; /* 0=kernpairs section, 1=charset section. */ - int charset; + int charset = 0; /* Index for previous line. */ int prev_index = -1; @@ -447,6 +441,20 @@ static struct } hash; +void +groff_init (void) +{ + space_index = font_char_name_to_index ("space"); +} + +void +groff_done (void) +{ + free (hash.tab) ; + pool_destroy(hash.ar); +} + + /* Searches for NAME in the global character code table, returns the index if found; otherwise inserts NAME and returns the new index. */