]> arthur.barton.de Git - netatalk.git/blob - bin/psorder/psorder.h
Initial revision
[netatalk.git] / bin / psorder / psorder.h
1 /*
2  * Copyright (c) 1990,1991 Regents of The University of Michigan.
3  * All Rights Reserved.
4  *
5  * Permission to use, copy, modify, and distribute this software and
6  * its documentation for any purpose and without fee is hereby granted,
7  * provided that the above copyright notice appears in all copies and
8  * that both that copyright notice and this permission notice appear
9  * in supporting documentation, and that the name of The University
10  * of Michigan not be used in advertising or publicity pertaining to
11  * distribution of the software without specific, written prior
12  * permission. This software is supplied as is without expressed or
13  * implied warranties of any kind.
14  *
15  *      Research Systems Unix Group
16  *      The University of Michigan
17  *      c/o Mike Clark
18  *      535 W. William Street
19  *      Ann Arbor, Michigan
20  *      +1-313-763-0525
21  *      netatalk@itd.umich.edu
22  */
23
24 #ifndef STDIN
25 #       define  STDIN   "-"
26 #endif
27 #ifndef FALSE
28 #       define  FALSE   0
29 #       define  TRUE    1
30 #endif
31
32 #define REVCHAR         'd'
33 #define FORWCHAR        'u'
34 #define FORCECHAR       'f'
35 #define OPTSTR          "duf"
36
37 #define WHITESPACE      " \t"
38 #define ATEND           "(atend)"
39 #define PPSADOBE        "%!PS-Adobe-"
40 #define PPAGE           "%%Page:"
41 #define PPAGES          "%%Pages:"
42 #define PTRAILER        "%%Trailer"
43 #define PBEGINDOC       "%%BeginDocument:"
44 #define PENDDOC         "%%EndDocument"
45 #define PBEGINBIN       "%%BeginBinary:"
46 #define PENDBIN         "%%EndBinary"
47
48 #define REWIND          0L
49 #define REVERSE         1
50 #define FORWARD         2
51
52 #define LABELLEN        32
53 #define ORDLEN          4
54 struct pspage_st {
55     struct pspage_st    *nextpage;
56     struct pspage_st    *prevpage;
57     off_t               offset;
58     char                lable[ LABELLEN ];
59     char                ord[ ORDLEN ];
60 };
61
62 #define NUMLEN          10
63 #define ORDERLEN        3
64 struct pages_st {
65     off_t               offset;
66     off_t               end;
67     char                num[ NUMLEN ];
68     char                order[ ORDERLEN ];
69 };
70
71 struct psinfo_st {
72     struct pspage_st    *firstpage;
73     struct pspage_st    *lastpage;
74     off_t               trailer;
75     struct pages_st     pages;
76 };
77
78 int
79 psorder();
80
81 void
82 filesetup();
83
84 void
85 readps();
86
87 int
88 handletok();
89
90 void
91 writeps();
92
93 void
94 writelable();
95
96 void
97 temp2out();
98
99 struct pspage_st
100 *getpspage();
101
102 void
103 filecleanup();