1.1 diff -r 139b91f9a224 -r 4368c5fd9242 semantics.c 1.2 --- a/semantics.c Mon Dec 31 16:44:24 2001 +0000 1.3 +++ b/semantics.c Tue Jan 01 03:44:40 2002 +0000 1.4 @@ -478,60 +478,6 @@ 1.5 } 1.6 1.7 1.8 -void doit (void) 1.9 -{ 1.10 - input_image_t *image = NULL; 1.11 - output_page_t *page = NULL; 1.12 - int i = 0; 1.13 - int p = 0; 1.14 - int page_index = 0; 1.15 - input_attributes_t input_attributes; 1.16 - input_modifier_type_t parity; 1.17 - page_label_t *page_label; 1.18 - 1.19 - for (;;) 1.20 - { 1.21 - if ((! image) || (i >= range_count (image->range))) 1.22 - { 1.23 - if (image) 1.24 - image = image->next; 1.25 - else 1.26 - image = first_input_image; 1.27 - if (! image) 1.28 - return; 1.29 - i = 0; 1.30 - } 1.31 - 1.32 - if ((! page) || (p >= range_count (page->range))) 1.33 - { 1.34 - if (page) 1.35 - page = page->next; 1.36 - else 1.37 - page = first_output_page; 1.38 - p = 0; 1.39 - page_label = get_output_page_label (page->output_context); 1.40 - process_page_numbers (page_index, 1.41 - range_count (page->range), 1.42 - page->range.first, 1.43 - page_label); 1.44 - } 1.45 - 1.46 - parity = ((image->range.first + i) % 2) ? INPUT_MODIFIER_ODD : INPUT_MODIFIER_EVEN; 1.47 - 1.48 - memset (& input_attributes, 0, sizeof (input_attributes)); 1.49 - input_attributes.rotation = get_input_rotation (image->input_context, 1.50 - parity);; 1.51 - 1.52 - process_page (image->range.first + i, 1.53 - input_attributes, 1.54 - page->bookmark_list); 1.55 - i++; 1.56 - p++; 1.57 - page_index++; 1.58 - } 1.59 -} 1.60 - 1.61 - 1.62 boolean parse_spec_file (char *fn) 1.63 { 1.64 boolean result = 0; 1.65 @@ -576,3 +522,63 @@ 1.66 1.67 return (result); 1.68 } 1.69 + 1.70 + 1.71 +boolean process_specs (void) 1.72 +{ 1.73 + input_image_t *image = NULL; 1.74 + output_page_t *page = NULL; 1.75 + int i = 0; 1.76 + int p = 0; 1.77 + int page_index = 0; 1.78 + input_attributes_t input_attributes; 1.79 + input_modifier_type_t parity; 1.80 + page_label_t *page_label; 1.81 + 1.82 + for (;;) 1.83 + { 1.84 + if ((! image) || (i >= range_count (image->range))) 1.85 + { 1.86 + if (image) 1.87 + image = image->next; 1.88 + else 1.89 + image = first_input_image; 1.90 + if (! image) 1.91 + return (0); 1.92 + i = 0; 1.93 + if (! open_tiff_input_file (get_input_file (image->input_context))) 1.94 + return (0); 1.95 + } 1.96 + 1.97 + if ((! page) || (p >= range_count (page->range))) 1.98 + { 1.99 + if (page) 1.100 + page = page->next; 1.101 + else 1.102 + page = first_output_page; 1.103 + p = 0; 1.104 + if (! open_pdf_output_file (get_output_file (page->output_context))) 1.105 + return (0); 1.106 + page_label = get_output_page_label (page->output_context); 1.107 + process_page_numbers (page_index, 1.108 + range_count (page->range), 1.109 + page->range.first, 1.110 + page_label); 1.111 + } 1.112 + 1.113 + parity = ((image->range.first + i) % 2) ? INPUT_MODIFIER_ODD : INPUT_MODIFIER_EVEN; 1.114 + 1.115 + memset (& input_attributes, 0, sizeof (input_attributes)); 1.116 + input_attributes.rotation = get_input_rotation (image->input_context, 1.117 + parity);; 1.118 + 1.119 + process_page (image->range.first + i, 1.120 + input_attributes, 1.121 + page->bookmark_list); 1.122 + i++; 1.123 + p++; 1.124 + page_index++; 1.125 + } 1.126 + 1.127 + return (1); 1.128 +}