/* global options */
-int dump_bdf( fnt_fontS* cpe_font_struct, unsigned char* file_buffer);
-int dump_bdf_hdr(FILE* fs, fnt_fontS* cpe_font_struct, unsigned char* file_buffer);
-
-char* g_lpstrFileName = NULL;
-char* g_lpstrCharSet = NULL;
-char* g_lpstrInputFile = NULL;
-int g_outputPoints = 0;
-
-static const char* errorDLLRead = "Unable to read Windows DLL.\n";
-static const char* errorFNTRead = "Unable to read .FNT file.\n";
-static const char* errorOpenFile = "Unable to open file.\n";
-static const char* errorMemory = "Memory allocation error.\n";
-static const char* errorFile = "Corrupt or invalid file.\n";
-static const char* errorFontData = "Unable to parse font data: Error ";
-static const char* errorEmpty = "No fonts found.\n";
+static int dump_bdf( fnt_fontS* cpe_font_struct, unsigned char* file_buffer);
+static int dump_bdf_hdr(FILE* fs, fnt_fontS* cpe_font_struct, unsigned char* file_buffer);
+
+static char* g_lpstrFileName = NULL;
+static char* g_lpstrCharSet = NULL;
+static char* g_lpstrInputFile = NULL;
+static int g_outputPoints = 0;
/* info */
return t;
}
-int dump_bdf( fnt_fontS* cpe_font_struct, unsigned char* file_buffer)
+static int dump_bdf( fnt_fontS* cpe_font_struct, unsigned char* file_buffer)
{
FILE* fp;
int ic;
}
-int dump_bdf_hdr(FILE* fs, fnt_fontS* cpe_font_struct, unsigned char* file_buffer)
+static int dump_bdf_hdr(FILE* fs, fnt_fontS* cpe_font_struct, unsigned char* file_buffer)
{
int l_fchar = return_data_value(dfChar, &cpe_font_struct->hdr.fi.dfFirstChar),
l_lchar = return_data_value(dfChar, &cpe_font_struct->hdr.fi.dfLastChar);
if( !(lpfont = (unsigned char*) realloc( lpfont, length )) )
{
- fprintf(stderr, errorMemory );
+ fprintf(stderr, "Memory allocation error.\n" );
exit(1);
}
lseek( fd, offset, SEEK_SET );
if( read(fd, lpfont, length) != length )
{
- fprintf(stderr, errorDLLRead );
+ fprintf(stderr, "Unable to read Windows DLL.\n" );
exit(1);
}
if( (i = parse_fnt_data( lpfont, length )) )
{
- fprintf(stderr, "%s%d\n", errorFontData, i );
+ fprintf(stderr, "Unable to parse font data: Error %d\n", i );
exit(1);
}
}
}
else
{
- fprintf(stderr, errorEmpty );
+ fprintf(stderr, "No fonts found.\n" );
exit(1);
}
free( lpdata );
}
else
{
- fprintf(stderr, errorDLLRead);
+ fprintf(stderr, "Unable to read Windows DLL.\n" );
exit(1);
}
break;
{
if( (i = parse_fnt_data( lpdata, file_stat.st_size )) )
{
- fprintf(stderr, "%s%d\n", errorFontData, i );
+ fprintf(stderr, "Unable to parse font data: Error %d\n", i );
exit(1);
}
free( lpdata );
}
else
{
- fprintf(stderr, errorFNTRead);
+ fprintf(stderr, "Unable to read .FNT file.\n" );
exit(1);
}
break;
case FILE_ERROR:
- fprintf(stderr, errorFile );
+ fprintf(stderr, "Corrupt or invalid file.\n" );
exit(1);
}
close(fd);
}
else
{
- fprintf(stderr, errorOpenFile );
+ fprintf(stderr, "Unable to open '%s'.\n", g_lpstrInputFile );
exit(1);
}
}