1 /* Copyright (C) 2001-2019 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,
8    modified or distributed except as expressly authorized under the terms
9    of the license contained in the file LICENSE in this distribution.
10 
11    Refer to licensing information at http://www.artifex.com or contact
12    Artifex Software, Inc.,  1305 Grant Avenue - Suite 200, Novato,
13    CA 94945, U.S.A., +1(415)492-9861, for further information.
14 */
15 
16 
17 /* Operators for setting trapping parameters and zones */
18 #include "ghost.h"
19 #include "oper.h"
20 #include "ialloc.h"
21 #include "iparam.h"
22 #include "gstrap.h"
23 
24 /* Define the current trap parameters. */
25 /****** THIS IS BOGUS ******/
26 gs_trap_params_t i_trap_params;
27 
28 /* <dict> .settrapparams - */
29 static int
zsettrapparams(i_ctx_t * i_ctx_p)30 zsettrapparams(i_ctx_t *i_ctx_p)
31 {
32     os_ptr op = osp;
33     dict_param_list list;
34     int code;
35 
36     check_type(*op, t_dictionary);
37     code = dict_param_list_read(&list, op, NULL, false, iimemory);
38     if (code < 0)
39         return code;
40     code = gs_settrapparams(&i_trap_params, (gs_param_list *) & list);
41     iparam_list_release(&list);
42     if (code < 0)
43         return code;
44     pop(1);
45     return 0;
46 }
47 
48 /* - settrapzone - */
49 static int
zsettrapzone(i_ctx_t * i_ctx_p)50 zsettrapzone(i_ctx_t *i_ctx_p)
51 {
52 /****** NYI ******/
53     return_error(gs_error_undefined);
54 }
55 
56 /* ------ Initialization procedure ------ */
57 
58 const op_def ztrap_op_defs[] =
59 {
60     op_def_begin_ll3(),
61     {"1.settrapparams", zsettrapparams},
62     {"0settrapzone", zsettrapzone},
63     op_def_end(0)
64 };
65