You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
- 02111-1307, USA. */
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ 02110-1301, USA. */
#include <config.h>
#include "font.h"
-#include <assert.h>
+#include "error.h"
#include <stdio.h>
#include <errno.h>
#include <stdlib.h>
int space_index;
static int font_msg (int, const char *,...)
- __attribute__ ((format (printf, 2, 3)));
+ PRINTF_FORMAT (2, 3);
static void scan_badchars (char *, int);
static void dup_char_metric (struct font_desc * font, int dest, int src);
static void add_char_metric (struct font_desc * font, struct char_metrics *metrics,
/* 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:
+/* Some notes on the groff_font manpage:
DESC file format: A typical PostScript `res' would be 72000, with
`hor' and `vert' set to 1 to indicate that all those positions are
/* Reads a Groff font description file and converts it to a usable
binary format in memory. Installs the binary format in the global
- font table. See groff_font(8) for a description of the font
+ font table. See groff_font for a description of the font
description format supported. Returns nonzero on success. */
struct font_desc *
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;
/* Current location in file, used for error reporting. */
struct file_locator where;
-#if unix
+#ifdef unix
fn = fn_tilde_expand (fn);
#endif
goto file_lossage;
}
free (line);
-#if unix
+#ifdef unix
free ((char *) fn);
#endif
if (f != NULL)
fclose (f);
pool_destroy (font_pool);
-#if unix
+#ifdef unix
free ((char *) fn);
#endif
err_pop_file_locator (&where);
}
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. */