moved most type declarations from semantics.h to semantics.c.

Mon, 31 Dec 2001 08:12:58 +0000

author
eric
date
Mon, 31 Dec 2001 08:12:58 +0000
changeset 22
198616589af5
parent 21
2bb19d98d928
child 23
1fe64161aaac

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