Mon, 26 Aug 2002 06:03:55 +0000
now use C99 stdint.h and stdbool.h
Makefile | file | annotate | diff | revisions | |
bitblt.c | file | annotate | diff | revisions | |
bitblt.h | file | annotate | diff | revisions | |
bitblt_test.c | file | annotate | diff | revisions | |
parser.y | file | annotate | diff | revisions | |
scanner.l | file | annotate | diff | revisions | |
semantics.c | file | annotate | diff | revisions | |
semantics.h | file | annotate | diff | revisions | |
t2p.c | file | annotate | diff | revisions | |
t2p.h | file | annotate | diff | revisions | |
tumble.c | file | annotate | diff | revisions | |
tumble.h | file | annotate | diff | revisions | |
type.h | file | annotate | diff | revisions |
1.1 --- a/Makefile Mon Aug 26 05:43:49 2002 +0000 1.2 +++ b/Makefile Mon Aug 26 06:03:55 2002 +0000 1.3 @@ -1,6 +1,6 @@ 1.4 # t2p: build a PDF file out of one or more TIFF Class F Group 4 files 1.5 # Makefile 1.6 -# $Id: Makefile,v 1.9 2002/01/30 00:55:53 eric Exp $ 1.7 +# $Id: Makefile,v 1.10 2002/08/25 22:03:55 eric Exp $ 1.8 # Copyright 2001 Eric Smith <eric@brouhaha.com> 1.9 # 1.10 # This program is free software; you can redistribute it and/or modify 1.11 @@ -25,7 +25,7 @@ 1.12 YFLAGS = -d -v 1.13 1.14 SRCS = bitblt.c bitblt_test.c t2p.c semantics.c 1.15 -HDRS = type.h bitblt.h t2p.h semantics.h 1.16 +HDRS = bitblt.h t2p.h semantics.h 1.17 MISC = Makefile scanner.l parser.y 1.18 1.19 TARGETS = t2p bitblt_test
2.1 --- a/bitblt.c Mon Aug 26 05:43:49 2002 +0000 2.2 +++ b/bitblt.c Mon Aug 26 06:03:55 2002 +0000 2.3 @@ -1,16 +1,17 @@ 2.4 +#include <stdbool.h> 2.5 +#include <stdint.h> 2.6 #include <assert.h> 2.7 #include <stdio.h> 2.8 #include <stdlib.h> 2.9 #include <string.h> 2.10 2.11 -#include "type.h" 2.12 #include "bitblt.h" 2.13 2.14 2.15 #define DIV_ROUND_UP(count,pow2) (((count) - 1) / (pow2) + 1) 2.16 2.17 2.18 -static const u8 bit_reverse_byte [0x100] = 2.19 +static const uint8_t bit_reverse_byte [0x100] = 2.20 { 2.21 0x00, 0x80, 0x40, 0xc0, 0x20, 0xa0, 0x60, 0xe0, 2.22 0x10, 0x90, 0x50, 0xd0, 0x30, 0xb0, 0x70, 0xf0, 2.23 @@ -47,7 +48,7 @@ 2.24 }; 2.25 2.26 2.27 -void reverse_bits (u8 *p, int byte_count) 2.28 +void reverse_bits (uint8_t *p, int byte_count) 2.29 { 2.30 while (byte_count--) 2.31 { 2.32 @@ -69,7 +70,7 @@ 2.33 static word_type *temp_buffer; 2.34 static word_type temp_buffer_size; 2.35 2.36 -static void realloc_temp_buffer (u32 size) 2.37 +static void realloc_temp_buffer (uint32_t size) 2.38 { 2.39 if (size <= temp_buffer_size) 2.40 return; 2.41 @@ -121,8 +122,8 @@ 2.42 Bitmap *create_bitmap (Rect *rect) 2.43 { 2.44 Bitmap *bitmap; 2.45 - u32 width = rect_width (rect); 2.46 - u32 height = rect_height (rect); 2.47 + uint32_t width = rect_width (rect); 2.48 + uint32_t height = rect_height (rect); 2.49 2.50 if ((width <= 0) || (height <= 0)) 2.51 return (NULL); 2.52 @@ -147,7 +148,7 @@ 2.53 free (bitmap); 2.54 } 2.55 2.56 -boolean get_pixel (Bitmap *bitmap, Point coord) 2.57 +bool get_pixel (Bitmap *bitmap, Point coord) 2.58 { 2.59 word_type *p; 2.60 int w,b; 2.61 @@ -165,7 +166,7 @@ 2.62 return (((*p) & pixel_mask (b)) != 0); 2.63 } 2.64 2.65 -void set_pixel (Bitmap *bitmap, Point coord, boolean value) 2.66 +void set_pixel (Bitmap *bitmap, Point coord, bool value) 2.67 { 2.68 word_type *p; 2.69 int w,b; 2.70 @@ -189,7 +190,7 @@ 2.71 2.72 /* modifies rect1 to be the intersection of rect1 and rect2; 2.73 returns true if intersection is non-null */ 2.74 -static boolean clip_rect (Rect *rect1, Rect *rect2) 2.75 +static bool clip_rect (Rect *rect1, Rect *rect2) 2.76 { 2.77 if (rect1->min.y > rect2->max.y) 2.78 goto empty; 2.79 @@ -223,12 +224,12 @@ 2.80 static void blt_background (Bitmap *dest_bitmap, 2.81 Rect dest_rect) 2.82 { 2.83 - u32 y; 2.84 + uint32_t y; 2.85 word_type *rp; 2.86 - u32 left_bit, left_word; 2.87 - u32 right_bit, right_word; 2.88 + uint32_t left_bit, left_word; 2.89 + uint32_t right_bit, right_word; 2.90 word_type left_mask, right_mask; 2.91 - s32 word_count; 2.92 + int32_t word_count; 2.93 2.94 /* This function requires a non-null dest rect */ 2.95 assert (dest_rect.min.x < dest_rect.max.x); 2.96 @@ -289,7 +290,7 @@ 2.97 /* use Duff's Device for the full words */ 2.98 if (word_count) 2.99 { 2.100 - s32 i = word_count; 2.101 + int32_t i = word_count; 2.102 switch (i % 8) 2.103 { 2.104 while (i > 0) 2.105 @@ -323,7 +324,7 @@ 2.106 Bitmap *dest_bitmap, 2.107 Rect *dest_rect) 2.108 { 2.109 - s32 y; 2.110 + int32_t y; 2.111 word_type *rp; 2.112 2.113 /* This function requires a non-null src rect */ 2.114 @@ -402,18 +403,18 @@ 2.115 { 2.116 Rect sr, dr; /* src and dest rects, clipped to visible portion of 2.117 dest rect */ 2.118 - u32 drw, drh; /* dest rect width, height - gets adjusted */ 2.119 + uint32_t drw, drh; /* dest rect width, height - gets adjusted */ 2.120 Point src_point, dest_point; 2.121 2.122 /* dest coordinates: */ 2.123 - u32 x0, x1, x2, x3; 2.124 - u32 y0, y1, y2, y3; 2.125 + uint32_t x0, x1, x2, x3; 2.126 + uint32_t y0, y1, y2, y3; 2.127 2.128 { 2.129 sr = * src_rect; 2.130 2.131 - u32 srw = rect_width (& sr); 2.132 - u32 srh = rect_height (& sr); 2.133 + uint32_t srw = rect_width (& sr); 2.134 + uint32_t srh = rect_height (& sr); 2.135 2.136 if ((srw < 0) || (srh < 0)) 2.137 goto done; /* the source rect is empty! */ 2.138 @@ -595,7 +596,7 @@ 2.139 src_point.x < src_rect->max.x; 2.140 src_point.x++) 2.141 { 2.142 - boolean a; 2.143 + bool a; 2.144 2.145 dest_point.x = dest_min->x + src_point.x - src_rect->min.x; 2.146 2.147 @@ -616,7 +617,7 @@ 2.148 src_point.x < src_rect->max.x; 2.149 src_point.x++) 2.150 { 2.151 - boolean a, b, c; 2.152 + bool a, b, c; 2.153 2.154 dest_point.x = dest_min->x + src_point.x - src_rect->min.x; 2.155 2.156 @@ -639,7 +640,7 @@ 2.157 word_type *rp; /* row pointer */ 2.158 word_type *p1; /* work src ptr */ 2.159 word_type *p2; /* work dest ptr */ 2.160 - s32 y; 2.161 + int32_t y; 2.162 int shift1, shift2; 2.163 2.164 realloc_temp_buffer ((src->row_words + 1) * sizeof (word_type)); 2.165 @@ -713,7 +714,7 @@ 2.166 /* "in-place" transformations - will allocate new memory and free old */ 2.167 void transpose (Bitmap *src) 2.168 { 2.169 - u32 new_row_words = DIV_ROUND_UP (rect_height (& src->rect), 32); 2.170 + uint32_t new_row_words = DIV_ROUND_UP (rect_height (& src->rect), 32); 2.171 word_type *new_bits; 2.172 2.173 new_bits = calloc (1, new_row_words * rect_width (& src->rect) * sizeof (word_type));
3.1 --- a/bitblt.h Mon Aug 26 05:43:49 2002 +0000 3.2 +++ b/bitblt.h Mon Aug 26 06:03:55 2002 +0000 3.3 @@ -1,7 +1,7 @@ 3.4 typedef struct Point 3.5 { 3.6 - s32 x; 3.7 - s32 y; 3.8 + int32_t x; 3.9 + int32_t y; 3.10 } Point; 3.11 3.12 typedef struct Rect 3.13 @@ -10,18 +10,18 @@ 3.14 Point max; 3.15 } Rect; 3.16 3.17 -static inline s32 rect_width (Rect *r) 3.18 +static inline int32_t rect_width (Rect *r) 3.19 { 3.20 return (r->max.x - r->min.x); 3.21 } 3.22 3.23 -static inline s32 rect_height (Rect *r) 3.24 +static inline int32_t rect_height (Rect *r) 3.25 { 3.26 return (r->max.y - r->min.y); 3.27 } 3.28 3.29 3.30 -typedef u32 word_type; 3.31 +typedef uint32_t word_type; 3.32 #define BITS_PER_WORD (8 * sizeof (word_type)) 3.33 #define ALL_ONES (~ 0U) 3.34 3.35 @@ -30,7 +30,7 @@ 3.36 { 3.37 word_type *bits; 3.38 Rect rect; 3.39 - u32 row_words; 3.40 + uint32_t row_words; 3.41 } Bitmap; 3.42 3.43 3.44 @@ -43,8 +43,8 @@ 3.45 Bitmap *create_bitmap (Rect *rect); 3.46 void free_bitmap (Bitmap *bitmap); 3.47 3.48 -boolean get_pixel (Bitmap *bitmap, Point coord); 3.49 -void set_pixel (Bitmap *bitmap, Point coord, boolean value); 3.50 +bool get_pixel (Bitmap *bitmap, Point coord); 3.51 +void set_pixel (Bitmap *bitmap, Point coord, bool value); 3.52 3.53 3.54 Bitmap *bitblt (Bitmap *src_bitmap, 3.55 @@ -68,4 +68,4 @@ 3.56 void rot_270 (Bitmap *src); /* transpose + flip_v */ 3.57 3.58 3.59 -void reverse_bits (u8 *p, int byte_count); 3.60 +void reverse_bits (uint8_t *p, int byte_count);
4.1 --- a/bitblt_test.c Mon Aug 26 05:43:49 2002 +0000 4.2 +++ b/bitblt_test.c Mon Aug 26 06:03:55 2002 +0000 4.3 @@ -1,7 +1,8 @@ 4.4 +#include <stdbool.h> 4.5 +#include <stdint.h> 4.6 #include <stdio.h> 4.7 #include <stdlib.h> 4.8 4.9 -#include "type.h" 4.10 #include "bitblt.h" 4.11 4.12
5.1 --- a/parser.y Mon Aug 26 05:43:49 2002 +0000 5.2 +++ b/parser.y Mon Aug 26 06:03:55 2002 +0000 5.3 @@ -1,6 +1,7 @@ 5.4 %{ 5.5 + #include <stdbool.h> 5.6 + #include <stdint.h> 5.7 #include <stdio.h> 5.8 - #include "type.h" 5.9 #include "semantics.h" 5.10 %} 5.11 5.12 @@ -186,7 +187,7 @@ 5.13 5.14 output_file_clause: 5.15 FILE_KEYWORD STRING { output_set_file ($2); } 5.16 - pdf_file_attributes ';' 5.17 + pdf_file_attributes ';' ; 5.18 5.19 label_clause: 5.20 LABEL ';' { page_label_t label = { NULL, '\0' }; output_set_page_label (label); }
6.1 --- a/scanner.l Mon Aug 26 05:43:49 2002 +0000 6.2 +++ b/scanner.l Mon Aug 26 06:03:55 2002 +0000 6.3 @@ -1,14 +1,15 @@ 6.4 /* 6.5 -$Id: scanner.l,v 1.15 2002/01/02 02:17:24 eric Exp $ 6.6 +$Id: scanner.l,v 1.16 2002/08/25 22:02:31 eric Exp $ 6.7 */ 6.8 6.9 %option case-insensitive 6.10 %option noyywrap 6.11 6.12 %{ 6.13 +#include <stdbool.h> 6.14 +#include <stdint.h> 6.15 #include <stdio.h> 6.16 #include <string.h> 6.17 -#include "type.h" 6.18 #include "semantics.h" 6.19 #include "parser.tab.h" 6.20
7.1 --- a/semantics.c Mon Aug 26 05:43:49 2002 +0000 7.2 +++ b/semantics.c Mon Aug 26 06:03:55 2002 +0000 7.3 @@ -1,8 +1,9 @@ 7.4 +#include <stdbool.h> 7.5 +#include <stdint.h> 7.6 #include <stdlib.h> 7.7 #include <string.h> 7.8 #include <stdio.h> 7.9 7.10 -#include "type.h" 7.11 #include "semantics.h" 7.12 #include "parser.tab.h" 7.13 #include "t2p.h" 7.14 @@ -10,13 +11,13 @@ 7.15 7.16 typedef struct 7.17 { 7.18 - boolean has_page_size; 7.19 + bool has_page_size; 7.20 page_size_t page_size; 7.21 7.22 - boolean has_rotation; 7.23 + bool has_rotation; 7.24 int rotation; 7.25 7.26 - boolean has_crop; 7.27 + bool has_crop; 7.28 crop_t crop; 7.29 } input_modifiers_t; 7.30 7.31 @@ -57,7 +58,7 @@ 7.32 bookmark_t *first_bookmark; 7.33 bookmark_t *last_bookmark; 7.34 7.35 - boolean has_page_label; 7.36 + bool has_page_label; 7.37 page_label_t page_label; 7.38 } output_context_t; 7.39 7.40 @@ -432,9 +433,9 @@ 7.41 exit (2); 7.42 } 7.43 7.44 -static boolean get_input_rotation (input_context_t *context, 7.45 - input_modifier_type_t type, 7.46 - int *rotation) 7.47 +static bool get_input_rotation (input_context_t *context, 7.48 + input_modifier_type_t type, 7.49 + int *rotation) 7.50 { 7.51 for (; context; context = context->parent) 7.52 { 7.53 @@ -452,9 +453,9 @@ 7.54 return (0); /* default */ 7.55 } 7.56 7.57 -static boolean get_input_page_size (input_context_t *context, 7.58 - input_modifier_type_t type, 7.59 - page_size_t *page_size) 7.60 +static bool get_input_page_size (input_context_t *context, 7.61 + input_modifier_type_t type, 7.62 + page_size_t *page_size) 7.63 { 7.64 for (; context; context = context->parent) 7.65 { 7.66 @@ -510,7 +511,7 @@ 7.67 for (i = image->range.first; i <= image->range.last; i++) 7.68 { 7.69 input_modifier_type_t parity = (i % 2) ? INPUT_MODIFIER_ODD : INPUT_MODIFIER_EVEN; 7.70 - boolean has_rotation, has_page_size; 7.71 + bool has_rotation, has_page_size; 7.72 int rotation; 7.73 page_size_t page_size; 7.74 7.75 @@ -571,9 +572,9 @@ 7.76 } 7.77 7.78 7.79 -boolean parse_spec_file (char *fn) 7.80 +bool parse_spec_file (char *fn) 7.81 { 7.82 - boolean result = 0; 7.83 + bool result = 0; 7.84 7.85 yyin = fopen (fn, "r"); 7.86 if (! yyin) 7.87 @@ -617,7 +618,7 @@ 7.88 } 7.89 7.90 7.91 -boolean process_specs (void) 7.92 +bool process_specs (void) 7.93 { 7.94 input_image_t *image = NULL; 7.95 output_page_t *page = NULL;
8.1 --- a/semantics.h Mon Aug 26 05:43:49 2002 +0000 8.2 +++ b/semantics.h Mon Aug 26 06:03:55 2002 +0000 8.3 @@ -72,5 +72,5 @@ 8.4 8.5 8.6 /* functions to be called from main program: */ 8.7 -boolean parse_spec_file (char *fn); 8.8 -boolean process_specs (void); 8.9 +bool parse_spec_file (char *fn); 8.10 +bool process_specs (void);
9.1 --- a/t2p.c Mon Aug 26 05:43:49 2002 +0000 9.2 +++ b/t2p.c Mon Aug 26 06:03:55 2002 +0000 9.3 @@ -4,7 +4,7 @@ 9.4 * will be compressed using ITU-T T.6 (G4) fax encoding. 9.5 * 9.6 * Main program 9.7 - * $Id: t2p.c,v 1.18 2002/08/25 21:43:49 eric Exp $ 9.8 + * $Id: t2p.c,v 1.19 2002/08/25 22:02:31 eric Exp $ 9.9 * Copyright 2001 Eric Smith <eric@brouhaha.com> 9.10 * 9.11 * This program is free software; you can redistribute it and/or modify 9.12 @@ -23,6 +23,8 @@ 9.13 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA */ 9.14 9.15 9.16 +#include <stdbool.h> 9.17 +#include <stdint.h> 9.18 #include <stdio.h> 9.19 #include <stdlib.h> 9.20 #include <unistd.h> 9.21 @@ -33,7 +35,6 @@ 9.22 #include <panda/functions.h> 9.23 #include <panda/constants.h> 9.24 9.25 -#include "type.h" 9.26 #include "bitblt.h" 9.27 #include "semantics.h" 9.28 #include "parser.tab.h" 9.29 @@ -62,7 +63,7 @@ 9.30 /* panda_pdf *out; */ 9.31 9.32 9.33 -boolean close_tiff_input_file (void) 9.34 +bool close_tiff_input_file (void) 9.35 { 9.36 if (in) 9.37 { 9.38 @@ -74,7 +75,7 @@ 9.39 return (1); 9.40 } 9.41 9.42 -boolean open_tiff_input_file (char *name) 9.43 +bool open_tiff_input_file (char *name) 9.44 { 9.45 if (in) 9.46 { 9.47 @@ -99,7 +100,7 @@ 9.48 } 9.49 9.50 9.51 -boolean close_pdf_output_files (void) 9.52 +bool close_pdf_output_files (void) 9.53 { 9.54 output_file_t *o, *n; 9.55 9.56 @@ -115,8 +116,8 @@ 9.57 return (1); 9.58 } 9.59 9.60 -boolean open_pdf_output_file (char *name, 9.61 - pdf_file_attributes_t *attributes) 9.62 +bool open_pdf_output_file (char *name, 9.63 + pdf_file_attributes_t *attributes) 9.64 { 9.65 output_file_t *o; 9.66 9.67 @@ -225,23 +226,23 @@ 9.68 9.69 #define SWAP(type,a,b) do { type temp; temp = a; a = b; b = temp; } while (0) 9.70 9.71 -boolean process_page (int image, /* range 1 .. n */ 9.72 - input_attributes_t input_attributes, 9.73 - bookmark_t *bookmarks) 9.74 +bool process_page (int image, /* range 1 .. n */ 9.75 + input_attributes_t input_attributes, 9.76 + bookmark_t *bookmarks) 9.77 { 9.78 int result = 0; 9.79 9.80 - u32 image_length, image_width; 9.81 - u32 dest_image_length, dest_image_width; 9.82 + uint32_t image_length, image_width; 9.83 + uint32_t dest_image_length, dest_image_width; 9.84 #ifdef CHECK_DEPTH 9.85 - u32 image_depth; 9.86 + uint32_t image_depth; 9.87 #endif 9.88 9.89 - u16 samples_per_pixel; 9.90 - u16 bits_per_sample; 9.91 - u16 planar_config; 9.92 + uint16_t samples_per_pixel; 9.93 + uint16_t bits_per_sample; 9.94 + uint16_t planar_config; 9.95 9.96 - u16 resolution_unit; 9.97 + uint16_t resolution_unit; 9.98 float x_resolution, y_resolution; 9.99 float dest_x_resolution, dest_y_resolution; 9.100 9.101 @@ -381,7 +382,7 @@ 9.102 } 9.103 9.104 #ifdef TIFF_REVERSE_BITS 9.105 - reverse_bits ((u8 *) bitmap->bits, 9.106 + reverse_bits ((uint8_t *) bitmap->bits, 9.107 image_length * bitmap->row_words * sizeof (word_type)); 9.108 #endif /* TIFF_REVERSE_BITS */ 9.109 9.110 @@ -424,7 +425,7 @@ 9.111 TIFFSetField (tiff_temp, TIFFTAG_PHOTOMETRIC, PHOTOMETRIC_MINISWHITE); 9.112 9.113 #ifdef TIFF_REVERSE_BITS 9.114 - reverse_bits ((u8 *) bitmap->bits, 9.115 + reverse_bits ((uint8_t *) bitmap->bits, 9.116 image_length * bitmap->row_words * sizeof (word_type)); 9.117 #endif /* TIFF_REVERSE_BITS */ 9.118
10.1 --- a/t2p.h Mon Aug 26 05:43:49 2002 +0000 10.2 +++ b/t2p.h Mon Aug 26 06:03:55 2002 +0000 10.3 @@ -1,21 +1,21 @@ 10.4 typedef struct 10.5 { 10.6 - boolean has_resolution; 10.7 + bool has_resolution; 10.8 double x_resolution; 10.9 double y_resolution; 10.10 10.11 - boolean has_page_size; 10.12 + bool has_page_size; 10.13 page_size_t page_size; 10.14 10.15 - boolean has_rotation; 10.16 + bool has_rotation; 10.17 int rotation; 10.18 10.19 - boolean has_crop; 10.20 + bool has_crop; 10.21 crop_t crop; 10.22 } input_attributes_t; 10.23 10.24 -boolean open_tiff_input_file (char *name); 10.25 -boolean close_tiff_input_file (void); 10.26 +bool open_tiff_input_file (char *name); 10.27 +bool close_tiff_input_file (void); 10.28 10.29 10.30 typedef struct 10.31 @@ -27,8 +27,8 @@ 10.32 char *keywords; 10.33 } pdf_file_attributes_t; 10.34 10.35 -boolean open_pdf_output_file (char *name, 10.36 - pdf_file_attributes_t *attributes); 10.37 +bool open_pdf_output_file (char *name, 10.38 + pdf_file_attributes_t *attributes); 10.39 10.40 10.41 void process_page_numbers (int page_index, 10.42 @@ -36,6 +36,6 @@ 10.43 int base, 10.44 page_label_t *page_label); 10.45 10.46 -boolean process_page (int image, /* range 1 .. n */ 10.47 - input_attributes_t input_attributes, 10.48 - bookmark_t *bookmarks); 10.49 +bool process_page (int image, /* range 1 .. n */ 10.50 + input_attributes_t input_attributes, 10.51 + bookmark_t *bookmarks);
11.1 --- a/tumble.c Mon Aug 26 05:43:49 2002 +0000 11.2 +++ b/tumble.c Mon Aug 26 06:03:55 2002 +0000 11.3 @@ -4,7 +4,7 @@ 11.4 * will be compressed using ITU-T T.6 (G4) fax encoding. 11.5 * 11.6 * Main program 11.7 - * $Id: tumble.c,v 1.18 2002/08/25 21:43:49 eric Exp $ 11.8 + * $Id: tumble.c,v 1.19 2002/08/25 22:02:31 eric Exp $ 11.9 * Copyright 2001 Eric Smith <eric@brouhaha.com> 11.10 * 11.11 * This program is free software; you can redistribute it and/or modify 11.12 @@ -23,6 +23,8 @@ 11.13 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA */ 11.14 11.15 11.16 +#include <stdbool.h> 11.17 +#include <stdint.h> 11.18 #include <stdio.h> 11.19 #include <stdlib.h> 11.20 #include <unistd.h> 11.21 @@ -33,7 +35,6 @@ 11.22 #include <panda/functions.h> 11.23 #include <panda/constants.h> 11.24 11.25 -#include "type.h" 11.26 #include "bitblt.h" 11.27 #include "semantics.h" 11.28 #include "parser.tab.h" 11.29 @@ -62,7 +63,7 @@ 11.30 /* panda_pdf *out; */ 11.31 11.32 11.33 -boolean close_tiff_input_file (void) 11.34 +bool close_tiff_input_file (void) 11.35 { 11.36 if (in) 11.37 { 11.38 @@ -74,7 +75,7 @@ 11.39 return (1); 11.40 } 11.41 11.42 -boolean open_tiff_input_file (char *name) 11.43 +bool open_tiff_input_file (char *name) 11.44 { 11.45 if (in) 11.46 { 11.47 @@ -99,7 +100,7 @@ 11.48 } 11.49 11.50 11.51 -boolean close_pdf_output_files (void) 11.52 +bool close_pdf_output_files (void) 11.53 { 11.54 output_file_t *o, *n; 11.55 11.56 @@ -115,8 +116,8 @@ 11.57 return (1); 11.58 } 11.59 11.60 -boolean open_pdf_output_file (char *name, 11.61 - pdf_file_attributes_t *attributes) 11.62 +bool open_pdf_output_file (char *name, 11.63 + pdf_file_attributes_t *attributes) 11.64 { 11.65 output_file_t *o; 11.66 11.67 @@ -225,23 +226,23 @@ 11.68 11.69 #define SWAP(type,a,b) do { type temp; temp = a; a = b; b = temp; } while (0) 11.70 11.71 -boolean process_page (int image, /* range 1 .. n */ 11.72 - input_attributes_t input_attributes, 11.73 - bookmark_t *bookmarks) 11.74 +bool process_page (int image, /* range 1 .. n */ 11.75 + input_attributes_t input_attributes, 11.76 + bookmark_t *bookmarks) 11.77 { 11.78 int result = 0; 11.79 11.80 - u32 image_length, image_width; 11.81 - u32 dest_image_length, dest_image_width; 11.82 + uint32_t image_length, image_width; 11.83 + uint32_t dest_image_length, dest_image_width; 11.84 #ifdef CHECK_DEPTH 11.85 - u32 image_depth; 11.86 + uint32_t image_depth; 11.87 #endif 11.88 11.89 - u16 samples_per_pixel; 11.90 - u16 bits_per_sample; 11.91 - u16 planar_config; 11.92 + uint16_t samples_per_pixel; 11.93 + uint16_t bits_per_sample; 11.94 + uint16_t planar_config; 11.95 11.96 - u16 resolution_unit; 11.97 + uint16_t resolution_unit; 11.98 float x_resolution, y_resolution; 11.99 float dest_x_resolution, dest_y_resolution; 11.100 11.101 @@ -381,7 +382,7 @@ 11.102 } 11.103 11.104 #ifdef TIFF_REVERSE_BITS 11.105 - reverse_bits ((u8 *) bitmap->bits, 11.106 + reverse_bits ((uint8_t *) bitmap->bits, 11.107 image_length * bitmap->row_words * sizeof (word_type)); 11.108 #endif /* TIFF_REVERSE_BITS */ 11.109 11.110 @@ -424,7 +425,7 @@ 11.111 TIFFSetField (tiff_temp, TIFFTAG_PHOTOMETRIC, PHOTOMETRIC_MINISWHITE); 11.112 11.113 #ifdef TIFF_REVERSE_BITS 11.114 - reverse_bits ((u8 *) bitmap->bits, 11.115 + reverse_bits ((uint8_t *) bitmap->bits, 11.116 image_length * bitmap->row_words * sizeof (word_type)); 11.117 #endif /* TIFF_REVERSE_BITS */ 11.118
12.1 --- a/tumble.h Mon Aug 26 05:43:49 2002 +0000 12.2 +++ b/tumble.h Mon Aug 26 06:03:55 2002 +0000 12.3 @@ -1,21 +1,21 @@ 12.4 typedef struct 12.5 { 12.6 - boolean has_resolution; 12.7 + bool has_resolution; 12.8 double x_resolution; 12.9 double y_resolution; 12.10 12.11 - boolean has_page_size; 12.12 + bool has_page_size; 12.13 page_size_t page_size; 12.14 12.15 - boolean has_rotation; 12.16 + bool has_rotation; 12.17 int rotation; 12.18 12.19 - boolean has_crop; 12.20 + bool has_crop; 12.21 crop_t crop; 12.22 } input_attributes_t; 12.23 12.24 -boolean open_tiff_input_file (char *name); 12.25 -boolean close_tiff_input_file (void); 12.26 +bool open_tiff_input_file (char *name); 12.27 +bool close_tiff_input_file (void); 12.28 12.29 12.30 typedef struct 12.31 @@ -27,8 +27,8 @@ 12.32 char *keywords; 12.33 } pdf_file_attributes_t; 12.34 12.35 -boolean open_pdf_output_file (char *name, 12.36 - pdf_file_attributes_t *attributes); 12.37 +bool open_pdf_output_file (char *name, 12.38 + pdf_file_attributes_t *attributes); 12.39 12.40 12.41 void process_page_numbers (int page_index, 12.42 @@ -36,6 +36,6 @@ 12.43 int base, 12.44 page_label_t *page_label); 12.45 12.46 -boolean process_page (int image, /* range 1 .. n */ 12.47 - input_attributes_t input_attributes, 12.48 - bookmark_t *bookmarks); 12.49 +bool process_page (int image, /* range 1 .. n */ 12.50 + input_attributes_t input_attributes, 12.51 + bookmark_t *bookmarks);
13.1 --- a/type.h Mon Aug 26 05:43:49 2002 +0000 13.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 13.3 @@ -1,7 +0,0 @@ 13.4 -typedef unsigned char u8; 13.5 -typedef unsigned short u16; 13.6 -typedef unsigned int u32; 13.7 - 13.8 -typedef int s32; 13.9 - 13.10 -typedef int boolean;