/src/ghostpdl/pcl/pl/pjtop.c
Line | Count | Source |
1 | | /* Copyright (C) 2001-2023 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., 39 Mesa Street, Suite 108A, San Francisco, |
13 | | CA 94129, USA, for further information. |
14 | | */ |
15 | | |
16 | | |
17 | | /* pjtop.c */ |
18 | | /* Interface to PJL-specific portions parser */ |
19 | | |
20 | | #include "string_.h" |
21 | | #include "pjtop.h" |
22 | | #include "pjparse.h" |
23 | | |
24 | | /* return the current setting of a pjl environment variable. */ |
25 | | pjl_envvar_t * |
26 | | pjl_proc_get_envvar(pl_interp_implementation_t * pli, const char *pjl_var) |
27 | 1.19M | { |
28 | 1.19M | return pjl_get_envvar(pli->interp_client_data, pjl_var); |
29 | 1.19M | } |
30 | | |
31 | | /* compare a pjl environment variable to a string values. */ |
32 | | int |
33 | | pjl_proc_compare(pl_interp_implementation_t * pli, |
34 | | const pjl_envvar_t * s1, const char *s2) |
35 | 418k | { |
36 | 418k | return pjl_compare(s1, s2); |
37 | 418k | } |
38 | | |
39 | | /* map a pjl symbol set name to a pcl integer */ |
40 | | int |
41 | | pjl_proc_map_pjl_sym_to_pcl_sym(pl_interp_implementation_t * pli, |
42 | | const pjl_envvar_t * symname) |
43 | 99.1k | { |
44 | 99.1k | return pjl_map_pjl_sym_to_pcl_sym(symname); |
45 | 99.1k | } |
46 | | |
47 | | /* pjl environment variable to integer. */ |
48 | | int |
49 | | pjl_proc_vartoi(pl_interp_implementation_t * pli, const pjl_envvar_t * s) |
50 | 138k | { |
51 | 138k | return pjl_vartoi(s); |
52 | 138k | } |
53 | | |
54 | | /* pjl envioronment variable to float. */ |
55 | | double |
56 | | pjl_proc_vartof(pl_interp_implementation_t * pli, const pjl_envvar_t * s) |
57 | 297k | { |
58 | 297k | return pjl_vartof(s); |
59 | 297k | } |
60 | | |
61 | | /* convert a pjl designated fontsource to a subdirectory pathname. */ |
62 | | char * |
63 | | pjl_proc_fontsource_to_path(pl_interp_implementation_t * pli, |
64 | | const pjl_envvar_t * fontsource) |
65 | 105k | { |
66 | 105k | return pjl_fontsource_to_path(pli->interp_client_data, fontsource); |
67 | 105k | } |
68 | | |
69 | | /* Change to next highest priority font source. */ |
70 | | void |
71 | | pjl_proc_set_next_fontsource(pl_interp_implementation_t * pli) |
72 | 0 | { |
73 | 0 | pjl_set_next_fontsource(pli->interp_client_data); |
74 | 0 | } |
75 | | |
76 | | /* tell pjl that a soft font is being deleted. */ |
77 | | int |
78 | | pjl_proc_register_permanent_soft_font_deletion(pl_interp_implementation_t * pli, |
79 | | int font_number) |
80 | 0 | { |
81 | 0 | return pjl_register_permanent_soft_font_deletion(pli->interp_client_data, |
82 | 0 | font_number); |
83 | 0 | } |
84 | | |
85 | | /* request that pjl add a soft font and return a pjl font number for the font. */ |
86 | | int |
87 | | pjl_proc_register_permanent_soft_font_addition(pl_interp_implementation_t * pli) |
88 | 0 | { |
89 | 0 | return pjl_register_permanent_soft_font_addition(pli->interp_client_data); |
90 | 0 | } |
91 | | |
92 | | long int |
93 | | pjl_proc_get_named_resource_size(pl_interp_implementation_t * pli, char *name) |
94 | 0 | { |
95 | 0 | return pjl_get_named_resource_size(pli->interp_client_data, name); |
96 | 0 | } |
97 | | |
98 | | int |
99 | | pjl_proc_get_named_resource(pl_interp_implementation_t * pli, char *name, |
100 | | byte * data, long int datasize) |
101 | 0 | { |
102 | 0 | return pjl_get_named_resource(pli->interp_client_data, name, data, datasize); |
103 | 0 | } |
104 | | |
105 | | int |
106 | | pjl_proc_process(pl_interp_implementation_t * pli, stream_cursor_read * pr) |
107 | 5 | { |
108 | | return pjl_process(pli->interp_client_data, NULL, pr); |
109 | 5 | } |