Mon, 31 Dec 2001 07:44:23 +0000
*** empty log message ***
eric@18 | 1 | typedef struct |
eric@18 | 2 | { |
eric@18 | 3 | double width; |
eric@18 | 4 | double height; |
eric@18 | 5 | } page_size_t; |
eric@18 | 6 | |
eric@18 | 7 | typedef struct |
eric@18 | 8 | { |
eric@18 | 9 | int first; |
eric@18 | 10 | int last; |
eric@18 | 11 | } range_t; |
eric@18 | 12 | |
eric@18 | 13 | typedef struct |
eric@18 | 14 | { |
eric@18 | 15 | double left; |
eric@18 | 16 | double right; |
eric@18 | 17 | double top; |
eric@18 | 18 | double bottom; |
eric@18 | 19 | } crop_t; |
eric@18 | 20 | |
eric@18 | 21 | typedef struct |
eric@18 | 22 | { |
eric@18 | 23 | boolean has_size; |
eric@18 | 24 | page_size_t size; |
eric@18 | 25 | |
eric@18 | 26 | boolean has_rotation; |
eric@18 | 27 | int rotation; |
eric@18 | 28 | |
eric@18 | 29 | boolean has_crop; |
eric@18 | 30 | crop_t crop; |
eric@18 | 31 | } input_modifiers_t; |
eric@18 | 32 | |
eric@18 | 33 | |
eric@18 | 34 | typedef enum |
eric@18 | 35 | { |
eric@18 | 36 | INPUT_MODIFIER_ALL, |
eric@18 | 37 | INPUT_MODIFIER_ODD, |
eric@18 | 38 | INPUT_MODIFIER_EVEN, |
eric@18 | 39 | INPUT_MODIFIER_TYPE_COUNT /* must be last */ |
eric@18 | 40 | } input_modifier_type_t; |
eric@18 | 41 | |
eric@18 | 42 | |
eric@18 | 43 | typedef struct input_context_t |
eric@18 | 44 | { |
eric@20 | 45 | struct input_context_t *parent; |
eric@20 | 46 | struct input_context_t *next; |
eric@18 | 47 | |
eric@20 | 48 | int image_count; /* how many pages reference this context, |
eric@18 | 49 | including those from subcontexts */ |
eric@18 | 50 | |
eric@20 | 51 | char *input_file; |
eric@20 | 52 | |
eric@18 | 53 | input_modifiers_t modifiers [INPUT_MODIFIER_TYPE_COUNT]; |
eric@18 | 54 | } input_context_t; |
eric@18 | 55 | |
eric@18 | 56 | |
eric@20 | 57 | typedef struct input_image_t |
eric@20 | 58 | { |
eric@20 | 59 | struct input_image_t *next; |
eric@20 | 60 | input_context_t *input_context; |
eric@20 | 61 | range_t range; |
eric@20 | 62 | } input_image_t; |
eric@20 | 63 | |
eric@20 | 64 | |
eric@20 | 65 | typedef struct bookmark_t |
eric@20 | 66 | { |
eric@20 | 67 | struct bookmark_t *next; |
eric@20 | 68 | char *name; |
eric@20 | 69 | } bookmark_t; |
eric@16 | 70 | |
eric@16 | 71 | |
eric@20 | 72 | typedef struct output_context_t |
eric@20 | 73 | { |
eric@20 | 74 | struct output_context_t *parent; |
eric@20 | 75 | struct output_context_t *next; |
eric@20 | 76 | |
eric@20 | 77 | int page_count; /* how many pages reference this context, |
eric@20 | 78 | including those from subcontexts */ |
eric@20 | 79 | |
eric@20 | 80 | char *output_file; |
eric@20 | 81 | bookmark_t *first_bookmark; |
eric@20 | 82 | bookmark_t *last_bookmark; |
eric@20 | 83 | char *page_number_format; |
eric@20 | 84 | } output_context_t; |
eric@20 | 85 | |
eric@20 | 86 | |
eric@20 | 87 | typedef struct output_page_t |
eric@20 | 88 | { |
eric@20 | 89 | struct output_page_t *next; |
eric@20 | 90 | output_context_t *output_context; |
eric@20 | 91 | range_t range; |
eric@20 | 92 | bookmark_t *bookmark_list; |
eric@20 | 93 | } output_page_t; |
eric@20 | 94 | |
eric@20 | 95 | |
eric@20 | 96 | extern int line; /* line number in spec file */ |
eric@16 | 97 | |
eric@16 | 98 | |
eric@16 | 99 | boolean parse_spec_file (char *fn); |
eric@16 | 100 | |
eric@16 | 101 | |
eric@16 | 102 | /* semantic routines for input statements */ |
eric@19 | 103 | void input_push_context (void); |
eric@16 | 104 | void input_pop_context (void); |
eric@19 | 105 | void input_set_modifier_context (input_modifier_type_t type); |
eric@16 | 106 | void input_set_file (char *name); |
eric@19 | 107 | void input_set_rotation (int rotation); |
eric@20 | 108 | void input_images (range_t range); |
eric@16 | 109 | |
eric@16 | 110 | /* semantic routines for output statements */ |
eric@16 | 111 | void output_set_file (char *name); |
eric@20 | 112 | void output_set_bookmark (char *name); |
eric@20 | 113 | void output_set_page_number_format (char *format); |
eric@20 | 114 | void output_pages (range_t range); |