1

More cleanup

This commit is contained in:
Alex Yatskov 2021-01-09 15:36:33 -08:00
parent 13de8b5081
commit 41f2d1a280
12 changed files with 12 additions and 135 deletions

View File

@ -41,7 +41,6 @@ static unsigned long png_crc(const char *buf, size_t len);
static int png_compress(const char *src, int width, int height, char *dest, static int png_compress(const char *src, int width, int height, char *dest,
size_t *dest_len); size_t *dest_len);
/* /*
* Return required buffer size for a narrow font character converted * Return required buffer size for a narrow font character converted
* to XBM image format. * to XBM image format.
@ -1285,78 +1284,3 @@ eb_bitmap_to_png(const char *bitmap, int width, int height, char *png,
#undef INT2CHARS #undef INT2CHARS
#undef RGB2CHARS #undef RGB2CHARS
#ifdef TEST
#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>
#define test_width 32
#define test_height 16
static unsigned char test_bitmap[] = {
0xff, 0xff, 0xff, 0xff, 0x80, 0x81, 0x83, 0x01, 0x80, 0x81, 0x01, 0x01,
0x80, 0x81, 0x01, 0x01, 0xe3, 0x8f, 0x11, 0xc7, 0xe3, 0x8f, 0x0f, 0xc7,
0xe3, 0x81, 0x87, 0xc7, 0xe3, 0x81, 0xc3, 0xc7, 0xe3, 0x81, 0xe1, 0xc7,
0xe3, 0x8f, 0x11, 0xc7, 0xe3, 0x8f, 0x11, 0xc7, 0xe3, 0x81, 0x01, 0xc7,
0xe3, 0x81, 0x01, 0xc7, 0xe3, 0x81, 0x83, 0xc7, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff
};
int
main(int argc, char *argv[])
{
char image[EB_SIZE_FONT_IMAGE];
size_t image_size;
int file;
eb_bitmap_to_xbm(test_bitmap, test_width, test_height, image, &image_size);
file = creat("test.xbm", 0644);
if (file < 0)
exit(1);
if (write(file, image, image_size) != image_size) {
close(file);
exit(1);
}
eb_bitmap_to_xpm(test_bitmap, test_width, test_height, image, &image_size);
file = creat("test.xpm", 0644);
if (file < 0)
exit(1);
if (write(file, image, image_size) != image_size) {
close(file);
exit(1);
}
eb_bitmap_to_gif(test_bitmap, test_width, test_height, image, &image_size);
file = creat("test.gif", 0644);
if (file < 0)
exit(1);
if (write(file, image, image_size) != image_size) {
close(file);
exit(1);
}
eb_bitmap_to_bmp(test_bitmap, test_width, test_height, image, &image_size);
file = creat("test.bmp", 0644);
if (file < 0)
exit(1);
if (write(file, image, image_size) != image_size) {
close(file);
exit(1);
}
eb_bitmap_to_png(test_bitmap, test_width, test_height, image, &image_size);
file = creat("test.png", 0644);
if (file < 0)
exit(1);
if (write(file, image, image_size) != image_size) {
close(file);
exit(1);
}
return 0;
}
#endif /* TEST */

2
book.c
View File

@ -49,7 +49,6 @@ static EB_Error_Code eb_load_catalog_epwing(EB_Book *book,
static Zio_Code eb_get_hint_zio_code(int catalog_hint_value); static Zio_Code eb_get_hint_zio_code(int catalog_hint_value);
static void eb_load_language(EB_Book *book); static void eb_load_language(EB_Book *book);
/* /*
* Initialize `book'. * Initialize `book'.
*/ */
@ -73,7 +72,6 @@ eb_initialize_book(EB_Book *book)
LOG(("out: eb_initialize_book()")); LOG(("out: eb_initialize_book()"));
} }
/* /*
* Bind `book' to `path'. * Bind `book' to `path'.
*/ */

View File

@ -42,16 +42,6 @@
#include <fcntl.h> #include <fcntl.h>
#include <sys/time.h> #include <sys/time.h>
/*
* stat() macros.
*/
#ifndef S_ISREG
#define S_ISREG(m) (((m) & S_IFMT) == S_IFREG)
#endif
#ifndef S_ISDIR
#define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
#endif
/* /*
* Flags for open(). * Flags for open().
*/ */
@ -80,12 +70,4 @@
#define _(string) (string) #define _(string) (string)
#define N_(string) (string) #define N_(string) (string)
/*
* Fake missing function names.
*/
#ifndef HAVE_STRCASECMP
#define strcasecmp eb_strcasecmp
#define strncasecmp eb_strncasecmp
#endif
#endif /* EB_BUILD_PRE_H */ #endif /* EB_BUILD_PRE_H */

View File

@ -269,9 +269,5 @@ eb_error_message(EB_Error_Code error_code)
else else
message = N_("unknown error"); message = N_("unknown error");
#ifdef ENABLE_NLS
message = dgettext(EB_TEXT_DOMAIN_NAME, message);
#endif /* ENABLE_NLS */
return message; return message;
} }

View File

@ -113,7 +113,6 @@
#define EB_ERR_UNBOUND_BOOKLIST 67 #define EB_ERR_UNBOUND_BOOKLIST 67
#define EB_ERR_NO_SUCH_BOOK 68 #define EB_ERR_NO_SUCH_BOOK 68
/* /*
* The number of error codes. * The number of error codes.
*/ */

View File

@ -40,7 +40,6 @@ static EB_Error_Code eb_narrow_character_bitmap_jis(EB_Book *book,
static EB_Error_Code eb_narrow_character_bitmap_latin(EB_Book *book, static EB_Error_Code eb_narrow_character_bitmap_latin(EB_Book *book,
int character_number, char *bitmap); int character_number, char *bitmap);
/* /*
* Open a font file. * Open a font file.
*/ */

View File

@ -2094,5 +2094,3 @@ eb_backward_text(EB_Book *book, EB_Appendix *appendix)
LOG(("out: eb_backward_text() = %s", eb_error_string(error_code))); LOG(("out: eb_backward_text() = %s", eb_error_string(error_code)));
return error_code; return error_code;
} }

2
text.c
View File

@ -111,5 +111,3 @@ eb_text(EB_Book *book, EB_Position *position)
LOG(("out: eb_text() = %s", eb_error_string(error_code))); LOG(("out: eb_text() = %s", eb_error_string(error_code)));
return error_code; return error_code;
} }

17
zio.c
View File

@ -45,23 +45,6 @@
#define O_BINARY 0 #define O_BINARY 0
#endif #endif
/*
* The maximum length of path name.
*/
#ifndef PATH_MAX
#ifdef MAXPATHLEN
#define PATH_MAX MAXPATHLEN
#else /* not MAXPATHLEN */
#define PATH_MAX 1024
#endif /* not MAXPATHLEN */
#endif /* not PATH_MAX */
/*
* Mutual exclusion lock of Pthreads.
*/
#ifndef ENABLE_PTHREAD
#endif
/* /*
* Debug message handler. * Debug message handler.
*/ */