1 /* Copyright (C) 1997 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: gxclzlib.c,v 1.4 2002/02/21 22:24:53 giles Exp $ */
18 /* zlib filter initialization for RAM-based band lists */
19 /* Must be compiled with -I$(ZSRCDIR) */
20 #include "std.h"
21 #include "gstypes.h"
22 #include "gsmemory.h"
23 #include "gxclmem.h"
24 #include "szlibx.h"
25
26 private stream_zlib_state cl_zlibE_state;
27 private stream_zlib_state cl_zlibD_state;
28
29 /* Initialize the states to be copied. */
30 void
gs_cl_zlib_init(gs_memory_t * mem)31 gs_cl_zlib_init(gs_memory_t * mem)
32 {
33 s_zlib_set_defaults((stream_state *) & cl_zlibE_state);
34 cl_zlibE_state.no_wrapper = true;
35 cl_zlibE_state.template = &s_zlibE_template;
36 s_zlib_set_defaults((stream_state *) & cl_zlibD_state);
37 cl_zlibD_state.no_wrapper = true;
38 cl_zlibD_state.template = &s_zlibD_template;
39 }
40
41 /* Return the prototypes for compressing/decompressing the band list. */
42 const stream_state *
clist_compressor_state(void * client_data)43 clist_compressor_state(void *client_data)
44 {
45 return (const stream_state *)&cl_zlibE_state;
46 }
47 const stream_state *
clist_decompressor_state(void * client_data)48 clist_decompressor_state(void *client_data)
49 {
50 return (const stream_state *)&cl_zlibD_state;
51 }
52