semantics.h

Mon, 31 Dec 2001 07:25:08 +0000

author
eric
date
Mon, 31 Dec 2001 07:25:08 +0000
changeset 20
a1cd8cb9d09e
parent 19
e9bf1ed4f331
child 22
198616589af5
permissions
-rw-r--r--

*** empty log message ***

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