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