Mon, 31 Dec 2001 08:12:58 +0000
moved most type declarations from semantics.h to semantics.c.
made various functions static.
semantics.c | file | annotate | diff | revisions | |
semantics.h | file | annotate | diff | revisions |
1.1 diff -r 2bb19d98d928 -r 198616589af5 semantics.c 1.2 --- a/semantics.c Mon Dec 31 07:44:23 2001 +0000 1.3 +++ b/semantics.c Mon Dec 31 08:12:58 2001 +0000 1.4 @@ -7,6 +7,72 @@ 1.5 #include "parser.tab.h" 1.6 1.7 1.8 +typedef struct 1.9 +{ 1.10 + boolean has_size; 1.11 + page_size_t size; 1.12 + 1.13 + boolean has_rotation; 1.14 + int rotation; 1.15 + 1.16 + boolean has_crop; 1.17 + crop_t crop; 1.18 +} input_modifiers_t; 1.19 + 1.20 + 1.21 +typedef struct input_context_t 1.22 +{ 1.23 + struct input_context_t *parent; 1.24 + struct input_context_t *next; 1.25 + 1.26 + int image_count; /* how many pages reference this context, 1.27 + including those from subcontexts */ 1.28 + 1.29 + char *input_file; 1.30 + 1.31 + input_modifiers_t modifiers [INPUT_MODIFIER_TYPE_COUNT]; 1.32 +} input_context_t; 1.33 + 1.34 + 1.35 +typedef struct input_image_t 1.36 +{ 1.37 + struct input_image_t *next; 1.38 + input_context_t *input_context; 1.39 + range_t range; 1.40 +} input_image_t; 1.41 + 1.42 + 1.43 +typedef struct bookmark_t 1.44 +{ 1.45 + struct bookmark_t *next; 1.46 + char *name; 1.47 +} bookmark_t; 1.48 + 1.49 + 1.50 +typedef struct output_context_t 1.51 +{ 1.52 + struct output_context_t *parent; 1.53 + struct output_context_t *next; 1.54 + 1.55 + int page_count; /* how many pages reference this context, 1.56 + including those from subcontexts */ 1.57 + 1.58 + char *output_file; 1.59 + bookmark_t *first_bookmark; 1.60 + bookmark_t *last_bookmark; 1.61 + char *page_number_format; 1.62 +} output_context_t; 1.63 + 1.64 + 1.65 +typedef struct output_page_t 1.66 +{ 1.67 + struct output_page_t *next; 1.68 + output_context_t *output_context; 1.69 + range_t range; 1.70 + bookmark_t *bookmark_list; 1.71 +} output_page_t; 1.72 + 1.73 + 1.74 #define SEMANTIC_DEBUG 1.75 #ifdef SEMANTIC_DEBUG 1.76 #define SDBG(x) printf x 1.77 @@ -87,7 +153,7 @@ 1.78 #endif /* SEMANTIC_DEBUG */ 1.79 } 1.80 1.81 -void input_clone (void) 1.82 +static void input_clone (void) 1.83 { 1.84 input_context_t *new_input_context; 1.85 1.86 @@ -119,7 +185,7 @@ 1.87 SDBG(("rotation %d\n", rotation)); 1.88 } 1.89 1.90 -void increment_input_image_count (int count) 1.91 +static void increment_input_image_count (int count) 1.92 { 1.93 input_context_t *context; 1.94 1.95 @@ -199,7 +265,7 @@ 1.96 last_output_context = last_output_context->parent; 1.97 }; 1.98 1.99 -void output_clone (void) 1.100 +static void output_clone (void) 1.101 { 1.102 output_context_t *new_output_context; 1.103 1.104 @@ -257,7 +323,7 @@ 1.105 last_output_context->page_number_format = format; 1.106 } 1.107 1.108 -void increment_output_page_count (int count) 1.109 +static void increment_output_page_count (int count) 1.110 { 1.111 output_context_t *context; 1.112 1.113 @@ -317,7 +383,7 @@ 1.114 } 1.115 1.116 1.117 -char *get_input_file (input_context_t *context) 1.118 +static char *get_input_file (input_context_t *context) 1.119 { 1.120 for (; context; context = context->parent) 1.121 if (context->input_file) 1.122 @@ -326,7 +392,7 @@ 1.123 exit (2); 1.124 } 1.125 1.126 -int get_input_rotation (input_context_t *context, input_modifier_type_t type) 1.127 +static int get_input_rotation (input_context_t *context, input_modifier_type_t type) 1.128 { 1.129 for (; context; context = context->parent) 1.130 { 1.131 @@ -338,7 +404,7 @@ 1.132 return (0); /* default */ 1.133 } 1.134 1.135 -char *get_output_file (output_context_t *context) 1.136 +static char *get_output_file (output_context_t *context) 1.137 { 1.138 for (; context; context = context->parent) 1.139 if (context->output_file) 1.140 @@ -347,7 +413,7 @@ 1.141 exit (2); 1.142 } 1.143 1.144 -char *get_output_page_number_format (output_context_t *context) 1.145 +static char *get_output_page_number_format (output_context_t *context) 1.146 { 1.147 for (; context; context = context->parent) 1.148 if (context->page_number_format)
2.1 diff -r 2bb19d98d928 -r 198616589af5 semantics.h 2.2 --- a/semantics.h Mon Dec 31 07:44:23 2001 +0000 2.3 +++ b/semantics.h Mon Dec 31 08:12:58 2001 +0000 2.4 @@ -18,18 +18,6 @@ 2.5 double bottom; 2.6 } crop_t; 2.7 2.8 -typedef struct 2.9 -{ 2.10 - boolean has_size; 2.11 - page_size_t size; 2.12 - 2.13 - boolean has_rotation; 2.14 - int rotation; 2.15 - 2.16 - boolean has_crop; 2.17 - crop_t crop; 2.18 -} input_modifiers_t; 2.19 - 2.20 2.21 typedef enum 2.22 { 2.23 @@ -40,59 +28,6 @@ 2.24 } input_modifier_type_t; 2.25 2.26 2.27 -typedef struct input_context_t 2.28 -{ 2.29 - struct input_context_t *parent; 2.30 - struct input_context_t *next; 2.31 - 2.32 - int image_count; /* how many pages reference this context, 2.33 - including those from subcontexts */ 2.34 - 2.35 - char *input_file; 2.36 - 2.37 - input_modifiers_t modifiers [INPUT_MODIFIER_TYPE_COUNT]; 2.38 -} input_context_t; 2.39 - 2.40 - 2.41 -typedef struct input_image_t 2.42 -{ 2.43 - struct input_image_t *next; 2.44 - input_context_t *input_context; 2.45 - range_t range; 2.46 -} input_image_t; 2.47 - 2.48 - 2.49 -typedef struct bookmark_t 2.50 -{ 2.51 - struct bookmark_t *next; 2.52 - char *name; 2.53 -} bookmark_t; 2.54 - 2.55 - 2.56 -typedef struct output_context_t 2.57 -{ 2.58 - struct output_context_t *parent; 2.59 - struct output_context_t *next; 2.60 - 2.61 - int page_count; /* how many pages reference this context, 2.62 - including those from subcontexts */ 2.63 - 2.64 - char *output_file; 2.65 - bookmark_t *first_bookmark; 2.66 - bookmark_t *last_bookmark; 2.67 - char *page_number_format; 2.68 -} output_context_t; 2.69 - 2.70 - 2.71 -typedef struct output_page_t 2.72 -{ 2.73 - struct output_page_t *next; 2.74 - output_context_t *output_context; 2.75 - range_t range; 2.76 - bookmark_t *bookmark_list; 2.77 -} output_page_t; 2.78 - 2.79 - 2.80 extern int line; /* line number in spec file */ 2.81 2.82