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