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
101
102
103
104
105
|
/*
* $Id: psorder.h,v 1.2 2001/06/29 14:14:46 rufustfirefly Exp $
*
* Copyright (c) 1990,1991 Regents of The University of Michigan.
* All Rights Reserved.
*
* Permission to use, copy, modify, and distribute this software and
* its documentation for any purpose and without fee is hereby granted,
* provided that the above copyright notice appears in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation, and that the name of The University
* of Michigan not be used in advertising or publicity pertaining to
* distribution of the software without specific, written prior
* permission. This software is supplied as is without expressed or
* implied warranties of any kind.
*
* Research Systems Unix Group
* The University of Michigan
* c/o Mike Clark
* 535 W. William Street
* Ann Arbor, Michigan
* +1-313-763-0525
* netatalk@itd.umich.edu
*/
#ifndef STDIN
# define STDIN "-"
#endif /* ! STDIN */
#ifndef FALSE
# define FALSE 0
# define TRUE 1
#endif /* ! FALSE */
#define REVCHAR 'd'
#define FORWCHAR 'u'
#define FORCECHAR 'f'
#define OPTSTR "duf"
#define WHITESPACE " \t"
#define ATEND "(atend)"
#define PPSADOBE "%!PS-Adobe-"
#define PPAGE "%%Page:"
#define PPAGES "%%Pages:"
#define PTRAILER "%%Trailer"
#define PBEGINDOC "%%BeginDocument:"
#define PENDDOC "%%EndDocument"
#define PBEGINBIN "%%BeginBinary:"
#define PENDBIN "%%EndBinary"
#define REWIND 0L
#define REVERSE 1
#define FORWARD 2
#define LABELLEN 32
#define ORDLEN 4
struct pspage_st {
struct pspage_st *nextpage;
struct pspage_st *prevpage;
off_t offset;
char lable[ LABELLEN ];
char ord[ ORDLEN ];
};
#define NUMLEN 10
#define ORDERLEN 3
struct pages_st {
off_t offset;
off_t end;
char num[ NUMLEN ];
char order[ ORDERLEN ];
};
struct psinfo_st {
struct pspage_st *firstpage;
struct pspage_st *lastpage;
off_t trailer;
struct pages_st pages;
};
int
psorder();
void
filesetup();
void
readps();
int
handletok();
void
writeps();
void
writelable();
void
temp2out();
struct pspage_st
*getpspage();
void
filecleanup();
|