semantics.h

Wed, 12 Mar 2003 08:38:04 +0000

author
eric
date
Wed, 12 Mar 2003 08:38:04 +0000
changeset 104
82cb954059c4
parent 48
3d0be1c1c1b2
child 125
e2ef1c2f9eca
permissions
-rw-r--r--

updated copyright notice.

eric@104 1 /*
eric@104 2 * t2p: Create a PDF file from the contents of one or more TIFF
eric@104 3 * bilevel image files. The images in the resulting PDF file
eric@104 4 * will be compressed using ITU-T T.6 (G4) fax encoding.
eric@104 5 *
eric@104 6 * Semantic routines for spec file parser
eric@104 7 * $Id: semantics.h,v 1.12 2003/03/12 00:38:04 eric Exp $
eric@104 8 * Copyright 2001, 2002, 2003 Eric Smith <eric@brouhaha.com>
eric@104 9 *
eric@104 10 * This program is free software; you can redistribute it and/or modify
eric@104 11 * it under the terms of the GNU General Public License version 2 as
eric@104 12 * published by the Free Software Foundation. Note that permission is
eric@104 13 * not granted to redistribute this program under the terms of any
eric@104 14 * other version of the General Public License.
eric@104 15 *
eric@104 16 * This program is distributed in the hope that it will be useful,
eric@104 17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
eric@104 18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
eric@104 19 * GNU General Public License for more details.
eric@104 20 *
eric@104 21 * You should have received a copy of the GNU General Public License
eric@104 22 * along with this program; if not, write to the Free Software
eric@104 23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA
eric@104 24 */
eric@104 25
eric@104 26
eric@18 27 typedef struct
eric@18 28 {
eric@18 29 double width;
eric@18 30 double height;
eric@18 31 } page_size_t;
eric@18 32
eric@18 33 typedef struct
eric@18 34 {
eric@18 35 int first;
eric@18 36 int last;
eric@18 37 } range_t;
eric@18 38
eric@18 39 typedef struct
eric@18 40 {
eric@18 41 double left;
eric@18 42 double right;
eric@18 43 double top;
eric@18 44 double bottom;
eric@18 45 } crop_t;
eric@18 46
eric@25 47 typedef struct
eric@25 48 {
eric@25 49 char *prefix;
eric@25 50 char style;
eric@25 51 } page_label_t;
eric@25 52
eric@18 53
eric@18 54 typedef enum
eric@18 55 {
eric@18 56 INPUT_MODIFIER_ALL,
eric@18 57 INPUT_MODIFIER_ODD,
eric@18 58 INPUT_MODIFIER_EVEN,
eric@18 59 INPUT_MODIFIER_TYPE_COUNT /* must be last */
eric@18 60 } input_modifier_type_t;
eric@18 61
eric@18 62
eric@24 63 typedef struct bookmark_t
eric@24 64 {
eric@24 65 struct bookmark_t *next;
eric@24 66 int level; /* 1 is outermost */
eric@24 67 char *name;
eric@24 68 } bookmark_t;
eric@24 69
eric@24 70
eric@20 71 extern int line; /* line number in spec file */
eric@24 72 extern int bookmark_level;
eric@16 73
eric@16 74
eric@16 75 /* semantic routines for input statements */
eric@19 76 void input_push_context (void);
eric@16 77 void input_pop_context (void);
eric@19 78 void input_set_modifier_context (input_modifier_type_t type);
eric@16 79 void input_set_file (char *name);
eric@19 80 void input_set_rotation (int rotation);
eric@32 81 void input_set_page_size (page_size_t size);
eric@20 82 void input_images (range_t range);
eric@16 83
eric@16 84 /* semantic routines for output statements */
eric@24 85 void output_push_context (void);
eric@24 86 void output_pop_context (void);
eric@30 87
eric@16 88 void output_set_file (char *name);
eric@30 89 void output_set_author (char *author);
eric@30 90 void output_set_creator (char *creator);
eric@30 91 void output_set_title (char *title);
eric@30 92 void output_set_subject (char *subject);
eric@30 93 void output_set_keywords (char *keywords);
eric@30 94
eric@20 95 void output_set_bookmark (char *name);
eric@25 96 void output_set_page_label (page_label_t label);
eric@20 97 void output_pages (range_t range);
eric@26 98
eric@26 99
eric@26 100 /* functions to be called from main program: */
eric@48 101 bool parse_spec_file (char *fn);
eric@48 102 bool process_specs (void);