2 |
- |
1 |
/* Copyright (C) 1993, 2000 Aladdin Enterprises. All rights reserved.
|
|
|
2 |
|
|
|
3 |
This software is provided AS-IS with no warranty, either express or
|
|
|
4 |
implied.
|
|
|
5 |
|
|
|
6 |
This software is distributed under license and may not be copied,
|
|
|
7 |
modified or distributed except as expressly authorized under the terms
|
|
|
8 |
of the license contained in the file LICENSE in this distribution.
|
|
|
9 |
|
|
|
10 |
For more information about licensing, please refer to
|
|
|
11 |
http://www.ghostscript.com/licensing/. For information on
|
|
|
12 |
commercial licensing, go to http://www.artifex.com/licensing/ or
|
|
|
13 |
contact Artifex Software, Inc., 101 Lucas Valley Road #110,
|
|
|
14 |
San Rafael, CA 94903, U.S.A., +1(415)492-9861.
|
|
|
15 |
*/
|
|
|
16 |
|
|
|
17 |
/* $Id: sfilter.h,v 1.8 2002/02/21 22:24:54 giles Exp $ */
|
|
|
18 |
/* Definitions for simple Ghostscript streams */
|
|
|
19 |
/* Requires scommon.h; should require strimpl.h only if any templates */
|
|
|
20 |
/* are referenced, but some compilers always require strimpl.h. */
|
|
|
21 |
|
|
|
22 |
#ifndef sfilter_INCLUDED
|
|
|
23 |
# define sfilter_INCLUDED
|
|
|
24 |
|
|
|
25 |
#include "gstypes.h" /* for gs_[const_]string */
|
|
|
26 |
|
|
|
27 |
/*
|
|
|
28 |
* Define the processing states of the simplest Ghostscript streams.
|
|
|
29 |
* We use abbreviations for the stream names so as not to exceed the
|
|
|
30 |
* 31-character limit that some compilers put on identifiers.
|
|
|
31 |
*
|
|
|
32 |
* The processing state of a stream has three logical sections:
|
|
|
33 |
* parameters set by the client before the stream is opened,
|
|
|
34 |
* values computed from the parameters at initialization time,
|
|
|
35 |
* and values that change dynamically. Unless otherwise indicated,
|
|
|
36 |
* all structure members change dynamically.
|
|
|
37 |
*/
|
|
|
38 |
|
|
|
39 |
/* eexecEncode */
|
|
|
40 |
typedef struct stream_exE_state_s {
|
|
|
41 |
stream_state_common;
|
|
|
42 |
/* The following parameters are set by the client. */
|
|
|
43 |
ushort cstate; /* encryption state */
|
|
|
44 |
} stream_exE_state;
|
|
|
45 |
|
|
|
46 |
#define private_st_exE_state() /* in sfilter1.c */\
|
|
|
47 |
gs_private_st_simple(st_exE_state, stream_exE_state, "eexecEncode state")
|
|
|
48 |
extern const stream_template s_exE_template;
|
|
|
49 |
|
|
|
50 |
/* eexecDecode */
|
|
|
51 |
typedef struct stream_PFBD_state_s stream_PFBD_state;
|
|
|
52 |
typedef struct stream_exD_state_s {
|
|
|
53 |
stream_state_common;
|
|
|
54 |
/* The following parameters are set by the client. */
|
|
|
55 |
ushort cstate; /* encryption state */
|
|
|
56 |
int binary; /* 1=binary, 0=hex, -1=don't know yet */
|
|
|
57 |
int lenIV; /* # of initial decoded bytes to skip */
|
|
|
58 |
stream_PFBD_state *pfb_state; /* state of underlying */
|
|
|
59 |
/* PFBDecode stream, if any */
|
|
|
60 |
/* The following change dynamically. */
|
|
|
61 |
int odd; /* odd digit */
|
|
|
62 |
long record_left; /* data left in binary record in .PFB file, */
|
|
|
63 |
/* max_long if not reading a .PFB file */
|
|
|
64 |
long hex_left; /* # of encoded chars to process as hex */
|
|
|
65 |
/* if binary == 0 */
|
|
|
66 |
int skip; /* # of decoded bytes to skip */
|
|
|
67 |
} stream_exD_state;
|
|
|
68 |
|
|
|
69 |
#define private_st_exD_state() /* in seexec.c */\
|
|
|
70 |
gs_private_st_ptrs1(st_exD_state, stream_exD_state, "eexecDecode state",\
|
|
|
71 |
exd_enum_ptrs, exd_reloc_ptrs, pfb_state)
|
|
|
72 |
extern const stream_template s_exD_template;
|
|
|
73 |
|
|
|
74 |
/* PFBDecode */
|
|
|
75 |
/* The typedef for the state appears under eexecDecode above. */
|
|
|
76 |
/*typedef */ struct stream_PFBD_state_s {
|
|
|
77 |
stream_state_common;
|
|
|
78 |
/* The following parameters are set by the client. */
|
|
|
79 |
int binary_to_hex;
|
|
|
80 |
/* The following change dynamically. */
|
|
|
81 |
int record_type;
|
|
|
82 |
ulong record_left; /* bytes left in current record */
|
|
|
83 |
} /*stream_PFBD_state */ ;
|
|
|
84 |
|
|
|
85 |
#define private_st_PFBD_state() /* in sfilter1.c */\
|
|
|
86 |
gs_private_st_simple(st_PFBD_state, stream_PFBD_state, "PFBDecode state")
|
|
|
87 |
extern const stream_template s_PFBD_template;
|
|
|
88 |
|
|
|
89 |
/* SubFileDecode */
|
|
|
90 |
typedef struct stream_SFD_state_s {
|
|
|
91 |
stream_state_common;
|
|
|
92 |
/* The following parameters are set by the client. */
|
|
|
93 |
long count; /* # of chars or EODs to scan over */
|
|
|
94 |
gs_const_string eod;
|
|
|
95 |
long skip_count; /* # of initial chars or records to skip */
|
|
|
96 |
/* The following change dynamically. */
|
|
|
97 |
uint match; /* # of matched chars not copied to output */
|
|
|
98 |
uint copy_count; /* # of matched characters left to copy */
|
|
|
99 |
uint copy_ptr; /* index of next character to copy */
|
|
|
100 |
} stream_SFD_state;
|
|
|
101 |
#define private_st_SFD_state() /* in sfilter1.c */\
|
|
|
102 |
gs_private_st_const_strings1(st_SFD_state, stream_SFD_state,\
|
|
|
103 |
"SubFileDecode state", sfd_enum_ptrs, sfd_reloc_ptrs, eod)
|
|
|
104 |
extern const stream_template s_SFD_template;
|
|
|
105 |
|
|
|
106 |
#endif /* sfilter_INCLUDED */
|