diff --git a/bitmap.c b/bitmap.c index 68f174c..0af0eb5 100644 --- a/bitmap.c +++ b/bitmap.c @@ -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, size_t *dest_len); - /* * Return required buffer size for a narrow font character converted * to XBM image format. @@ -1285,78 +1284,3 @@ eb_bitmap_to_png(const char *bitmap, int width, int height, char *png, #undef INT2CHARS #undef RGB2CHARS - - -#ifdef TEST - -#include -#include -#include - -#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 */ diff --git a/book.c b/book.c index 4abebd7..7dfeda7 100644 --- a/book.c +++ b/book.c @@ -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 void eb_load_language(EB_Book *book); - /* * Initialize `book'. */ @@ -73,7 +72,6 @@ eb_initialize_book(EB_Book *book) LOG(("out: eb_initialize_book()")); } - /* * Bind `book' to `path'. */ diff --git a/build-pre.h b/build-pre.h index 20cb88a..3ac81e4 100644 --- a/build-pre.h +++ b/build-pre.h @@ -42,16 +42,6 @@ #include #include -/* - * 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(). */ @@ -80,12 +70,4 @@ #define _(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 */ diff --git a/error.c b/error.c index c6a8bbd..b86d799 100644 --- a/error.c +++ b/error.c @@ -269,9 +269,5 @@ eb_error_message(EB_Error_Code error_code) else message = N_("unknown error"); -#ifdef ENABLE_NLS - message = dgettext(EB_TEXT_DOMAIN_NAME, message); -#endif /* ENABLE_NLS */ - return message; } diff --git a/error.h b/error.h index 2ba7cde..543d42e 100644 --- a/error.h +++ b/error.h @@ -113,7 +113,6 @@ #define EB_ERR_UNBOUND_BOOKLIST 67 #define EB_ERR_NO_SUCH_BOOK 68 - /* * The number of error codes. */ diff --git a/log.c b/log.c index a0a2550..c354a66 100644 --- a/log.c +++ b/log.c @@ -130,7 +130,7 @@ eb_log_stderr(const char *message, va_list ap) } -#define MAX_QUOTED_STREAM_LENGTH 100 +#define MAX_QUOTED_STREAM_LENGTH 100 /* * Return Quoted printable string of `stream'. diff --git a/narwalt.c b/narwalt.c index 5a14be0..5483337 100644 --- a/narwalt.c +++ b/narwalt.c @@ -43,7 +43,7 @@ static EB_Error_Code eb_narrow_character_text_latin(EB_Appendix *appendix, /* * Hash macro for cache data. */ -#define EB_HASH_ALT_CACHE(c) ((c) & 0x0f) +#define EB_HASH_ALT_CACHE(c) ((c) & 0x0f) /* diff --git a/narwfont.c b/narwfont.c index ada0e19..a7e6c6f 100644 --- a/narwfont.c +++ b/narwfont.c @@ -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, int character_number, char *bitmap); - /* * Open a font file. */ diff --git a/readtext.c b/readtext.c index 27c6b4d..02a0bc3 100644 --- a/readtext.c +++ b/readtext.c @@ -35,17 +35,17 @@ /* * The maximum number of arguments for an escape sequence. */ -#define EB_MAX_ARGV 7 +#define EB_MAX_ARGV 7 /* * Read next when the length of cached data is shorter than this value. */ -#define SIZE_FEW_REST 48 +#define SIZE_FEW_REST 48 /* * Special skip-code that represents `no skip-code is set'. */ -#define SKIP_CODE_NONE -1 +#define SKIP_CODE_NONE -1 /* * Cache data buffer. @@ -2094,5 +2094,3 @@ eb_backward_text(EB_Book *book, EB_Appendix *appendix) LOG(("out: eb_backward_text() = %s", eb_error_string(error_code))); return error_code; } - - diff --git a/search.c b/search.c index 576b372..b01c788 100644 --- a/search.c +++ b/search.c @@ -35,16 +35,16 @@ /* * Page-ID macros. */ -#define PAGE_ID_IS_LEAF_LAYER(page_id) (((page_id) & 0x80) == 0x80) -#define PAGE_ID_IS_LAYER_START(page_id) (((page_id) & 0x40) == 0x40) -#define PAGE_ID_IS_LAYER_END(page_id) (((page_id) & 0x20) == 0x20) -#define PAGE_ID_HAVE_GROUP_ENTRY(page_id) (((page_id) & 0x10) == 0x10) +#define PAGE_ID_IS_LEAF_LAYER(page_id) (((page_id) & 0x80) == 0x80) +#define PAGE_ID_IS_LAYER_START(page_id) (((page_id) & 0x40) == 0x40) +#define PAGE_ID_IS_LAYER_END(page_id) (((page_id) & 0x20) == 0x20) +#define PAGE_ID_HAVE_GROUP_ENTRY(page_id) (((page_id) & 0x10) == 0x10) /* * The maximum number of hit entries for tomporary hit lists. * This is used in eb_hit_list(). */ -#define EB_TMP_MAX_HITS 64 +#define EB_TMP_MAX_HITS 64 /* * Book-code of the book in which you want to search a word. diff --git a/text.c b/text.c index e7dde81..7a375b3 100644 --- a/text.c +++ b/text.c @@ -111,5 +111,3 @@ eb_text(EB_Book *book, EB_Position *position) LOG(("out: eb_text() = %s", eb_error_string(error_code))); return error_code; } - - diff --git a/zio.c b/zio.c index 7a4eb80..b094050 100644 --- a/zio.c +++ b/zio.c @@ -45,23 +45,6 @@ #define O_BINARY 0 #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. */ @@ -95,7 +78,7 @@ extern void eb_log(const char *, ...); /* * Size of a page (The term `page' means `block' in JIS X 4081). */ -#define ZIO_SIZE_PAGE 2048 +#define ZIO_SIZE_PAGE 2048 /* * Size of a cache buffer. @@ -109,7 +92,7 @@ extern void eb_log(const char *, ...); /* * NULL Zio ID. */ -#define ZIO_ID_NONE -1 +#define ZIO_ID_NONE -1 /* * Buffer for caching uncompressed data.