xref: /plan9/sys/src/cmd/gs/src/ztrap.c (revision 593dc095aefb2a85c828727bbfa9da139a49bdf4)
1 /* Copyright (C) 1997, 1998, 1999 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: ztrap.c,v 1.4 2002/02/21 22:24:54 giles Exp $ */
18 /* Operators for setting trapping parameters and zones */
19 #include "ghost.h"
20 #include "oper.h"
21 #include "ialloc.h"
22 #include "iparam.h"
23 #include "gstrap.h"
24 
25 /* Define the current trap parameters. */
26 /****** THIS IS BOGUS ******/
27 gs_trap_params_t i_trap_params;
28 
29 /* <dict> .settrapparams - */
30 private int
zsettrapparams(i_ctx_t * i_ctx_p)31 zsettrapparams(i_ctx_t *i_ctx_p)
32 {
33     os_ptr op = osp;
34     dict_param_list list;
35     int code;
36 
37     check_type(*op, t_dictionary);
38     code = dict_param_list_read(&list, op, NULL, false, iimemory);
39     if (code < 0)
40 	return code;
41     code = gs_settrapparams(&i_trap_params, (gs_param_list *) & list);
42     iparam_list_release(&list);
43     if (code < 0)
44 	return code;
45     pop(1);
46     return 0;
47 }
48 
49 /* - settrapzone - */
50 private int
zsettrapzone(i_ctx_t * i_ctx_p)51 zsettrapzone(i_ctx_t *i_ctx_p)
52 {
53 /****** NYI ******/
54     return_error(e_undefined);
55 }
56 
57 /* ------ Initialization procedure ------ */
58 
59 const op_def ztrap_op_defs[] =
60 {
61     op_def_begin_ll3(),
62     {"1.settrapparams", zsettrapparams},
63     {"0settrapzone", zsettrapzone},
64     op_def_end(0)
65 };
66