1 /* Copyright (C) 2001-2006 Artifex Software, Inc.
2    All Rights Reserved.
3 
4    This software is provided AS-IS with no warranty, either express or
5    implied.
6 
7    This software is distributed under license and may not be copied, modified
8    or distributed except as expressly authorized under the terms of that
9    license.  Refer to licensing information at http://www.artifex.com/
10    or contact Artifex Software, Inc.,  7 Mt. Lassen Drive - Suite A-134,
11    San Rafael, CA  94903, U.S.A., +1(415)492-9861, for further information.
12 */
13 
14 /* $Id: gxclzlib.c 8250 2007-09-25 13:31:24Z giles $ */
15 /* zlib filter initialization for RAM-based band lists */
16 /* Must be compiled with -I$(ZSRCDIR) */
17 #include "std.h"
18 #include "gstypes.h"
19 #include "gsmemory.h"
20 #include "gxclmem.h"
21 #include "szlibx.h"
22 
23 static stream_zlib_state cl_zlibE_state;
24 static stream_zlib_state cl_zlibD_state;
25 
26 /* Initialize the states to be copied. */
27 int
gs_cl_zlib_init(gs_memory_t * mem)28 gs_cl_zlib_init(gs_memory_t * mem)
29 {
30     s_zlib_set_defaults((stream_state *) & cl_zlibE_state);
31     cl_zlibE_state.no_wrapper = true;
32     cl_zlibE_state.template = &s_zlibE_template;
33     s_zlib_set_defaults((stream_state *) & cl_zlibD_state);
34     cl_zlibD_state.no_wrapper = true;
35     cl_zlibD_state.template = &s_zlibD_template;
36     return 0;
37 }
38 
39 /* Return the prototypes for compressing/decompressing the band list. */
40 const stream_state *
clist_compressor_state(void * client_data)41 clist_compressor_state(void *client_data)
42 {
43     return (const stream_state *)&cl_zlibE_state;
44 }
45 const stream_state *
clist_decompressor_state(void * client_data)46 clist_decompressor_state(void *client_data)
47 {
48     return (const stream_state *)&cl_zlibD_state;
49 }
50