]> git.wh0rd.org Git - ICEs.git/blob - 148285/gdevpdfe.i.0
initial import
[ICEs.git] / 148285 / gdevpdfe.i.0
1 # 1 "./src/gdevpdfe.c"
2 # 1 "/var/tmp/portage/app-text/ghostscript-gpl-8.54/work/ghostscript-8.54-gpl//"
3 # 1 "<built-in>"
4 # 1 "<command line>"
5 # 1 "./src/gdevpdfe.c"
6 # 16 "./src/gdevpdfe.c"
7 # 1 "./src/gx.h" 1
8 # 20 "./src/gx.h"
9 # 1 "./src/stdio_.h" 1
10 # 24 "./src/stdio_.h"
11 # 1 "./src/std.h" 1
12 # 20 "./src/std.h"
13 # 1 "./src/stdpre.h" 1
14 # 244 "./src/stdpre.h"
15 typedef unsigned char byte;
16 typedef unsigned char uchar;
17 typedef unsigned short ushort;
18 typedef unsigned int uint;
19 typedef unsigned long ulong;
20 # 264 "./src/stdpre.h"
21 # 1 "/usr/include/sys/types.h" 1 3 4
22 # 27 "/usr/include/sys/types.h" 3 4
23 # 1 "/usr/include/features.h" 1 3 4
24 # 323 "/usr/include/features.h" 3 4
25 # 1 "/usr/include/sys/cdefs.h" 1 3 4
26 # 313 "/usr/include/sys/cdefs.h" 3 4
27 # 1 "/usr/include/bits/wordsize.h" 1 3 4
28 # 314 "/usr/include/sys/cdefs.h" 2 3 4
29 # 324 "/usr/include/features.h" 2 3 4
30 # 346 "/usr/include/features.h" 3 4
31 # 1 "/usr/include/gnu/stubs.h" 1 3 4
32
33
34
35 # 1 "/usr/include/bits/wordsize.h" 1 3 4
36 # 5 "/usr/include/gnu/stubs.h" 2 3 4
37
38
39 # 1 "/usr/include/gnu/stubs-32.h" 1 3 4
40 # 8 "/usr/include/gnu/stubs.h" 2 3 4
41 # 347 "/usr/include/features.h" 2 3 4
42 # 28 "/usr/include/sys/types.h" 2 3 4
43
44
45
46 # 1 "/usr/include/bits/types.h" 1 3 4
47 # 28 "/usr/include/bits/types.h" 3 4
48 # 1 "/usr/include/bits/wordsize.h" 1 3 4
49 # 29 "/usr/include/bits/types.h" 2 3 4
50
51
52 # 1 "/usr/lib/gcc/i686-pc-linux-gnu/4.1.1/include/stddef.h" 1 3 4
53 # 214 "/usr/lib/gcc/i686-pc-linux-gnu/4.1.1/include/stddef.h" 3 4
54 typedef unsigned int size_t;
55 # 32 "/usr/include/bits/types.h" 2 3 4
56
57
58 typedef unsigned char __u_char;
59 typedef unsigned short int __u_short;
60 typedef unsigned int __u_int;
61 typedef unsigned long int __u_long;
62
63
64 typedef signed char __int8_t;
65 typedef unsigned char __uint8_t;
66 typedef signed short int __int16_t;
67 typedef unsigned short int __uint16_t;
68 typedef signed int __int32_t;
69 typedef unsigned int __uint32_t;
70
71
72
73
74 __extension__ typedef signed long long int __int64_t;
75 __extension__ typedef unsigned long long int __uint64_t;
76
77
78
79
80
81
82
83 __extension__ typedef long long int __quad_t;
84 __extension__ typedef unsigned long long int __u_quad_t;
85 # 134 "/usr/include/bits/types.h" 3 4
86 # 1 "/usr/include/bits/typesizes.h" 1 3 4
87 # 135 "/usr/include/bits/types.h" 2 3 4
88
89
90 __extension__ typedef __u_quad_t __dev_t;
91 __extension__ typedef unsigned int __uid_t;
92 __extension__ typedef unsigned int __gid_t;
93 __extension__ typedef unsigned long int __ino_t;
94 __extension__ typedef __u_quad_t __ino64_t;
95 __extension__ typedef unsigned int __mode_t;
96 __extension__ typedef unsigned int __nlink_t;
97 __extension__ typedef long int __off_t;
98 __extension__ typedef __quad_t __off64_t;
99 __extension__ typedef int __pid_t;
100 __extension__ typedef struct { int __val[2]; } __fsid_t;
101 __extension__ typedef long int __clock_t;
102 __extension__ typedef unsigned long int __rlim_t;
103 __extension__ typedef __u_quad_t __rlim64_t;
104 __extension__ typedef unsigned int __id_t;
105 __extension__ typedef long int __time_t;
106 __extension__ typedef unsigned int __useconds_t;
107 __extension__ typedef long int __suseconds_t;
108
109 __extension__ typedef int __daddr_t;
110 __extension__ typedef long int __swblk_t;
111 __extension__ typedef int __key_t;
112
113
114 __extension__ typedef int __clockid_t;
115
116
117 __extension__ typedef void * __timer_t;
118
119
120 __extension__ typedef long int __blksize_t;
121
122
123
124
125 __extension__ typedef long int __blkcnt_t;
126 __extension__ typedef __quad_t __blkcnt64_t;
127
128
129 __extension__ typedef unsigned long int __fsblkcnt_t;
130 __extension__ typedef __u_quad_t __fsblkcnt64_t;
131
132
133 __extension__ typedef unsigned long int __fsfilcnt_t;
134 __extension__ typedef __u_quad_t __fsfilcnt64_t;
135
136 __extension__ typedef int __ssize_t;
137
138
139
140 typedef __off64_t __loff_t;
141 typedef __quad_t *__qaddr_t;
142 typedef char *__caddr_t;
143
144
145 __extension__ typedef int __intptr_t;
146
147
148 __extension__ typedef unsigned int __socklen_t;
149 # 32 "/usr/include/sys/types.h" 2 3 4
150
151
152
153 typedef __u_char u_char;
154 typedef __u_short u_short;
155 typedef __u_int u_int;
156 typedef __u_long u_long;
157 typedef __quad_t quad_t;
158 typedef __u_quad_t u_quad_t;
159 typedef __fsid_t fsid_t;
160
161
162
163
164 typedef __loff_t loff_t;
165
166
167
168 typedef __ino_t ino_t;
169 # 62 "/usr/include/sys/types.h" 3 4
170 typedef __dev_t dev_t;
171
172
173
174
175 typedef __gid_t gid_t;
176
177
178
179
180 typedef __mode_t mode_t;
181
182
183
184
185 typedef __nlink_t nlink_t;
186
187
188
189
190 typedef __uid_t uid_t;
191
192
193
194
195
196 typedef __off_t off_t;
197 # 100 "/usr/include/sys/types.h" 3 4
198 typedef __pid_t pid_t;
199
200
201
202
203 typedef __id_t id_t;
204
205
206
207
208 typedef __ssize_t ssize_t;
209
210
211
212
213
214 typedef __daddr_t daddr_t;
215 typedef __caddr_t caddr_t;
216
217
218
219
220
221 typedef __key_t key_t;
222 # 133 "/usr/include/sys/types.h" 3 4
223 # 1 "/usr/include/time.h" 1 3 4
224 # 75 "/usr/include/time.h" 3 4
225
226
227 typedef __time_t time_t;
228
229
230
231 # 93 "/usr/include/time.h" 3 4
232 typedef __clockid_t clockid_t;
233 # 105 "/usr/include/time.h" 3 4
234 typedef __timer_t timer_t;
235 # 134 "/usr/include/sys/types.h" 2 3 4
236 # 147 "/usr/include/sys/types.h" 3 4
237 # 1 "/usr/lib/gcc/i686-pc-linux-gnu/4.1.1/include/stddef.h" 1 3 4
238 # 148 "/usr/include/sys/types.h" 2 3 4
239
240
241
242 typedef unsigned long int ulong_;
243 typedef unsigned short int ushort_;
244 typedef unsigned int uint_;
245 # 195 "/usr/include/sys/types.h" 3 4
246 typedef int int8_t __attribute__ ((__mode__ (__QI__)));
247 typedef int int16_t __attribute__ ((__mode__ (__HI__)));
248 typedef int int32_t __attribute__ ((__mode__ (__SI__)));
249 typedef int int64_t __attribute__ ((__mode__ (__DI__)));
250
251
252 typedef unsigned int u_int8_t __attribute__ ((__mode__ (__QI__)));
253 typedef unsigned int u_int16_t __attribute__ ((__mode__ (__HI__)));
254 typedef unsigned int u_int32_t __attribute__ ((__mode__ (__SI__)));
255 typedef unsigned int u_int64_t __attribute__ ((__mode__ (__DI__)));
256
257 typedef int register_t __attribute__ ((__mode__ (__word__)));
258 # 217 "/usr/include/sys/types.h" 3 4
259 # 1 "/usr/include/endian.h" 1 3 4
260 # 37 "/usr/include/endian.h" 3 4
261 # 1 "/usr/include/bits/endian.h" 1 3 4
262 # 38 "/usr/include/endian.h" 2 3 4
263 # 218 "/usr/include/sys/types.h" 2 3 4
264
265
266 # 1 "/usr/include/sys/select.h" 1 3 4
267 # 31 "/usr/include/sys/select.h" 3 4
268 # 1 "/usr/include/bits/select.h" 1 3 4
269 # 32 "/usr/include/sys/select.h" 2 3 4
270
271
272 # 1 "/usr/include/bits/sigset.h" 1 3 4
273 # 23 "/usr/include/bits/sigset.h" 3 4
274 typedef int __sig_atomic_t;
275
276
277
278
279 typedef struct
280   {
281     unsigned long int __val[(1024 / (8 * sizeof (unsigned long int)))];
282   } __sigset_t;
283 # 35 "/usr/include/sys/select.h" 2 3 4
284
285
286
287 typedef __sigset_t sigset_t;
288
289
290
291
292
293 # 1 "/usr/include/time.h" 1 3 4
294 # 121 "/usr/include/time.h" 3 4
295 struct timespec
296   {
297     __time_t tv_sec;
298     long int tv_nsec;
299   };
300 # 45 "/usr/include/sys/select.h" 2 3 4
301
302 # 1 "/usr/include/bits/time.h" 1 3 4
303 # 69 "/usr/include/bits/time.h" 3 4
304 struct timeval
305   {
306     __time_t tv_sec;
307     __suseconds_t tv_usec;
308   };
309 # 47 "/usr/include/sys/select.h" 2 3 4
310
311
312 typedef __suseconds_t suseconds_t;
313
314
315
316
317
318 typedef long int __fd_mask;
319 # 67 "/usr/include/sys/select.h" 3 4
320 typedef struct
321   {
322
323
324
325
326
327
328     __fd_mask __fds_bits[1024 / (8 * sizeof (__fd_mask))];
329
330
331   } fd_set;
332
333
334
335
336
337
338 typedef __fd_mask fd_mask;
339 # 99 "/usr/include/sys/select.h" 3 4
340
341 # 109 "/usr/include/sys/select.h" 3 4
342 extern int select (int __nfds, fd_set *__restrict __readfds,
343      fd_set *__restrict __writefds,
344      fd_set *__restrict __exceptfds,
345      struct timeval *__restrict __timeout);
346 # 121 "/usr/include/sys/select.h" 3 4
347 extern int pselect (int __nfds, fd_set *__restrict __readfds,
348       fd_set *__restrict __writefds,
349       fd_set *__restrict __exceptfds,
350       const struct timespec *__restrict __timeout,
351       const __sigset_t *__restrict __sigmask);
352
353
354
355 # 221 "/usr/include/sys/types.h" 2 3 4
356
357
358 # 1 "/usr/include/sys/sysmacros.h" 1 3 4
359 # 29 "/usr/include/sys/sysmacros.h" 3 4
360 __extension__
361 extern __inline unsigned int gnu_dev_major (unsigned long long int __dev)
362      __attribute__ ((__nothrow__));
363 __extension__
364 extern __inline unsigned int gnu_dev_minor (unsigned long long int __dev)
365      __attribute__ ((__nothrow__));
366 __extension__
367 extern __inline unsigned long long int gnu_dev_makedev (unsigned int __major,
368        unsigned int __minor)
369      __attribute__ ((__nothrow__));
370
371
372 __extension__ extern __inline unsigned int
373 __attribute__ ((__nothrow__)) gnu_dev_major (unsigned long long int __dev)
374 {
375   return ((__dev >> 8) & 0xfff) | ((unsigned int) (__dev >> 32) & ~0xfff);
376 }
377
378 __extension__ extern __inline unsigned int
379 __attribute__ ((__nothrow__)) gnu_dev_minor (unsigned long long int __dev)
380 {
381   return (__dev & 0xff) | ((unsigned int) (__dev >> 12) & ~0xff);
382 }
383
384 __extension__ extern __inline unsigned long long int
385 __attribute__ ((__nothrow__)) gnu_dev_makedev (unsigned int __major, unsigned int __minor)
386 {
387   return ((__minor & 0xff) | ((__major & 0xfff) << 8)
388    | (((unsigned long long int) (__minor & ~0xff)) << 12)
389    | (((unsigned long long int) (__major & ~0xfff)) << 32));
390 }
391 # 224 "/usr/include/sys/types.h" 2 3 4
392 # 235 "/usr/include/sys/types.h" 3 4
393 typedef __blkcnt_t blkcnt_t;
394
395
396
397 typedef __fsblkcnt_t fsblkcnt_t;
398
399
400
401 typedef __fsfilcnt_t fsfilcnt_t;
402 # 270 "/usr/include/sys/types.h" 3 4
403 # 1 "/usr/include/bits/pthreadtypes.h" 1 3 4
404 # 36 "/usr/include/bits/pthreadtypes.h" 3 4
405 typedef unsigned long int pthread_t;
406
407
408 typedef union
409 {
410   char __size[36];
411   long int __align;
412 } pthread_attr_t;
413
414
415 typedef struct __pthread_internal_slist
416 {
417   struct __pthread_internal_slist *__next;
418 } __pthread_slist_t;
419
420
421
422
423 typedef union
424 {
425   struct __pthread_mutex_s
426   {
427     int __lock;
428     unsigned int __count;
429     int __owner;
430
431
432     int __kind;
433     unsigned int __nusers;
434     __extension__ union
435     {
436       int __spins;
437       __pthread_slist_t __list;
438     };
439   } __data;
440   char __size[24];
441   long int __align;
442 } pthread_mutex_t;
443
444 typedef union
445 {
446   char __size[4];
447   long int __align;
448 } pthread_mutexattr_t;
449
450
451
452
453 typedef union
454 {
455   struct
456   {
457     int __lock;
458     unsigned int __futex;
459     __extension__ unsigned long long int __total_seq;
460     __extension__ unsigned long long int __wakeup_seq;
461     __extension__ unsigned long long int __woken_seq;
462     void *__mutex;
463     unsigned int __nwaiters;
464     unsigned int __broadcast_seq;
465   } __data;
466   char __size[48];
467   __extension__ long long int __align;
468 } pthread_cond_t;
469
470 typedef union
471 {
472   char __size[4];
473   long int __align;
474 } pthread_condattr_t;
475
476
477
478 typedef unsigned int pthread_key_t;
479
480
481
482 typedef int pthread_once_t;
483
484
485
486
487
488 typedef union
489 {
490   struct
491   {
492     int __lock;
493     unsigned int __nr_readers;
494     unsigned int __readers_wakeup;
495     unsigned int __writer_wakeup;
496     unsigned int __nr_readers_queued;
497     unsigned int __nr_writers_queued;
498
499
500     unsigned int __flags;
501     int __writer;
502   } __data;
503   char __size[32];
504   long int __align;
505 } pthread_rwlock_t;
506
507 typedef union
508 {
509   char __size[8];
510   long int __align;
511 } pthread_rwlockattr_t;
512
513
514
515
516
517 typedef volatile int pthread_spinlock_t;
518
519
520
521
522 typedef union
523 {
524   char __size[20];
525   long int __align;
526 } pthread_barrier_t;
527
528 typedef union
529 {
530   char __size[4];
531   int __align;
532 } pthread_barrierattr_t;
533 # 271 "/usr/include/sys/types.h" 2 3 4
534
535
536
537 # 265 "./src/stdpre.h" 2
538 # 285 "./src/stdpre.h"
539 typedef int bool;
540 # 322 "./src/stdpre.h"
541 typedef const char *ptr_ord_t;
542 # 363 "./src/stdpre.h"
543 typedef double floatp;
544 # 391 "./src/stdpre.h"
545 typedef const char *client_name_t;
546 # 419 "./src/stdpre.h"
547 # 1 "./src/stdpn.h" 1
548 # 420 "./src/stdpre.h" 2
549 # 21 "./src/std.h" 2
550
551
552 # 1 "./obj/../soobj/arch.h" 1
553 # 24 "./src/std.h" 2
554 # 68 "./src/std.h"
555 typedef ushort bits16;
556
557
558 typedef uint bits32;
559 # 142 "./src/std.h"
560 # 1 "/usr/include/stdio.h" 1 3 4
561 # 30 "/usr/include/stdio.h" 3 4
562
563
564
565
566 # 1 "/usr/lib/gcc/i686-pc-linux-gnu/4.1.1/include/stddef.h" 1 3 4
567 # 35 "/usr/include/stdio.h" 2 3 4
568 # 44 "/usr/include/stdio.h" 3 4
569
570
571 typedef struct _IO_FILE FILE;
572
573
574
575
576
577 # 62 "/usr/include/stdio.h" 3 4
578 typedef struct _IO_FILE __FILE;
579 # 72 "/usr/include/stdio.h" 3 4
580 # 1 "/usr/include/libio.h" 1 3 4
581 # 32 "/usr/include/libio.h" 3 4
582 # 1 "/usr/include/_G_config.h" 1 3 4
583 # 14 "/usr/include/_G_config.h" 3 4
584 # 1 "/usr/lib/gcc/i686-pc-linux-gnu/4.1.1/include/stddef.h" 1 3 4
585 # 326 "/usr/lib/gcc/i686-pc-linux-gnu/4.1.1/include/stddef.h" 3 4
586 typedef long int wchar_t;
587 # 355 "/usr/lib/gcc/i686-pc-linux-gnu/4.1.1/include/stddef.h" 3 4
588 typedef unsigned int wint_t;
589 # 15 "/usr/include/_G_config.h" 2 3 4
590 # 24 "/usr/include/_G_config.h" 3 4
591 # 1 "/usr/include/wchar.h" 1 3 4
592 # 48 "/usr/include/wchar.h" 3 4
593 # 1 "/usr/lib/gcc/i686-pc-linux-gnu/4.1.1/include/stddef.h" 1 3 4
594 # 49 "/usr/include/wchar.h" 2 3 4
595
596 # 1 "/usr/include/bits/wchar.h" 1 3 4
597 # 51 "/usr/include/wchar.h" 2 3 4
598 # 76 "/usr/include/wchar.h" 3 4
599 typedef struct
600 {
601   int __count;
602   union
603   {
604     wint_t __wch;
605     char __wchb[4];
606   } __value;
607 } __mbstate_t;
608 # 25 "/usr/include/_G_config.h" 2 3 4
609
610 typedef struct
611 {
612   __off_t __pos;
613   __mbstate_t __state;
614 } _G_fpos_t;
615 typedef struct
616 {
617   __off64_t __pos;
618   __mbstate_t __state;
619 } _G_fpos64_t;
620 # 44 "/usr/include/_G_config.h" 3 4
621 # 1 "/usr/include/gconv.h" 1 3 4
622 # 28 "/usr/include/gconv.h" 3 4
623 # 1 "/usr/include/wchar.h" 1 3 4
624 # 48 "/usr/include/wchar.h" 3 4
625 # 1 "/usr/lib/gcc/i686-pc-linux-gnu/4.1.1/include/stddef.h" 1 3 4
626 # 49 "/usr/include/wchar.h" 2 3 4
627 # 29 "/usr/include/gconv.h" 2 3 4
628
629
630 # 1 "/usr/lib/gcc/i686-pc-linux-gnu/4.1.1/include/stddef.h" 1 3 4
631 # 32 "/usr/include/gconv.h" 2 3 4
632
633
634
635
636
637 enum
638 {
639   __GCONV_OK = 0,
640   __GCONV_NOCONV,
641   __GCONV_NODB,
642   __GCONV_NOMEM,
643
644   __GCONV_EMPTY_INPUT,
645   __GCONV_FULL_OUTPUT,
646   __GCONV_ILLEGAL_INPUT,
647   __GCONV_INCOMPLETE_INPUT,
648
649   __GCONV_ILLEGAL_DESCRIPTOR,
650   __GCONV_INTERNAL_ERROR
651 };
652
653
654
655 enum
656 {
657   __GCONV_IS_LAST = 0x0001,
658   __GCONV_IGNORE_ERRORS = 0x0002
659 };
660
661
662
663 struct __gconv_step;
664 struct __gconv_step_data;
665 struct __gconv_loaded_object;
666 struct __gconv_trans_data;
667
668
669
670 typedef int (*__gconv_fct) (struct __gconv_step *, struct __gconv_step_data *,
671        __const unsigned char **, __const unsigned char *,
672        unsigned char **, size_t *, int, int);
673
674
675 typedef wint_t (*__gconv_btowc_fct) (struct __gconv_step *, unsigned char);
676
677
678 typedef int (*__gconv_init_fct) (struct __gconv_step *);
679 typedef void (*__gconv_end_fct) (struct __gconv_step *);
680
681
682
683 typedef int (*__gconv_trans_fct) (struct __gconv_step *,
684       struct __gconv_step_data *, void *,
685       __const unsigned char *,
686       __const unsigned char **,
687       __const unsigned char *, unsigned char **,
688       size_t *);
689
690
691 typedef int (*__gconv_trans_context_fct) (void *, __const unsigned char *,
692        __const unsigned char *,
693        unsigned char *, unsigned char *);
694
695
696 typedef int (*__gconv_trans_query_fct) (__const char *, __const char ***,
697      size_t *);
698
699
700 typedef int (*__gconv_trans_init_fct) (void **, const char *);
701 typedef void (*__gconv_trans_end_fct) (void *);
702
703 struct __gconv_trans_data
704 {
705
706   __gconv_trans_fct __trans_fct;
707   __gconv_trans_context_fct __trans_context_fct;
708   __gconv_trans_end_fct __trans_end_fct;
709   void *__data;
710   struct __gconv_trans_data *__next;
711 };
712
713
714
715 struct __gconv_step
716 {
717   struct __gconv_loaded_object *__shlib_handle;
718   __const char *__modname;
719
720   int __counter;
721
722   char *__from_name;
723   char *__to_name;
724
725   __gconv_fct __fct;
726   __gconv_btowc_fct __btowc_fct;
727   __gconv_init_fct __init_fct;
728   __gconv_end_fct __end_fct;
729
730
731
732   int __min_needed_from;
733   int __max_needed_from;
734   int __min_needed_to;
735   int __max_needed_to;
736
737
738   int __stateful;
739
740   void *__data;
741 };
742
743
744
745 struct __gconv_step_data
746 {
747   unsigned char *__outbuf;
748   unsigned char *__outbufend;
749
750
751
752   int __flags;
753
754
755
756   int __invocation_counter;
757
758
759
760   int __internal_use;
761
762   __mbstate_t *__statep;
763   __mbstate_t __state;
764
765
766
767   struct __gconv_trans_data *__trans;
768 };
769
770
771
772 typedef struct __gconv_info
773 {
774   size_t __nsteps;
775   struct __gconv_step *__steps;
776   __extension__ struct __gconv_step_data __data [];
777 } *__gconv_t;
778 # 45 "/usr/include/_G_config.h" 2 3 4
779 typedef union
780 {
781   struct __gconv_info __cd;
782   struct
783   {
784     struct __gconv_info __cd;
785     struct __gconv_step_data __data;
786   } __combined;
787 } _G_iconv_t;
788
789 typedef int _G_int16_t __attribute__ ((__mode__ (__HI__)));
790 typedef int _G_int32_t __attribute__ ((__mode__ (__SI__)));
791 typedef unsigned int _G_uint16_t __attribute__ ((__mode__ (__HI__)));
792 typedef unsigned int _G_uint32_t __attribute__ ((__mode__ (__SI__)));
793 # 33 "/usr/include/libio.h" 2 3 4
794 # 53 "/usr/include/libio.h" 3 4
795 # 1 "/usr/lib/gcc/i686-pc-linux-gnu/4.1.1/include/stdarg.h" 1 3 4
796 # 43 "/usr/lib/gcc/i686-pc-linux-gnu/4.1.1/include/stdarg.h" 3 4
797 typedef __builtin_va_list __gnuc_va_list;
798 # 54 "/usr/include/libio.h" 2 3 4
799 # 166 "/usr/include/libio.h" 3 4
800 struct _IO_jump_t; struct _IO_FILE;
801 # 176 "/usr/include/libio.h" 3 4
802 typedef void _IO_lock_t;
803
804
805
806
807
808 struct _IO_marker {
809   struct _IO_marker *_next;
810   struct _IO_FILE *_sbuf;
811
812
813
814   int _pos;
815 # 199 "/usr/include/libio.h" 3 4
816 };
817
818
819 enum __codecvt_result
820 {
821   __codecvt_ok,
822   __codecvt_partial,
823   __codecvt_error,
824   __codecvt_noconv
825 };
826 # 267 "/usr/include/libio.h" 3 4
827 struct _IO_FILE {
828   int _flags;
829
830
831
832
833   char* _IO_read_ptr;
834   char* _IO_read_end;
835   char* _IO_read_base;
836   char* _IO_write_base;
837   char* _IO_write_ptr;
838   char* _IO_write_end;
839   char* _IO_buf_base;
840   char* _IO_buf_end;
841
842   char *_IO_save_base;
843   char *_IO_backup_base;
844   char *_IO_save_end;
845
846   struct _IO_marker *_markers;
847
848   struct _IO_FILE *_chain;
849
850   int _fileno;
851
852
853
854   int _flags2;
855
856   __off_t _old_offset;
857
858
859
860   unsigned short _cur_column;
861   signed char _vtable_offset;
862   char _shortbuf[1];
863
864
865
866   _IO_lock_t *_lock;
867 # 315 "/usr/include/libio.h" 3 4
868   __off64_t _offset;
869 # 324 "/usr/include/libio.h" 3 4
870   void *__pad1;
871   void *__pad2;
872   void *__pad3;
873   void *__pad4;
874   size_t __pad5;
875
876   int _mode;
877
878   char _unused2[15 * sizeof (int) - 4 * sizeof (void *) - sizeof (size_t)];
879
880 };
881
882
883 typedef struct _IO_FILE _IO_FILE;
884
885
886 struct _IO_FILE_plus;
887
888 extern struct _IO_FILE_plus _IO_2_1_stdin_;
889 extern struct _IO_FILE_plus _IO_2_1_stdout_;
890 extern struct _IO_FILE_plus _IO_2_1_stderr_;
891 # 360 "/usr/include/libio.h" 3 4
892 typedef __ssize_t __io_read_fn (void *__cookie, char *__buf, size_t __nbytes);
893
894
895
896
897
898
899
900 typedef __ssize_t __io_write_fn (void *__cookie, __const char *__buf,
901      size_t __n);
902
903
904
905
906
907
908
909 typedef int __io_seek_fn (void *__cookie, __off64_t *__pos, int __w);
910
911
912 typedef int __io_close_fn (void *__cookie);
913 # 412 "/usr/include/libio.h" 3 4
914 extern int __underflow (_IO_FILE *) __attribute__ ((__nothrow__));
915 extern int __uflow (_IO_FILE *) __attribute__ ((__nothrow__));
916 extern int __overflow (_IO_FILE *, int) __attribute__ ((__nothrow__));
917 extern wint_t __wunderflow (_IO_FILE *) __attribute__ ((__nothrow__));
918 extern wint_t __wuflow (_IO_FILE *) __attribute__ ((__nothrow__));
919 extern wint_t __woverflow (_IO_FILE *, wint_t) __attribute__ ((__nothrow__));
920 # 450 "/usr/include/libio.h" 3 4
921 extern int _IO_getc (_IO_FILE *__fp) __attribute__ ((__nothrow__));
922 extern int _IO_putc (int __c, _IO_FILE *__fp) __attribute__ ((__nothrow__));
923 extern int _IO_feof (_IO_FILE *__fp) __attribute__ ((__nothrow__));
924 extern int _IO_ferror (_IO_FILE *__fp) __attribute__ ((__nothrow__));
925
926 extern int _IO_peekc_locked (_IO_FILE *__fp) __attribute__ ((__nothrow__));
927
928
929
930
931
932 extern void _IO_flockfile (_IO_FILE *) __attribute__ ((__nothrow__));
933 extern void _IO_funlockfile (_IO_FILE *) __attribute__ ((__nothrow__));
934 extern int _IO_ftrylockfile (_IO_FILE *) __attribute__ ((__nothrow__));
935 # 480 "/usr/include/libio.h" 3 4
936 extern int _IO_vfscanf (_IO_FILE * __restrict, const char * __restrict,
937    __gnuc_va_list, int *__restrict);
938 extern int _IO_vfprintf (_IO_FILE *__restrict, const char *__restrict,
939     __gnuc_va_list);
940 extern __ssize_t _IO_padn (_IO_FILE *, int, __ssize_t) __attribute__ ((__nothrow__));
941 extern size_t _IO_sgetn (_IO_FILE *, void *, size_t) __attribute__ ((__nothrow__));
942
943 extern __off64_t _IO_seekoff (_IO_FILE *, __off64_t, int, int) __attribute__ ((__nothrow__));
944 extern __off64_t _IO_seekpos (_IO_FILE *, __off64_t, int) __attribute__ ((__nothrow__));
945
946 extern void _IO_free_backup_area (_IO_FILE *) __attribute__ ((__nothrow__));
947 # 73 "/usr/include/stdio.h" 2 3 4
948 # 86 "/usr/include/stdio.h" 3 4
949
950
951 typedef _G_fpos_t fpos_t;
952
953
954
955
956 # 138 "/usr/include/stdio.h" 3 4
957 # 1 "/usr/include/bits/stdio_lim.h" 1 3 4
958 # 139 "/usr/include/stdio.h" 2 3 4
959
960
961
962 extern struct _IO_FILE *stdin;
963 extern struct _IO_FILE *stdout;
964 extern struct _IO_FILE *stderr;
965
966
967
968
969
970
971
972 extern int remove (__const char *__filename) __attribute__ ((__nothrow__));
973
974 extern int rename (__const char *__old, __const char *__new) __attribute__ ((__nothrow__));
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989 extern FILE *tmpfile (void);
990 # 183 "/usr/include/stdio.h" 3 4
991 extern char *tmpnam (char *__s) __attribute__ ((__nothrow__));
992
993
994
995
996
997 extern char *tmpnam_r (char *__s) __attribute__ ((__nothrow__));
998 # 201 "/usr/include/stdio.h" 3 4
999 extern char *tempnam (__const char *__dir, __const char *__pfx)
1000      __attribute__ ((__nothrow__)) __attribute__ ((__malloc__));
1001
1002
1003
1004
1005
1006
1007
1008
1009 extern int fclose (FILE *__stream);
1010
1011
1012
1013
1014 extern int fflush (FILE *__stream);
1015
1016 # 226 "/usr/include/stdio.h" 3 4
1017 extern int fflush_unlocked (FILE *__stream);
1018 # 240 "/usr/include/stdio.h" 3 4
1019
1020
1021
1022
1023
1024
1025 extern FILE *fopen (__const char *__restrict __filename,
1026       __const char *__restrict __modes);
1027
1028
1029
1030
1031 extern FILE *freopen (__const char *__restrict __filename,
1032         __const char *__restrict __modes,
1033         FILE *__restrict __stream);
1034 # 267 "/usr/include/stdio.h" 3 4
1035
1036 # 278 "/usr/include/stdio.h" 3 4
1037 extern FILE *fdopen (int __fd, __const char *__modes) __attribute__ ((__nothrow__));
1038 # 298 "/usr/include/stdio.h" 3 4
1039
1040
1041
1042 extern void setbuf (FILE *__restrict __stream, char *__restrict __buf) __attribute__ ((__nothrow__));
1043
1044
1045
1046 extern int setvbuf (FILE *__restrict __stream, char *__restrict __buf,
1047       int __modes, size_t __n) __attribute__ ((__nothrow__));
1048
1049
1050
1051
1052
1053 extern void setbuffer (FILE *__restrict __stream, char *__restrict __buf,
1054          size_t __size) __attribute__ ((__nothrow__));
1055
1056
1057 extern void setlinebuf (FILE *__stream) __attribute__ ((__nothrow__));
1058
1059
1060
1061
1062
1063
1064
1065
1066 extern int fprintf (FILE *__restrict __stream,
1067       __const char *__restrict __format, ...);
1068
1069
1070
1071
1072 extern int printf (__const char *__restrict __format, ...);
1073
1074 extern int sprintf (char *__restrict __s,
1075       __const char *__restrict __format, ...) __attribute__ ((__nothrow__));
1076
1077
1078
1079
1080
1081 extern int vfprintf (FILE *__restrict __s, __const char *__restrict __format,
1082        __gnuc_va_list __arg);
1083
1084
1085
1086
1087 extern int vprintf (__const char *__restrict __format, __gnuc_va_list __arg);
1088
1089 extern int vsprintf (char *__restrict __s, __const char *__restrict __format,
1090        __gnuc_va_list __arg) __attribute__ ((__nothrow__));
1091
1092
1093
1094
1095
1096 extern int snprintf (char *__restrict __s, size_t __maxlen,
1097        __const char *__restrict __format, ...)
1098      __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 3, 4)));
1099
1100 extern int vsnprintf (char *__restrict __s, size_t __maxlen,
1101         __const char *__restrict __format, __gnuc_va_list __arg)
1102      __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 3, 0)));
1103
1104 # 392 "/usr/include/stdio.h" 3 4
1105
1106
1107
1108
1109
1110 extern int fscanf (FILE *__restrict __stream,
1111      __const char *__restrict __format, ...) ;
1112
1113
1114
1115
1116 extern int scanf (__const char *__restrict __format, ...) ;
1117
1118 extern int sscanf (__const char *__restrict __s,
1119      __const char *__restrict __format, ...) __attribute__ ((__nothrow__));
1120
1121 # 434 "/usr/include/stdio.h" 3 4
1122
1123
1124
1125
1126
1127 extern int fgetc (FILE *__stream);
1128 extern int getc (FILE *__stream);
1129
1130
1131
1132
1133
1134 extern int getchar (void);
1135
1136 # 458 "/usr/include/stdio.h" 3 4
1137 extern int getc_unlocked (FILE *__stream);
1138 extern int getchar_unlocked (void);
1139 # 469 "/usr/include/stdio.h" 3 4
1140 extern int fgetc_unlocked (FILE *__stream);
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152 extern int fputc (int __c, FILE *__stream);
1153 extern int putc (int __c, FILE *__stream);
1154
1155
1156
1157
1158
1159 extern int putchar (int __c);
1160
1161 # 502 "/usr/include/stdio.h" 3 4
1162 extern int fputc_unlocked (int __c, FILE *__stream);
1163
1164
1165
1166
1167
1168
1169
1170 extern int putc_unlocked (int __c, FILE *__stream);
1171 extern int putchar_unlocked (int __c);
1172
1173
1174
1175
1176
1177
1178 extern int getw (FILE *__stream);
1179
1180
1181 extern int putw (int __w, FILE *__stream);
1182
1183
1184
1185
1186
1187
1188
1189
1190 extern char *fgets (char *__restrict __s, int __n, FILE *__restrict __stream)
1191      ;
1192
1193
1194
1195
1196
1197
1198 extern char *gets (char *__s) ;
1199
1200 # 583 "/usr/include/stdio.h" 3 4
1201
1202
1203
1204
1205
1206 extern int fputs (__const char *__restrict __s, FILE *__restrict __stream);
1207
1208
1209
1210
1211
1212 extern int puts (__const char *__s);
1213
1214
1215
1216
1217
1218
1219 extern int ungetc (int __c, FILE *__stream);
1220
1221
1222
1223
1224
1225
1226 extern size_t fread (void *__restrict __ptr, size_t __size,
1227        size_t __n, FILE *__restrict __stream) ;
1228
1229
1230
1231
1232 extern size_t fwrite (__const void *__restrict __ptr, size_t __size,
1233         size_t __n, FILE *__restrict __s) ;
1234
1235 # 636 "/usr/include/stdio.h" 3 4
1236 extern size_t fread_unlocked (void *__restrict __ptr, size_t __size,
1237          size_t __n, FILE *__restrict __stream) ;
1238 extern size_t fwrite_unlocked (__const void *__restrict __ptr, size_t __size,
1239           size_t __n, FILE *__restrict __stream) ;
1240
1241
1242
1243
1244
1245
1246
1247
1248 extern int fseek (FILE *__stream, long int __off, int __whence);
1249
1250
1251
1252
1253 extern long int ftell (FILE *__stream) ;
1254
1255
1256
1257
1258 extern void rewind (FILE *__stream);
1259
1260 # 672 "/usr/include/stdio.h" 3 4
1261 extern int fseeko (FILE *__stream, __off_t __off, int __whence);
1262
1263
1264
1265
1266 extern __off_t ftello (FILE *__stream) ;
1267 # 691 "/usr/include/stdio.h" 3 4
1268
1269
1270
1271
1272
1273
1274 extern int fgetpos (FILE *__restrict __stream, fpos_t *__restrict __pos);
1275
1276
1277
1278
1279 extern int fsetpos (FILE *__stream, __const fpos_t *__pos);
1280 # 714 "/usr/include/stdio.h" 3 4
1281
1282 # 723 "/usr/include/stdio.h" 3 4
1283
1284
1285 extern void clearerr (FILE *__stream) __attribute__ ((__nothrow__));
1286
1287 extern int feof (FILE *__stream) __attribute__ ((__nothrow__)) ;
1288
1289 extern int ferror (FILE *__stream) __attribute__ ((__nothrow__)) ;
1290
1291
1292
1293
1294 extern void clearerr_unlocked (FILE *__stream) __attribute__ ((__nothrow__));
1295 extern int feof_unlocked (FILE *__stream) __attribute__ ((__nothrow__)) ;
1296 extern int ferror_unlocked (FILE *__stream) __attribute__ ((__nothrow__)) ;
1297
1298
1299
1300
1301
1302
1303
1304
1305 extern void perror (__const char *__s);
1306
1307
1308
1309
1310
1311
1312 # 1 "/usr/include/bits/sys_errlist.h" 1 3 4
1313 # 27 "/usr/include/bits/sys_errlist.h" 3 4
1314 extern int sys_nerr;
1315 extern __const char *__const sys_errlist[];
1316 # 753 "/usr/include/stdio.h" 2 3 4
1317
1318
1319
1320
1321 extern int fileno (FILE *__stream) __attribute__ ((__nothrow__)) ;
1322
1323
1324
1325
1326 extern int fileno_unlocked (FILE *__stream) __attribute__ ((__nothrow__)) ;
1327 # 772 "/usr/include/stdio.h" 3 4
1328 extern FILE *popen (__const char *__command, __const char *__modes) ;
1329
1330
1331
1332
1333
1334 extern int pclose (FILE *__stream);
1335
1336
1337
1338
1339
1340 extern char *ctermid (char *__s) __attribute__ ((__nothrow__));
1341 # 812 "/usr/include/stdio.h" 3 4
1342 extern void flockfile (FILE *__stream) __attribute__ ((__nothrow__));
1343
1344
1345
1346 extern int ftrylockfile (FILE *__stream) __attribute__ ((__nothrow__)) ;
1347
1348
1349 extern void funlockfile (FILE *__stream) __attribute__ ((__nothrow__));
1350 # 842 "/usr/include/stdio.h" 3 4
1351
1352 # 143 "./src/std.h" 2
1353
1354
1355
1356
1357
1358
1359 typedef struct gs_memory_s gs_memory_t;
1360 # 164 "./src/std.h"
1361 int outwrite(const gs_memory_t *mem, const char *str, int len);
1362 int errwrite(const char *str, int len);
1363 void outflush(const gs_memory_t *mem);
1364 void errflush(void);
1365 # 181 "./src/std.h"
1366 int outprintf(const gs_memory_t *mem, const char *fmt, ...) __attribute__((__format__ (__printf__, 2, 3)));
1367 int errprintf(const char *fmt, ...) __attribute__((__format__ (__printf__, 1, 2)));
1368
1369
1370
1371
1372
1373
1374
1375 void dprintf_file_and_line(const char *, int);
1376
1377
1378
1379
1380
1381
1382 void dflush(void);
1383 # 255 "./src/std.h"
1384 void printf_program_ident(const gs_memory_t *mem, const char *program_name, long revision_number);
1385 void eprintf_program_ident(const char *program_name, long revision_number);
1386 const char *gs_program_name(void);
1387 long gs_revision_number(void);
1388 # 286 "./src/std.h"
1389 void lprintf_file_and_line(const char *, int);
1390 # 25 "./src/stdio_.h" 2
1391 # 42 "./src/stdio_.h"
1392 int unlink(const char *);
1393 # 21 "./src/gx.h" 2
1394 # 1 "./src/gserror.h" 1
1395 # 20 "./src/gserror.h"
1396 int gs_log_error(int, const char *, int);
1397 # 43 "./src/gserror.h"
1398 const char *gs_errstr(int code);
1399
1400 int gs_throw_imp(const char *func, const char *file, int line,
1401         int op, int code, const char *fmt, ...) __attribute__((__format__ (__printf__, 6, 7)));
1402 # 22 "./src/gx.h" 2
1403 # 1 "./src/gsio.h" 1
1404 # 23 "./src/gx.h" 2
1405 # 1 "./src/gstypes.h" 1
1406 # 26 "./src/gstypes.h"
1407 typedef ulong gs_id;
1408 # 43 "./src/gstypes.h"
1409 typedef struct gs_string_s {
1410     byte *data; uint size;
1411 } gs_string;
1412
1413
1414
1415 typedef struct gs_const_string_s {
1416     const byte *data; uint size;
1417 } gs_const_string;
1418 typedef struct gs_param_string_s {
1419     const byte *data; uint size;
1420     bool persistent;
1421 } gs_param_string;
1422 # 69 "./src/gstypes.h"
1423 typedef struct gs_bytestring_s {
1424     byte *data; uint size;
1425     byte *bytes;
1426 } gs_bytestring;
1427 typedef struct gs_const_bytestring_s {
1428     const byte *data; uint size;
1429     const byte *bytes;
1430 } gs_const_bytestring;
1431 # 86 "./src/gstypes.h"
1432 typedef struct gs_point_s {
1433     double x, y;
1434 } gs_point;
1435 typedef struct gs_int_point_s {
1436     int x, y;
1437 } gs_int_point;
1438
1439
1440
1441
1442
1443 typedef struct gs_log2_scale_point_s {
1444     int x, y;
1445 } gs_log2_scale_point;
1446
1447
1448
1449
1450
1451
1452
1453 typedef struct gs_rect_s {
1454     gs_point p, q;
1455 } gs_rect;
1456 typedef struct gs_int_rect_s {
1457     gs_int_point p, q;
1458 } gs_int_rect;
1459
1460
1461
1462
1463
1464
1465 typedef struct gs_range_s {
1466     float rmin, rmax;
1467 } gs_range_t;
1468 # 24 "./src/gx.h" 2
1469 # 1 "./src/gsmemory.h" 1
1470 # 41 "./src/gsmemory.h"
1471 # 1 "./src/gslibctx.h" 1
1472 # 20 "./src/gslibctx.h"
1473 # 1 "./src/gs_dll_call.h" 1
1474 # 21 "./src/gslibctx.h" 2
1475
1476
1477 typedef struct name_table_s *name_table_ptr;
1478
1479 typedef struct gs_lib_ctx_s
1480 {
1481     gs_memory_t *memory;
1482     FILE *fstdin;
1483     FILE *fstdout;
1484     FILE *fstderr;
1485     FILE *fstdout2;
1486     bool stdout_is_redirected;
1487     bool stdout_to_stderr;
1488     bool stdin_is_interactive;
1489     void *caller_handle;
1490     int ( *stdin_fn)(void *caller_handle, char *buf, int len);
1491     int ( *stdout_fn)(void *caller_handle, const char *str, int len);
1492     int ( *stderr_fn)(void *caller_handle, const char *str, int len);
1493     int ( *poll_fn)(void *caller_handle);
1494     ulong gs_next_id;
1495     void *top_of_system;
1496
1497
1498     name_table_ptr gs_name_table;
1499
1500
1501
1502     bool dict_auto_expand;
1503 } gs_lib_ctx_t;
1504
1505
1506
1507
1508
1509 int gs_lib_ctx_init( gs_memory_t *mem );
1510
1511 void *gs_lib_ctx_get_interp_instance( gs_memory_t *mem );
1512
1513
1514
1515
1516 const gs_memory_t * gs_lib_ctx_get_non_gc_memory_t(void);
1517 # 42 "./src/gsmemory.h" 2
1518
1519
1520 typedef struct gs_memory_struct_type_s gs_memory_struct_type_t;
1521 typedef const gs_memory_struct_type_t *gs_memory_type_ptr_t;
1522 # 55 "./src/gsmemory.h"
1523 typedef struct gs_ptr_procs_s gs_ptr_procs_t;
1524 typedef const gs_ptr_procs_t *gs_ptr_type_t;
1525
1526
1527 typedef struct gs_gc_root_s gs_gc_root_t;
1528
1529
1530
1531 typedef client_name_t struct_name_t;
1532
1533
1534 uint gs_struct_type_size(gs_memory_type_ptr_t);
1535
1536
1537 struct_name_t gs_struct_type_name(gs_memory_type_ptr_t);
1538
1539
1540
1541
1542
1543
1544
1545 typedef struct gs_memory_status_s {
1546
1547
1548
1549
1550
1551     ulong allocated;
1552
1553
1554
1555
1556     ulong used;
1557 } gs_memory_status_t;
1558 # 222 "./src/gsmemory.h"
1559 typedef struct gs_memory_procs_s {
1560
1561     byte *(*alloc_bytes_immovable)(gs_memory_t *mem, uint nbytes, client_name_t cname); void *(*resize_object)(gs_memory_t *mem, void *obj, uint new_num_elements, client_name_t cname); void (*free_object)(gs_memory_t *mem, void *data, client_name_t cname); gs_memory_t *(*stable)(gs_memory_t *mem); void (*status)(gs_memory_t *mem, gs_memory_status_t *status); void (*free_all)(gs_memory_t *mem, uint free_mask, client_name_t cname); void (*consolidate_free)(gs_memory_t *mem);
1562 # 250 "./src/gsmemory.h"
1563     byte *(*alloc_bytes)(gs_memory_t *mem, uint nbytes, client_name_t cname);
1564 # 261 "./src/gsmemory.h"
1565     void *(*alloc_struct)(gs_memory_t *mem, gs_memory_type_ptr_t pstype, client_name_t cname);
1566
1567
1568     void *(*alloc_struct_immovable)(gs_memory_t *mem, gs_memory_type_ptr_t pstype, client_name_t cname);
1569 # 275 "./src/gsmemory.h"
1570     byte *(*alloc_byte_array)(gs_memory_t *mem, uint num_elements, uint elt_size, client_name_t cname);
1571
1572
1573     byte *(*alloc_byte_array_immovable)(gs_memory_t *mem, uint num_elements, uint elt_size, client_name_t cname);
1574 # 289 "./src/gsmemory.h"
1575     void *(*alloc_struct_array)(gs_memory_t *mem, uint num_elements, gs_memory_type_ptr_t pstype, client_name_t cname);
1576
1577
1578     void *(*alloc_struct_array_immovable)(gs_memory_t *mem, uint num_elements, gs_memory_type_ptr_t pstype, client_name_t cname);
1579 # 302 "./src/gsmemory.h"
1580     uint (*object_size)(gs_memory_t *mem, const void *obj);
1581 # 314 "./src/gsmemory.h"
1582     gs_memory_type_ptr_t (*object_type)(gs_memory_t *mem, const void *obj);
1583 # 324 "./src/gsmemory.h"
1584     byte *(*alloc_string)(gs_memory_t *mem, uint nbytes, client_name_t cname);
1585
1586
1587     byte *(*alloc_string_immovable)(gs_memory_t *mem, uint nbytes, client_name_t cname);
1588 # 339 "./src/gsmemory.h"
1589     byte *(*resize_string)(gs_memory_t *mem, byte *data, uint old_num, uint new_num, client_name_t cname);
1590 # 350 "./src/gsmemory.h"
1591     void (*free_string)(gs_memory_t *mem, byte *data, uint nbytes, client_name_t cname);
1592 # 364 "./src/gsmemory.h"
1593     int (*register_root)(gs_memory_t *mem, gs_gc_root_t *root, gs_ptr_type_t ptype, void **pp, client_name_t cname);
1594 # 375 "./src/gsmemory.h"
1595     void (*unregister_root)(gs_memory_t *mem, gs_gc_root_t *root, client_name_t cname);
1596 # 390 "./src/gsmemory.h"
1597     void (*enable_free)(gs_memory_t *mem, bool enable);
1598
1599 } gs_memory_procs_t;
1600
1601
1602
1603
1604
1605
1606
1607 void gs_free_const_object(gs_memory_t *mem, const void *data,
1608      client_name_t cname);
1609 void gs_free_const_string(gs_memory_t *mem, const byte *data, uint nbytes,
1610      client_name_t cname);
1611
1612
1613
1614
1615
1616 void gs_free_bytestring(gs_memory_t *mem, gs_bytestring *pbs,
1617    client_name_t cname);
1618 void gs_free_const_bytestring(gs_memory_t *mem, gs_const_bytestring *pbs,
1619          client_name_t cname);
1620
1621
1622
1623
1624
1625 void *gs_resize_struct_array(gs_memory_t *mem, void *obj, uint num_elements,
1626         gs_memory_type_ptr_t pstype,
1627         client_name_t cname);
1628
1629
1630 int gs_register_struct_root(gs_memory_t *mem, gs_gc_root_t *root,
1631        void **pp, client_name_t cname);
1632
1633
1634 void gs_ignore_free_object(gs_memory_t *mem, void *data, client_name_t cname);
1635 void gs_ignore_free_string(gs_memory_t *mem, byte *data, uint nbytes, client_name_t cname);
1636
1637
1638 void gs_ignore_consolidate_free(gs_memory_t *mem);
1639
1640
1641
1642
1643
1644
1645
1646 void *gs_raw_alloc_struct_immovable(gs_memory_t * rmem,
1647         gs_memory_type_ptr_t pstype,
1648         client_name_t cname);
1649
1650 typedef struct pl_mem_node_s pl_mem_node_t;
1651 # 468 "./src/gsmemory.h"
1652 struct gs_memory_s {
1653     gs_memory_t *stable_memory; gs_memory_procs_t procs; gs_lib_ctx_t *gs_lib_ctx; pl_mem_node_t *head; gs_memory_t *non_gc_memory;
1654 };
1655 # 25 "./src/gx.h" 2
1656 # 1 "./src/gdebug.h" 1
1657 # 50 "./src/gdebug.h"
1658 extern char gs_debug[128];
1659 bool gs_debug_c(int );
1660 # 60 "./src/gdebug.h"
1661 extern FILE *gs_debug_out;
1662 # 114 "./src/gdebug.h"
1663 void debug_dump_bytes(const byte * from, const byte * to,
1664         const char *msg);
1665 void debug_dump_bitmap(const byte * from, uint raster, uint height,
1666          const char *msg);
1667 void debug_print_string(const byte * str, uint len);
1668 void debug_print_string_hex(const byte * str, uint len);
1669 # 26 "./src/gx.h" 2
1670
1671
1672
1673
1674
1675
1676 typedef struct gs_imager_state_s gs_imager_state;
1677
1678
1679
1680
1681 typedef struct gs_state_s gs_state;
1682 # 17 "./src/gdevpdfe.c" 2
1683 # 1 "./src/string_.h" 1
1684 # 30 "./src/string_.h"
1685 # 1 "/usr/include/string.h" 1 3 4
1686 # 28 "/usr/include/string.h" 3 4
1687
1688
1689
1690
1691
1692 # 1 "/usr/lib/gcc/i686-pc-linux-gnu/4.1.1/include/stddef.h" 1 3 4
1693 # 34 "/usr/include/string.h" 2 3 4
1694
1695
1696
1697
1698 extern void *memcpy (void *__restrict __dest,
1699        __const void *__restrict __src, size_t __n)
1700      __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
1701
1702
1703 extern void *memmove (void *__dest, __const void *__src, size_t __n)
1704      __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
1705
1706
1707
1708
1709
1710
1711 extern void *memccpy (void *__restrict __dest, __const void *__restrict __src,
1712         int __c, size_t __n)
1713      __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
1714
1715
1716
1717
1718
1719 extern void *memset (void *__s, int __c, size_t __n) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
1720
1721
1722 extern int memcmp (__const void *__s1, __const void *__s2, size_t __n)
1723      __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
1724
1725
1726 extern void *memchr (__const void *__s, int __c, size_t __n)
1727       __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
1728
1729 # 82 "/usr/include/string.h" 3 4
1730
1731
1732 extern char *strcpy (char *__restrict __dest, __const char *__restrict __src)
1733      __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
1734
1735 extern char *strncpy (char *__restrict __dest,
1736         __const char *__restrict __src, size_t __n)
1737      __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
1738
1739
1740 extern char *strcat (char *__restrict __dest, __const char *__restrict __src)
1741      __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
1742
1743 extern char *strncat (char *__restrict __dest, __const char *__restrict __src,
1744         size_t __n) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
1745
1746
1747 extern int strcmp (__const char *__s1, __const char *__s2)
1748      __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
1749
1750 extern int strncmp (__const char *__s1, __const char *__s2, size_t __n)
1751      __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
1752
1753
1754 extern int strcoll (__const char *__s1, __const char *__s2)
1755      __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
1756
1757 extern size_t strxfrm (char *__restrict __dest,
1758          __const char *__restrict __src, size_t __n)
1759      __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2)));
1760
1761 # 130 "/usr/include/string.h" 3 4
1762 extern char *strdup (__const char *__s)
1763      __attribute__ ((__nothrow__)) __attribute__ ((__malloc__)) __attribute__ ((__nonnull__ (1)));
1764 # 165 "/usr/include/string.h" 3 4
1765
1766
1767 extern char *strchr (__const char *__s, int __c)
1768      __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
1769
1770 extern char *strrchr (__const char *__s, int __c)
1771      __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
1772
1773 # 181 "/usr/include/string.h" 3 4
1774
1775
1776
1777 extern size_t strcspn (__const char *__s, __const char *__reject)
1778      __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
1779
1780
1781 extern size_t strspn (__const char *__s, __const char *__accept)
1782      __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
1783
1784 extern char *strpbrk (__const char *__s, __const char *__accept)
1785      __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
1786
1787 extern char *strstr (__const char *__haystack, __const char *__needle)
1788      __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
1789
1790
1791
1792 extern char *strtok (char *__restrict __s, __const char *__restrict __delim)
1793      __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2)));
1794
1795
1796
1797
1798 extern char *__strtok_r (char *__restrict __s,
1799     __const char *__restrict __delim,
1800     char **__restrict __save_ptr)
1801      __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2, 3)));
1802
1803 extern char *strtok_r (char *__restrict __s, __const char *__restrict __delim,
1804          char **__restrict __save_ptr)
1805      __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2, 3)));
1806 # 240 "/usr/include/string.h" 3 4
1807
1808
1809 extern size_t strlen (__const char *__s)
1810      __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
1811
1812 # 254 "/usr/include/string.h" 3 4
1813
1814
1815 extern char *strerror (int __errnum) __attribute__ ((__nothrow__));
1816
1817 # 270 "/usr/include/string.h" 3 4
1818 extern int strerror_r (int __errnum, char *__buf, size_t __buflen) __asm__ ("" "__xpg_strerror_r") __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2)));
1819 # 288 "/usr/include/string.h" 3 4
1820 extern void __bzero (void *__s, size_t __n) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
1821
1822
1823
1824 extern void bcopy (__const void *__src, void *__dest, size_t __n)
1825      __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
1826
1827
1828 extern void bzero (void *__s, size_t __n) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
1829
1830
1831 extern int bcmp (__const void *__s1, __const void *__s2, size_t __n)
1832      __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
1833
1834
1835 extern char *index (__const char *__s, int __c)
1836      __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
1837
1838
1839 extern char *rindex (__const char *__s, int __c)
1840      __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
1841
1842
1843
1844 extern int ffs (int __i) __attribute__ ((__nothrow__)) __attribute__ ((__const__));
1845 # 325 "/usr/include/string.h" 3 4
1846 extern int strcasecmp (__const char *__s1, __const char *__s2)
1847      __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
1848
1849
1850 extern int strncasecmp (__const char *__s1, __const char *__s2, size_t __n)
1851      __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
1852 # 348 "/usr/include/string.h" 3 4
1853 extern char *strsep (char **__restrict __stringp,
1854        __const char *__restrict __delim)
1855      __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2)));
1856 # 426 "/usr/include/string.h" 3 4
1857
1858 # 31 "./src/string_.h" 2
1859 # 18 "./src/gdevpdfe.c" 2
1860 # 1 "./src/time_.h" 1
1861 # 28 "./src/time_.h"
1862 # 1 "./obj/../soobj/gconfig_.h" 1
1863 # 29 "./src/time_.h" 2
1864
1865
1866
1867
1868
1869
1870 # 1 "/usr/include/sys/time.h" 1 3 4
1871 # 27 "/usr/include/sys/time.h" 3 4
1872 # 1 "/usr/include/time.h" 1 3 4
1873 # 28 "/usr/include/sys/time.h" 2 3 4
1874
1875 # 1 "/usr/include/bits/time.h" 1 3 4
1876 # 30 "/usr/include/sys/time.h" 2 3 4
1877 # 39 "/usr/include/sys/time.h" 3 4
1878
1879 # 57 "/usr/include/sys/time.h" 3 4
1880 struct timezone
1881   {
1882     int tz_minuteswest;
1883     int tz_dsttime;
1884   };
1885
1886 typedef struct timezone *__restrict __timezone_ptr_t;
1887 # 73 "/usr/include/sys/time.h" 3 4
1888 extern int gettimeofday (struct timeval *__restrict __tv,
1889     __timezone_ptr_t __tz) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
1890
1891
1892
1893
1894 extern int settimeofday (__const struct timeval *__tv,
1895     __const struct timezone *__tz)
1896      __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
1897
1898
1899
1900
1901
1902 extern int adjtime (__const struct timeval *__delta,
1903       struct timeval *__olddelta) __attribute__ ((__nothrow__));
1904
1905
1906
1907
1908 enum __itimer_which
1909   {
1910
1911     ITIMER_REAL = 0,
1912
1913
1914     ITIMER_VIRTUAL = 1,
1915
1916
1917
1918     ITIMER_PROF = 2
1919
1920   };
1921
1922
1923
1924 struct itimerval
1925   {
1926
1927     struct timeval it_interval;
1928
1929     struct timeval it_value;
1930   };
1931
1932
1933
1934
1935
1936
1937 typedef int __itimer_which_t;
1938
1939
1940
1941
1942 extern int getitimer (__itimer_which_t __which,
1943         struct itimerval *__value) __attribute__ ((__nothrow__));
1944
1945
1946
1947
1948 extern int setitimer (__itimer_which_t __which,
1949         __const struct itimerval *__restrict __new,
1950         struct itimerval *__restrict __old) __attribute__ ((__nothrow__));
1951
1952
1953
1954
1955 extern int utimes (__const char *__file, __const struct timeval __tvp[2])
1956      __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
1957
1958
1959
1960 extern int lutimes (__const char *__file, __const struct timeval __tvp[2])
1961      __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1)));
1962
1963
1964 extern int futimes (int __fd, __const struct timeval __tvp[2]) __attribute__ ((__nothrow__));
1965 # 191 "/usr/include/sys/time.h" 3 4
1966
1967 # 36 "./src/time_.h" 2
1968
1969
1970
1971
1972
1973
1974 # 1 "/usr/include/time.h" 1 3 4
1975 # 31 "/usr/include/time.h" 3 4
1976
1977
1978
1979
1980
1981
1982
1983
1984 # 1 "/usr/lib/gcc/i686-pc-linux-gnu/4.1.1/include/stddef.h" 1 3 4
1985 # 40 "/usr/include/time.h" 2 3 4
1986
1987
1988
1989 # 1 "/usr/include/bits/time.h" 1 3 4
1990 # 44 "/usr/include/time.h" 2 3 4
1991 # 59 "/usr/include/time.h" 3 4
1992
1993
1994 typedef __clock_t clock_t;
1995
1996
1997
1998 # 132 "/usr/include/time.h" 3 4
1999
2000
2001 struct tm
2002 {
2003   int tm_sec;
2004   int tm_min;
2005   int tm_hour;
2006   int tm_mday;
2007   int tm_mon;
2008   int tm_year;
2009   int tm_wday;
2010   int tm_yday;
2011   int tm_isdst;
2012
2013
2014   long int tm_gmtoff;
2015   __const char *tm_zone;
2016
2017
2018
2019
2020 };
2021
2022
2023
2024
2025
2026
2027
2028
2029 struct itimerspec
2030   {
2031     struct timespec it_interval;
2032     struct timespec it_value;
2033   };
2034
2035
2036 struct sigevent;
2037 # 181 "/usr/include/time.h" 3 4
2038
2039
2040
2041 extern clock_t clock (void) __attribute__ ((__nothrow__));
2042
2043
2044 extern time_t time (time_t *__timer) __attribute__ ((__nothrow__));
2045
2046
2047 extern double difftime (time_t __time1, time_t __time0)
2048      __attribute__ ((__nothrow__)) __attribute__ ((__const__));
2049
2050
2051 extern time_t mktime (struct tm *__tp) __attribute__ ((__nothrow__));
2052
2053
2054
2055
2056
2057 extern size_t strftime (char *__restrict __s, size_t __maxsize,
2058    __const char *__restrict __format,
2059    __const struct tm *__restrict __tp) __attribute__ ((__nothrow__));
2060
2061 # 229 "/usr/include/time.h" 3 4
2062
2063
2064
2065 extern struct tm *gmtime (__const time_t *__timer) __attribute__ ((__nothrow__));
2066
2067
2068
2069 extern struct tm *localtime (__const time_t *__timer) __attribute__ ((__nothrow__));
2070
2071
2072
2073
2074
2075 extern struct tm *gmtime_r (__const time_t *__restrict __timer,
2076        struct tm *__restrict __tp) __attribute__ ((__nothrow__));
2077
2078
2079
2080 extern struct tm *localtime_r (__const time_t *__restrict __timer,
2081           struct tm *__restrict __tp) __attribute__ ((__nothrow__));
2082
2083
2084
2085
2086
2087 extern char *asctime (__const struct tm *__tp) __attribute__ ((__nothrow__));
2088
2089
2090 extern char *ctime (__const time_t *__timer) __attribute__ ((__nothrow__));
2091
2092
2093
2094
2095
2096
2097
2098 extern char *asctime_r (__const struct tm *__restrict __tp,
2099    char *__restrict __buf) __attribute__ ((__nothrow__));
2100
2101
2102 extern char *ctime_r (__const time_t *__restrict __timer,
2103         char *__restrict __buf) __attribute__ ((__nothrow__));
2104
2105
2106
2107
2108 extern char *__tzname[2];
2109 extern int __daylight;
2110 extern long int __timezone;
2111
2112
2113
2114
2115 extern char *tzname[2];
2116
2117
2118
2119 extern void tzset (void) __attribute__ ((__nothrow__));
2120
2121
2122
2123 extern int daylight;
2124 extern long int timezone;
2125
2126
2127
2128
2129
2130 extern int stime (__const time_t *__when) __attribute__ ((__nothrow__));
2131 # 312 "/usr/include/time.h" 3 4
2132 extern time_t timegm (struct tm *__tp) __attribute__ ((__nothrow__));
2133
2134
2135 extern time_t timelocal (struct tm *__tp) __attribute__ ((__nothrow__));
2136
2137
2138 extern int dysize (int __year) __attribute__ ((__nothrow__)) __attribute__ ((__const__));
2139 # 327 "/usr/include/time.h" 3 4
2140 extern int nanosleep (__const struct timespec *__requested_time,
2141         struct timespec *__remaining);
2142
2143
2144
2145 extern int clock_getres (clockid_t __clock_id, struct timespec *__res) __attribute__ ((__nothrow__));
2146
2147
2148 extern int clock_gettime (clockid_t __clock_id, struct timespec *__tp) __attribute__ ((__nothrow__));
2149
2150
2151 extern int clock_settime (clockid_t __clock_id, __const struct timespec *__tp)
2152      __attribute__ ((__nothrow__));
2153
2154
2155
2156
2157
2158
2159 extern int clock_nanosleep (clockid_t __clock_id, int __flags,
2160        __const struct timespec *__req,
2161        struct timespec *__rem);
2162
2163
2164 extern int clock_getcpuclockid (pid_t __pid, clockid_t *__clock_id) __attribute__ ((__nothrow__));
2165
2166
2167
2168
2169 extern int timer_create (clockid_t __clock_id,
2170     struct sigevent *__restrict __evp,
2171     timer_t *__restrict __timerid) __attribute__ ((__nothrow__));
2172
2173
2174 extern int timer_delete (timer_t __timerid) __attribute__ ((__nothrow__));
2175
2176
2177 extern int timer_settime (timer_t __timerid, int __flags,
2178      __const struct itimerspec *__restrict __value,
2179      struct itimerspec *__restrict __ovalue) __attribute__ ((__nothrow__));
2180
2181
2182 extern int timer_gettime (timer_t __timerid, struct itimerspec *__value)
2183      __attribute__ ((__nothrow__));
2184
2185
2186 extern int timer_getoverrun (timer_t __timerid) __attribute__ ((__nothrow__));
2187 # 416 "/usr/include/time.h" 3 4
2188
2189 # 43 "./src/time_.h" 2
2190 # 78 "./src/time_.h"
2191 # 1 "/usr/include/sys/times.h" 1 3 4
2192 # 32 "/usr/include/sys/times.h" 3 4
2193
2194
2195
2196 struct tms
2197   {
2198     clock_t tms_utime;
2199     clock_t tms_stime;
2200
2201     clock_t tms_cutime;
2202     clock_t tms_cstime;
2203   };
2204
2205
2206
2207
2208
2209
2210 extern clock_t times (struct tms *__buffer) __attribute__ ((__nothrow__));
2211
2212
2213 # 79 "./src/time_.h" 2
2214 # 19 "./src/gdevpdfe.c" 2
2215 # 1 "./src/stream.h" 1
2216 # 21 "./src/stream.h"
2217 # 1 "./src/scommon.h" 1
2218 # 22 "./src/scommon.h"
2219 # 1 "./src/gsstype.h" 1
2220 # 21 "./src/gsstype.h"
2221 typedef struct gc_state_s gc_state_t;
2222
2223
2224
2225
2226
2227 typedef struct enum_ptr_s {
2228     const void *ptr;
2229     uint size;
2230 } enum_ptr_t;
2231 # 79 "./src/gsstype.h"
2232 typedef struct struct_shared_procs_s struct_shared_procs_t;
2233
2234 struct gs_memory_struct_type_s {
2235  uint ssize;
2236  struct_name_t sname;
2237
2238
2239
2240
2241  const struct_shared_procs_t *shared;
2242
2243
2244
2245  void (*clear_marks)(const gs_memory_t *cmem, void *pre, uint size, const gs_memory_struct_type_t *pstype);
2246  gs_ptr_type_t (*enum_ptrs)(const gs_memory_t *mem, const void *ptr, uint size, int index, enum_ptr_t *pep, const gs_memory_struct_type_t *pstype, gc_state_t *gcst);
2247  void (*reloc_ptrs)(void *ptr, uint size, const gs_memory_struct_type_t *pstype, gc_state_t *gcst);
2248  void (*finalize)(void *ptr);
2249
2250
2251
2252  const void *proc_data;
2253 };
2254 # 23 "./src/scommon.h" 2
2255 # 34 "./src/scommon.h"
2256 typedef struct stream_s stream;
2257
2258
2259
2260
2261
2262
2263 typedef struct stream_state_s stream_state;
2264 # 50 "./src/scommon.h"
2265 typedef struct stream_template_s stream_template;
2266 # 87 "./src/scommon.h"
2267 typedef struct stream_cursor_read_s {
2268     const byte *ptr;
2269     const byte *limit;
2270     byte *_skip;
2271 } stream_cursor_read;
2272 typedef struct stream_cursor_write_s {
2273     const byte *_skip;
2274     byte *ptr;
2275     byte *limit;
2276 } stream_cursor_write;
2277 typedef union stream_cursor_s {
2278     stream_cursor_read r;
2279     stream_cursor_write w;
2280 } stream_cursor;
2281 # 134 "./src/scommon.h"
2282 int s_no_report_error(stream_state *, const char *);
2283 # 165 "./src/scommon.h"
2284 struct stream_state_s {
2285     const stream_template *template; gs_memory_t *memory; int (*report_error)(stream_state *, const char *); int min_left; char error_string[79 + 1];
2286 };
2287
2288 extern const gs_memory_struct_type_t st_stream_state;
2289 # 22 "./src/stream.h" 2
2290 # 1 "./src/srdline.h" 1
2291 # 43 "./src/srdline.h"
2292 extern int sreadline(stream *s_in, stream *s_out, void *readline_data, gs_const_string *prompt, gs_string *buf, gs_memory_t *bufmem, uint *pcount, bool *pin_eol, bool (*is_stdin)(const stream *));
2293 # 23 "./src/stream.h" 2
2294 # 35 "./src/stream.h"
2295 typedef struct {
2296
2297
2298
2299
2300
2301     int (*available)(stream *, long *);
2302
2303
2304
2305
2306
2307     int (*seek)(stream *, long);
2308
2309
2310
2311
2312
2313     void (*reset)(stream *);
2314
2315
2316
2317
2318
2319     int (*flush)(stream *);
2320
2321
2322
2323
2324
2325     int (*close)(stream *);
2326
2327
2328
2329     int (*process)(stream_state *, stream_cursor_read *, stream_cursor_write *, bool);
2330
2331
2332
2333
2334
2335
2336     int (*switch_mode)(stream *, bool);
2337
2338 } stream_procs;
2339
2340
2341
2342 struct stream_s {
2343
2344
2345
2346
2347
2348     const stream_template *template; gs_memory_t *memory; int (*report_error)(stream_state *, const char *); int min_left; char error_string[79 + 1];
2349 # 110 "./src/stream.h"
2350     stream_cursor cursor;
2351     byte *cbuf;
2352     uint bsize;
2353     uint cbsize;
2354 # 127 "./src/stream.h"
2355     short end_status;
2356
2357     byte foreign;
2358     byte modes;
2359 # 139 "./src/stream.h"
2360     gs_string cbuf_string;
2361
2362     long position;
2363
2364     stream_procs procs;
2365     stream *strm;
2366
2367     int is_temp;
2368
2369
2370
2371
2372     int inline_temp;
2373
2374     stream_state *state;
2375
2376
2377
2378
2379
2380
2381     ushort read_id;
2382
2383
2384     ushort write_id;
2385     stream *prev, *next;
2386     bool close_strm;
2387     bool close_at_eod;
2388     int (*save_close)(stream *);
2389
2390
2391
2392
2393
2394     FILE *file;
2395     gs_const_string file_name;
2396
2397     uint file_modes;
2398
2399
2400     long file_offset;
2401     long file_limit;
2402 };
2403
2404
2405 extern const gs_memory_struct_type_t st_stream;
2406 # 217 "./src/stream.h"
2407 int savailable(stream *, long *);
2408
2409
2410
2411 int sclose(stream *);
2412 int sswitch(stream *, bool);
2413
2414
2415
2416
2417 int spgetcc(stream *, bool);
2418 # 240 "./src/stream.h"
2419 int sgets(stream *, byte *, uint, uint *);
2420 int sungetc(stream *, byte);
2421
2422
2423
2424
2425 int spskip(stream *, long, long *);
2426
2427
2428
2429
2430
2431
2432
2433 int s_process_read_buf(stream *);
2434
2435
2436
2437
2438 int spputc(stream *, byte);
2439 # 268 "./src/stream.h"
2440 int sputs(stream *, const byte *, uint, uint *);
2441
2442
2443
2444
2445
2446 int s_process_write_buf(stream *, bool);
2447
2448
2449 long stell(stream *);
2450 int spseek(stream *, long);
2451 # 327 "./src/stream.h"
2452 stream *s_alloc(gs_memory_t *, client_name_t);
2453 stream_state *s_alloc_state(gs_memory_t *, gs_memory_type_ptr_t, client_name_t);
2454
2455
2456
2457
2458 void s_init(stream *, gs_memory_t *);
2459 void s_init_state(stream_state *, const stream_template *, gs_memory_t *);
2460
2461
2462 void sread_string(stream *, const byte *, uint),
2463     sread_string_reusable(stream *, const byte *, uint),
2464     swrite_string(stream *, byte *, uint);
2465 void sread_file(stream *, FILE *, byte *, uint),
2466     swrite_file(stream *, FILE *, byte *, uint),
2467     sappend_file(stream *, FILE *, byte *, uint);
2468
2469
2470 int sread_subfile(stream *s, long start, long length);
2471
2472
2473
2474 int ssetfilename(stream *, const byte *, uint);
2475
2476
2477
2478 int sfilename(stream *, gs_const_string *);
2479
2480
2481
2482 void swrite_position_only(stream *);
2483
2484
2485 void s_std_init(stream *, byte *, uint, const stream_procs *, int );
2486
2487
2488 void s_disable(stream *);
2489
2490
2491 int s_std_null(stream *);
2492 void s_std_read_reset(stream *), s_std_write_reset(stream *);
2493 int s_std_read_flush(stream *), s_std_write_flush(stream *), s_std_noavailable(stream *, long *),
2494      s_std_noseek(stream *, long), s_std_close(stream *), s_std_switch_mode(stream *, bool);
2495
2496
2497 int s_filter_write_flush(stream *), s_filter_close(stream *);
2498
2499
2500 extern const stream_procs s_filter_read_procs, s_filter_write_procs;
2501 # 385 "./src/stream.h"
2502 int s_init_filter(stream *fs, stream_state *fss, byte *buf, uint bsize,
2503     stream *target);
2504 stream *s_add_filter(stream **ps, const stream_template *template,
2505        stream_state *ss, gs_memory_t *mem);
2506
2507
2508
2509
2510
2511 int s_close_filters(stream **ps, stream *target);
2512
2513
2514
2515 extern const stream_template s_NullE_template;
2516 extern const stream_template s_NullD_template;
2517 # 20 "./src/gdevpdfe.c" 2
2518 # 1 "./src/gp.h" 1
2519 # 32 "./src/gp.h"
2520 # 1 "./src/gpgetenv.h" 1
2521 # 37 "./src/gpgetenv.h"
2522 int gp_getenv(const char *key, char *ptr, int *plen);
2523 # 33 "./src/gp.h" 2
2524 # 47 "./src/gp.h"
2525 void gp_init(void);
2526
2527
2528
2529
2530
2531 void gp_exit(int exit_status, int code);
2532
2533
2534
2535
2536
2537 void gp_do_exit(int exit_status);
2538 # 68 "./src/gp.h"
2539 const char *gp_strerror(int);
2540
2541
2542
2543
2544
2545
2546
2547 void gp_get_realtime(long ptm[2]);
2548
2549
2550
2551
2552
2553 void gp_get_usertime(long ptm[2]);
2554 # 97 "./src/gp.h"
2555 int gp_readline_init(void **preadline_data, gs_memory_t *mem);
2556
2557
2558
2559
2560 int gp_readline(stream *s_in, stream *s_out, void *readline_data,
2561   gs_const_string *prompt, gs_string *buf,
2562   gs_memory_t *bufmem, uint *pcount, bool *pin_eol,
2563   bool (*is_stdin)(const stream *));
2564
2565
2566
2567
2568 void gp_readline_finit(void *readline_data);
2569 # 122 "./src/gp.h"
2570 int gp_stdin_read(char *buf, int len, int interactive, FILE *f);
2571 # 131 "./src/gp.h"
2572 const char *gp_getenv_display(void);
2573 # 145 "./src/gp.h"
2574 extern const char gp_file_name_list_separator;
2575
2576
2577 extern const char gp_scratch_file_name_prefix[];
2578
2579
2580 extern const char gp_null_file_name[];
2581
2582
2583 extern const char gp_current_directory_name[];
2584
2585
2586
2587
2588 extern const char gp_fmode_binary_suffix[];
2589
2590
2591
2592 extern const char gp_fmode_rb[];
2593 extern const char gp_fmode_wb[];
2594 # 182 "./src/gp.h"
2595 FILE *gp_open_scratch_file(const char *prefix,
2596       char fname[260],
2597       const char *mode);
2598
2599
2600 FILE *gp_fopen(const char *fname, const char *mode);
2601
2602
2603
2604 int gp_setmode_binary(FILE * pfile, bool mode);
2605
2606 typedef enum {
2607     gp_combine_small_buffer = -1,
2608     gp_combine_cant_handle = 0,
2609     gp_combine_success = 1
2610 } gp_file_name_combine_result;
2611 # 206 "./src/gp.h"
2612 gp_file_name_combine_result gp_file_name_combine(const char *prefix, uint plen,
2613      const char *fname, uint flen, bool no_sibling, char *buffer, uint *blen);
2614 # 218 "./src/gp.h"
2615 uint gp_file_name_root(const char *fname, uint len);
2616 # 227 "./src/gp.h"
2617 uint gs_file_name_check_separator(const char *fname, int len, const char *item);
2618
2619
2620
2621
2622
2623 bool gp_file_name_is_parent(const char *fname, uint len);
2624
2625
2626
2627
2628
2629 bool gp_file_name_is_current(const char *fname, uint len);
2630
2631
2632
2633
2634
2635 const char *gp_file_name_current(void);
2636
2637
2638
2639
2640
2641 const char *gp_file_name_separator(void);
2642
2643
2644
2645
2646
2647 const char *gp_file_name_directory_separator(void);
2648
2649
2650
2651
2652
2653 const char *gp_file_name_parent(void);
2654
2655
2656
2657
2658 bool gp_file_name_is_partent_allowed(void);
2659
2660
2661
2662
2663
2664 bool gp_file_name_is_empty_item_meanful(void);
2665
2666
2667
2668
2669
2670 int gp_read_macresource(byte *buf, const char *fname,
2671                                      const uint type, const ushort id);
2672 # 304 "./src/gp.h"
2673 int gp_cache_insert(int type, byte *key, int keylen, void *buffer, int buflen);
2674
2675
2676 typedef void *(*gp_cache_alloc)(void *userdata, int bytes);
2677 int gp_cache_query(int type, byte* key, int keylen, void **buffer,
2678     gp_cache_alloc alloc, void *userdata);
2679 # 334 "./src/gp.h"
2680 FILE *gp_open_printer(char fname[260], int binary_mode);
2681 # 343 "./src/gp.h"
2682 void gp_close_printer(FILE * pfile, const char *fname);
2683
2684
2685
2686
2687
2688 typedef struct file_enum_s file_enum;
2689 # 363 "./src/gp.h"
2690 file_enum *gp_enumerate_files_init(const char *pat, uint patlen,
2691        gs_memory_t * memory);
2692 # 373 "./src/gp.h"
2693 uint gp_enumerate_files_next(file_enum * pfen, char *ptr, uint maxlen);
2694
2695
2696
2697
2698
2699
2700
2701 void gp_enumerate_files_close(file_enum * pfen);
2702 # 393 "./src/gp.h"
2703 void *gp_enumerate_fonts_init(gs_memory_t *mem);
2704 # 402 "./src/gp.h"
2705 int gp_enumerate_fonts_next(void *enum_state, char **fontname, char **path);
2706
2707
2708 void gp_enumerate_fonts_free(void *enum_state);
2709 # 21 "./src/gdevpdfe.c" 2
2710 # 1 "./src/smd5.h" 1
2711 # 21 "./src/smd5.h"
2712 # 1 "./src/md5.h" 1
2713 # 52 "./src/md5.h"
2714 typedef unsigned char md5_byte_t;
2715 typedef unsigned int md5_word_t;
2716
2717
2718 typedef struct md5_state_s {
2719     md5_word_t count[2];
2720     md5_word_t abcd[4];
2721     md5_byte_t buf[64];
2722 } md5_state_t;
2723
2724
2725
2726
2727
2728
2729
2730 void md5_init(md5_state_t *pms);
2731
2732
2733 void md5_append(md5_state_t *pms, const md5_byte_t *data, int nbytes);
2734
2735
2736 void md5_finish(md5_state_t *pms, md5_byte_t digest[16]);
2737 # 22 "./src/smd5.h" 2
2738
2739
2740
2741
2742
2743 typedef struct stream_MD5E_state_s {
2744     const stream_template *template; gs_memory_t *memory; int (*report_error)(stream_state *, const char *); int min_left; char error_string[79 + 1];
2745     md5_state_t md5;
2746 } stream_MD5E_state;
2747
2748
2749
2750
2751 extern const stream_template s_MD5E_template;
2752
2753 stream *s_MD5E_make_stream(gs_memory_t *mem, byte *digest, int digest_size);
2754
2755
2756
2757
2758
2759
2760 stream *s_MD5C_make_stream(gs_memory_t *mem, stream *strm);
2761
2762 int s_MD5C_get_digest(stream *s, byte *buf, int buf_length);
2763 # 22 "./src/gdevpdfe.c" 2
2764 # 1 "./src/gscdefs.h" 1
2765 # 20 "./src/gscdefs.h"
2766 # 1 "./obj/../soobj/gconfigv.h" 1
2767 # 21 "./src/gscdefs.h" 2
2768 # 39 "./src/gscdefs.h"
2769 extern const long gs_buildtime;
2770 extern const char *const gs_copyright;
2771 extern const char *const gs_product;
2772 extern const char *const gs_productfamily;
2773 extern const long gs_revision;
2774 extern const long gs_revisiondate;
2775 extern const long gs_serialnumber;
2776
2777
2778 extern const char *const gs_doc_directory;
2779 extern const char *const gs_lib_default_path;
2780 extern const char *const gs_init_file;
2781 # 61 "./src/gscdefs.h"
2782 extern const unsigned gx_image_class_table_count;
2783
2784
2785
2786 extern const unsigned gx_image_type_table_count;
2787 # 74 "./src/gscdefs.h"
2788 extern const unsigned gx_io_device_table_count;
2789 # 23 "./src/gdevpdfe.c" 2
2790 # 1 "./src/gdevpdfx.h" 1
2791 # 20 "./src/gdevpdfx.h"
2792 # 1 "./src/gsparam.h" 1
2793 # 34 "./src/gsparam.h"
2794 typedef struct gs_param_list_s gs_param_list;
2795
2796
2797
2798 typedef const char *gs_param_name;
2799 # 48 "./src/gsparam.h"
2800 typedef enum {
2801
2802     gs_param_type_null, gs_param_type_bool, gs_param_type_int,
2803     gs_param_type_long, gs_param_type_float,
2804
2805     gs_param_type_string, gs_param_type_name,
2806     gs_param_type_int_array, gs_param_type_float_array,
2807     gs_param_type_string_array, gs_param_type_name_array,
2808
2809     gs_param_type_dict, gs_param_type_dict_int_keys, gs_param_type_array
2810 } gs_param_type;
2811 # 73 "./src/gsparam.h"
2812 typedef struct gs_param_int_array_s { const int *data; uint size; bool persistent; } gs_param_int_array;
2813 typedef struct gs_param_float_array_s { const float *data; uint size; bool persistent; } gs_param_float_array;
2814 typedef struct gs_param_string_array_s { const gs_param_string *data; uint size; bool persistent; } gs_param_string_array;
2815 # 91 "./src/gsparam.h"
2816 typedef struct gs_param_collection_s {
2817     gs_param_list *list;
2818     uint size;
2819 } gs_param_collection;
2820 typedef gs_param_collection gs_param_dict;
2821 typedef gs_param_collection gs_param_array;
2822 # 118 "./src/gsparam.h"
2823 extern const byte gs_param_type_sizes[];
2824 extern const byte gs_param_type_base_sizes[];
2825 # 134 "./src/gsparam.h"
2826 typedef union gs_param_value_s {
2827     bool b; int i; long l; float f; gs_param_string s; gs_param_string n; gs_param_int_array ia; gs_param_float_array fa; gs_param_string_array sa; gs_param_string_array na; gs_param_collection d;
2828 } gs_param_value;
2829
2830
2831
2832
2833
2834 typedef struct gs_param_typed_value_s {
2835     gs_param_value value;
2836     gs_param_type type;
2837 } gs_param_typed_value;
2838
2839
2840
2841
2842
2843
2844 gs_ptr_type_t gs_param_typed_value_enum_ptrs(const gs_memory_t *mem, const void *ptr, uint size, int index, enum_ptr_t *pep, const gs_memory_struct_type_t *pstype, gc_state_t *gcst);
2845 void gs_param_typed_value_reloc_ptrs(void *ptr, uint size, const gs_memory_struct_type_t *pstype, gc_state_t *gcst);
2846
2847
2848
2849
2850
2851
2852 typedef enum {
2853
2854
2855
2856     gs_param_collection_dict_any = 0,
2857
2858
2859
2860
2861
2862     gs_param_collection_dict_int_keys = 1,
2863
2864
2865
2866
2867     gs_param_collection_array = 2
2868
2869 } gs_param_collection_type_t;
2870 # 193 "./src/gsparam.h"
2871 typedef union gs_param_enumerator_s {
2872     int intval;
2873     long longval;
2874     void *pvoid;
2875     char *pchar;
2876 } gs_param_enumerator_t;
2877 typedef gs_param_string gs_param_key_t;
2878 # 254 "./src/gsparam.h"
2879 typedef struct gs_param_list_procs_s {
2880 # 266 "./src/gsparam.h"
2881   int (*xmit_typed)(gs_param_list *, gs_param_name, gs_param_typed_value *);
2882 # 276 "./src/gsparam.h"
2883   int (*begin_xmit_collection)(gs_param_list *, gs_param_name, gs_param_dict *, gs_param_collection_type_t);
2884 # 294 "./src/gsparam.h"
2885   int (*end_xmit_collection)(gs_param_list *, gs_param_name, gs_param_dict *);
2886 # 310 "./src/gsparam.h"
2887   int (*next_key)(gs_param_list *, gs_param_enumerator_t *, gs_param_key_t *);
2888 # 324 "./src/gsparam.h"
2889   int (*request)(gs_param_list *, gs_param_name);
2890 # 339 "./src/gsparam.h"
2891   int (*requested)(const gs_param_list *, gs_param_name);
2892 # 348 "./src/gsparam.h"
2893   int (*get_policy)(gs_param_list *, gs_param_name);
2894 # 360 "./src/gsparam.h"
2895   int (*signal_error)(gs_param_list *, gs_param_name, int);
2896 # 373 "./src/gsparam.h"
2897   int (*commit)(gs_param_list *);
2898
2899
2900
2901 } gs_param_list_procs;
2902
2903
2904 int param_read_requested_typed(gs_param_list *, gs_param_name,
2905       gs_param_typed_value *);
2906
2907
2908
2909
2910
2911
2912 int param_read_null(gs_param_list *, gs_param_name);
2913 int param_write_null(gs_param_list *, gs_param_name);
2914 int param_read_bool(gs_param_list *, gs_param_name, bool *);
2915 int param_write_bool(gs_param_list *, gs_param_name, const bool *);
2916 int param_read_int(gs_param_list *, gs_param_name, int *);
2917 int param_write_int(gs_param_list *, gs_param_name, const int *);
2918 int param_read_long(gs_param_list *, gs_param_name, long *);
2919 int param_write_long(gs_param_list *, gs_param_name, const long *);
2920 int param_read_float(gs_param_list *, gs_param_name, float *);
2921 int param_write_float(gs_param_list *, gs_param_name, const float *);
2922 int param_read_string(gs_param_list *, gs_param_name, gs_param_string *);
2923 int param_write_string(gs_param_list *, gs_param_name,
2924          const gs_param_string *);
2925 int param_read_name(gs_param_list *, gs_param_name, gs_param_string *);
2926 int param_write_name(gs_param_list *, gs_param_name,
2927        const gs_param_string *);
2928 int param_read_int_array(gs_param_list *, gs_param_name,
2929     gs_param_int_array *);
2930 int param_write_int_array(gs_param_list *, gs_param_name,
2931      const gs_param_int_array *);
2932 int param_write_int_values(gs_param_list *, gs_param_name,
2933       const int *, uint, bool);
2934 int param_read_float_array(gs_param_list *, gs_param_name,
2935       gs_param_float_array *);
2936 int param_write_float_array(gs_param_list *, gs_param_name,
2937        const gs_param_float_array *);
2938 int param_write_float_values(gs_param_list *, gs_param_name,
2939         const float *, uint, bool);
2940 int param_read_string_array(gs_param_list *, gs_param_name,
2941        gs_param_string_array *);
2942 int param_write_string_array(gs_param_list *, gs_param_name,
2943         const gs_param_string_array *);
2944 int param_read_name_array(gs_param_list *, gs_param_name,
2945      gs_param_string_array *);
2946 int param_write_name_array(gs_param_list *, gs_param_name,
2947       const gs_param_string_array *);
2948 # 437 "./src/gsparam.h"
2949 struct gs_param_list_s {
2950     const gs_param_list_procs *procs; gs_memory_t *memory; bool persistent_keys;
2951 };
2952
2953
2954
2955
2956 void gs_param_list_set_persist_keys(gs_param_list *, bool);
2957
2958
2959 void param_init_enumerator(gs_param_enumerator_t * penum);
2960
2961
2962
2963
2964
2965
2966 typedef struct gs_param_item_s {
2967     const char *key;
2968     byte type;
2969     short offset;
2970 } gs_param_item_t;
2971
2972
2973
2974
2975
2976
2977 int gs_param_read_items(gs_param_list * plist, void *obj,
2978    const gs_param_item_t * items);
2979 int gs_param_write_items(gs_param_list * plist, const void *obj,
2980     const void *default_obj,
2981     const gs_param_item_t * items);
2982
2983
2984 void gs_param_list_init(gs_param_list *, const gs_param_list_procs *,
2985    gs_memory_t *);
2986
2987
2988
2989
2990
2991
2992 int param_coerce_typed(gs_param_typed_value * pvalue,
2993          gs_param_type req_type, gs_memory_t * mem);
2994
2995
2996
2997
2998
2999
3000
3001 int gs_param_request_default(gs_param_list *, gs_param_name);
3002 int gs_param_requested_default(const gs_param_list *, gs_param_name);
3003 # 518 "./src/gsparam.h"
3004 typedef struct gs_c_param_s gs_c_param;
3005 typedef struct gs_c_param_list_s {
3006     const gs_param_list_procs *procs; gs_memory_t *memory; bool persistent_keys;
3007     gs_c_param *head;
3008     gs_param_list *target;
3009     uint count;
3010     bool any_requested;
3011     gs_param_collection_type_t coll_type;
3012 } gs_c_param_list;
3013 # 538 "./src/gsparam.h"
3014 void gs_c_param_list_set_target(gs_c_param_list *, gs_param_list *);
3015
3016
3017
3018
3019
3020 gs_c_param_list *gs_c_param_list_alloc(gs_memory_t *, client_name_t);
3021 void gs_c_param_list_write(gs_c_param_list *, gs_memory_t *);
3022 void gs_c_param_list_write_more(gs_c_param_list *);
3023 void gs_c_param_list_read(gs_c_param_list *);
3024 void gs_c_param_list_release(gs_c_param_list *);
3025 # 21 "./src/gdevpdfx.h" 2
3026 # 1 "./src/gsuid.h" 1
3027 # 24 "./src/gsuid.h"
3028 typedef struct gs_uid_s gs_uid;
3029
3030 struct gs_uid_s {
3031
3032
3033     long id;
3034     long *xvalues;
3035 };
3036 # 60 "./src/gsuid.h"
3037 bool uid_equal(const gs_uid *, const gs_uid *);
3038
3039
3040 int uid_copy(gs_uid *puid, gs_memory_t *mem, client_name_t cname);
3041 # 22 "./src/gdevpdfx.h" 2
3042 # 1 "./src/gxdevice.h" 1
3043 # 21 "./src/gxdevice.h"
3044 # 1 "./src/gxdevcli.h" 1
3045 # 21 "./src/gxdevcli.h"
3046 # 1 "./src/stdint_.h" 1
3047 # 41 "./src/stdint_.h"
3048 # 1 "/usr/include/stdint.h" 1 3 4
3049 # 28 "/usr/include/stdint.h" 3 4
3050 # 1 "/usr/include/bits/wordsize.h" 1 3 4
3051 # 29 "/usr/include/stdint.h" 2 3 4
3052 # 49 "/usr/include/stdint.h" 3 4
3053 typedef unsigned char uint8_t;
3054 typedef unsigned short int uint16_t;
3055
3056 typedef unsigned int uint32_t;
3057
3058
3059
3060
3061
3062 __extension__
3063 typedef unsigned long long int uint64_t;
3064
3065
3066
3067
3068
3069
3070 typedef signed char int_least8_t;
3071 typedef short int int_least16_t;
3072 typedef int int_least32_t;
3073
3074
3075
3076 __extension__
3077 typedef long long int int_least64_t;
3078
3079
3080
3081 typedef unsigned char uint_least8_t;
3082 typedef unsigned short int uint_least16_t;
3083 typedef unsigned int uint_least32_t;
3084
3085
3086
3087 __extension__
3088 typedef unsigned long long int uint_least64_t;
3089
3090
3091
3092
3093
3094
3095 typedef signed char int_fast8_t;
3096
3097
3098
3099
3100
3101 typedef int int_fast16_t;
3102 typedef int int_fast32_t;
3103 __extension__
3104 typedef long long int int_fast64_t;
3105
3106
3107
3108 typedef unsigned char uint_fast8_t;
3109
3110
3111
3112
3113
3114 typedef unsigned int uint_fast16_t;
3115 typedef unsigned int uint_fast32_t;
3116 __extension__
3117 typedef unsigned long long int uint_fast64_t;
3118 # 126 "/usr/include/stdint.h" 3 4
3119 typedef int intptr_t;
3120
3121
3122 typedef unsigned int uintptr_t;
3123 # 138 "/usr/include/stdint.h" 3 4
3124 __extension__
3125 typedef long long int intmax_t;
3126 __extension__
3127 typedef unsigned long long int uintmax_t;
3128 # 42 "./src/stdint_.h" 2
3129 # 22 "./src/gxdevcli.h" 2
3130 # 1 "./src/gscompt.h" 1
3131 # 39 "./src/gscompt.h"
3132 typedef struct gs_composite_s gs_composite_t;
3133
3134
3135
3136
3137
3138
3139 gs_id gs_composite_id(const gs_composite_t * pcte);
3140 # 23 "./src/gxdevcli.h" 2
3141 # 1 "./src/gsdcolor.h" 1
3142 # 20 "./src/gsdcolor.h"
3143 # 1 "./src/gsccolor.h" 1
3144 # 25 "./src/gsccolor.h"
3145 typedef struct gs_pattern_instance_s gs_pattern_instance_t;
3146 # 37 "./src/gsccolor.h"
3147 typedef struct gs_paint_color_s {
3148     float values[(8 * 8)];
3149 } gs_paint_color;
3150
3151
3152
3153
3154 typedef struct gs_client_color_s gs_client_color;
3155
3156
3157 struct gs_client_color_s {
3158     gs_paint_color paint;
3159     gs_pattern_instance_t *pattern;
3160 };
3161
3162 extern const gs_memory_struct_type_t st_client_color;
3163 # 21 "./src/gsdcolor.h" 2
3164 # 1 "./src/gxarith.h" 1
3165 # 25 "./src/gxarith.h"
3166 int imod(int m, int n);
3167
3168
3169 int igcd(int x, int y);
3170
3171
3172
3173
3174
3175 int idivmod(int a, int b, int m);
3176
3177
3178
3179
3180 int ilog2(int n);
3181 # 22 "./src/gsdcolor.h" 2
3182 # 1 "./src/gxbitmap.h" 1
3183 # 21 "./src/gxbitmap.h"
3184 # 1 "./src/gsbitmap.h" 1
3185 # 52 "./src/gsbitmap.h"
3186 typedef gs_id gs_bitmap_id;
3187 # 73 "./src/gsbitmap.h"
3188 typedef struct gs_bitmap_s {
3189     byte * data; int raster; gs_int_point size; gs_bitmap_id id;
3190 } gs_bitmap;
3191 typedef struct gs_const_bitmap_s {
3192     const byte * data; int raster; gs_int_point size; gs_bitmap_id id;
3193 } gs_const_bitmap;
3194 # 94 "./src/gsbitmap.h"
3195 typedef struct gs_tile_bitmap_s {
3196     byte * data; int raster; gs_int_point size; gs_bitmap_id id; ushort rep_width, rep_height;
3197 } gs_tile_bitmap;
3198 typedef struct gs_const_tile_bitmap_s {
3199     const byte * data; int raster; gs_int_point size; gs_bitmap_id id; ushort rep_width, rep_height;
3200 } gs_const_tile_bitmap;
3201 # 122 "./src/gsbitmap.h"
3202 typedef struct gs_depth_bitmap_s {
3203     byte * data; int raster; gs_int_point size; gs_bitmap_id id; byte pix_depth; byte num_comps;
3204 } gs_depth_bitmap;
3205 typedef struct gs_const_depth_bitmap_s {
3206     const byte * data; int raster; gs_int_point size; gs_bitmap_id id; byte pix_depth; byte num_comps;
3207 } gs_const_depth_bitmap;
3208
3209
3210
3211
3212
3213
3214 typedef struct gs_tile_depth_bitmap_s {
3215     byte * data; int raster; gs_int_point size; gs_bitmap_id id; ushort rep_width, rep_height; byte pix_depth; byte num_comps;
3216 } gs_tile_depth_bitmap;
3217 typedef struct gs_const_tile_depth_bitmap_s {
3218     const byte * data; int raster; gs_int_point size; gs_bitmap_id id; ushort rep_width, rep_height; byte pix_depth; byte num_comps;
3219 } gs_const_tile_depth_bitmap;
3220 # 153 "./src/gsbitmap.h"
3221 extern const gs_memory_struct_type_t st_gs_bitmap;
3222 extern const gs_memory_struct_type_t st_gs_tile_bitmap;
3223 extern const gs_memory_struct_type_t st_gs_depth_bitmap;
3224 extern const gs_memory_struct_type_t st_gs_tile_depth_bitmap;
3225 # 22 "./src/gxbitmap.h" 2
3226
3227
3228 typedef gs_bitmap_id gx_bitmap_id;
3229 # 74 "./src/gxbitmap.h"
3230 typedef struct gx_bitmap_s {
3231     byte * data; int raster; gs_int_point size; gs_bitmap_id id;
3232 } gx_bitmap;
3233 typedef struct gx_const_bitmap_s {
3234     const byte * data; int raster; gs_int_point size; gs_bitmap_id id;
3235 } gx_const_bitmap;
3236
3237
3238
3239
3240
3241
3242
3243 typedef struct gx_tile_bitmap_s {
3244     byte * data; int raster; gs_int_point size; gs_bitmap_id id; ushort rep_width, rep_height;
3245 } gx_tile_bitmap;
3246 typedef struct gx_const_tile_bitmap_s {
3247     const byte * data; int raster; gs_int_point size; gs_bitmap_id id; ushort rep_width, rep_height;
3248 } gx_const_tile_bitmap;
3249 # 135 "./src/gxbitmap.h"
3250 typedef struct gx_strip_bitmap_s {
3251     byte * data; int raster; gs_int_point size; gs_bitmap_id id; ushort rep_width, rep_height; ushort rep_shift; ushort shift;
3252 } gx_strip_bitmap;
3253 typedef struct gx_const_strip_bitmap_s {
3254     const byte * data; int raster; gs_int_point size; gs_bitmap_id id; ushort rep_width, rep_height; ushort rep_shift; ushort shift;
3255 } gx_const_strip_bitmap;
3256
3257 extern const gs_memory_struct_type_t st_gx_strip_bitmap;
3258 # 23 "./src/gsdcolor.h" 2
3259 # 1 "./src/gxhttile.h" 1
3260 # 30 "./src/gxhttile.h"
3261 typedef struct gx_ht_tile_s gx_ht_tile;
3262
3263
3264
3265 struct gx_ht_tile_s {
3266     gx_strip_bitmap tiles;
3267     int level;
3268
3269
3270     uint index;
3271
3272 };
3273 # 24 "./src/gsdcolor.h" 2
3274 # 1 "./src/gxcindex.h" 1
3275 # 20 "./src/gxcindex.h"
3276 # 1 "./src/gsbitops.h" 1
3277 # 270 "./src/gsbitops.h"
3278 void bits_fill_rectangle(byte * dest, int dest_bit, uint raster,
3279         uint pattern, int width_bits, int height);
3280 void bits_fill_rectangle_masked(byte * dest, int dest_bit, uint raster,
3281         uint pattern, uint src_mask,
3282         int width_bits, int height);
3283
3284
3285 void bits_replicate_horizontally(byte * data, uint width, uint height,
3286         uint raster, uint replicated_width, uint replicated_raster);
3287
3288
3289 void bits_replicate_vertically(byte * data, uint height, uint raster,
3290     uint replicated_height);
3291
3292
3293 void bits_bounding_box(const byte * data, uint height, uint raster,
3294     gs_int_rect * pbox);
3295
3296
3297
3298
3299 void bits_compress_scaled(const byte * src, int srcx, uint width,
3300     uint height, uint sraster, byte * dest, uint draster,
3301     const gs_log2_scale_point * plog2_scale, int log2_out_bits);
3302
3303
3304 typedef struct bits_plane_s {
3305     union bpd_ {
3306  byte *write;
3307  const byte *read;
3308     } data;
3309     int raster;
3310     int depth;
3311     int x;
3312 } bits_plane_t;
3313 int bits_extract_plane(const bits_plane_t *dest ,
3314     const bits_plane_t *source , int shift, int width, int height);
3315
3316
3317 int bits_expand_plane(const bits_plane_t *dest ,
3318     const bits_plane_t *source , int shift, int width, int height);
3319
3320
3321 void bytes_fill_rectangle(byte * dest, uint raster,
3322     byte value, int width_bytes, int height);
3323
3324
3325 void bytes_copy_rectangle(byte * dest, uint dest_raster,
3326     const byte * src, uint src_raster, int width_bytes, int height);
3327 # 21 "./src/gxcindex.h" 2
3328 # 55 "./src/gxcindex.h"
3329 typedef unsigned long long gx_color_index_data;
3330 # 79 "./src/gxcindex.h"
3331 typedef gx_color_index_data gx_color_index;
3332 # 25 "./src/gsdcolor.h" 2
3333 # 1 "./src/gxwts.h" 1
3334 # 17 "./src/gxwts.h"
3335 typedef bits16 wts_screen_sample_t;
3336
3337
3338
3339 typedef struct wts_screen_s wts_screen_t;
3340
3341
3342 typedef enum {
3343     WTS_SCREEN_RAT,
3344     WTS_SCREEN_J,
3345     WTS_SCREEN_H
3346 } wts_screen_type;
3347
3348 struct wts_screen_s {
3349     wts_screen_type type;
3350     int cell_width;
3351     int cell_height;
3352     int cell_shift;
3353     wts_screen_sample_t *samples;
3354 };
3355
3356 typedef struct {
3357     wts_screen_t base;
3358
3359
3360
3361
3362     int pa;
3363     int pb;
3364     int pc;
3365     int pd;
3366
3367     int XA;
3368     int YA;
3369     int XB;
3370     int YB;
3371     int XC;
3372     int YC;
3373     int XD;
3374     int YD;
3375 } wts_screen_j_t;
3376
3377 typedef struct {
3378     wts_screen_t base;
3379
3380
3381     double px;
3382
3383     double py;
3384
3385     int x1;
3386     int y1;
3387 } wts_screen_h_t;
3388
3389 int wts_get_samples(const wts_screen_t *ws, int x, int y,
3390   wts_screen_sample_t **samples, int *p_nsamples);
3391 # 26 "./src/gsdcolor.h" 2
3392
3393
3394
3395 typedef struct gx_device_color_s gx_device_color;
3396
3397
3398
3399
3400 typedef struct gx_device_color_saved_s gx_device_color_saved;
3401
3402
3403
3404
3405 typedef struct gx_device_halftone_s gx_device_halftone;
3406 # 87 "./src/gsdcolor.h"
3407 bool gx_device_color_equal(const gx_device_color *pdevc1,
3408       const gx_device_color *pdevc2);
3409 # 157 "./src/gsdcolor.h"
3410 void gx_complete_halftone(gx_device_color *pdevc, int num_comps,
3411                           gx_device_halftone *pdht);
3412 # 183 "./src/gsdcolor.h"
3413 typedef struct gx_color_tile_s gx_color_tile;
3414 # 253 "./src/gsdcolor.h"
3415 typedef struct gx_device_color_type_s gx_device_color_type_t;
3416 typedef const gx_device_color_type_t *gx_device_color_type;
3417
3418 struct gx_device_color_s {
3419
3420
3421
3422
3423     gx_device_color_type type;
3424
3425
3426
3427
3428
3429
3430     union _c {
3431  gx_color_index pure;
3432  struct _bin {
3433      const gx_device_halftone *b_ht;
3434      gx_color_index color[2];
3435      uint b_level;
3436      int b_index;
3437      gx_ht_tile *b_tile;
3438  } binary;
3439  struct _col {
3440      gx_device_halftone *c_ht;
3441      ushort num_components;
3442      byte c_base[(8 * 8)];
3443      uint c_level[(8 * 8)];
3444      ushort alpha;
3445
3446
3447
3448
3449
3450
3451      gx_color_index plane_mask;
3452
3453
3454  } colored;
3455  struct _wts {
3456      const gx_device_halftone *w_ht;
3457      wts_screen_sample_t levels[(8 * 8)];
3458      ushort num_components;
3459
3460
3461      gx_color_index plane_vector[(8 * 8)];
3462  } wts;
3463  struct _pat {
3464      gx_color_tile *p_tile;
3465  } pattern;
3466     } colors;
3467     gs_int_point phase;
3468
3469
3470
3471
3472
3473
3474
3475     bool ccolor_valid;
3476
3477
3478
3479
3480
3481
3482     gs_client_color ccolor;
3483
3484     struct _mask {
3485  struct mp_ {
3486      short x, y;
3487  } m_phase;
3488  gx_bitmap_id id;
3489  gx_color_tile *m_tile;
3490     } mask;
3491 };
3492 # 374 "./src/gsdcolor.h"
3493 struct gx_device_color_saved_s {
3494     gx_device_color_type type;
3495     union _svc {
3496         gx_color_index pure;
3497         struct _svbin {
3498             gx_color_index b_color[2];
3499             uint b_level;
3500             int b_index;
3501         } binary;
3502         struct _svcol {
3503             byte c_base[(8 * 8)];
3504             uint c_level[(8 * 8)];
3505             ushort alpha;
3506         } colored;
3507         struct _swts {
3508             wts_screen_sample_t levels[(8 * 8)];
3509         } wts;
3510  struct _pattern {
3511      gs_id id;
3512      gs_int_point phase;
3513  } pattern;
3514  struct _pattern2 {
3515      gs_id id;
3516      bool shfill;
3517  } pattern2;
3518     } colors;
3519     gs_int_point phase;
3520 };
3521 # 414 "./src/gsdcolor.h"
3522 extern const gx_device_color_type_t *const gx_dc_type_none;
3523
3524
3525 extern const gx_device_color_type_t *const gx_dc_type_null;
3526
3527
3528 extern const gx_device_color_type_t *const gx_dc_type_pure;
3529 # 430 "./src/gsdcolor.h"
3530 extern const gx_device_color_type_t *const gx_dc_type_ht_binary;
3531
3532
3533 extern const gx_device_color_type_t *const gx_dc_type_ht_colored;
3534
3535
3536 extern const gx_device_color_type_t *const gx_dc_type_wts;
3537 # 24 "./src/gxdevcli.h" 2
3538 # 1 "./src/gsmatrix.h" 1
3539 # 26 "./src/gsmatrix.h"
3540 struct gs_matrix_s {
3541     float xx, xy, yx, yy, tx, ty;
3542 };
3543
3544
3545
3546 typedef struct gs_matrix_s gs_matrix;
3547 # 50 "./src/gsmatrix.h"
3548 void gs_make_identity(gs_matrix *);
3549 int gs_make_translation(floatp, floatp, gs_matrix *),
3550     gs_make_scaling(floatp, floatp, gs_matrix *),
3551     gs_make_rotation(floatp, gs_matrix *);
3552
3553
3554 int gs_matrix_multiply(const gs_matrix *, const gs_matrix *, gs_matrix *),
3555     gs_matrix_invert(const gs_matrix *, gs_matrix *),
3556     gs_matrix_translate(const gs_matrix *, floatp, floatp, gs_matrix *),
3557     gs_matrix_scale(const gs_matrix *, floatp, floatp, gs_matrix *),
3558     gs_matrix_rotate(const gs_matrix *, floatp, gs_matrix *);
3559
3560
3561 int gs_point_transform(floatp, floatp, const gs_matrix *, gs_point *),
3562     gs_point_transform_inverse(floatp, floatp, const gs_matrix *, gs_point *),
3563     gs_distance_transform(floatp, floatp, const gs_matrix *, gs_point *),
3564     gs_distance_transform_inverse(floatp, floatp, const gs_matrix *, gs_point *),
3565     gs_points_bbox(const gs_point[4], gs_rect *),
3566     gs_bbox_transform_only(const gs_rect *, const gs_matrix *, gs_point[4]),
3567     gs_bbox_transform(const gs_rect *, const gs_matrix *, gs_rect *),
3568     gs_bbox_transform_inverse(const gs_rect *, const gs_matrix *, gs_rect *);
3569
3570
3571
3572
3573
3574
3575 int sget_matrix(stream *, gs_matrix *);
3576 int sput_matrix(stream *, const gs_matrix *);
3577 # 25 "./src/gxdevcli.h" 2
3578 # 1 "./src/gsiparam.h" 1
3579 # 43 "./src/gsiparam.h"
3580 typedef struct gx_image_type_s gx_image_type_t;
3581 # 52 "./src/gsiparam.h"
3582 typedef struct gs_image_common_s {
3583     const gx_image_type_t *type; gs_matrix ImageMatrix;
3584 } gs_image_common_t;
3585 # 120 "./src/gsiparam.h"
3586 typedef struct gs_data_image_s {
3587     const gx_image_type_t *type; gs_matrix ImageMatrix; int Width; int Height; int BitsPerComponent; float Decode[((8 * 8) + 1) * 2]; bool Interpolate;
3588 } gs_data_image_t;
3589 # 143 "./src/gsiparam.h"
3590 typedef enum {
3591
3592     gs_image_format_chunky = 0,
3593
3594     gs_image_format_component_planar = 1,
3595
3596     gs_image_format_bit_planar = 2
3597 } gs_image_format_t;
3598
3599
3600
3601
3602 typedef struct gs_color_space_s gs_color_space;
3603 # 175 "./src/gsiparam.h"
3604 typedef struct gs_pixel_image_s {
3605     const gx_image_type_t *type; gs_matrix ImageMatrix; int Width; int Height; int BitsPerComponent; float Decode[((8 * 8) + 1) * 2]; bool Interpolate; gs_image_format_t format; const gs_color_space *ColorSpace; bool CombineWithColor;
3606 } gs_pixel_image_t;
3607
3608 extern const gs_memory_struct_type_t st_gs_pixel_image;
3609 # 189 "./src/gsiparam.h"
3610 typedef enum {
3611
3612     gs_image_alpha_none = 0,
3613
3614     gs_image_alpha_first,
3615
3616     gs_image_alpha_last
3617 } gs_image_alpha_t;
3618
3619 typedef struct gs_image1_s {
3620     const gx_image_type_t *type; gs_matrix ImageMatrix; int Width; int Height; int BitsPerComponent; float Decode[((8 * 8) + 1) * 2]; bool Interpolate; gs_image_format_t format; const gs_color_space *ColorSpace; bool CombineWithColor;
3621
3622
3623
3624
3625     bool ImageMask;
3626
3627
3628
3629
3630     bool adjust;
3631
3632
3633
3634
3635
3636     gs_image_alpha_t Alpha;
3637 } gs_image1_t;
3638
3639
3640 extern const gs_memory_struct_type_t st_gs_image1;
3641
3642
3643
3644
3645
3646
3647
3648 typedef gs_image1_t gs_image_t;
3649 # 236 "./src/gsiparam.h"
3650 void
3651
3652
3653
3654      gs_image_common_t_init(gs_image_common_t * pic),
3655
3656
3657
3658
3659
3660
3661
3662      gs_data_image_t_init(gs_data_image_t * pim, int num_components),
3663
3664
3665
3666
3667
3668
3669     gs_pixel_image_t_init(gs_pixel_image_t * pim,
3670      const gs_color_space * color_space);
3671 # 270 "./src/gsiparam.h"
3672 void gs_image_t_init_adjust(gs_image_t * pim, const gs_color_space * pcs,
3673        bool adjust);
3674
3675
3676 void gs_image_t_init_mask_adjust(gs_image_t * pim, bool write_1s,
3677      bool adjust);
3678 # 26 "./src/gxdevcli.h" 2
3679 # 1 "./src/gsrefct.h" 1
3680 # 34 "./src/gsrefct.h"
3681 typedef struct rc_header_s rc_header;
3682 struct rc_header_s {
3683     long ref_count;
3684     gs_memory_t *memory;
3685
3686
3687     void (*free)(gs_memory_t *, void *, client_name_t);
3688 };
3689 # 56 "./src/gsrefct.h"
3690 void rc_free_struct_only(gs_memory_t *, void *, client_name_t);
3691 # 27 "./src/gxdevcli.h" 2
3692 # 1 "./src/gsropt.h" 1
3693 # 41 "./src/gsropt.h"
3694 typedef enum {
3695     rop2_0 = 0,
3696     rop2_S = 0xc,
3697
3698     rop2_D = 0xa,
3699
3700     rop2_1 = 0xf,
3701
3702
3703     rop2_default = rop2_S
3704 } gs_rop2_t;
3705 # 60 "./src/gsropt.h"
3706 typedef enum {
3707     rop3_0 = 0,
3708     rop3_T = 0xf0,
3709
3710     rop3_S = 0xcc,
3711
3712     rop3_D = 0xaa,
3713
3714     rop3_1 = 0xff,
3715     rop3_default = rop3_T | rop3_S
3716 } gs_rop3_t;
3717 # 159 "./src/gsropt.h"
3718 typedef uint gs_logical_operation_t;
3719 # 198 "./src/gsropt.h"
3720 typedef unsigned long rop_operand;
3721 typedef rop_operand (*rop_proc)(rop_operand D, rop_operand S, rop_operand T);
3722
3723
3724 typedef enum {
3725     rop_usage_none = 0,
3726     rop_usage_D = 1,
3727     rop_usage_S = 2,
3728     rop_usage_DS = 3,
3729     rop_usage_T = 4,
3730     rop_usage_DT = 5,
3731     rop_usage_ST = 6,
3732     rop_usage_DST = 7
3733 } rop_usage_t;
3734
3735
3736 extern const rop_proc rop_proc_table[256];
3737
3738
3739 extern const byte rop_usage_table[256];
3740 # 28 "./src/gxdevcli.h" 2
3741 # 1 "./src/gsstruct.h" 1
3742 # 83 "./src/gsstruct.h"
3743 typedef struct obj_header_s obj_header_t;
3744
3745
3746
3747
3748
3749
3750
3751 struct gs_ptr_procs_s {
3752
3753
3754
3755
3756
3757     void (*unmark)(enum_ptr_t *, gc_state_t *);
3758
3759
3760
3761
3762
3763
3764     bool (*mark)(enum_ptr_t *, gc_state_t *);
3765 # 114 "./src/gsstruct.h"
3766     void *(*reloc)(const void *, gc_state_t *);
3767
3768 };
3769
3770
3771
3772 extern const gs_ptr_procs_t ptr_struct_procs;
3773
3774
3775
3776 extern const gs_ptr_procs_t ptr_string_procs;
3777
3778 extern const gs_ptr_procs_t ptr_const_string_procs;
3779
3780
3781
3782
3783
3784
3785 struct gs_gc_root_s {
3786     gs_gc_root_t *next;
3787     gs_ptr_type_t ptype;
3788     void **p;
3789     bool free_on_unregister;
3790 };
3791 # 174 "./src/gsstruct.h"
3792 typedef struct gc_procs_common_s {
3793     void *(*reloc_struct_ptr)(const void *, gc_state_t *); void (*reloc_string)(gs_string *, gc_state_t *); void (*reloc_const_string)(gs_const_string *, gc_state_t *); void (*reloc_param_string)(gs_param_string *, gc_state_t *);
3794 } gc_procs_common_t;
3795
3796
3797
3798
3799
3800
3801
3802 gs_ptr_type_t gs_no_struct_enum_ptrs(const gs_memory_t *mem, const void *ptr, uint size, int index, enum_ptr_t *pep, const gs_memory_struct_type_t *pstype, gc_state_t *gcst);
3803 void gs_no_struct_reloc_ptrs(void *ptr, uint size, const gs_memory_struct_type_t *pstype, gc_state_t *gcst);
3804
3805
3806
3807
3808
3809 extern const gs_memory_struct_type_t st_free;
3810
3811
3812
3813 extern const gs_memory_struct_type_t st_bytes;
3814
3815
3816
3817 extern const gs_memory_struct_type_t st_gc_root_t;
3818 # 210 "./src/gsstruct.h"
3819 extern const gs_memory_struct_type_t st_const_string_element;
3820 # 231 "./src/gsstruct.h"
3821 typedef enum {
3822     GC_ELT_OBJ,
3823     GC_ELT_STRING,
3824     GC_ELT_CONST_STRING
3825 } gc_ptr_type_index_t;
3826
3827 typedef struct gc_ptr_element_s {
3828     ushort type;
3829     ushort offset;
3830 } gc_ptr_element_t;
3831 # 255 "./src/gsstruct.h"
3832 typedef struct gc_struct_data_s {
3833     ushort num_ptrs;
3834     ushort super_offset;
3835     const gs_memory_struct_type_t *super_type;
3836     const gc_ptr_element_t *ptrs;
3837 } gc_struct_data_t;
3838 # 278 "./src/gsstruct.h"
3839 gs_ptr_type_t basic_enum_ptrs(const gs_memory_t *mem, const void *ptr, uint size, int index, enum_ptr_t *pep, const gs_memory_struct_type_t *pstype, gc_state_t *gcst);
3840 void basic_reloc_ptrs(void *ptr, uint size, const gs_memory_struct_type_t *pstype, gc_state_t *gcst);
3841 # 360 "./src/gsstruct.h"
3842 extern gs_ptr_type_t
3843     enum_bytestring(enum_ptr_t *pep, const gs_bytestring *pbs);
3844
3845
3846 extern gs_ptr_type_t
3847     enum_const_bytestring(enum_ptr_t *pep, const gs_const_bytestring *pbs);
3848 # 418 "./src/gsstruct.h"
3849 extern void reloc_bytestring(gs_bytestring *pbs, gc_state_t *gcst);
3850
3851
3852 extern void reloc_const_bytestring(gs_const_bytestring *pbs, gc_state_t *gcst);
3853 # 29 "./src/gxdevcli.h" 2
3854 # 1 "./src/gstparam.h" 1
3855 # 24 "./src/gstparam.h"
3856 typedef enum {
3857     BLEND_MODE_Compatible,
3858     BLEND_MODE_Normal,
3859     BLEND_MODE_Multiply,
3860     BLEND_MODE_Screen,
3861     BLEND_MODE_Difference,
3862     BLEND_MODE_Darken,
3863     BLEND_MODE_Lighten,
3864     BLEND_MODE_ColorDodge,
3865     BLEND_MODE_ColorBurn,
3866     BLEND_MODE_Exclusion,
3867     BLEND_MODE_HardLight,
3868     BLEND_MODE_Overlay,
3869     BLEND_MODE_SoftLight,
3870     BLEND_MODE_Luminosity,
3871     BLEND_MODE_Hue,
3872     BLEND_MODE_Saturation,
3873     BLEND_MODE_Color
3874
3875 } gs_blend_mode_t;
3876
3877
3878
3879
3880
3881
3882
3883 typedef enum {
3884     TRANSPARENCY_STATE_Group = 1,
3885     TRANSPARENCY_STATE_Mask
3886 } gs_transparency_state_type_t;
3887
3888
3889
3890 typedef struct gs_transparency_state_s gs_transparency_state_t;
3891 struct gs_transparency_state_s {
3892     gs_transparency_state_t *saved; gs_transparency_state_type_t type;
3893 };
3894
3895
3896
3897
3898 typedef struct gs_transparency_mask_s {
3899     rc_header rc;
3900 } gs_transparency_mask_t;
3901
3902
3903
3904
3905
3906
3907
3908 typedef struct gs_function_s gs_function_t;
3909
3910
3911
3912
3913 typedef struct gs_transparency_group_params_s {
3914     const gs_color_space *ColorSpace;
3915     bool Isolated;
3916     bool Knockout;
3917 } gs_transparency_group_params_t;
3918
3919
3920 typedef enum {
3921     TRANSPARENCY_MASK_Alpha,
3922     TRANSPARENCY_MASK_Luminosity
3923 } gs_transparency_mask_subtype_t;
3924
3925
3926
3927
3928
3929
3930 typedef struct gs_transparency_mask_params_s {
3931     gs_transparency_mask_subtype_t subtype;
3932     int Background_components;
3933     float Background[(8 * 8)];
3934     float GrayBackground;
3935     int (*TransferFunction)(floatp in, float *out, void *proc_data);
3936     gs_function_t *TransferFunction_data;
3937 } gs_transparency_mask_params_t;
3938
3939
3940
3941
3942 typedef struct gx_transparency_mask_params_s {
3943     gs_transparency_mask_subtype_t subtype;
3944     int Background_components;
3945     float Background[(8 * 8)];
3946     float GrayBackground;
3947     bool function_is_identity;
3948     byte transfer_fn[256];
3949 } gx_transparency_mask_params_t;
3950
3951
3952 typedef enum {
3953     TRANSPARENCY_CHANNEL_Opacity = 0,
3954     TRANSPARENCY_CHANNEL_Shape = 1
3955 } gs_transparency_channel_selector_t;
3956 # 30 "./src/gxdevcli.h" 2
3957 # 1 "./src/gsxfont.h" 1
3958 # 22 "./src/gsxfont.h"
3959 typedef ulong gx_xglyph;
3960
3961
3962
3963
3964 struct gx_xfont_procs_s;
3965 typedef struct gx_xfont_procs_s gx_xfont_procs;
3966
3967
3968 struct gx_xfont_s;
3969 typedef struct gx_xfont_s gx_xfont;
3970 # 31 "./src/gxdevcli.h" 2
3971
3972
3973 # 1 "./src/gxcvalue.h" 1
3974 # 21 "./src/gxcvalue.h"
3975 typedef unsigned short gx_color_value;
3976 # 34 "./src/gxdevcli.h" 2
3977 # 1 "./src/gxfixed.h" 1
3978 # 25 "./src/gxfixed.h"
3979 typedef long fixed;
3980 typedef ulong ufixed;
3981 # 159 "./src/gxfixed.h"
3982 fixed fixed_mult_quo(fixed A, fixed B, fixed C);
3983 # 263 "./src/gxfixed.h"
3984 typedef struct gs_fixed_point_s {
3985     fixed x, y;
3986 } gs_fixed_point;
3987
3988
3989 typedef struct gs_fixed_rect_s {
3990     gs_fixed_point p, q;
3991 } gs_fixed_rect;
3992 # 35 "./src/gxdevcli.h" 2
3993 # 1 "./src/gxtext.h" 1
3994 # 20 "./src/gxtext.h"
3995 # 1 "./src/gstext.h" 1
3996 # 20 "./src/gstext.h"
3997 # 1 "./src/gsccode.h" 1
3998 # 25 "./src/gsccode.h"
3999 typedef ulong gs_char;
4000 # 72 "./src/gsccode.h"
4001 typedef ulong gs_glyph;
4002 # 90 "./src/gsccode.h"
4003 typedef bool (*gs_glyph_mark_proc_t)(const gs_memory_t *mem, gs_glyph glyph, void *proc_data);
4004
4005
4006 typedef enum {
4007     ENCODING_INDEX_UNKNOWN = -1,
4008
4009     ENCODING_INDEX_STANDARD = 0,
4010     ENCODING_INDEX_ISOLATIN1,
4011     ENCODING_INDEX_SYMBOL,
4012     ENCODING_INDEX_DINGBATS,
4013     ENCODING_INDEX_WINANSI,
4014     ENCODING_INDEX_MACROMAN,
4015     ENCODING_INDEX_MACEXPERT,
4016
4017
4018     ENCODING_INDEX_MACGLYPH,
4019     ENCODING_INDEX_ALOGLYPH,
4020     ENCODING_INDEX_ALXGLYPH,
4021     ENCODING_INDEX_CFFSTRINGS
4022
4023 } gs_encoding_index_t;
4024 # 123 "./src/gsccode.h"
4025 typedef enum gs_glyph_space_s {
4026     GLYPH_SPACE_NAME,
4027     GLYPH_SPACE_INDEX,
4028     GLYPH_SPACE_NOGEN
4029 } gs_glyph_space_t;
4030
4031
4032
4033
4034
4035
4036 typedef int (*gs_glyph_name_proc_t)(const gs_memory_t *mem,
4037         gs_glyph glyph, gs_const_string *pstr,
4038         void *proc_data);
4039 # 21 "./src/gstext.h" 2
4040 # 1 "./src/gscpm.h" 1
4041 # 20 "./src/gscpm.h"
4042 typedef enum {
4043     cpm_show,
4044     cpm_charwidth,
4045     cpm_false_charpath,
4046     cpm_true_charpath,
4047     cpm_false_charboxpath,
4048     cpm_true_charboxpath
4049 } gs_char_path_mode;
4050
4051 typedef enum {
4052     CACHE_DEVICE_NONE = 0,
4053     CACHE_DEVICE_NOT_CACHING,
4054     CACHE_DEVICE_NONE_AND_CLIP,
4055     CACHE_DEVICE_CACHING
4056 } gs_in_cache_device_t;
4057 # 22 "./src/gstext.h" 2
4058 # 95 "./src/gstext.h"
4059 typedef struct gs_text_params_s {
4060
4061     uint operation;
4062     union sd_ {
4063  const byte *bytes;
4064  const gs_char *chars;
4065  const gs_glyph *glyphs;
4066  gs_char d_char;
4067  gs_glyph d_glyph;
4068     } data;
4069     uint size;
4070
4071
4072     gs_point delta_all;
4073     gs_point delta_space;
4074     union s_ {
4075  gs_char s_char;
4076  gs_glyph s_glyph;
4077     } space;
4078
4079
4080     const float *x_widths;
4081     const float *y_widths;
4082     uint widths_size;
4083 } gs_text_params_t;
4084 # 128 "./src/gstext.h"
4085 int gs_text_replaced_width(const gs_text_params_t *text, uint index,
4086       gs_point *pwidth);
4087
4088
4089
4090
4091
4092
4093
4094 typedef struct gs_text_enum_s gs_text_enum_t;
4095
4096
4097
4098
4099
4100 typedef struct gx_device_s gx_device;
4101 # 155 "./src/gstext.h"
4102 typedef struct gs_font_s gs_font;
4103
4104
4105
4106 typedef struct gx_path_s gx_path;
4107
4108
4109
4110 typedef struct gx_clip_path_s gx_clip_path;
4111 # 187 "./src/gstext.h"
4112 int gx_device_text_begin(gx_device *dev, gs_imager_state *pis, const gs_text_params_t *text, gs_font *font, gx_path *path, const gx_device_color *pdcolor, const gx_clip_path *pcpath, gs_memory_t *memory, gs_text_enum_t **ppte);
4113
4114
4115
4116
4117
4118
4119 int gs_text_begin(gs_state * pgs, const gs_text_params_t * text,
4120     gs_memory_t * mem, gs_text_enum_t ** ppenum);
4121
4122
4123
4124
4125
4126 int gs_text_update_dev_color(gs_state * pgs, gs_text_enum_t * pte);
4127
4128
4129
4130 int
4131 gs_show_begin(gs_state *, const byte *, uint,
4132        gs_memory_t *, gs_text_enum_t **),
4133     gs_ashow_begin(gs_state *, floatp, floatp, const byte *, uint,
4134      gs_memory_t *, gs_text_enum_t **),
4135     gs_widthshow_begin(gs_state *, floatp, floatp, gs_char,
4136          const byte *, uint,
4137          gs_memory_t *, gs_text_enum_t **),
4138     gs_awidthshow_begin(gs_state *, floatp, floatp, gs_char,
4139    floatp, floatp, const byte *, uint,
4140    gs_memory_t *, gs_text_enum_t **),
4141     gs_kshow_begin(gs_state *, const byte *, uint,
4142      gs_memory_t *, gs_text_enum_t **),
4143     gs_xyshow_begin(gs_state *, const byte *, uint,
4144       const float *, const float *, uint,
4145       gs_memory_t *, gs_text_enum_t **),
4146     gs_glyphshow_begin(gs_state *, gs_glyph,
4147          gs_memory_t *, gs_text_enum_t **),
4148     gs_cshow_begin(gs_state *, const byte *, uint,
4149      gs_memory_t *, gs_text_enum_t **),
4150     gs_stringwidth_begin(gs_state *, const byte *, uint,
4151     gs_memory_t *, gs_text_enum_t **),
4152     gs_charpath_begin(gs_state *, const byte *, uint, bool,
4153         gs_memory_t *, gs_text_enum_t **),
4154     gs_glyphpath_begin(gs_state *, gs_glyph, bool,
4155          gs_memory_t *, gs_text_enum_t **),
4156     gs_glyphwidth_begin(gs_state *, gs_glyph,
4157    gs_memory_t *, gs_text_enum_t **),
4158     gs_charboxpath_begin(gs_state *, const byte *, uint, bool,
4159     gs_memory_t *, gs_text_enum_t **);
4160
4161
4162
4163
4164 int gs_text_restart(gs_text_enum_t *pte, const gs_text_params_t *text);
4165
4166
4167
4168
4169 int gs_text_resync(gs_text_enum_t *pte, const gs_text_enum_t *pfrom);
4170 # 276 "./src/gstext.h"
4171 int gs_text_process(gs_text_enum_t *pte);
4172
4173
4174 gs_font *gs_text_current_font(const gs_text_enum_t *pte);
4175 gs_char gs_text_current_char(const gs_text_enum_t *pte);
4176 gs_char gs_text_next_char(const gs_text_enum_t *pte);
4177 gs_glyph gs_text_current_glyph(const gs_text_enum_t *pte);
4178 int gs_text_total_width(const gs_text_enum_t *pte, gs_point *pwidth);
4179
4180
4181
4182
4183
4184
4185 bool gs_text_is_width_only(const gs_text_enum_t *pte);
4186
4187
4188
4189
4190 int gs_text_current_width(const gs_text_enum_t *pte, gs_point *pwidth);
4191
4192
4193
4194
4195
4196 typedef enum {
4197     TEXT_SET_CHAR_WIDTH,
4198     TEXT_SET_CACHE_DEVICE,
4199     TEXT_SET_CACHE_DEVICE2
4200 } gs_text_cache_control_t;
4201 int
4202     gs_text_set_cache(gs_text_enum_t *pte, const double *values,
4203         gs_text_cache_control_t control),
4204     gs_text_setcharwidth(gs_text_enum_t *pte, const double wxy[2]),
4205     gs_text_setcachedevice(gs_text_enum_t *pte, const double wbox[6]),
4206     gs_text_setcachedevice2(gs_text_enum_t *pte, const double wbox2[10]);
4207
4208
4209 int gs_text_retry(gs_text_enum_t *pte);
4210
4211
4212 void gs_text_release(gs_text_enum_t *pte, client_name_t cname);
4213 # 21 "./src/gxtext.h" 2
4214
4215
4216
4217 typedef struct gs_text_enum_procs_s gs_text_enum_procs_t;
4218
4219
4220
4221 typedef struct cached_fm_pair_s cached_fm_pair;
4222
4223
4224
4225
4226
4227 typedef struct gs_text_returned_s {
4228     gs_char current_char;
4229     gs_glyph current_glyph;
4230     gs_point total_width;
4231 } gs_text_returned_t;
4232 # 54 "./src/gxtext.h"
4233 typedef struct gx_font_stack_item_s {
4234     gs_font *font;
4235     uint index;
4236 } gx_font_stack_item_t;
4237 typedef struct gx_font_stack_s {
4238     int depth;
4239     gx_font_stack_item_t items[1 + 5];
4240 } gx_font_stack_t;
4241 # 74 "./src/gxtext.h"
4242 void rc_free_text_enum(gs_memory_t *, void *, client_name_t);
4243 # 111 "./src/gxtext.h"
4244 struct gs_text_enum_s {
4245     gs_text_params_t text; gx_device *dev; gx_device *imaging_dev; gs_imager_state *pis; gs_font *orig_font; gx_path *path; const gx_device_color *pdcolor; const gx_clip_path *pcpath; gs_memory_t *memory; const gs_text_enum_procs_t *procs; rc_header rc; gs_font *current_font; gs_glyph outer_CID; bool is_pure_color; gs_log2_scale_point log2_scale; cached_fm_pair *pair; uint index; uint xy_index; gx_font_stack_t fstack; int cmap_code; gs_point FontBBox_as_Metrics2; ulong text_enum_id; bool device_disabled_grid_fitting; gs_text_returned_t returned;
4246 };
4247 # 163 "./src/gxtext.h"
4248 int gs_text_enum_init(gs_text_enum_t *pte,
4249         const gs_text_enum_procs_t *procs,
4250         gx_device *dev, gs_imager_state *pis,
4251         const gs_text_params_t *text,
4252         gs_font *font, gx_path *path,
4253         const gx_device_color *pdcolor,
4254         const gx_clip_path *pcpath,
4255         gs_memory_t *mem);
4256
4257
4258
4259
4260
4261
4262
4263 void gs_text_enum_copy_dynamic(gs_text_enum_t *pto,
4264           const gs_text_enum_t *pfrom,
4265           bool for_return);
4266 # 211 "./src/gxtext.h"
4267 struct gs_text_enum_procs_s {
4268 # 224 "./src/gxtext.h"
4269     int (*resync)(gs_text_enum_t *pte, const gs_text_enum_t *pfrom);
4270 # 254 "./src/gxtext.h"
4271     int (*process)(gs_text_enum_t *pte);
4272 # 265 "./src/gxtext.h"
4273     bool (*is_width_only)(const gs_text_enum_t *pte);
4274 # 274 "./src/gxtext.h"
4275     int (*current_width)(const gs_text_enum_t *pte, gs_point *pwidth);
4276 # 285 "./src/gxtext.h"
4277     int (*set_cache)(gs_text_enum_t *pte, const double *values, gs_text_cache_control_t control);
4278 # 295 "./src/gxtext.h"
4279     int (*retry)(gs_text_enum_t *pte);
4280 # 306 "./src/gxtext.h"
4281     void (*release)(gs_text_enum_t *pte, client_name_t cname);
4282
4283 };
4284
4285
4286 void gx_default_text_release(gs_text_enum_t *pte, client_name_t cname);
4287 # 36 "./src/gxdevcli.h" 2
4288 # 1 "./src/gxcmap.h" 1
4289 # 21 "./src/gxcmap.h"
4290 # 1 "./src/gscsel.h" 1
4291 # 25 "./src/gscsel.h"
4292 typedef enum {
4293     gs_color_select_all = -1,
4294     gs_color_select_texture = 0,
4295     gs_color_select_source = 1
4296 } gs_color_select_t;
4297 # 22 "./src/gxcmap.h" 2
4298 # 1 "./src/gxfmap.h" 1
4299 # 22 "./src/gxfmap.h"
4300 # 1 "./src/gxfrac.h" 1
4301 # 25 "./src/gxfrac.h"
4302 typedef short frac;
4303 typedef short signed_frac;
4304 # 23 "./src/gxfmap.h" 2
4305 # 1 "./src/gxtmap.h" 1
4306 # 27 "./src/gxtmap.h"
4307 typedef struct gx_transfer_map_s gx_transfer_map;
4308
4309
4310
4311
4312
4313 typedef float (*gs_mapping_proc) (floatp, const gx_transfer_map *);
4314
4315
4316
4317
4318
4319 typedef float (*gs_mapping_closure_proc_t) (floatp value,
4320          const gx_transfer_map * pmap,
4321          const void *proc_data);
4322 typedef struct gs_mapping_closure_s {
4323     gs_mapping_closure_proc_t proc;
4324     const void *data;
4325 } gs_mapping_closure_t;
4326 # 24 "./src/gxfmap.h" 2
4327 # 39 "./src/gxfmap.h"
4328 struct gx_transfer_map_s {
4329     rc_header rc;
4330     gs_mapping_proc proc;
4331     gs_mapping_closure_t closure;
4332
4333     gs_id id;
4334     frac values[(1 << 8)];
4335 };
4336
4337 extern const gs_memory_struct_type_t st_transfer_map;
4338
4339
4340
4341
4342
4343 void gx_set_identity_transfer(gx_transfer_map *);
4344 # 63 "./src/gxfmap.h"
4345 frac gx_color_frac_map(frac, const frac *);
4346 # 97 "./src/gxfmap.h"
4347 float gs_mapped_transfer(floatp, const gx_transfer_map *);
4348
4349
4350
4351
4352 float gs_identity_transfer(floatp, const gx_transfer_map *);
4353 # 23 "./src/gxcmap.h" 2
4354 # 85 "./src/gxcmap.h"
4355 struct gx_cm_color_map_procs_s {
4356     void (*map_gray) (gx_device * dev, frac gray, frac * out);
4357     void (*map_rgb) (gx_device * dev, const gs_imager_state *pis, frac r, frac g, frac b, frac * out);
4358     void (*map_cmyk) (gx_device * dev, frac c, frac m, frac y, frac k, frac * out);
4359 };
4360
4361 typedef struct gx_cm_color_map_procs_s gx_cm_color_map_procs;
4362
4363
4364
4365
4366 void gray_cs_to_gray_cm (gx_device * dev, frac gray, frac * out);
4367 void rgb_cs_to_rgb_cm (gx_device * dev, const gs_imager_state *pis, frac r, frac g, frac b, frac * out);
4368 void cmyk_cs_to_cmyk_cm (gx_device * dev, frac c, frac m, frac y, frac k, frac * out);
4369 # 112 "./src/gxcmap.h"
4370 struct gx_color_map_procs_s {
4371     void (*map_gray)(frac, gx_device_color *, const gs_imager_state *, gx_device *, gs_color_select_t);
4372     void (*map_rgb)(frac, frac, frac, gx_device_color *, const gs_imager_state *, gx_device *, gs_color_select_t);
4373     void (*map_cmyk)(frac, frac, frac, frac, gx_device_color *, const gs_imager_state *, gx_device *, gs_color_select_t);
4374     void (*map_rgb_alpha)(frac, frac, frac, frac, gx_device_color *, const gs_imager_state *, gx_device *, gs_color_select_t);
4375     void (*map_separation)(frac, gx_device_color *, const gs_imager_state *, gx_device *, gs_color_select_t);
4376     void (*map_devicen)(const frac *, gx_device_color *, const gs_imager_state *, gx_device *, gs_color_select_t);
4377     bool (*is_halftoned)(const gs_imager_state *, gx_device *);
4378 };
4379 typedef struct gx_color_map_procs_s gx_color_map_procs;
4380
4381
4382
4383
4384
4385
4386 const gx_color_map_procs *
4387     gx_get_cmap_procs(const gs_imager_state *, const gx_device *);
4388 const gx_color_map_procs *
4389     gx_default_get_cmap_procs(const gs_imager_state *, const gx_device *);
4390
4391
4392
4393
4394
4395
4396 void gx_set_cmap_procs(gs_imager_state *, const gx_device *);
4397 # 163 "./src/gxcmap.h"
4398 extern void gx_default_gray_cs_to_gray_cm (gx_device * dev, frac gray, frac * out);
4399 extern void gx_default_rgb_cs_to_gray_cm (gx_device * dev, const gs_imager_state *pis, frac r, frac g, frac b, frac * out);
4400 extern void gx_default_cmyk_cs_to_gray_cm (gx_device * dev, frac c, frac m, frac y, frac k, frac * out);
4401
4402 extern void gx_default_gray_cs_to_rgb_cm (gx_device * dev, frac gray, frac * out);
4403 extern void gx_default_rgb_cs_to_rgb_cm (gx_device * dev, const gs_imager_state *pis, frac r, frac g, frac b, frac * out);
4404 extern void gx_default_cmyk_cs_to_rgb_cm (gx_device * dev, frac c, frac m, frac y, frac k, frac * out);
4405
4406 extern void gx_default_gray_cs_to_cmyk_cm (gx_device * dev, frac gray, frac * out);
4407 extern void gx_default_rgb_cs_to_cmyk_cm (gx_device * dev, const gs_imager_state *pis, frac r, frac g, frac b, frac * out);
4408 extern void gx_default_cmyk_cs_to_cmyk_cm (gx_device * dev, frac c, frac m, frac y, frac k, frac * out);
4409
4410 extern void gx_default_gray_cs_to_cmyk_cm (gx_device * dev, frac gray, frac * out);
4411 extern void gx_default_rgb_cs_to_cmyk_cm (gx_device * dev, const gs_imager_state *pis, frac r, frac g, frac b, frac * out);
4412 extern void gx_default_cmyk_cs_to_cmyk_cm (gx_device * dev, frac c, frac m, frac y, frac k, frac * out);
4413
4414 extern void gx_error_gray_cs_to_cmyk_cm (gx_device * dev, frac gray, frac * out);
4415 extern void gx_error_rgb_cs_to_cmyk_cm (gx_device * dev, const gs_imager_state *pis, frac r, frac g, frac b, frac * out);
4416 extern void gx_error_cmyk_cs_to_cmyk_cm (gx_device * dev, frac c, frac m, frac y, frac k, frac * out);
4417 # 238 "./src/gxcmap.h"
4418 int (gx_error_get_color_comp_index)(gx_device * dev, const char * pname, int name_size, int component_type);
4419 int (gx_default_DevGray_get_color_comp_index)(gx_device * dev, const char * pname, int name_size, int component_type);
4420 int (gx_default_DevRGB_get_color_comp_index)(gx_device * dev, const char * pname, int name_size, int component_type);
4421 int (gx_default_DevCMYK_get_color_comp_index)(gx_device * dev, const char * pname, int name_size, int component_type);
4422 int (gx_default_DevRGBK_get_color_comp_index)(gx_device * dev, const char * pname, int name_size, int component_type);
4423
4424
4425
4426
4427
4428 const gx_cm_color_map_procs * (gx_error_get_color_mapping_procs)(const gx_device * dev);
4429 const gx_cm_color_map_procs * (gx_default_DevGray_get_color_mapping_procs)(const gx_device * dev);
4430 const gx_cm_color_map_procs * (gx_default_DevRGB_get_color_mapping_procs)(const gx_device * dev);
4431 const gx_cm_color_map_procs * (gx_default_DevCMYK_get_color_mapping_procs)(const gx_device * dev);
4432 const gx_cm_color_map_procs * (gx_default_DevRGBK_get_color_mapping_procs)(const gx_device * dev);
4433
4434
4435
4436
4437
4438 gx_color_index (gx_error_encode_color)(gx_device * dev, const gx_color_value colors[]);
4439 gx_color_index (gx_default_encode_color)(gx_device * dev, const gx_color_value colors[]);
4440
4441
4442
4443
4444
4445 gx_color_index (gx_default_gray_fast_encode)(gx_device * dev, const gx_color_value colors[]);
4446 gx_color_index (gx_default_gray_encode)(gx_device * dev, const gx_color_value colors[]);
4447
4448
4449
4450
4451
4452
4453 gx_color_index (gx_backwards_compatible_gray_encode)(gx_device * dev, const gx_color_value colors[]);
4454
4455
4456
4457
4458
4459 int (gx_error_decode_color)(gx_device * dev, gx_color_index cindex, gx_color_value colors[]);
4460 int (gx_default_decode_color)(gx_device * dev, gx_color_index cindex, gx_color_value colors[]);
4461 # 37 "./src/gxdevcli.h" 2
4462 # 1 "./src/gsnamecl.h" 1
4463 # 38 "./src/gsnamecl.h"
4464 typedef struct named_color_params_s {
4465
4466
4467
4468
4469     bool use_named_color_callback;
4470 # 52 "./src/gsnamecl.h"
4471     int color_index[(8 * 8)];
4472 } named_color_params_t;
4473 # 93 "./src/gsnamecl.h"
4474 int named_color_put_params(gx_device * dev, gs_param_list * plist);
4475 # 102 "./src/gsnamecl.h"
4476 int named_color_get_params(gx_device * dev, gs_param_list * plist);
4477
4478
4479
4480
4481
4482 bool named_color_install_Separation(gs_color_space * pcs, gs_state * pgs);
4483
4484
4485
4486
4487
4488 bool named_color_install_DeviceN(gs_color_space * pcs, gs_state * pgs);
4489
4490
4491
4492
4493
4494 int gx_remap_concrete_named_color_Separation(const frac * pconc,
4495  const gs_color_space * pcs, gx_device_color * pdc,
4496         const gs_imager_state * pis, gx_device * dev, gs_color_select_t select);
4497
4498
4499
4500
4501
4502 int gx_remap_concrete_named_color_DeviceN(const frac * pconc,
4503  const gs_color_space * pcs, gx_device_color * pdc,
4504         const gs_imager_state * pis, gx_device * dev, gs_color_select_t select);
4505 # 143 "./src/gsnamecl.h"
4506 typedef struct client_named_color_params_s {
4507     struct client_named_color_procs_s * client_procs;
4508     void * data;
4509 } client_named_color_params_t;
4510
4511
4512
4513
4514 typedef struct client_named_color_procs_s {
4515
4516
4517
4518
4519     bool (* install_Separation)(client_named_color_params_t * pparams,
4520      gs_color_space * pcs, gs_state * pgs);
4521
4522
4523
4524     int (* remap_Separation)(client_named_color_params_t * pparams,
4525      const frac * pconc, const gs_color_space * pcs,
4526      gx_device_color * pdc, const gs_imager_state * pis,
4527      gx_device * dev, gs_color_select_t select);
4528
4529
4530
4531
4532     bool (* install_DeviceN)(client_named_color_params_t * pparams,
4533      gs_color_space * pcs, gs_state * pgs);
4534
4535
4536
4537     int (* remap_DeviceN)(client_named_color_params_t * pparams, const frac * pconc,
4538      const gs_color_space * pcs, gx_device_color * pdc,
4539             const gs_imager_state * pis, gx_device * dev,
4540      gs_color_select_t select);
4541
4542 } client_named_color_procs_t;
4543 # 38 "./src/gxdevcli.h" 2
4544 # 134 "./src/gxdevcli.h"
4545 typedef struct gx_fill_params_s gx_fill_params;
4546
4547
4548
4549 typedef struct gx_stroke_params_s gx_stroke_params;
4550 # 149 "./src/gxdevcli.h"
4551 typedef struct gx_image_enum_common_s gx_image_enum_common_t;
4552
4553
4554
4555
4556
4557
4558 typedef struct gs_pattern1_instance_s gs_pattern1_instance_t;
4559
4560
4561
4562
4563 typedef gx_device_color gx_drawing_color;
4564
4565
4566
4567 typedef enum {
4568     go_text,
4569     go_graphics
4570 } graphics_object_type;
4571
4572
4573 typedef struct gs_fixed_edge_s {
4574     gs_fixed_point start;
4575     gs_fixed_point end;
4576 } gs_fixed_edge;
4577
4578
4579
4580
4581 typedef struct gs_get_bits_params_s gs_get_bits_params_t;
4582
4583
4584
4585 typedef struct gx_device_anti_alias_info_s {
4586     int text_bits;
4587     int graphics_bits;
4588 } gx_device_anti_alias_info;
4589
4590 typedef int32_t frac31;
4591
4592
4593
4594
4595 typedef struct gs_linear_color_edge_s {
4596     gs_fixed_point start;
4597     gs_fixed_point end;
4598     const frac31 *c0, *c1;
4599     fixed clip_x;
4600 } gs_linear_color_edge;
4601 # 227 "./src/gxdevcli.h"
4602 typedef enum {
4603     GX_CINFO_UNKNOWN_SEP_LIN = -1,
4604     GX_CINFO_SEP_LIN_NONE = 0,
4605     GX_CINFO_SEP_LIN
4606 } gx_color_enc_sep_lin_t;
4607
4608
4609
4610
4611
4612 typedef enum {
4613     GX_CINFO_POLARITY_UNKNOWN = -1,
4614     GX_CINFO_POLARITY_SUBTRACTIVE = 0,
4615     GX_CINFO_POLARITY_ADDITIVE
4616 } gx_color_polarity_t;
4617 # 261 "./src/gxdevcli.h"
4618 typedef enum {
4619     GX_CINFO_OPMODE_UNKNOWN = -1,
4620     GX_CINFO_OPMODE_NOT = 0,
4621     GX_CINFO_OPMODE
4622 } gx_cm_opmode_t;
4623 # 294 "./src/gxdevcli.h"
4624 typedef struct gx_device_color_info_s {
4625
4626
4627
4628
4629
4630
4631     int max_components;
4632
4633
4634
4635
4636
4637
4638
4639     int num_components;
4640
4641
4642
4643
4644
4645
4646
4647     gx_color_polarity_t polarity;
4648
4649
4650
4651
4652
4653     byte depth;
4654 # 351 "./src/gxdevcli.h"
4655     byte gray_index;
4656 # 373 "./src/gxdevcli.h"
4657     uint max_gray;
4658     uint max_color;
4659
4660     uint dither_grays;
4661     uint dither_colors;
4662
4663
4664
4665
4666
4667     gx_device_anti_alias_info anti_alias;
4668 # 421 "./src/gxdevcli.h"
4669     gx_color_enc_sep_lin_t separable_and_linear;
4670     byte comp_shift[(8 * 8)];
4671     byte comp_bits[(8 * 8)];
4672     gx_color_index comp_mask[(8 * 8)];
4673
4674
4675
4676
4677     const char * cm_name;
4678 # 443 "./src/gxdevcli.h"
4679     gx_cm_opmode_t opmode;
4680     gx_color_index process_comps;
4681 } gx_device_color_info;
4682 # 610 "./src/gxdevcli.h"
4683 typedef struct gx_device_procs_s gx_device_procs;
4684
4685
4686
4687 typedef struct gx_page_device_procs_s {
4688
4689
4690
4691     int (*install)(gx_device *dev, gs_state *pgs);
4692
4693
4694
4695     int (*begin_page)(gx_device *dev, gs_state *pgs);
4696
4697
4698
4699     int (*end_page)(gx_device *dev, int reason, gs_state *pgs);
4700
4701 } gx_page_device_procs;
4702
4703
4704 int gx_default_install(gx_device *dev, gs_state *pgs);
4705 int gx_default_begin_page(gx_device *dev, gs_state *pgs);
4706 int gx_default_end_page(gx_device *dev, int reason, gs_state *pgs);
4707 # 671 "./src/gxdevcli.h"
4708 typedef struct gx_device_cached_colors_s {
4709     gx_color_index black, white;
4710 } gx_device_cached_colors_t;
4711 # 1213 "./src/gxdevcli.h"
4712 typedef enum {
4713     pattern_manage__can_accum,
4714     pattern_manage__start_accum,
4715     pattern_manage__finish_accum,
4716     pattern_manage__load,
4717     pattern_manage__shading_area
4718 } pattern_manage_t;
4719 # 1261 "./src/gxdevcli.h"
4720 typedef struct gs_fill_attributes_s {
4721       const gs_fixed_rect *clip;
4722       bool swap_axes;
4723       const gx_device_halftone *ht;
4724       gs_logical_operation_t lop;
4725       fixed ystart, yend;
4726 } gs_fill_attributes;
4727 # 1407 "./src/gxdevcli.h"
4728 typedef struct gx_image_plane_s {
4729     const byte *data;
4730     int data_x;
4731     uint raster;
4732 } gx_image_plane_t;
4733 # 1425 "./src/gxdevcli.h"
4734 int gx_image_data(gx_image_enum_common_t *info, const byte **planes,
4735     int data_x, uint raster, int height);
4736
4737
4738
4739
4740 int gx_image_plane_data(gx_image_enum_common_t *info,
4741    const gx_image_plane_t *planes, int height);
4742 int gx_image_plane_data_rows(gx_image_enum_common_t *info,
4743         const gx_image_plane_t *planes, int height,
4744         int *rows_used);
4745 int gx_image_flush(gx_image_enum_common_t *info);
4746 bool gx_image_planes_wanted(const gx_image_enum_common_t *info, byte *wanted);
4747 int gx_image_end(gx_image_enum_common_t *info, bool draw_last);
4748 # 1455 "./src/gxdevcli.h"
4749 struct gx_device_procs_s { int (*open_device)(gx_device *dev); void (*get_initial_matrix)(gx_device *dev, gs_matrix *pmat); int (*sync_output)(gx_device *dev); int (*output_page)(gx_device *dev, int num_copies, int flush); int (*close_device)(gx_device *dev); gx_color_index (*map_rgb_color)(gx_device *dev, const gx_color_value cv[]); int (*map_color_rgb)(gx_device *dev, gx_color_index color, gx_color_value rgb[3]); int (*fill_rectangle)(gx_device *dev, int x, int y, int width, int height, gx_color_index color); int (*tile_rectangle)(gx_device *dev, const gx_tile_bitmap *tile, int x, int y, int width, int height, gx_color_index color0, gx_color_index color1, int phase_x, int phase_y); int (*copy_mono)(gx_device *dev, const byte *data, int data_x, int raster, gx_bitmap_id id, int x, int y, int width, int height, gx_color_index color0, gx_color_index color1); int (*copy_color)(gx_device *dev, const byte *data, int data_x, int raster, gx_bitmap_id id, int x, int y, int width, int height); int (*obsolete_draw_line)(gx_device *dev, int x0, int y0, int x1, int y1, gx_color_index color); int (*get_bits)(gx_device *dev, int y, byte *data, byte **actual_data); int (*get_params)(gx_device *dev, gs_param_list *plist); int (*put_params)(gx_device *dev, gs_param_list *plist); gx_color_index (*map_cmyk_color)(gx_device *dev, const gx_color_value cv[]); const gx_xfont_procs *(*get_xfont_procs)(gx_device *dev); gx_device *(*get_xfont_device)(gx_device *dev); gx_color_index (*map_rgb_alpha_color)(gx_device *dev, gx_color_value red, gx_color_value green, gx_color_value blue, gx_color_value alpha); gx_device *(*get_page_device)(gx_device *dev); int (*get_alpha_bits)(gx_device *dev, graphics_object_type type); int (*copy_alpha)(gx_device *dev, const byte *data, int data_x, int raster, gx_bitmap_id id, int x, int y, int width, int height, gx_color_index color, int depth); int (*get_band)(gx_device *dev, int y, int *band_start); int (*copy_rop)(gx_device *dev, const byte *sdata, int sourcex, uint sraster, gx_bitmap_id id, const gx_color_index *scolors, const gx_tile_bitmap *texture, const gx_color_index *tcolors, int x, int y, int width, int height, int phase_x, int phase_y, gs_logical_operation_t lop); int (*fill_path)(gx_device *dev, const gs_imager_state *pis, gx_path *ppath, const gx_fill_params *params, const gx_drawing_color *pdcolor, const gx_clip_path *pcpath); int (*stroke_path)(gx_device *dev, const gs_imager_state *pis, gx_path *ppath, const gx_stroke_params *params, const gx_drawing_color *pdcolor, const gx_clip_path *pcpath); int (*fill_mask)(gx_device *dev, const byte *data, int data_x, int raster, gx_bitmap_id id, int x, int y, int width, int height, const gx_drawing_color *pdcolor, int depth, gs_logical_operation_t lop, const gx_clip_path *pcpath); int (*fill_trapezoid)(gx_device *dev, const gs_fixed_edge *left, const gs_fixed_edge *right, fixed ybot, fixed ytop, bool swap_axes, const gx_drawing_color *pdcolor, gs_logical_operation_t lop); int (*fill_parallelogram)(gx_device *dev, fixed px, fixed py, fixed ax, fixed ay, fixed bx, fixed by, const gx_drawing_color *pdcolor, gs_logical_operation_t lop); int (*fill_triangle)(gx_device *dev, fixed px, fixed py, fixed ax, fixed ay, fixed bx, fixed by, const gx_drawing_color *pdcolor, gs_logical_operation_t lop); int (*draw_thin_line)(gx_device *dev, fixed fx0, fixed fy0, fixed fx1, fixed fy1, const gx_drawing_color *pdcolor, gs_logical_operation_t lop); int (*begin_image)(gx_device *dev, const gs_imager_state *pis, const gs_image_t *pim, gs_image_format_t format, const gs_int_rect *prect, const gx_drawing_color *pdcolor, const gx_clip_path *pcpath, gs_memory_t *memory, gx_image_enum_common_t **pinfo); int (*image_data)(gx_device *dev, gx_image_enum_common_t *info, const byte **planes, int data_x, uint raster, int height); int (*end_image)(gx_device *dev, gx_image_enum_common_t *info, bool draw_last); int (*strip_tile_rectangle)(gx_device *dev, const gx_strip_bitmap *tiles, int x, int y, int width, int height, gx_color_index color0, gx_color_index color1, int phase_x, int phase_y); int (*strip_copy_rop)(gx_device *dev, const byte *sdata, int sourcex, uint sraster, gx_bitmap_id id, const gx_color_index *scolors, const gx_strip_bitmap *textures, const gx_color_index *tcolors, int x, int y, int width, int height, int phase_x, int phase_y, gs_logical_operation_t lop); void (*get_clipping_box)(gx_device *dev, gs_fixed_rect *pbox); int (*begin_typed_image)(gx_device *dev, const gs_imager_state *pis, const gs_matrix *pmat, const gs_image_common_t *pim, const gs_int_rect *prect, const gx_drawing_color *pdcolor, const gx_clip_path *pcpath, gs_memory_t *memory, gx_image_enum_common_t **pinfo); int (*get_bits_rectangle)(gx_device *dev, const gs_int_rect *prect, gs_get_bits_params_t *params, gs_int_rect **unread); int (*map_color_rgb_alpha)(gx_device *dev, gx_color_index color, gx_color_value rgba[4]); int (*create_compositor)(gx_device *dev, gx_device **pcdev, const gs_composite_t *pcte, gs_imager_state *pis, gs_memory_t *memory); int (*get_hardware_params)(gx_device *dev, gs_param_list *plist); int (*text_begin)(gx_device *dev, gs_imager_state *pis, const gs_text_params_t *text, gs_font *font, gx_path *path, const gx_device_color *pdcolor, const gx_clip_path *pcpath, gs_memory_t *memory, gs_text_enum_t **ppte); int (*finish_copydevice)(gx_device *dev, const gx_device *from_dev); int (*begin_transparency_group)(gx_device *dev, const gs_transparency_group_params_t *ptgp, const gs_rect *pbbox, gs_imager_state *pis, gs_transparency_state_t **ppts, gs_memory_t *mem); int (*end_transparency_group)(gx_device *dev, gs_imager_state *pis, gs_transparency_state_t **ppts); int (*begin_transparency_mask)(gx_device *dev, const gx_transparency_mask_params_t *ptmp, const gs_rect *pbbox, gs_imager_state *pis, gs_transparency_state_t **ppts, gs_memory_t *mem); int (*end_transparency_mask)(gx_device *dev, gs_transparency_mask_t **pptm); int (*discard_transparency_layer)(gx_device *dev, gs_transparency_state_t **ppts); const gx_cm_color_map_procs * ((*get_color_mapping_procs))(const gx_device * dev); int ((*get_color_comp_index))(gx_device * dev, const char * pname, int name_size, int component_type); gx_color_index ((*encode_color))(gx_device * dev, const gx_color_value colors[]); int ((*decode_color))(gx_device * dev, gx_color_index cindex, gx_color_value colors[]); int (*pattern_manage)(gx_device *pdev, gx_bitmap_id id, gs_pattern1_instance_t *pinst, pattern_manage_t function); int (*fill_rectangle_hl_color)(gx_device *dev, const gs_fixed_rect *rect, const gs_imager_state *pis, const gx_drawing_color *pdcolor, const gx_clip_path *pcpath); int (*include_color_space)(gx_device *dev, gs_color_space *cspace, const byte *res_name, int name_length); int (*fill_linear_color_scanline)(gx_device *dev, const gs_fill_attributes *fa, int i, int j, int w, const frac31 *c0, const int32_t *c0_f, const int32_t *cg_num, int32_t cg_den ); int (*fill_linear_color_trapezoid)(gx_device *dev, const gs_fill_attributes *fa, const gs_fixed_point *p0, const gs_fixed_point *p1, const gs_fixed_point *p2, const gs_fixed_point *p3, const frac31 *c0, const frac31 *c1, const frac31 *c2, const frac31 *c3); int (*fill_linear_color_triangle)(gx_device *dev, const gs_fill_attributes *fa, const gs_fixed_point *p0, const gs_fixed_point *p1, const gs_fixed_point *p2, const frac31 *c0, const frac31 *c1, const frac31 *c2); int (*update_spot_equivalent_colors)(gx_device *dev, const gs_state * pgs); };
4750 # 1471 "./src/gxdevcli.h"
4751 int gx_copy_mono_unaligned(gx_device *dev, const byte *data, int data_x, int raster, gx_bitmap_id id, int x, int y, int width, int height, gx_color_index color0, gx_color_index color1);
4752 int gx_copy_color_unaligned(gx_device *dev, const byte *data, int data_x, int raster, gx_bitmap_id id, int x, int y, int width, int height);
4753 int gx_copy_alpha_unaligned(gx_device *dev, const byte *data, int data_x, int raster, gx_bitmap_id id, int x, int y, int width, int height, gx_color_index color, int depth);
4754
4755
4756 struct gx_device_s {
4757     int params_size; const gx_device_procs *static_procs; const char *dname; gs_memory_t *memory; gs_memory_type_ptr_t stype; bool stype_is_dynamic; void (*finalize)(gx_device *); rc_header rc; bool retained; bool is_open; int max_fill_band; gx_device_color_info color_info; gx_device_cached_colors_t cached_colors; int width; int height; int TrayOrientation; float MediaSize[2]; float ImagingBBox[4]; bool ImagingBBox_set; float HWResolution[2]; float MarginsHWResolution[2]; float Margins[2]; float HWMargins[4]; long PageCount; long ShowpageCount; int NumCopies; bool NumCopies_set; bool IgnoreNumCopies; bool UseCIEColor; bool LockSafetyParams; gx_page_device_procs page_procs; gx_device_procs procs;
4758 };
4759
4760 extern const gs_memory_struct_type_t st_device;
4761 void gx_device_finalize(void *ptr);
4762 # 1491 "./src/gxdevcli.h"
4763 gx_device *gx_device_enum_ptr(gx_device *);
4764 gx_device *gx_device_reloc_ptr(gx_device *, gc_state_t *);
4765
4766
4767
4768 typedef gx_color_index (*dev_proc_map_rgb_color_t)(gx_device *dev, const gx_color_value cv[]);
4769 typedef int (*dev_proc_map_color_rgb_t)(gx_device *dev, gx_color_index color, gx_color_value rgb[3]);
4770 # 1510 "./src/gxdevcli.h"
4771 typedef struct gx_device_forward_s {
4772     int params_size; const gx_device_procs *static_procs; const char *dname; gs_memory_t *memory; gs_memory_type_ptr_t stype; bool stype_is_dynamic; void (*finalize)(gx_device *); rc_header rc; bool retained; bool is_open; int max_fill_band; gx_device_color_info color_info; gx_device_cached_colors_t cached_colors; int width; int height; int TrayOrientation; float MediaSize[2]; float ImagingBBox[4]; bool ImagingBBox_set; float HWResolution[2]; float MarginsHWResolution[2]; float Margins[2]; float HWMargins[4]; long PageCount; long ShowpageCount; int NumCopies; bool NumCopies_set; bool IgnoreNumCopies; bool UseCIEColor; bool LockSafetyParams; gx_page_device_procs page_procs; gx_device_procs procs; gx_device *target;
4773 } gx_device_forward;
4774
4775 extern const gs_memory_struct_type_t st_device_forward;
4776 # 1524 "./src/gxdevcli.h"
4777 typedef struct gx_device_null_s gx_device_null;
4778
4779 struct gx_device_null_s {
4780     int params_size; const gx_device_procs *static_procs; const char *dname; gs_memory_t *memory; gs_memory_type_ptr_t stype; bool stype_is_dynamic; void (*finalize)(gx_device *); rc_header rc; bool retained; bool is_open; int max_fill_band; gx_device_color_info color_info; gx_device_cached_colors_t cached_colors; int width; int height; int TrayOrientation; float MediaSize[2]; float ImagingBBox[4]; bool ImagingBBox_set; float HWResolution[2]; float MarginsHWResolution[2]; float Margins[2]; float HWMargins[4]; long PageCount; long ShowpageCount; int NumCopies; bool NumCopies_set; bool IgnoreNumCopies; bool UseCIEColor; bool LockSafetyParams; gx_page_device_procs page_procs; gx_device_procs procs; gx_device *target;
4781 };
4782 extern const gx_device_null gs_null_device;
4783
4784
4785
4786 extern const gs_memory_struct_type_t st_device_null;
4787 # 1547 "./src/gxdevcli.h"
4788 void gx_device_init(gx_device * dev, const gx_device * proto,
4789       gs_memory_t * mem, bool internal);
4790
4791
4792
4793
4794 void gs_make_null_device(gx_device_null *dev_null, gx_device *target,
4795     gs_memory_t *mem);
4796
4797 bool gs_is_null_device(gx_device *dev);
4798
4799
4800 void gx_device_set_target(gx_device_forward *fdev, gx_device *target);
4801
4802
4803 void gx_device_retain(gx_device *dev, bool retained);
4804
4805
4806
4807 uint gx_device_raster(const gx_device * dev, bool pad_to_word);
4808
4809
4810
4811
4812
4813 int gx_device_adjust_resolution(gx_device * dev, int actual_width, int actual_height, int fit);
4814
4815
4816
4817 void gx_device_set_margins(gx_device * dev, const float *margins ,
4818       bool move_origin);
4819
4820
4821 void gx_device_set_width_height(gx_device * dev, int width, int height);
4822
4823
4824 void gx_device_set_resolution(gx_device * dev, floatp x_dpi, floatp y_dpi);
4825
4826
4827 void gx_device_set_media_size(gx_device * dev, floatp media_width, floatp media_height);
4828 # 1596 "./src/gxdevcli.h"
4829 void gx_set_device_only(gs_state *, gx_device *);
4830
4831
4832 int gs_closedevice(gx_device *);
4833
4834
4835 void gx_device_free_local(gx_device *);
4836
4837
4838
4839
4840
4841
4842 typedef struct gx_device_type_s {
4843     gs_memory_type_ptr_t stype;
4844     int (*initialize)(gx_device *);
4845 } gx_device_type;
4846 # 22 "./src/gxdevice.h" 2
4847 # 1 "./src/gsfname.h" 1
4848 # 31 "./src/gsfname.h"
4849 typedef struct gx_io_device_s gx_io_device;
4850
4851
4852 typedef struct gs_parsed_file_name_s {
4853     gs_memory_t *memory;
4854     gx_io_device *iodev;
4855     const char *fname;
4856     uint len;
4857 } gs_parsed_file_name_t;
4858
4859
4860 int gs_parse_file_name(gs_parsed_file_name_t *, const char *, uint);
4861
4862
4863 int gs_parse_real_file_name(gs_parsed_file_name_t *, const char *, uint,
4864        gs_memory_t *, client_name_t);
4865
4866
4867 int gs_terminate_file_name(gs_parsed_file_name_t *, gs_memory_t *,
4868       client_name_t);
4869
4870
4871 void gs_free_file_name(gs_parsed_file_name_t *, client_name_t);
4872 # 23 "./src/gxdevice.h" 2
4873
4874
4875
4876
4877
4878 # 1 "./src/gsmalloc.h" 1
4879 # 22 "./src/gsmalloc.h"
4880 typedef struct gs_malloc_block_s gs_malloc_block_t;
4881 typedef struct gs_malloc_memory_s {
4882     gs_memory_t *stable_memory; gs_memory_procs_t procs; gs_lib_ctx_t *gs_lib_ctx; pl_mem_node_t *head; gs_memory_t *non_gc_memory;
4883     gs_malloc_block_t *allocated;
4884     long limit;
4885     long used;
4886     long max_used;
4887 } gs_malloc_memory_t;
4888
4889
4890 gs_malloc_memory_t *gs_malloc_memory_init(void);
4891
4892
4893
4894
4895
4896
4897
4898 gs_memory_t * gs_malloc_init(const gs_memory_t *parent);
4899 void gs_malloc_release(gs_memory_t *mem);
4900 # 51 "./src/gsmalloc.h"
4901 int gs_malloc_wrap(gs_memory_t **wrapped, gs_malloc_memory_t *contents);
4902
4903
4904 gs_malloc_memory_t *gs_malloc_wrapped_contents(gs_memory_t *wrapped);
4905
4906
4907 gs_malloc_memory_t *gs_malloc_unwrap(gs_memory_t *wrapped);
4908 # 29 "./src/gxdevice.h" 2
4909
4910
4911
4912
4913 # 1 "./src/gxstdio.h" 1
4914 # 34 "./src/gxdevice.h" 2
4915 # 213 "./src/gxdevice.h"
4916 int gx_default_open_device(gx_device *dev);
4917 void gx_default_get_initial_matrix(gx_device *dev, gs_matrix *pmat);
4918 void gx_upright_get_initial_matrix(gx_device *dev, gs_matrix *pmat);
4919 int gx_default_sync_output(gx_device *dev);
4920 int gx_default_output_page(gx_device *dev, int num_copies, int flush);
4921 int gx_default_close_device(gx_device *dev);
4922 gx_color_index gx_default_w_b_map_rgb_color(gx_device *dev, const gx_color_value cv[]);
4923 int gx_default_w_b_map_color_rgb(gx_device *dev, gx_color_index color, gx_color_value rgb[3]);
4924
4925
4926 int gx_default_tile_rectangle(gx_device *dev, const gx_tile_bitmap *tile, int x, int y, int width, int height, gx_color_index color0, gx_color_index color1, int phase_x, int phase_y);
4927 int gx_default_copy_mono(gx_device *dev, const byte *data, int data_x, int raster, gx_bitmap_id id, int x, int y, int width, int height, gx_color_index color0, gx_color_index color1);
4928 int gx_default_copy_color(gx_device *dev, const byte *data, int data_x, int raster, gx_bitmap_id id, int x, int y, int width, int height);
4929 int gx_default_draw_line(gx_device *dev, int x0, int y0, int x1, int y1, gx_color_index color);
4930 int gx_no_get_bits(gx_device *dev, int y, byte *data, byte **actual_data);
4931 int gx_default_get_bits(gx_device *dev, int y, byte *data, byte **actual_data);
4932 int gx_default_get_params(gx_device *dev, gs_param_list *plist);
4933 int gx_default_put_params(gx_device *dev, gs_param_list *plist);
4934 gx_color_index gx_default_map_cmyk_color(gx_device *dev, const gx_color_value cv[]);
4935 const gx_xfont_procs *gx_default_get_xfont_procs(gx_device *dev);
4936 gx_device *gx_default_get_xfont_device(gx_device *dev);
4937 gx_color_index gx_default_map_rgb_alpha_color(gx_device *dev, gx_color_value red, gx_color_value green, gx_color_value blue, gx_color_value alpha);
4938 gx_device *gx_default_get_page_device(gx_device *dev);
4939 gx_device *gx_page_device_get_page_device(gx_device *dev);
4940 int gx_default_get_alpha_bits(gx_device *dev, graphics_object_type type);
4941 int gx_no_copy_alpha(gx_device *dev, const byte *data, int data_x, int raster, gx_bitmap_id id, int x, int y, int width, int height, gx_color_index color, int depth);
4942 int gx_default_copy_alpha(gx_device *dev, const byte *data, int data_x, int raster, gx_bitmap_id id, int x, int y, int width, int height, gx_color_index color, int depth);
4943 int gx_default_get_band(gx_device *dev, int y, int *band_start);
4944 int gx_no_copy_rop(gx_device *dev, const byte *sdata, int sourcex, uint sraster, gx_bitmap_id id, const gx_color_index *scolors, const gx_tile_bitmap *texture, const gx_color_index *tcolors, int x, int y, int width, int height, int phase_x, int phase_y, gs_logical_operation_t lop);
4945 int gx_default_copy_rop(gx_device *dev, const byte *sdata, int sourcex, uint sraster, gx_bitmap_id id, const gx_color_index *scolors, const gx_tile_bitmap *texture, const gx_color_index *tcolors, int x, int y, int width, int height, int phase_x, int phase_y, gs_logical_operation_t lop);
4946 int gx_default_fill_path(gx_device *dev, const gs_imager_state *pis, gx_path *ppath, const gx_fill_params *params, const gx_drawing_color *pdcolor, const gx_clip_path *pcpath);
4947 int gx_default_stroke_path(gx_device *dev, const gs_imager_state *pis, gx_path *ppath, const gx_stroke_params *params, const gx_drawing_color *pdcolor, const gx_clip_path *pcpath);
4948 int gx_default_fill_mask(gx_device *dev, const byte *data, int data_x, int raster, gx_bitmap_id id, int x, int y, int width, int height, const gx_drawing_color *pdcolor, int depth, gs_logical_operation_t lop, const gx_clip_path *pcpath);
4949 int gx_default_fill_trapezoid(gx_device *dev, const gs_fixed_edge *left, const gs_fixed_edge *right, fixed ybot, fixed ytop, bool swap_axes, const gx_drawing_color *pdcolor, gs_logical_operation_t lop);
4950 int gx_default_fill_parallelogram(gx_device *dev, fixed px, fixed py, fixed ax, fixed ay, fixed bx, fixed by, const gx_drawing_color *pdcolor, gs_logical_operation_t lop);
4951 int gx_default_fill_triangle(gx_device *dev, fixed px, fixed py, fixed ax, fixed ay, fixed bx, fixed by, const gx_drawing_color *pdcolor, gs_logical_operation_t lop);
4952 int gx_default_draw_thin_line(gx_device *dev, fixed fx0, fixed fy0, fixed fx1, fixed fy1, const gx_drawing_color *pdcolor, gs_logical_operation_t lop);
4953 int gx_default_begin_image(gx_device *dev, const gs_imager_state *pis, const gs_image_t *pim, gs_image_format_t format, const gs_int_rect *prect, const gx_drawing_color *pdcolor, const gx_clip_path *pcpath, gs_memory_t *memory, gx_image_enum_common_t **pinfo);
4954 int gx_default_image_data(gx_device *dev, gx_image_enum_common_t *info, const byte **planes, int data_x, uint raster, int height);
4955 int gx_default_end_image(gx_device *dev, gx_image_enum_common_t *info, bool draw_last);
4956 int gx_default_strip_tile_rectangle(gx_device *dev, const gx_strip_bitmap *tiles, int x, int y, int width, int height, gx_color_index color0, gx_color_index color1, int phase_x, int phase_y);
4957 int gx_no_strip_copy_rop(gx_device *dev, const byte *sdata, int sourcex, uint sraster, gx_bitmap_id id, const gx_color_index *scolors, const gx_strip_bitmap *textures, const gx_color_index *tcolors, int x, int y, int width, int height, int phase_x, int phase_y, gs_logical_operation_t lop);
4958 int gx_default_strip_copy_rop(gx_device *dev, const byte *sdata, int sourcex, uint sraster, gx_bitmap_id id, const gx_color_index *scolors, const gx_strip_bitmap *textures, const gx_color_index *tcolors, int x, int y, int width, int height, int phase_x, int phase_y, gs_logical_operation_t lop);
4959 void gx_default_get_clipping_box(gx_device *dev, gs_fixed_rect *pbox);
4960 void gx_get_largest_clipping_box(gx_device *dev, gs_fixed_rect *pbox);
4961 int gx_default_begin_typed_image(gx_device *dev, const gs_imager_state *pis, const gs_matrix *pmat, const gs_image_common_t *pim, const gs_int_rect *prect, const gx_drawing_color *pdcolor, const gx_clip_path *pcpath, gs_memory_t *memory, gx_image_enum_common_t **pinfo);
4962 int gx_no_get_bits_rectangle(gx_device *dev, const gs_int_rect *prect, gs_get_bits_params_t *params, gs_int_rect **unread);
4963 int gx_default_get_bits_rectangle(gx_device *dev, const gs_int_rect *prect, gs_get_bits_params_t *params, gs_int_rect **unread);
4964 int gx_default_map_color_rgb_alpha(gx_device *dev, gx_color_index color, gx_color_value rgba[4]);
4965 int gx_no_create_compositor(gx_device *dev, gx_device **pcdev, const gs_composite_t *pcte, gs_imager_state *pis, gs_memory_t *memory);
4966
4967
4968 int gx_default_create_compositor(gx_device *dev, gx_device **pcdev, const gs_composite_t *pcte, gs_imager_state *pis, gs_memory_t *memory);
4969 int gx_null_create_compositor(gx_device *dev, gx_device **pcdev, const gs_composite_t *pcte, gs_imager_state *pis, gs_memory_t *memory);
4970 int gx_default_get_hardware_params(gx_device *dev, gs_param_list *plist);
4971 int gx_default_text_begin(gx_device *dev, gs_imager_state *pis, const gs_text_params_t *text, gs_font *font, gx_path *path, const gx_device_color *pdcolor, const gx_clip_path *pcpath, gs_memory_t *memory, gs_text_enum_t **ppte);
4972 int gx_default_finish_copydevice(gx_device *dev, const gx_device *from_dev);
4973 int gx_default_pattern_manage(gx_device *pdev, gx_bitmap_id id, gs_pattern1_instance_t *pinst, pattern_manage_t function);
4974 int gx_default_fill_rectangle_hl_color(gx_device *dev, const gs_fixed_rect *rect, const gs_imager_state *pis, const gx_drawing_color *pdcolor, const gx_clip_path *pcpath);
4975 int gx_default_include_color_space(gx_device *dev, gs_color_space *cspace, const byte *res_name, int name_length);
4976 int gx_default_fill_linear_color_scanline(gx_device *dev, const gs_fill_attributes *fa, int i, int j, int w, const frac31 *c0, const int32_t *c0_f, const int32_t *cg_num, int32_t cg_den );
4977 int gx_default_fill_linear_color_trapezoid(gx_device *dev, const gs_fill_attributes *fa, const gs_fixed_point *p0, const gs_fixed_point *p1, const gs_fixed_point *p2, const gs_fixed_point *p3, const frac31 *c0, const frac31 *c1, const frac31 *c2, const frac31 *c3);
4978 int gx_default_fill_linear_color_triangle(gx_device *dev, const gs_fill_attributes *fa, const gs_fixed_point *p0, const gs_fixed_point *p1, const gs_fixed_point *p2, const frac31 *c0, const frac31 *c1, const frac31 *c2);
4979 int gx_default_update_spot_equivalent_colors(gx_device *dev, const gs_state * pgs);
4980
4981
4982
4983
4984
4985 gx_color_index gx_default_b_w_map_rgb_color(gx_device *dev, const gx_color_value cv[]);
4986 int gx_default_b_w_map_color_rgb(gx_device *dev, gx_color_index color, gx_color_value rgb[3]);
4987 gx_color_index gx_default_gray_map_rgb_color(gx_device *dev, const gx_color_value cv[]);
4988 int gx_default_gray_map_color_rgb(gx_device *dev, gx_color_index color, gx_color_value rgb[3]);
4989 int gx_default_rgb_map_color_rgb(gx_device *dev, gx_color_index color, gx_color_value rgb[3]);
4990
4991
4992
4993
4994
4995
4996 gx_color_index gx_default_rgb_map_rgb_color(gx_device *dev, const gx_color_value cv[]);
4997 gx_color_index cmyk_1bit_map_cmyk_color(gx_device *dev, const gx_color_value cv[]);
4998 int cmyk_1bit_map_color_rgb(gx_device *dev, gx_color_index color, gx_color_value rgb[3]);
4999 int (cmyk_1bit_map_color_cmyk)(gx_device * dev, gx_color_index cindex, gx_color_value colors[]);
5000 gx_color_index cmyk_8bit_map_cmyk_color(gx_device *dev, const gx_color_value cv[]);
5001 int cmyk_8bit_map_color_rgb(gx_device *dev, gx_color_index color, gx_color_value rgb[3]);
5002 int (cmyk_8bit_map_color_cmyk)(gx_device * dev, gx_color_index cindex, gx_color_value colors[]);
5003 gx_color_index (gx_default_8bit_map_gray_color)(gx_device * dev, const gx_color_value colors[]);
5004 int (gx_default_8bit_map_color_gray)(gx_device * dev, gx_color_index cindex, gx_color_value colors[]);
5005
5006
5007 int gx_forward_close_device(gx_device *dev);
5008 void gx_forward_get_initial_matrix(gx_device *dev, gs_matrix *pmat);
5009 int gx_forward_sync_output(gx_device *dev);
5010 int gx_forward_output_page(gx_device *dev, int num_copies, int flush);
5011 gx_color_index gx_forward_map_rgb_color(gx_device *dev, const gx_color_value cv[]);
5012 int gx_forward_map_color_rgb(gx_device *dev, gx_color_index color, gx_color_value rgb[3]);
5013 int gx_forward_fill_rectangle(gx_device *dev, int x, int y, int width, int height, gx_color_index color);
5014 int gx_forward_tile_rectangle(gx_device *dev, const gx_tile_bitmap *tile, int x, int y, int width, int height, gx_color_index color0, gx_color_index color1, int phase_x, int phase_y);
5015 int gx_forward_copy_mono(gx_device *dev, const byte *data, int data_x, int raster, gx_bitmap_id id, int x, int y, int width, int height, gx_color_index color0, gx_color_index color1);
5016 int gx_forward_copy_color(gx_device *dev, const byte *data, int data_x, int raster, gx_bitmap_id id, int x, int y, int width, int height);
5017 int gx_forward_get_bits(gx_device *dev, int y, byte *data, byte **actual_data);
5018 int gx_forward_get_params(gx_device *dev, gs_param_list *plist);
5019 int gx_forward_put_params(gx_device *dev, gs_param_list *plist);
5020 gx_color_index gx_forward_map_cmyk_color(gx_device *dev, const gx_color_value cv[]);
5021 const gx_xfont_procs *gx_forward_get_xfont_procs(gx_device *dev);
5022 gx_device *gx_forward_get_xfont_device(gx_device *dev);
5023 gx_color_index gx_forward_map_rgb_alpha_color(gx_device *dev, gx_color_value red, gx_color_value green, gx_color_value blue, gx_color_value alpha);
5024 gx_device *gx_forward_get_page_device(gx_device *dev);
5025
5026 int gx_forward_copy_alpha(gx_device *dev, const byte *data, int data_x, int raster, gx_bitmap_id id, int x, int y, int width, int height, gx_color_index color, int depth);
5027 int gx_forward_get_band(gx_device *dev, int y, int *band_start);
5028 int gx_forward_copy_rop(gx_device *dev, const byte *sdata, int sourcex, uint sraster, gx_bitmap_id id, const gx_color_index *scolors, const gx_tile_bitmap *texture, const gx_color_index *tcolors, int x, int y, int width, int height, int phase_x, int phase_y, gs_logical_operation_t lop);
5029 int gx_forward_fill_path(gx_device *dev, const gs_imager_state *pis, gx_path *ppath, const gx_fill_params *params, const gx_drawing_color *pdcolor, const gx_clip_path *pcpath);
5030 int gx_forward_stroke_path(gx_device *dev, const gs_imager_state *pis, gx_path *ppath, const gx_stroke_params *params, const gx_drawing_color *pdcolor, const gx_clip_path *pcpath);
5031 int gx_forward_fill_mask(gx_device *dev, const byte *data, int data_x, int raster, gx_bitmap_id id, int x, int y, int width, int height, const gx_drawing_color *pdcolor, int depth, gs_logical_operation_t lop, const gx_clip_path *pcpath);
5032 int gx_forward_fill_trapezoid(gx_device *dev, const gs_fixed_edge *left, const gs_fixed_edge *right, fixed ybot, fixed ytop, bool swap_axes, const gx_drawing_color *pdcolor, gs_logical_operation_t lop);
5033 int gx_forward_fill_parallelogram(gx_device *dev, fixed px, fixed py, fixed ax, fixed ay, fixed bx, fixed by, const gx_drawing_color *pdcolor, gs_logical_operation_t lop);
5034 int gx_forward_fill_triangle(gx_device *dev, fixed px, fixed py, fixed ax, fixed ay, fixed bx, fixed by, const gx_drawing_color *pdcolor, gs_logical_operation_t lop);
5035 int gx_forward_draw_thin_line(gx_device *dev, fixed fx0, fixed fy0, fixed fx1, fixed fy1, const gx_drawing_color *pdcolor, gs_logical_operation_t lop);
5036 int gx_forward_begin_image(gx_device *dev, const gs_imager_state *pis, const gs_image_t *pim, gs_image_format_t format, const gs_int_rect *prect, const gx_drawing_color *pdcolor, const gx_clip_path *pcpath, gs_memory_t *memory, gx_image_enum_common_t **pinfo);
5037
5038
5039 int gx_forward_strip_tile_rectangle(gx_device *dev, const gx_strip_bitmap *tiles, int x, int y, int width, int height, gx_color_index color0, gx_color_index color1, int phase_x, int phase_y);
5040 int gx_forward_strip_copy_rop(gx_device *dev, const byte *sdata, int sourcex, uint sraster, gx_bitmap_id id, const gx_color_index *scolors, const gx_strip_bitmap *textures, const gx_color_index *tcolors, int x, int y, int width, int height, int phase_x, int phase_y, gs_logical_operation_t lop);
5041 void gx_forward_get_clipping_box(gx_device *dev, gs_fixed_rect *pbox);
5042 int gx_forward_begin_typed_image(gx_device *dev, const gs_imager_state *pis, const gs_matrix *pmat, const gs_image_common_t *pim, const gs_int_rect *prect, const gx_drawing_color *pdcolor, const gx_clip_path *pcpath, gs_memory_t *memory, gx_image_enum_common_t **pinfo);
5043 int gx_forward_get_bits_rectangle(gx_device *dev, const gs_int_rect *prect, gs_get_bits_params_t *params, gs_int_rect **unread);
5044 int gx_forward_map_color_rgb_alpha(gx_device *dev, gx_color_index color, gx_color_value rgba[4]);
5045
5046 int gx_forward_get_hardware_params(gx_device *dev, gs_param_list *plist);
5047 int gx_forward_text_begin(gx_device *dev, gs_imager_state *pis, const gs_text_params_t *text, gs_font *font, gx_path *path, const gx_device_color *pdcolor, const gx_clip_path *pcpath, gs_memory_t *memory, gs_text_enum_t **ppte);
5048 const gx_cm_color_map_procs * (gx_forward_get_color_mapping_procs)(const gx_device * dev);
5049 int (gx_forward_get_color_comp_index)(gx_device * dev, const char * pname, int name_size, int component_type);
5050 gx_color_index (gx_forward_encode_color)(gx_device * dev, const gx_color_value colors[]);
5051 int (gx_forward_decode_color)(gx_device * dev, gx_color_index cindex, gx_color_value colors[]);
5052 int gx_forward_pattern_manage(gx_device *pdev, gx_bitmap_id id, gs_pattern1_instance_t *pinst, pattern_manage_t function);
5053 int gx_forward_fill_rectangle_hl_color(gx_device *dev, const gs_fixed_rect *rect, const gs_imager_state *pis, const gx_drawing_color *pdcolor, const gx_clip_path *pcpath);
5054 int gx_forward_include_color_space(gx_device *dev, gs_color_space *cspace, const byte *res_name, int name_length);
5055 int gx_forward_fill_linear_color_scanline(gx_device *dev, const gs_fill_attributes *fa, int i, int j, int w, const frac31 *c0, const int32_t *c0_f, const int32_t *cg_num, int32_t cg_den );
5056 int gx_forward_fill_linear_color_trapezoid(gx_device *dev, const gs_fill_attributes *fa, const gs_fixed_point *p0, const gs_fixed_point *p1, const gs_fixed_point *p2, const gs_fixed_point *p3, const frac31 *c0, const frac31 *c1, const frac31 *c2, const frac31 *c3);
5057 int gx_forward_fill_linear_color_triangle(gx_device *dev, const gs_fill_attributes *fa, const gs_fixed_point *p0, const gs_fixed_point *p1, const gs_fixed_point *p2, const frac31 *c0, const frac31 *c1, const frac31 *c2);
5058 int gx_forward_update_spot_equivalent_colors(gx_device *dev, const gs_state * pgs);
5059
5060
5061
5062
5063 void gx_device_set_procs(gx_device *);
5064
5065
5066 void gx_device_fill_in_procs(gx_device *);
5067 void gx_device_forward_fill_in_procs(gx_device_forward *);
5068
5069
5070 void gx_device_forward_color_procs(gx_device_forward *);
5071
5072
5073
5074
5075
5076 void check_device_separable(gx_device * dev);
5077
5078
5079
5080
5081 void set_linear_color_bits_mask_shift(gx_device * dev);
5082
5083
5084
5085
5086 void gx_device_copy_color_procs(gx_device *dev, const gx_device *target);
5087
5088
5089 gx_color_index gx_device_black(gx_device *dev);
5090
5091
5092
5093 gx_color_index gx_device_white(gx_device *dev);
5094
5095
5096
5097
5098
5099 void gx_device_decache_colors(gx_device *dev);
5100
5101
5102
5103
5104
5105 void gx_device_copy_color_params(gx_device *dev, const gx_device *target);
5106
5107
5108
5109
5110
5111
5112 void gx_device_copy_params(gx_device *dev, const gx_device *target);
5113 # 418 "./src/gxdevice.h"
5114 int gx_parse_output_file_name(gs_parsed_file_name_t *pfn,
5115          const char **pfmt, const char *fname,
5116          uint len);
5117
5118
5119
5120
5121
5122 int gx_device_open_output_file(const gx_device * dev, char *fname,
5123           bool binary, bool positionable,
5124           FILE ** pfile);
5125
5126
5127 int gx_device_close_output_file(const gx_device * dev, const char *fname,
5128     FILE *file);
5129 # 451 "./src/gxdevice.h"
5130 int gx_finish_output_page(gx_device *dev, int num_copies, int flush);
5131 # 542 "./src/gxdevice.h"
5132 typedef struct gdev_input_media_s {
5133     float PageSize[4];
5134     const char *MediaColor;
5135     float MediaWeight;
5136     const char *MediaType;
5137 } gdev_input_media_t;
5138
5139
5140 extern const gdev_input_media_t gdev_input_media_default;
5141
5142 void gdev_input_media_init(gdev_input_media_t * pim);
5143
5144 int gdev_begin_input_media(gs_param_list * mlist, gs_param_dict * pdict,
5145       int count);
5146
5147 int gdev_write_input_page_size(int index, gs_param_dict * pdict,
5148           floatp width_points, floatp height_points);
5149
5150 int gdev_write_input_media(int index, gs_param_dict * pdict,
5151       const gdev_input_media_t * pim);
5152
5153 int gdev_end_input_media(gs_param_list * mlist, gs_param_dict * pdict);
5154
5155 typedef struct gdev_output_media_s {
5156     const char *OutputType;
5157 } gdev_output_media_t;
5158
5159
5160 extern const gdev_output_media_t gdev_output_media_default;
5161
5162 int gdev_begin_output_media(gs_param_list * mlist, gs_param_dict * pdict,
5163        int count);
5164
5165 int gdev_write_output_media(int index, gs_param_dict * pdict,
5166        const gdev_output_media_t * pom);
5167
5168 int gdev_end_output_media(gs_param_list * mlist, gs_param_dict * pdict);
5169 # 23 "./src/gdevpdfx.h" 2
5170 # 1 "./src/gxfont.h" 1
5171 # 22 "./src/gxfont.h"
5172 # 1 "./src/gsfont.h" 1
5173 # 31 "./src/gsfont.h"
5174 typedef struct gs_font_dir_s gs_font_dir;
5175 # 42 "./src/gsfont.h"
5176 gs_font_dir *gs_font_dir_alloc2(gs_memory_t * struct_mem,
5177     gs_memory_t * bits_mem);
5178 gs_font_dir *gs_font_dir_alloc2_limits(gs_memory_t * struct_mem,
5179            gs_memory_t * bits_mem,
5180            uint smax, uint bmax, uint mmax,
5181            uint cmax, uint upper);
5182 # 56 "./src/gsfont.h"
5183 int gs_definefont(gs_font_dir *, gs_font *);
5184
5185
5186 int gs_font_find_similar(const gs_font_dir * pdir, const gs_font **ppfont,
5187       int (*similar)(const gs_font *, const gs_font *));
5188
5189
5190
5191 int gs_scalefont(gs_font_dir *, const gs_font *, floatp, gs_font **);
5192 int gs_makefont(gs_font_dir *, const gs_font *, const gs_matrix *, gs_font **);
5193 int gs_setfont(gs_state *, gs_font *);
5194 gs_font *gs_currentfont(const gs_state *);
5195 gs_font *gs_rootfont(const gs_state *);
5196 void gs_set_currentfont(gs_state *, gs_font *);
5197 int gs_purge_font(gs_font *);
5198
5199 gs_font *gs_find_font_by_id(gs_font_dir *pdir, gs_id id, gs_matrix *FontMatrix);
5200
5201
5202 void gs_cachestatus(const gs_font_dir *, uint[7]);
5203
5204
5205 uint gs_currentcachesize(const gs_font_dir *);
5206 int gs_setcachesize(gs_font_dir *, uint);
5207 uint gs_currentcachelower(const gs_font_dir *);
5208 int gs_setcachelower(gs_font_dir *, uint);
5209 uint gs_currentcacheupper(const gs_font_dir *);
5210 int gs_setcacheupper(gs_font_dir *, uint);
5211 uint gs_currentaligntopixels(const gs_font_dir *);
5212 int gs_setaligntopixels(gs_font_dir *, uint);
5213 uint gs_currentgridfittt(const gs_font_dir *);
5214 int gs_setgridfittt(gs_font_dir *, uint);
5215 # 23 "./src/gxfont.h" 2
5216 # 1 "./src/gsgdata.h" 1
5217 # 53 "./src/gsgdata.h"
5218 typedef struct gs_glyph_data_procs_s gs_glyph_data_procs_t;
5219
5220
5221 typedef struct gs_glyph_data_s gs_glyph_data_t;
5222
5223 struct gs_glyph_data_s {
5224     gs_const_bytestring bits;
5225     const gs_glyph_data_procs_t *procs;
5226     void *proc_data;
5227     gs_memory_t *memory;
5228 };
5229 extern const gs_memory_struct_type_t st_glyph_data;
5230
5231
5232
5233
5234
5235
5236 struct gs_glyph_data_procs_s {
5237
5238
5239     void (*free)(gs_glyph_data_t *pgd, client_name_t cname);
5240
5241
5242     int (*substring)(gs_glyph_data_t *pgd, uint offset, uint size);
5243 };
5244
5245
5246
5247
5248
5249 int gs_glyph_data_substring(gs_glyph_data_t *pgd, uint offset, uint size);
5250
5251
5252
5253
5254
5255
5256 void gs_glyph_data_free(gs_glyph_data_t *pgd, client_name_t cname);
5257 # 123 "./src/gsgdata.h"
5258 void gs_glyph_data_from_string(gs_glyph_data_t *pgd, const byte *data,
5259           uint size, gs_font *font);
5260 void gs_glyph_data_from_bytes(gs_glyph_data_t *pgd, const byte *bytes,
5261          uint offset, uint size, gs_font *font);
5262
5263 void gs_glyph_data_from_null(gs_glyph_data_t *pgd);
5264 # 24 "./src/gxfont.h" 2
5265
5266 # 1 "./src/gsnotify.h" 1
5267 # 34 "./src/gsnotify.h"
5268 typedef int (*gs_notify_proc_t)(void *proc_data, void *event_data);
5269 typedef struct gs_notify_registration_s gs_notify_registration_t;
5270 struct gs_notify_registration_s {
5271     gs_notify_proc_t proc;
5272     void *proc_data;
5273     gs_notify_registration_t *next;
5274 };
5275
5276
5277
5278
5279
5280
5281 typedef struct gs_notify_list_s {
5282     gs_memory_t *memory;
5283     gs_notify_registration_t *first;
5284 } gs_notify_list_t;
5285
5286 extern const gs_memory_struct_type_t st_gs_notify_list;
5287
5288
5289
5290
5291
5292
5293
5294 void gs_notify_init(gs_notify_list_t *nlist, gs_memory_t *mem);
5295
5296
5297 int gs_notify_register(gs_notify_list_t *nlist, gs_notify_proc_t proc,
5298          void *proc_data);
5299
5300
5301
5302
5303
5304
5305 int gs_notify_unregister(gs_notify_list_t *nlist, gs_notify_proc_t proc,
5306     void *proc_data);
5307
5308
5309 int gs_notify_unregister_calling(gs_notify_list_t *nlist,
5310      gs_notify_proc_t proc, void *proc_data,
5311      void (*unreg_proc)(void *pdata));
5312
5313
5314
5315
5316
5317 int gs_notify_all(gs_notify_list_t *nlist, void *event_data);
5318
5319
5320 void gs_notify_release(gs_notify_list_t *nlist);
5321 # 26 "./src/gxfont.h" 2
5322
5323
5324 # 1 "./src/gxftype.h" 1
5325 # 23 "./src/gxftype.h"
5326 typedef enum {
5327     ft_composite = 0,
5328     ft_encrypted = 1,
5329     ft_encrypted2 = 2,
5330     ft_user_defined = 3,
5331     ft_disk_based = 4,
5332     ft_CID_encrypted = 9,
5333     ft_CID_user_defined = 10,
5334     ft_CID_TrueType = 11,
5335     ft_Chameleon = 14,
5336     ft_CID_bitmap = 32,
5337     ft_TrueType = 42
5338 } font_type;
5339
5340
5341
5342
5343 typedef enum {
5344     fbit_use_outlines = 0,
5345     fbit_use_bitmaps = 1,
5346     fbit_transform_bitmaps = 2
5347 } fbit_type;
5348 # 29 "./src/gxfont.h" 2
5349 # 58 "./src/gxfont.h"
5350 typedef struct gs_font_info_s {
5351     int members;
5352
5353
5354
5355
5356     int Ascent;
5357
5358     int AvgWidth;
5359
5360     gs_int_rect BBox;
5361
5362     int CapHeight;
5363
5364     int Descent;
5365
5366     uint Flags;
5367     uint Flags_requested;
5368     uint Flags_returned;
5369
5370     float ItalicAngle;
5371
5372     int Leading;
5373
5374     int MaxWidth;
5375
5376     int MissingWidth;
5377
5378     int StemH;
5379
5380     int StemV;
5381
5382     int UnderlinePosition;
5383
5384     int UnderlineThickness;
5385
5386     int XHeight;
5387
5388
5389
5390
5391     gs_const_string Copyright;
5392
5393     gs_const_string Notice;
5394
5395     gs_const_string FamilyName;
5396
5397     gs_const_string FullName;
5398
5399 } gs_font_info_t;
5400 # 134 "./src/gxfont.h"
5401 typedef struct gs_glyph_info_s {
5402     int members;
5403
5404
5405
5406
5407     gs_point width[2];
5408     gs_point v;
5409
5410     gs_rect bbox;
5411
5412     int num_pieces;
5413
5414     gs_glyph *pieces;
5415
5416
5417
5418
5419
5420 } gs_glyph_info_t;
5421
5422
5423
5424 typedef struct gs_font_procs_s {
5425 # 168 "./src/gxfont.h"
5426     int (*define_font)(gs_font_dir *, gs_font *);
5427 # 177 "./src/gxfont.h"
5428     int (*make_font)(gs_font_dir *, const gs_font *, const gs_matrix *, gs_font **);
5429 # 191 "./src/gxfont.h"
5430     int (*font_info)(gs_font *font, const gs_point *pscale, int members, gs_font_info_t *info);
5431 # 207 "./src/gxfont.h"
5432     int (*same_font)(const gs_font *font, const gs_font *ofont, int mask);
5433 # 221 "./src/gxfont.h"
5434     gs_glyph (*encode_char)(gs_font *, gs_char, gs_glyph_space_t);
5435
5436
5437
5438
5439
5440
5441     gs_char (*decode_glyph)(gs_font *, gs_glyph);
5442 # 240 "./src/gxfont.h"
5443     int (*enumerate_glyph)(gs_font *font, int *pindex, gs_glyph_space_t glyph_space, gs_glyph *pglyph);
5444 # 268 "./src/gxfont.h"
5445     int (*glyph_info)(gs_font *font, gs_glyph glyph, const gs_matrix *pmat, int members, gs_glyph_info_t *info);
5446 # 284 "./src/gxfont.h"
5447     int (*glyph_outline)(gs_font *font, int WMode, gs_glyph glyph, const gs_matrix *pmat, gx_path *ppath, double sbw[4]);
5448
5449
5450
5451
5452
5453
5454
5455     int (*glyph_name)(gs_font *font, gs_glyph glyph, gs_const_string *pstr);
5456 # 304 "./src/gxfont.h"
5457     int (*init_fstack)(gs_text_enum_t *, gs_font *);
5458 # 318 "./src/gxfont.h"
5459     int (*next_char_glyph)(gs_text_enum_t *pte, gs_char *pchar, gs_glyph *pglyph);
5460 # 330 "./src/gxfont.h"
5461     int (*build_char)(gs_text_enum_t *, gs_state *, gs_font *, gs_char, gs_glyph);
5462
5463 } gs_font_procs;
5464
5465
5466 int gs_no_define_font(gs_font_dir *, gs_font *);
5467 int gs_no_make_font(gs_font_dir *, const gs_font *, const gs_matrix *, gs_font **);
5468 int gs_base_make_font(gs_font_dir *, const gs_font *, const gs_matrix *, gs_font **);
5469 int gs_default_font_info(gs_font *font, const gs_point *pscale, int members, gs_font_info_t *info);
5470 int gs_default_same_font(const gs_font *font, const gs_font *ofont, int mask);
5471 int gs_base_same_font(const gs_font *font, const gs_font *ofont, int mask);
5472
5473 gs_glyph gs_no_encode_char(gs_font *, gs_char, gs_glyph_space_t);
5474 gs_char gs_no_decode_glyph(gs_font *, gs_glyph);
5475 int gs_no_enumerate_glyph(gs_font *font, int *pindex, gs_glyph_space_t glyph_space, gs_glyph *pglyph);
5476 int gs_default_glyph_info(gs_font *font, gs_glyph glyph, const gs_matrix *pmat, int members, gs_glyph_info_t *info);
5477 int gs_no_glyph_outline(gs_font *font, int WMode, gs_glyph glyph, const gs_matrix *pmat, gx_path *ppath, double sbw[4]);
5478 int gs_no_glyph_name(gs_font *font, gs_glyph glyph, gs_const_string *pstr);
5479
5480 int gs_default_init_fstack(gs_text_enum_t *, gs_font *);
5481 int gs_default_next_char_glyph(gs_text_enum_t *pte, gs_char *pchar, gs_glyph *pglyph);
5482 int gs_no_build_char(gs_text_enum_t *, gs_state *, gs_font *, gs_char, gs_glyph);
5483
5484 extern const gs_font_procs gs_font_procs_default;
5485
5486
5487 typedef struct gs_font_name_s {
5488
5489
5490     byte chars[47 + 1];
5491     uint size;
5492 } gs_font_name;
5493 # 396 "./src/gxfont.h"
5494 struct gs_font_s {
5495     gs_font *next, *prev; gs_memory_t *memory; gs_font_dir *dir; bool is_resource; gs_notify_list_t notify_list; gs_id id; gs_font *base; void *client_data; gs_matrix FontMatrix; gs_matrix orig_FontMatrix; font_type FontType; bool BitmapWidths; fbit_type ExactSize, InBetweenSize, TransformedChar; int WMode; int PaintType; float StrokeWidth; gs_font_procs procs; gs_font_name key_name, font_name;
5496 };
5497
5498 extern const gs_memory_struct_type_t st_gs_font;
5499 void gs_font_finalize(void *ptr);
5500 # 412 "./src/gxfont.h"
5501 extern const gs_memory_struct_type_t st_gs_font_ptr_element;
5502
5503
5504
5505
5506
5507
5508 gs_font *
5509   gs_font_alloc(gs_memory_t *mem, gs_memory_type_ptr_t pstype,
5510   const gs_font_procs *procs, gs_font_dir *dir,
5511   client_name_t cname);
5512
5513
5514 void gs_font_notify_init(gs_font *font);
5515
5516
5517
5518
5519
5520
5521 int gs_font_notify_register(gs_font *font, gs_notify_proc_t proc,
5522        void *proc_data);
5523 int gs_font_notify_unregister(gs_font *font, gs_notify_proc_t proc,
5524          void *proc_data);
5525
5526
5527
5528 typedef struct FAPI_server_s FAPI_server;
5529 # 454 "./src/gxfont.h"
5530 typedef struct gs_font_base_s gs_font_base;
5531
5532 struct gs_font_base_s {
5533     gs_font *next, *prev; gs_memory_t *memory; gs_font_dir *dir; bool is_resource; gs_notify_list_t notify_list; gs_id id; gs_font *base; void *client_data; gs_matrix FontMatrix; gs_matrix orig_FontMatrix; font_type FontType; bool BitmapWidths; fbit_type ExactSize, InBetweenSize, TransformedChar; int WMode; int PaintType; float StrokeWidth; gs_font_procs procs; gs_font_name key_name, font_name; gs_rect FontBBox; gs_uid UID; FAPI_server *FAPI; void *FAPI_font_data; gs_encoding_index_t encoding_index; gs_encoding_index_t nearest_encoding_index;
5534 };
5535
5536 extern const gs_memory_struct_type_t st_gs_font_base;
5537 # 469 "./src/gxfont.h"
5538 gs_font_base *
5539   gs_font_base_alloc(gs_memory_t *mem, gs_memory_type_ptr_t pstype,
5540        const gs_font_procs *procs, gs_font_dir *dir,
5541        client_name_t cname);
5542
5543
5544
5545
5546
5547 extern const char gx_extendeg_glyph_name_separator[];
5548
5549
5550
5551
5552
5553 bool gs_font_glyph_is_notdef(gs_font_base *bfont, gs_glyph glyph);
5554
5555
5556 const gs_font_base *gs_font_parent(const gs_font_base *pbfont);
5557 # 24 "./src/gdevpdfx.h" 2
5558 # 1 "./src/gxline.h" 1
5559 # 20 "./src/gxline.h"
5560 # 1 "./src/gslparam.h" 1
5561 # 21 "./src/gslparam.h"
5562 typedef enum {
5563     gs_cap_butt = 0,
5564     gs_cap_round = 1,
5565     gs_cap_square = 2,
5566     gs_cap_triangle = 3,
5567     gs_cap_unknown = 4
5568 } gs_line_cap;
5569
5570
5571
5572
5573 typedef enum {
5574     gs_join_miter = 0,
5575     gs_join_round = 1,
5576     gs_join_bevel = 2,
5577     gs_join_none = 3,
5578     gs_join_triangle = 4,
5579     gs_join_unknown = 5
5580 } gs_line_join;
5581 # 21 "./src/gxline.h" 2
5582
5583
5584
5585
5586 typedef struct gx_dash_params_s {
5587     float *pattern;
5588     uint pattern_size;
5589     float offset;
5590     bool adapt;
5591
5592     float pattern_length;
5593     bool init_ink_on;
5594     int init_index;
5595     float init_dist_left;
5596 } gx_dash_params;
5597
5598
5599
5600 typedef struct gx_line_params_s {
5601     float half_width;
5602     gs_line_cap cap;
5603     gs_line_join join;
5604     int curve_join;
5605
5606     float miter_limit;
5607     float miter_check;
5608
5609     float dot_length;
5610     bool dot_length_absolute;
5611     gs_matrix dot_orientation;
5612
5613     gx_dash_params dash;
5614 } gx_line_params;
5615
5616
5617
5618
5619
5620 int gx_set_miter_limit(gx_line_params *, floatp);
5621
5622
5623
5624 int gx_set_dash(gx_dash_params *, const float *, uint, floatp, gs_memory_t *);
5625
5626
5627 int gx_set_dot_length(gx_line_params *, floatp, bool);
5628 # 25 "./src/gdevpdfx.h" 2
5629
5630 # 1 "./src/spprint.h" 1
5631 # 30 "./src/spprint.h"
5632 int stream_write(stream * s, const void *ptr, uint count);
5633
5634
5635 int stream_puts(stream * s, const char *str);
5636 # 42 "./src/spprint.h"
5637 const char *pprintg1(stream * s, const char *format, floatp v);
5638 const char *pprintg2(stream * s, const char *format, floatp v1, floatp v2);
5639 const char *pprintg3(stream * s, const char *format,
5640        floatp v1, floatp v2, floatp v3);
5641 const char *pprintg4(stream * s, const char *format,
5642        floatp v1, floatp v2, floatp v3, floatp v4);
5643 const char *pprintg6(stream * s, const char *format,
5644        floatp v1, floatp v2, floatp v3, floatp v4,
5645        floatp v5, floatp v6);
5646
5647
5648
5649
5650
5651
5652
5653 const char *pprintd1(stream * s, const char *format, int v);
5654 const char *pprintd2(stream * s, const char *format, int v1, int v2);
5655 const char *pprintd3(stream * s, const char *format,
5656        int v1, int v2, int v3);
5657 const char *pprintd4(stream * s, const char *format,
5658        int v1, int v2, int v3, int v4);
5659
5660
5661 const char *pprintld1(stream * s, const char *format, long v);
5662 const char *pprintld2(stream * s, const char *format, long v1, long v2);
5663 const char *pprintld3(stream * s, const char *format,
5664         long v1, long v2, long v3);
5665
5666
5667 const char *pprints1(stream * s, const char *format, const char *str);
5668 const char *pprints2(stream * s, const char *format,
5669        const char *str1, const char *str2);
5670 const char *pprints3(stream * s, const char *format,
5671        const char *str1, const char *str2, const char *str3);
5672 # 27 "./src/gdevpdfx.h" 2
5673 # 1 "./src/gdevpsdf.h" 1
5674 # 25 "./src/gdevpsdf.h"
5675 # 1 "./src/gdevvec.h" 1
5676 # 23 "./src/gdevvec.h"
5677 # 1 "./src/gdevbbox.h" 1
5678 # 72 "./src/gdevbbox.h"
5679 typedef struct gx_device_bbox_procs_s {
5680
5681
5682
5683     bool (*init_box)(void *proc_data);
5684
5685
5686
5687     void (*get_box)(const void *proc_data, gs_fixed_rect *pbox);
5688
5689
5690
5691     void (*add_rect)(void *proc_data, fixed x0, fixed y0, fixed x1, fixed y1);
5692
5693
5694
5695     bool (*in_rect)(const void *proc_data, const gs_fixed_rect *pbox);
5696
5697 } gx_device_bbox_procs_t;
5698
5699 bool bbox_default_init_box(void *proc_data);
5700 void bbox_default_get_box(const void *proc_data, gs_fixed_rect *pbox);
5701 void bbox_default_add_rect(void *proc_data, fixed x0, fixed y0, fixed x1, fixed y1);
5702 bool bbox_default_in_rect(const void *proc_data, const gs_fixed_rect *pbox);
5703 # 108 "./src/gdevbbox.h"
5704 typedef struct gx_device_bbox_s gx_device_bbox;
5705
5706
5707
5708
5709 struct gx_device_bbox_s {
5710     int params_size; const gx_device_procs *static_procs; const char *dname; gs_memory_t *memory; gs_memory_type_ptr_t stype; bool stype_is_dynamic; void (*finalize)(gx_device *); rc_header rc; bool retained; bool is_open; int max_fill_band; gx_device_color_info color_info; gx_device_cached_colors_t cached_colors; int width; int height; int TrayOrientation; float MediaSize[2]; float ImagingBBox[4]; bool ImagingBBox_set; float HWResolution[2]; float MarginsHWResolution[2]; float Margins[2]; float HWMargins[4]; long PageCount; long ShowpageCount; int NumCopies; bool NumCopies_set; bool IgnoreNumCopies; bool UseCIEColor; bool LockSafetyParams; gx_page_device_procs page_procs; gx_device_procs procs; gx_device *target; bool free_standing; bool forward_open_close; gx_device_bbox_procs_t box_procs; void *box_proc_data; bool white_is_opaque; gs_fixed_rect bbox; gx_color_index black, white; gx_color_index transparent;
5711 };
5712
5713 extern const gs_memory_struct_type_t st_device_bbox;
5714
5715
5716
5717
5718
5719
5720 void gx_device_bbox_init(gx_device_bbox * dev, gx_device * target, gs_memory_t *mem);
5721
5722
5723 void gx_device_bbox_fwd_open_close(gx_device_bbox * dev,
5724        bool forward_open_close);
5725
5726
5727 void gx_device_bbox_set_white_opaque(gx_device_bbox *dev,
5728          bool white_is_opaque);
5729
5730
5731 void gx_device_bbox_bbox(gx_device_bbox * dev, gs_rect * pbbox);
5732
5733
5734 void gx_device_bbox_release(gx_device_bbox *dev);
5735 # 24 "./src/gdevvec.h" 2
5736 # 1 "./src/gxiparam.h" 1
5737 # 37 "./src/gxiparam.h"
5738 struct gx_image_type_s {
5739
5740
5741
5742
5743     gs_memory_type_ptr_t stype;
5744
5745
5746
5747
5748
5749     int (*begin_typed_image)(gx_device *dev, const gs_imager_state *pis, const gs_matrix *pmat, const gs_image_common_t *pim, const gs_int_rect *prect, const gx_drawing_color *pdcolor, const gx_clip_path *pcpath, gs_memory_t *memory, gx_image_enum_common_t **pinfo);
5750 # 59 "./src/gxiparam.h"
5751     int (*source_size)(const gs_imager_state *pis, const gs_image_common_t *pic, gs_int_point *psize);
5752 # 70 "./src/gxiparam.h"
5753     int (*sput)(const gs_image_common_t *pic, stream *s, const gs_color_space **ppcs);
5754 # 80 "./src/gxiparam.h"
5755     int (*sget)(gs_image_common_t *pic, stream *s, const gs_color_space *pcs);
5756 # 89 "./src/gxiparam.h"
5757     void (*release)(gs_image_common_t *pic, gs_memory_t *mem);
5758
5759
5760
5761
5762
5763     int index;
5764 };
5765
5766
5767
5768
5769
5770 int gx_data_image_source_size(const gs_imager_state *pis, const gs_image_common_t *pic, gs_int_point *psize);
5771
5772
5773
5774
5775 int gx_image_no_sput(const gs_image_common_t *pic, stream *s, const gs_color_space **ppcs);
5776 int gx_image_no_sget(gs_image_common_t *pic, stream *s, const gs_color_space *pcs);
5777 void gx_image_default_release(gs_image_common_t *pic, gs_memory_t *mem);
5778
5779
5780
5781
5782 int gx_pixel_image_sput(const gs_pixel_image_t *pic, stream *s,
5783    const gs_color_space **ppcs, int extra);
5784 int gx_pixel_image_sget(gs_pixel_image_t *pic, stream *s,
5785    const gs_color_space *pcs);
5786 void gx_pixel_image_release(gs_pixel_image_t *pic, gs_memory_t *mem);
5787
5788
5789 bool gx_image_matrix_is_default(const gs_data_image_t *pid);
5790 void gx_image_matrix_set_default(gs_data_image_t *pid);
5791 void sput_variable_uint(stream *s, uint w);
5792 int sget_variable_uint(stream *s, uint *pw);
5793 # 138 "./src/gxiparam.h"
5794 typedef struct gx_image_enum_procs_s {
5795 # 149 "./src/gxiparam.h"
5796     int (*plane_data)(gx_image_enum_common_t *info, const gx_image_plane_t *planes, int height, int *rows_used);
5797 # 160 "./src/gxiparam.h"
5798     int (*end_image)(gx_image_enum_common_t *info, bool draw_last);
5799 # 173 "./src/gxiparam.h"
5800     int (*flush)(gx_image_enum_common_t *info);
5801 # 198 "./src/gxiparam.h"
5802     bool (*planes_wanted)(const gx_image_enum_common_t *info, byte *wanted);
5803
5804 } gx_image_enum_procs_t;
5805 # 220 "./src/gxiparam.h"
5806 struct gx_image_enum_common_s {
5807     const gx_image_type_t *image_type; const gx_image_enum_procs_t *procs; gx_device *dev; gs_id id; int num_planes; int plane_depths[(((8 * 8) + 1) * 8)]; int plane_widths[(((8 * 8) + 1) * 8)];
5808 };
5809
5810 extern const gs_memory_struct_type_t st_gx_image_enum_common;
5811 # 233 "./src/gxiparam.h"
5812 int gx_image_enum_common_init(gx_image_enum_common_t * piec,
5813          const gs_data_image_t * pic,
5814          const gx_image_enum_procs_t * piep,
5815          gx_device * dev, int num_components,
5816          gs_image_format_t format);
5817
5818
5819
5820
5821
5822 int gx_no_plane_data(gx_image_enum_common_t *info, const gx_image_plane_t *planes, int height, int *rows_used);
5823 int gx_ignore_end_image(gx_image_enum_common_t *info, bool draw_last);
5824
5825
5826
5827
5828 int gx_begin_image1(gx_device *dev, const gs_imager_state *pis, const gs_matrix *pmat, const gs_image_common_t *pim, const gs_int_rect *prect, const gx_drawing_color *pdcolor, const gx_clip_path *pcpath, gs_memory_t *memory, gx_image_enum_common_t **pinfo);
5829 int gx_image1_plane_data(gx_image_enum_common_t *info, const gx_image_plane_t *planes, int height, int *rows_used);
5830 int gx_image1_end_image(gx_image_enum_common_t *info, bool draw_last);
5831 int gx_image1_flush(gx_image_enum_common_t *info);
5832 # 25 "./src/gdevvec.h" 2
5833 # 1 "./src/gxistate.h" 1
5834 # 28 "./src/gxistate.h"
5835 # 1 "./src/gxmatrix.h" 1
5836 # 33 "./src/gxmatrix.h"
5837 struct gs_matrix_fixed_s {
5838     float xx, xy, yx, yy, tx, ty;
5839     fixed tx_fixed, ty_fixed;
5840     bool txy_fixed_valid;
5841 };
5842
5843
5844
5845 typedef struct gs_matrix_fixed_s gs_matrix_fixed;
5846
5847
5848
5849 int gs_matrix_fixed_from_matrix(gs_matrix_fixed *, const gs_matrix *);
5850
5851
5852 int gs_point_transform2fixed(const gs_matrix_fixed *, floatp, floatp,
5853         gs_fixed_point *);
5854 int gs_distance_transform2fixed(const gs_matrix_fixed *, floatp, floatp,
5855     gs_fixed_point *);
5856
5857 int gs_point_transform2fixed_rounding(const gs_matrix_fixed * pmat,
5858     floatp x, floatp y, gs_fixed_point * ppt);
5859 # 63 "./src/gxmatrix.h"
5860 typedef struct {
5861     long xx, xy, yx, yy;
5862     int skewed;
5863     int shift;
5864     int max_bits;
5865     fixed round;
5866 } fixed_coeff;
5867 # 81 "./src/gxmatrix.h"
5868 fixed fixed_coeff_mult(fixed, long, const fixed_coeff *, int);
5869 # 29 "./src/gxistate.h" 2
5870
5871 # 1 "./src/gscspace.h" 1
5872 # 166 "./src/gscspace.h"
5873 typedef enum {
5874
5875
5876     gs_color_space_index_DeviceGray = 0,
5877     gs_color_space_index_DeviceRGB,
5878
5879
5880     gs_color_space_index_DeviceCMYK,
5881
5882
5883     gs_color_space_index_DevicePixel,
5884     gs_color_space_index_DeviceN,
5885
5886
5887
5888     gs_color_space_index_CIEDEFG,
5889     gs_color_space_index_CIEDEF,
5890     gs_color_space_index_CIEABC,
5891     gs_color_space_index_CIEA,
5892     gs_color_space_index_Separation,
5893     gs_color_space_index_Indexed,
5894     gs_color_space_index_Pattern,
5895
5896
5897     gs_color_space_index_CIEICC
5898
5899 } gs_color_space_index;
5900 # 201 "./src/gscspace.h"
5901 typedef struct gs_color_space_type_s gs_color_space_type;
5902 # 225 "./src/gscspace.h"
5903 typedef struct gs_device_pixel_params_s {
5904     int depth;
5905 } gs_device_pixel_params;
5906 typedef struct gs_cie_a_s gs_cie_a;
5907 typedef struct gs_cie_abc_s gs_cie_abc;
5908 typedef struct gs_cie_def_s gs_cie_def;
5909 typedef struct gs_cie_defg_s gs_cie_defg;
5910 # 240 "./src/gscspace.h"
5911 typedef struct gs_small_base_color_space_s {
5912     const gs_color_space_type * type; gs_memory_t * pmem; gs_id id; union { gs_device_pixel_params pixel; gs_cie_defg * defg; gs_cie_def * def; gs_cie_abc * abc; gs_cie_a * a; } params;
5913 } gs_small_base_color_space;
5914 # 252 "./src/gscspace.h"
5915 typedef struct gs_cie_icc_s gs_cie_icc;
5916
5917 typedef struct gs_cieicc_params_s {
5918     gs_cie_icc * picc_info;
5919     gs_small_base_color_space alt_space;
5920 } gs_icc_params;
5921
5922
5923
5924
5925
5926 typedef struct gs_base_color_space_s {
5927     const gs_color_space_type * type; gs_memory_t * pmem; gs_id id; union { gs_device_pixel_params pixel; gs_cie_defg * defg; gs_cie_def * def; gs_cie_abc * abc; gs_cie_a * a; gs_icc_params icc; } params;
5928 } gs_base_color_space;
5929
5930
5931
5932
5933
5934 typedef struct gs_device_n_map_s gs_device_n_map;
5935
5936
5937
5938
5939 typedef struct gs_device_n_attributes_s gs_device_n_attributes;
5940
5941
5942
5943
5944
5945
5946 typedef ulong gs_separation_name;
5947 # 292 "./src/gscspace.h"
5948 typedef int (gs_callback_func_get_colorname_string)
5949      (const gs_memory_t *mem, gs_separation_name colorname, unsigned char **ppstr, unsigned int *plen);
5950
5951 typedef enum { SEP_NONE, SEP_ALL, SEP_OTHER } separation_type;
5952
5953 typedef struct gs_separation_params_s {
5954     gs_separation_name sep_name;
5955     gs_base_color_space alt_space;
5956     gs_device_n_map *map;
5957     separation_type sep_type;
5958     bool use_alt_cspace;
5959     gs_callback_func_get_colorname_string *get_colorname_string;
5960
5961
5962
5963 } gs_separation_params;
5964
5965 typedef struct gs_device_n_params_s {
5966     gs_separation_name *names;
5967     uint num_components;
5968     gs_base_color_space alt_space;
5969     gs_device_n_map *map;
5970     gs_device_n_attributes *colorants;
5971     bool use_alt_cspace;
5972     gs_callback_func_get_colorname_string *get_colorname_string;
5973
5974
5975
5976 } gs_device_n_params;
5977
5978
5979
5980
5981
5982
5983 typedef struct gs_direct_color_space_s {
5984     const gs_color_space_type * type; gs_memory_t * pmem; gs_id id; union { gs_device_pixel_params pixel; gs_cie_defg * defg; gs_cie_def * def; gs_cie_abc * abc; gs_cie_a * a; gs_icc_params icc; gs_separation_params separation; gs_device_n_params device_n; } params;
5985 } gs_direct_color_space;
5986 # 341 "./src/gscspace.h"
5987 typedef struct gs_indexed_map_s gs_indexed_map;
5988
5989 typedef struct gs_indexed_params_s {
5990     gs_direct_color_space base_space;
5991     int hival;
5992     union {
5993  gs_const_string table;
5994  gs_indexed_map *map;
5995     } lookup;
5996     bool use_proc;
5997 } gs_indexed_params;
5998
5999
6000
6001
6002
6003 typedef struct gs_paint_color_space_s {
6004     const gs_color_space_type * type; gs_memory_t * pmem; gs_id id; union { gs_device_pixel_params pixel; gs_cie_defg * defg; gs_cie_def * def; gs_cie_abc * abc; gs_cie_a * a; gs_icc_params icc; gs_separation_params separation; gs_device_n_params device_n; gs_indexed_params indexed; } params;
6005 } gs_paint_color_space;
6006
6007
6008
6009
6010
6011
6012
6013 typedef struct gs_pattern_params_s {
6014     bool has_base_space;
6015     gs_paint_color_space base_space;
6016 } gs_pattern_params;
6017
6018
6019
6020
6021 struct gs_color_space_s {
6022     const gs_color_space_type * type; gs_memory_t * pmem; gs_id id; union { gs_device_pixel_params pixel; gs_cie_defg * defg; gs_cie_def * def; gs_cie_abc * abc; gs_cie_a * a; gs_icc_params icc; gs_separation_params separation; gs_device_n_params device_n; gs_indexed_params indexed; gs_pattern_params pattern; } params;
6023
6024
6025
6026 };
6027 # 438 "./src/gscspace.h"
6028 extern int
6029     gs_cspace_init_DeviceGray(const gs_memory_t *mem, gs_color_space *pcs),
6030     gs_cspace_build_DeviceGray(gs_color_space ** ppcspace,
6031       gs_memory_t * pmem),
6032     gs_cspace_init_DeviceRGB(const gs_memory_t *mem, gs_color_space *pcs),
6033     gs_cspace_build_DeviceRGB(gs_color_space ** ppcspace,
6034                               gs_memory_t * pmem),
6035     gs_cspace_init_DeviceCMYK(const gs_memory_t *mem, gs_color_space *pcs),
6036     gs_cspace_build_DeviceCMYK(gs_color_space ** ppcspace,
6037                                gs_memory_t * pmem);
6038
6039
6040 void gs_cspace_init_from(gs_color_space * pcsto,
6041     const gs_color_space * pcsfrom);
6042
6043
6044 void gs_cspace_assign(gs_color_space * pdest, const gs_color_space * psrc);
6045
6046
6047 void gs_cspace_release(gs_color_space * pcs);
6048
6049
6050
6051
6052 gs_color_space_index gs_color_space_get_index(const gs_color_space *);
6053
6054
6055 int gs_color_space_num_components(const gs_color_space *);
6056
6057
6058
6059
6060
6061
6062 bool gs_color_space_equal(const gs_color_space *pcs1,
6063      const gs_color_space *pcs2);
6064
6065
6066
6067
6068
6069
6070 void gs_color_space_restrict_color(gs_client_color *, const gs_color_space *);
6071
6072
6073
6074
6075
6076
6077 const gs_color_space *gs_cspace_base_space(const gs_color_space * pcspace);
6078 # 31 "./src/gxistate.h" 2
6079 # 1 "./src/gstrans.h" 1
6080 # 21 "./src/gstrans.h"
6081 # 1 "./src/gxcomp.h" 1
6082 # 22 "./src/gxcomp.h"
6083 # 1 "./src/gxbitfmt.h" 1
6084 # 28 "./src/gxbitfmt.h"
6085 typedef ulong gx_bitmap_format_t;
6086 # 23 "./src/gxcomp.h" 2
6087 # 67 "./src/gxcomp.h"
6088 typedef struct gs_composite_type_procs_s {
6089
6090
6091
6092
6093
6094
6095
6096     int (*create_default_compositor)(const gs_composite_t *pcte, gx_device **pcdev, gx_device *dev, gs_imager_state *pis, gs_memory_t *mem);
6097
6098
6099
6100
6101
6102
6103     bool (*equal)(const gs_composite_t *pcte, const gs_composite_t *pcte2);
6104 # 95 "./src/gxcomp.h"
6105     int (*write)(const gs_composite_t *pcte, byte *data, uint *psize);
6106 # 105 "./src/gxcomp.h"
6107     int (*read)(gs_composite_t **ppcte, const byte *data, uint size, gs_memory_t *mem);
6108
6109
6110
6111
6112
6113
6114
6115     int (*clist_compositor_write_update)(const gs_composite_t * pcte, gx_device * dev, gx_device ** pcdev, gs_imager_state * pis, gs_memory_t * mem);
6116
6117
6118
6119
6120
6121
6122
6123     int (*clist_compositor_read_update)(gs_composite_t * pcte, gx_device * cdev, gx_device * tdev, gs_imager_state * pis, gs_memory_t * mem);
6124
6125 } gs_composite_type_procs_t;
6126
6127 typedef struct gs_composite_type_s {
6128     byte comp_id;
6129     gs_composite_type_procs_t procs;
6130 } gs_composite_type_t;
6131
6132
6133
6134
6135
6136 int gx_default_composite_clist_write_update(const gs_composite_t * pcte, gx_device * dev, gx_device ** pcdev, gs_imager_state * pis, gs_memory_t * mem);
6137
6138
6139
6140
6141
6142 int gx_default_composite_clist_read_update(gs_composite_t * pcte, gx_device * cdev, gx_device * tdev, gs_imager_state * pis, gs_memory_t * mem);
6143 # 152 "./src/gxcomp.h"
6144 struct gs_composite_s {
6145     const gs_composite_type_t *type; gs_id id; rc_header rc;
6146 };
6147 # 22 "./src/gstrans.h" 2
6148
6149
6150
6151
6152 typedef enum {
6153     PDF14_PUSH_DEVICE,
6154     PDF14_POP_DEVICE,
6155     PDF14_BEGIN_TRANS_GROUP,
6156     PDF14_END_TRANS_GROUP,
6157     PDF14_INIT_TRANS_MASK,
6158     PDF14_BEGIN_TRANS_MASK,
6159     PDF14_END_TRANS_MASK,
6160     PDF14_SET_BLEND_PARAMS
6161 } pdf14_compositor_operations;
6162 # 60 "./src/gstrans.h"
6163 typedef struct gs_transparency_source_s {
6164     float alpha;
6165     gs_transparency_mask_t *mask;
6166 } gs_transparency_source_t;
6167
6168 struct gs_pdf14trans_params_s {
6169
6170     pdf14_compositor_operations pdf14_op;
6171
6172     int changed;
6173
6174     bool Isolated;
6175     bool Knockout;
6176     gs_rect bbox;
6177
6178     gs_transparency_channel_selector_t csel;
6179
6180     gs_transparency_mask_subtype_t subtype;
6181     int Background_components;
6182     bool function_is_identity;
6183     float Background[(8 * 8)];
6184     float GrayBackground;
6185     gs_function_t *transfer_function;
6186     byte transfer_fn[256];
6187
6188     gs_blend_mode_t blend_mode;
6189     bool text_knockout;
6190     gs_transparency_source_t opacity;
6191     gs_transparency_source_t shape;
6192     bool mask_is_image;
6193 };
6194
6195 typedef struct gs_pdf14trans_params_s gs_pdf14trans_params_t;
6196
6197
6198
6199
6200
6201
6202 typedef struct gs_pdf14trans_s {
6203     const gs_composite_type_t *type; gs_id id; rc_header rc;
6204     gs_pdf14trans_params_t params;
6205 } gs_pdf14trans_t;
6206
6207
6208
6209 int gs_setblendmode(gs_state *, gs_blend_mode_t);
6210 gs_blend_mode_t gs_currentblendmode(const gs_state *);
6211 int gs_setopacityalpha(gs_state *, floatp);
6212 float gs_currentopacityalpha(const gs_state *);
6213 int gs_setshapealpha(gs_state *, floatp);
6214 float gs_currentshapealpha(const gs_state *);
6215 int gs_settextknockout(gs_state *, bool);
6216 bool gs_currenttextknockout(const gs_state *);
6217
6218
6219
6220
6221
6222
6223 gs_transparency_state_type_t
6224     gs_current_transparency_type(const gs_state *pgs);
6225
6226
6227
6228
6229
6230 int gs_push_pdf14trans_device(gs_state * pgs);
6231
6232 int gs_pop_pdf14trans_device(gs_state * pgs);
6233
6234 void gs_trans_group_params_init(gs_transparency_group_params_t *ptgp);
6235
6236 int gs_begin_transparency_group(gs_state * pgs,
6237     const gs_transparency_group_params_t *ptgp,
6238     const gs_rect *pbbox);
6239
6240 int gs_end_transparency_group(gs_state *pgs);
6241
6242 void gs_trans_mask_params_init(gs_transparency_mask_params_t *ptmp,
6243           gs_transparency_mask_subtype_t subtype);
6244
6245 int gs_begin_transparency_mask(gs_state *pgs,
6246           const gs_transparency_mask_params_t *ptmp,
6247           const gs_rect *pbbox, bool mask_is_image);
6248
6249 int gs_end_transparency_mask(gs_state *pgs,
6250         gs_transparency_channel_selector_t csel);
6251
6252 int gs_init_transparency_mask(gs_state *pgs,
6253          gs_transparency_channel_selector_t csel);
6254
6255 int gs_discard_transparency_layer(gs_state *pgs);
6256
6257
6258
6259
6260 int gx_begin_transparency_group(gs_imager_state * pis, gx_device * pdev,
6261     const gs_pdf14trans_params_t * pparams);
6262
6263 int gx_end_transparency_group(gs_imager_state * pis, gx_device * pdev);
6264
6265 int gx_init_transparency_mask(gs_imager_state * pis,
6266     const gs_pdf14trans_params_t * pparams);
6267
6268 int gx_begin_transparency_mask(gs_imager_state * pis, gx_device * pdev,
6269     const gs_pdf14trans_params_t * pparams);
6270
6271 int gx_end_transparency_mask(gs_imager_state * pis, gx_device * pdev,
6272     const gs_pdf14trans_params_t * pparams);
6273
6274 int gx_discard_transparency_layer(gs_imager_state *pis);
6275
6276
6277
6278
6279 int gs_is_pdf14trans_compositor(const gs_composite_t * pct);
6280 # 32 "./src/gxistate.h" 2
6281 # 86 "./src/gxistate.h"
6282 typedef struct gs_halftone_s gs_halftone;
6283 # 109 "./src/gxistate.h"
6284 typedef struct gx_transfer_s {
6285     int red_component_num;
6286     gx_transfer_map *red;
6287     int green_component_num;
6288     gx_transfer_map *green;
6289     int blue_component_num;
6290     gx_transfer_map *blue;
6291     int gray_component_num;
6292     gx_transfer_map *gray;
6293 } gx_transfer;
6294 # 187 "./src/gxistate.h"
6295 typedef struct gs_devicen_color_map_s {
6296     bool use_alt_cspace;
6297
6298
6299
6300     separation_type sep_type;
6301     uint num_components;
6302     uint num_colorants;
6303     gs_id cspace_id;
6304     int color_map[(8 * 8)];
6305 } gs_devicen_color_map;
6306 # 253 "./src/gxistate.h"
6307 struct gs_imager_state_s {
6308     gs_memory_t *memory; void *client_data; gx_line_params line_params; gs_matrix_fixed ctm; bool current_point_valid; gs_point current_point; gs_point subpath_start; bool clamp_coordinates; gs_logical_operation_t log_op; gx_color_value alpha; gs_blend_mode_t blend_mode; gs_transparency_source_t opacity, shape; gs_id soft_mask_id; bool text_knockout; uint text_rendering_mode; gs_transparency_state_t *transparency_stack; bool overprint; int overprint_mode; int effective_overprint_mode; float flatness; gs_fixed_point fill_adjust; bool stroke_adjust; bool accurate_curves; bool have_pattern_streams; float smoothness; const gx_color_map_procs * (*get_cmap_procs)(const gs_imager_state *, const gx_device *); gs_halftone *halftone; gs_int_point screen_phase[2]; gx_device_halftone *dev_ht; struct gs_cie_render_s *cie_render; gx_transfer_map *black_generation; gx_transfer_map *undercolor_removal; gx_transfer set_transfer; gx_transfer_map *effective_transfer[(8 * 8)]; struct gx_cie_joint_caches_s *cie_joint_caches; const struct gx_color_map_procs_s *cmap_procs; gs_devicen_color_map color_component_map; struct gx_pattern_cache_s *pattern_cache;
6309 };
6310 # 274 "./src/gxistate.h"
6311 int gs_imager_state_initialize(gs_imager_state * pis, gs_memory_t * mem);
6312
6313
6314
6315 gs_imager_state *
6316     gs_imager_state_copy(const gs_imager_state * pis, gs_memory_t * mem);
6317
6318
6319 void gs_imager_state_copied(gs_imager_state * pis);
6320
6321
6322 void gs_imager_state_pre_assign(gs_imager_state *to,
6323     const gs_imager_state *from);
6324
6325
6326
6327 void gs_imager_state_release(gs_imager_state * pis);
6328 int gs_currentscreenphase_pis(const gs_imager_state *, gs_int_point *, gs_color_select_t);
6329 # 26 "./src/gdevvec.h" 2
6330 # 1 "./src/gxhldevc.h" 1
6331 # 66 "./src/gxhldevc.h"
6332 typedef struct gx_hl_saved_color_s {
6333     gs_id color_space_id;
6334     gs_id pattern_id;
6335     bool ccolor_valid;
6336     gs_client_color ccolor;
6337     gx_device_color_saved saved_dev_color;
6338 } gx_hl_saved_color;
6339
6340
6341
6342
6343 void gx_hld_saved_color_init(gx_hl_saved_color * psc);
6344
6345
6346
6347
6348
6349 const gs_state * gx_hld_get_gstate_ptr(const gs_imager_state * pis);
6350 # 98 "./src/gxhldevc.h"
6351 bool gx_hld_save_color(const gs_imager_state * pis,
6352  const gx_device_color * pdevc, gx_hl_saved_color * psc);
6353
6354
6355
6356
6357
6358
6359 bool gx_hld_saved_color_equal(const gx_hl_saved_color * psc1,
6360       const gx_hl_saved_color * psc2);
6361
6362
6363
6364
6365 bool gx_hld_saved_color_same_cspace(const gx_hl_saved_color * psc1,
6366       const gx_hl_saved_color * psc2);
6367
6368
6369
6370
6371 bool
6372 gx_hld_is_hl_color_available(const gs_imager_state * pis,
6373   const gx_device_color * pdevc);
6374 # 129 "./src/gxhldevc.h"
6375 typedef enum {
6376         non_pattern_color_space,
6377         pattern_color_sapce,
6378  use_process_color
6379 } gx_hld_get_color_space_and_ccolor_status;
6380 # 158 "./src/gxhldevc.h"
6381 gx_hld_get_color_space_and_ccolor_status gx_hld_get_color_space_and_ccolor(
6382   const gs_imager_state * pis, const gx_device_color * pdevc,
6383   const gs_color_space ** ppcs, const gs_client_color ** ppcc);
6384 # 169 "./src/gxhldevc.h"
6385 int gx_hld_get_number_color_components(const gs_imager_state * pis);
6386
6387
6388
6389
6390 typedef enum {
6391     valid_result = 1,
6392     invalid_color_info = 2,
6393     invalid_component_requested = 3
6394 } gx_hld_get_color_component_status;
6395 # 188 "./src/gxhldevc.h"
6396 gx_hld_get_color_component_status gx_hld_get_color_component(
6397   const gs_imager_state * pis, const gx_device_color * pdevc,
6398   int comp_numi, float * output);
6399 # 27 "./src/gdevvec.h" 2
6400 # 62 "./src/gdevvec.h"
6401 typedef struct gx_device_vector_s gx_device_vector;
6402 # 77 "./src/gdevvec.h"
6403 typedef enum {
6404     gx_path_type_none = 0,
6405
6406
6407
6408
6409     gx_path_type_fill = 1,
6410     gx_path_type_stroke = 2,
6411     gx_path_type_clip = 4,
6412     gx_path_type_winding_number = 0,
6413     gx_path_type_even_odd = 8,
6414     gx_path_type_optimize = 16,
6415     gx_path_type_always_close = 32,
6416     gx_path_type_rule = gx_path_type_winding_number | gx_path_type_even_odd
6417 } gx_path_type_t;
6418 typedef enum {
6419     gx_rect_x_first,
6420     gx_rect_y_first
6421 } gx_rect_direction_t;
6422 typedef struct gx_device_vector_procs_s {
6423
6424     int (*beginpage) (gx_device_vector * vdev);
6425
6426     int (*setlinewidth) (gx_device_vector * vdev, floatp width);
6427     int (*setlinecap) (gx_device_vector * vdev, gs_line_cap cap);
6428     int (*setlinejoin) (gx_device_vector * vdev, gs_line_join join);
6429     int (*setmiterlimit) (gx_device_vector * vdev, floatp limit);
6430     int (*setdash) (gx_device_vector * vdev, const float *pattern,
6431       uint count, floatp offset);
6432     int (*setflat) (gx_device_vector * vdev, floatp flatness);
6433     int (*setlogop) (gx_device_vector * vdev, gs_logical_operation_t lop,
6434        gs_logical_operation_t diff);
6435
6436     bool (*can_handle_hl_color) (gx_device_vector * vdev, const gs_imager_state * pis,
6437                          const gx_drawing_color * pdc);
6438     int (*setfillcolor) (gx_device_vector * vdev, const gs_imager_state * pis,
6439                          const gx_drawing_color * pdc);
6440     int (*setstrokecolor) (gx_device_vector * vdev, const gs_imager_state * pis,
6441                            const gx_drawing_color * pdc);
6442
6443
6444     int (*dopath) (gx_device_vector * vdev, const gx_path * ppath,
6445      gx_path_type_t type, const gs_matrix *pmat);
6446     int (*dorect) (gx_device_vector * vdev, fixed x0, fixed y0, fixed x1,
6447      fixed y1, gx_path_type_t type);
6448     int (*beginpath) (gx_device_vector * vdev, gx_path_type_t type);
6449     int (*moveto) (gx_device_vector * vdev, floatp x0, floatp y0,
6450      floatp x, floatp y, gx_path_type_t type);
6451     int (*lineto) (gx_device_vector * vdev, floatp x0, floatp y0,
6452      floatp x, floatp y, gx_path_type_t type);
6453     int (*curveto) (gx_device_vector * vdev, floatp x0, floatp y0,
6454       floatp x1, floatp y1, floatp x2, floatp y2,
6455       floatp x3, floatp y3, gx_path_type_t type);
6456     int (*closepath) (gx_device_vector * vdev, floatp x0, floatp y0,
6457         floatp x_start, floatp y_start, gx_path_type_t type);
6458     int (*endpath) (gx_device_vector * vdev, gx_path_type_t type);
6459 } gx_device_vector_procs;
6460
6461
6462
6463 int gdev_vector_setflat(gx_device_vector * vdev, floatp flatness);
6464
6465
6466
6467 int gdev_vector_dopath(gx_device_vector * vdev, const gx_path * ppath,
6468          gx_path_type_t type, const gs_matrix *pmat);
6469
6470
6471 int gdev_vector_dorect(gx_device_vector * vdev, fixed x0, fixed y0,
6472          fixed x1, fixed y1, gx_path_type_t type);
6473 # 203 "./src/gdevvec.h"
6474 struct gx_device_vector_s {
6475     int params_size; const gx_device_procs *static_procs; const char *dname; gs_memory_t *memory; gs_memory_type_ptr_t stype; bool stype_is_dynamic; void (*finalize)(gx_device *); rc_header rc; bool retained; bool is_open; int max_fill_band; gx_device_color_info color_info; gx_device_cached_colors_t cached_colors; int width; int height; int TrayOrientation; float MediaSize[2]; float ImagingBBox[4]; bool ImagingBBox_set; float HWResolution[2]; float MarginsHWResolution[2]; float Margins[2]; float HWMargins[4]; long PageCount; long ShowpageCount; int NumCopies; bool NumCopies_set; bool IgnoreNumCopies; bool UseCIEColor; bool LockSafetyParams; gx_page_device_procs page_procs; gx_device_procs procs; gs_memory_t *v_memory; const gx_device_vector_procs *vec_procs; char fname[(260 - 1) + 1]; FILE *file; stream *strm; byte *strmbuf; uint strmbuf_size; int open_options; gs_imager_state state; float dash_pattern[11]; bool fill_used_process_color; bool stroke_used_process_color; gx_hl_saved_color saved_fill_color; gx_hl_saved_color saved_stroke_color; gs_id no_clip_path_id; gs_id clip_path_id; gx_path_type_t fill_options, stroke_options; gs_point scale; bool in_page; gx_device_bbox *bbox_device; gx_color_index black, white;
6476 };
6477
6478
6479
6480 extern const gs_memory_struct_type_t st_device_vector;
6481 # 220 "./src/gdevvec.h"
6482 void gdev_vector_init(gx_device_vector * vdev);
6483
6484
6485 void gdev_vector_reset(gx_device_vector * vdev);
6486 # 234 "./src/gdevvec.h"
6487 int gdev_vector_open_file_options(gx_device_vector * vdev,
6488       uint strmbuf_size, int open_options);
6489
6490
6491
6492
6493
6494
6495
6496 stream *gdev_vector_stream(gx_device_vector * vdev);
6497
6498
6499
6500 int gdev_vector_update_log_op(gx_device_vector * vdev,
6501          gs_logical_operation_t lop);
6502
6503
6504
6505 int gdev_vector_update_fill_color(gx_device_vector * vdev,
6506       const gs_imager_state * pis,
6507       const gx_drawing_color * pdcolor);
6508
6509
6510
6511 int gdev_vector_prepare_fill(gx_device_vector * vdev,
6512         const gs_imager_state * pis,
6513         const gx_fill_params * params,
6514         const gx_drawing_color * pdcolor);
6515
6516
6517
6518
6519
6520
6521 int gdev_vector_prepare_stroke(gx_device_vector * vdev,
6522           const gs_imager_state * pis,
6523           const gx_stroke_params * params,
6524           const gx_drawing_color * pdcolor,
6525           floatp scale);
6526
6527
6528
6529
6530
6531
6532
6533 int gdev_vector_stroke_scaling(const gx_device_vector *vdev,
6534           const gs_imager_state *pis,
6535           double *pscale, gs_matrix *pmat);
6536
6537
6538 typedef struct gdev_vector_dopath_state_s {
6539
6540     gx_device_vector *vdev;
6541     gx_path_type_t type;
6542     bool first;
6543     gs_matrix scale_mat;
6544
6545     gs_point start;
6546     gs_point prev;
6547 } gdev_vector_dopath_state_t;
6548 void gdev_vector_dopath_init(gdev_vector_dopath_state_t *state,
6549         gx_device_vector *vdev,
6550         gx_path_type_t type, const gs_matrix *pmat);
6551
6552
6553 int gdev_vector_dopath_segment(gdev_vector_dopath_state_t *state, int pe_op,
6554           gs_fixed_point vs[3]);
6555
6556
6557
6558
6559
6560 int gdev_vector_write_polygon(gx_device_vector * vdev,
6561          const gs_fixed_point * points, uint count,
6562          bool close, gx_path_type_t type);
6563
6564
6565 int gdev_vector_write_rectangle(gx_device_vector * vdev,
6566     fixed x0, fixed y0, fixed x1, fixed y1,
6567     bool close, gx_rect_direction_t dir);
6568
6569
6570
6571 int gdev_vector_write_clip_path(gx_device_vector * vdev,
6572     const gx_clip_path * pcpath);
6573
6574
6575
6576 int gdev_vector_update_clip_path(gx_device_vector * vdev,
6577      const gx_clip_path * pcpath);
6578
6579
6580 int gdev_vector_close_file(gx_device_vector * vdev);
6581 # 343 "./src/gdevvec.h"
6582 typedef struct gdev_vector_image_enum_s {
6583     const gx_image_type_t *image_type; const gx_image_enum_procs_t *procs; gx_device *dev; gs_id id; int num_planes; int plane_depths[(((8 * 8) + 1) * 8)]; int plane_widths[(((8 * 8) + 1) * 8)]; gs_memory_t *memory; gx_image_enum_common_t *default_info; gx_image_enum_common_t *bbox_info; int width, height; int bits_per_pixel; uint bits_per_row; int y;
6584 } gdev_vector_image_enum_t;
6585
6586 extern const gs_memory_struct_type_t st_vector_image_enum;
6587 # 358 "./src/gdevvec.h"
6588 int gdev_vector_begin_image(gx_device_vector * vdev,
6589    const gs_imager_state * pis, const gs_image_t * pim,
6590    gs_image_format_t format, const gs_int_rect * prect,
6591        const gx_drawing_color * pdcolor, const gx_clip_path * pcpath,
6592       gs_memory_t * mem, const gx_image_enum_procs_t * pprocs,
6593        gdev_vector_image_enum_t * pie);
6594
6595
6596
6597 int gdev_vector_end_image(gx_device_vector * vdev,
6598        gdev_vector_image_enum_t * pie, bool draw_last, gx_color_index pad);
6599
6600
6601
6602
6603 int gdev_vector_put_params(gx_device *dev, gs_param_list *plist);
6604 int gdev_vector_get_params(gx_device *dev, gs_param_list *plist);
6605
6606
6607
6608
6609 int gdev_vector_fill_rectangle(gx_device *dev, int x, int y, int width, int height, gx_color_index color);
6610
6611 int gdev_vector_fill_path(gx_device *dev, const gs_imager_state *pis, gx_path *ppath, const gx_fill_params *params, const gx_drawing_color *pdcolor, const gx_clip_path *pcpath);
6612
6613 int gdev_vector_stroke_path(gx_device *dev, const gs_imager_state *pis, gx_path *ppath, const gx_stroke_params *params, const gx_drawing_color *pdcolor, const gx_clip_path *pcpath);
6614
6615
6616 int gdev_vector_fill_trapezoid(gx_device *dev, const gs_fixed_edge *left, const gs_fixed_edge *right, fixed ybot, fixed ytop, bool swap_axes, const gx_drawing_color *pdcolor, gs_logical_operation_t lop);
6617 int gdev_vector_fill_parallelogram(gx_device *dev, fixed px, fixed py, fixed ax, fixed ay, fixed bx, fixed by, const gx_drawing_color *pdcolor, gs_logical_operation_t lop);
6618 int gdev_vector_fill_triangle(gx_device *dev, fixed px, fixed py, fixed ax, fixed ay, fixed bx, fixed by, const gx_drawing_color *pdcolor, gs_logical_operation_t lop);
6619 # 26 "./src/gdevpsdf.h" 2
6620
6621 # 1 "./src/strimpl.h" 1
6622 # 124 "./src/strimpl.h"
6623 struct stream_template_s {
6624
6625
6626     gs_memory_type_ptr_t stype;
6627
6628
6629     int (*init)(stream_state *);
6630
6631
6632
6633     int (*process)(stream_state *, stream_cursor_read *, stream_cursor_write *, bool);
6634
6635
6636     uint min_in_size;
6637     uint min_out_size;
6638
6639
6640     void (*release)(stream_state *);
6641
6642
6643
6644     void (*set_defaults)(stream_state *);
6645
6646
6647     int (*reinit)(stream_state *);
6648
6649 };
6650
6651
6652 int stream_move(stream_cursor_read *, stream_cursor_write *);
6653
6654
6655 typedef enum {
6656     hex_ignore_garbage = 0,
6657     hex_ignore_whitespace = 1,
6658     hex_ignore_leading_whitespace = 2
6659 } hex_syntax;
6660 int s_hex_process(stream_cursor_read *, stream_cursor_write *, int *, hex_syntax);
6661 # 28 "./src/gdevpsdf.h" 2
6662 # 1 "./src/sa85x.h" 1
6663 # 21 "./src/sa85x.h"
6664 # 1 "./src/sa85d.h" 1
6665 # 22 "./src/sa85d.h"
6666 typedef struct stream_A85D_state_s {
6667     const stream_template *template; gs_memory_t *memory; int (*report_error)(stream_state *, const char *); int min_left; char error_string[79 + 1];
6668     int odd;
6669     ulong word;
6670 } stream_A85D_state;
6671 # 35 "./src/sa85d.h"
6672 extern const stream_template s_A85D_template;
6673 # 22 "./src/sa85x.h" 2
6674
6675
6676 typedef struct stream_A85E_state_s {
6677     const stream_template *template; gs_memory_t *memory; int (*report_error)(stream_state *, const char *); int min_left; char error_string[79 + 1];
6678
6679     int count;
6680     int last_char;
6681 } stream_A85E_state;
6682
6683
6684
6685
6686
6687
6688 extern const stream_template s_A85E_template;
6689 # 29 "./src/gdevpsdf.h" 2
6690 # 1 "./src/scfx.h" 1
6691 # 21 "./src/scfx.h"
6692 # 1 "./src/shc.h" 1
6693 # 20 "./src/shc.h"
6694 # 1 "./src/gsbittab.h" 1
6695 # 41 "./src/gsbittab.h"
6696 extern const byte byte_reverse_bits[256];
6697
6698
6699
6700
6701 extern const byte byte_right_mask[9];
6702
6703
6704
6705
6706 extern const byte byte_count_bits[256];
6707 # 60 "./src/gsbittab.h"
6708 extern const byte
6709     byte_bit_run_length_0[256], byte_bit_run_length_1[256],
6710     byte_bit_run_length_2[256], byte_bit_run_length_3[256],
6711     byte_bit_run_length_4[256], byte_bit_run_length_5[256],
6712     byte_bit_run_length_6[256], byte_bit_run_length_7[256];
6713
6714
6715
6716
6717
6718 extern const byte *const byte_bit_run_length[8];
6719 extern const byte *const byte_bit_run_length_neg[8];
6720
6721
6722
6723
6724
6725 extern const byte byte_acegbdfh_to_abcdefgh[256];
6726 # 21 "./src/shc.h" 2
6727 # 45 "./src/shc.h"
6728 typedef struct hc_definition_s {
6729     ushort *counts;
6730     uint num_counts;
6731     ushort *values;
6732     uint num_values;
6733 } hc_definition;
6734 # 71 "./src/shc.h"
6735 typedef struct stream_hc_state_s {
6736     const stream_template *template; gs_memory_t *memory; int (*report_error)(stream_state *, const char *); int min_left; char error_string[79 + 1]; bool FirstBitLowOrder; uint bits; int bits_left;
6737 } stream_hc_state;
6738 # 84 "./src/shc.h"
6739 typedef struct hce_code_s {
6740     ushort code;
6741     ushort code_length;
6742 } hce_code;
6743
6744
6745
6746 typedef struct hce_table_s {
6747     uint count;
6748     hce_code *codes;
6749 } hce_table;
6750 # 133 "./src/shc.h"
6751 void hc_put_code_proc(bool, byte *, uint);
6752 # 150 "./src/shc.h"
6753 byte *hc_put_last_bits_proc(stream_hc_state *, byte *, uint, int);
6754 # 169 "./src/shc.h"
6755 typedef struct hcd_code_s {
6756     short value;
6757     ushort code_length;
6758 } hcd_code;
6759
6760 typedef struct hcd_table_s {
6761     uint count;
6762     uint initial_bits;
6763     hcd_code *codes;
6764 } hcd_table;
6765 # 22 "./src/scfx.h" 2
6766 # 46 "./src/scfx.h"
6767 typedef struct stream_CF_state_s {
6768     const stream_template *template; gs_memory_t *memory; int (*report_error)(stream_state *, const char *); int min_left; char error_string[79 + 1]; bool FirstBitLowOrder; uint bits; int bits_left; bool Uncompressed; int K; bool EndOfLine; bool EncodedByteAlign; int Columns; int Rows; bool EndOfBlock; bool BlackIs1; int DamagedRowsBeforeError; int DecodedByteAlign; uint raster; byte *lbuf; byte *lprev; int k_left;
6769 } stream_CF_state;
6770 # 69 "./src/scfx.h"
6771 typedef struct stream_CFE_state_s {
6772     const stream_template *template; gs_memory_t *memory; int (*report_error)(stream_state *, const char *); int min_left; char error_string[79 + 1]; bool FirstBitLowOrder; uint bits; int bits_left; bool Uncompressed; int K; bool EndOfLine; bool EncodedByteAlign; int Columns; int Rows; bool EndOfBlock; bool BlackIs1; int DamagedRowsBeforeError; int DecodedByteAlign; uint raster; byte *lbuf; byte *lprev; int k_left;
6773
6774     int max_code_bytes;
6775     byte *lcode;
6776
6777     int read_count;
6778     int write_count;
6779     int code_bytes;
6780 } stream_CFE_state;
6781
6782
6783
6784
6785
6786
6787 extern const stream_template s_CFE_template;
6788
6789
6790 typedef struct stream_CFD_state_s {
6791     const stream_template *template; gs_memory_t *memory; int (*report_error)(stream_state *, const char *); int min_left; char error_string[79 + 1]; bool FirstBitLowOrder; uint bits; int bits_left; bool Uncompressed; int K; bool EndOfLine; bool EncodedByteAlign; int Columns; int Rows; bool EndOfBlock; bool BlackIs1; int DamagedRowsBeforeError; int DecodedByteAlign; uint raster; byte *lbuf; byte *lprev; int k_left;
6792     int cbit;
6793
6794     int rows_left;
6795     int row;
6796     int rpos;
6797     int wpos;
6798
6799     int eol_count;
6800     byte invert;
6801
6802     int run_color;
6803
6804
6805
6806     int damaged_rows;
6807
6808     bool skipping_damage;
6809
6810
6811     int uncomp_run;
6812
6813
6814     int uncomp_left;
6815     int uncomp_exit;
6816
6817 } stream_CFD_state;
6818
6819
6820
6821
6822
6823
6824 extern const stream_template s_CFD_template;
6825 # 30 "./src/gdevpsdf.h" 2
6826 # 1 "./src/spsdf.h" 1
6827 # 34 "./src/spsdf.h"
6828 void s_write_ps_string(stream * s, const byte * str, uint size, int print_ok);
6829
6830
6831
6832
6833
6834
6835 int s_alloc_position_stream(stream ** ps, gs_memory_t * mem);
6836
6837
6838
6839
6840
6841 typedef struct param_printer_params_s {
6842     const char *prefix;
6843     const char *suffix;
6844     const char *item_prefix;
6845     const char *item_suffix;
6846     int print_ok;
6847 } param_printer_params_t;
6848
6849
6850
6851
6852 typedef struct printer_param_list_s {
6853     const gs_param_list_procs *procs; gs_memory_t *memory; bool persistent_keys;
6854     stream *strm;
6855     param_printer_params_t params;
6856     bool any;
6857 } printer_param_list_t;
6858
6859
6860
6861
6862
6863
6864 extern const param_printer_params_t param_printer_params_default;
6865 int s_alloc_param_printer(gs_param_list ** pplist,
6866      const param_printer_params_t * ppp, stream * s,
6867      gs_memory_t * mem);
6868 void s_free_param_printer(gs_param_list * plist);
6869
6870 int s_init_param_printer(printer_param_list_t *prlist,
6871     const param_printer_params_t * ppp, stream * s);
6872 void s_release_param_printer(printer_param_list_t *prlist);
6873 # 31 "./src/gdevpsdf.h" 2
6874
6875 extern const stream_template s_DCTE_template;
6876 # 43 "./src/gdevpsdf.h"
6877 typedef struct psdf_image_params_s {
6878     gs_c_param_list *ACSDict;
6879     bool AntiAlias;
6880     bool AutoFilter;
6881     int Depth;
6882     gs_c_param_list *Dict;
6883     bool Downsample;
6884     float DownsampleThreshold;
6885     enum psdf_downsample_type {
6886  ds_Average,
6887  ds_Bicubic,
6888  ds_Subsample
6889     } DownsampleType;
6890
6891
6892     bool Encode;
6893     const char *Filter;
6894     int Resolution;
6895     const char *AutoFilterStrategy;
6896     const stream_template *filter_template;
6897 } psdf_image_params;
6898
6899
6900
6901
6902
6903
6904 extern const stream_template s_CFE_template;
6905
6906
6907 typedef struct psdf_distiller_params_s {
6908
6909
6910
6911     bool ASCII85EncodePages;
6912     enum psdf_auto_rotate_pages {
6913  arp_None,
6914  arp_All,
6915  arp_PageByPage
6916     } AutoRotatePages;
6917
6918
6919     enum psdf_binding {
6920  binding_Left,
6921  binding_Right
6922     } Binding;
6923
6924
6925     bool CompressPages;
6926     enum psdf_default_rendering_intent {
6927  ri_Default,
6928  ri_Perceptual,
6929  ri_Saturation,
6930  ri_RelativeColorimetric,
6931  ri_AbsoluteColorimetric
6932     } DefaultRenderingIntent;
6933
6934
6935
6936     bool DetectBlends;
6937     bool DoThumbnails;
6938     long ImageMemory;
6939     bool LockDistillerParams;
6940     bool LZWEncodePages;
6941     int OPM;
6942     bool PreserveOPIComments;
6943     bool UseFlateCompression;
6944
6945
6946
6947     gs_const_string CalCMYKProfile;
6948     gs_const_string CalGrayProfile;
6949     gs_const_string CalRGBProfile;
6950     gs_const_string sRGBProfile;
6951     enum psdf_color_conversion_strategy {
6952  ccs_LeaveColorUnchanged,
6953  ccs_UseDeviceDependentColor,
6954  ccs_UseDeviceIndependentColor,
6955  ccs_UseDeviceIndependentColorForImages,
6956  ccs_sRGB,
6957  ccs_CMYK,
6958  ccs_Gray
6959     } ColorConversionStrategy;
6960
6961
6962
6963
6964     bool PreserveHalftoneInfo;
6965     bool PreserveOverprintSettings;
6966     enum psdf_transfer_function_info {
6967  tfi_Preserve,
6968  tfi_Apply,
6969  tfi_Remove
6970     } TransferFunctionInfo;
6971
6972
6973     enum psdf_ucr_and_bg_info {
6974  ucrbg_Preserve,
6975  ucrbg_Remove
6976     } UCRandBGInfo;
6977 # 157 "./src/gdevpsdf.h"
6978     psdf_image_params ColorImage;
6979     bool ConvertCMYKImagesToRGB;
6980     bool ConvertImagesToIndexed;
6981
6982
6983
6984
6985
6986
6987
6988     psdf_image_params GrayImage;
6989
6990
6991
6992
6993
6994
6995     psdf_image_params MonoImage;
6996
6997
6998
6999
7000
7001
7002     gs_param_string_array AlwaysEmbed;
7003     gs_param_string_array NeverEmbed;
7004     enum psdf_cannot_embed_font_policy {
7005  cefp_OK,
7006  cefp_Warning,
7007  cefp_Error
7008     } CannotEmbedFontPolicy;
7009
7010
7011     bool EmbedAllFonts;
7012     int MaxSubsetPct;
7013     bool SubsetFonts;
7014
7015
7016
7017
7018 } psdf_distiller_params;
7019
7020
7021 typedef enum {
7022     psdf_version_level1 = 1000,
7023     psdf_version_level1_color = 1100,
7024     psdf_version_level2 = 2000,
7025     psdf_version_level2_with_TT = 2010,
7026     psdf_version_level2_plus = 2017,
7027     psdf_version_ll3 = 3010
7028 } psdf_version;
7029 # 220 "./src/gdevpsdf.h"
7030 typedef struct gx_device_psdf_s {
7031     int params_size; const gx_device_procs *static_procs; const char *dname; gs_memory_t *memory; gs_memory_type_ptr_t stype; bool stype_is_dynamic; void (*finalize)(gx_device *); rc_header rc; bool retained; bool is_open; int max_fill_band; gx_device_color_info color_info; gx_device_cached_colors_t cached_colors; int width; int height; int TrayOrientation; float MediaSize[2]; float ImagingBBox[4]; bool ImagingBBox_set; float HWResolution[2]; float MarginsHWResolution[2]; float Margins[2]; float HWMargins[4]; long PageCount; long ShowpageCount; int NumCopies; bool NumCopies_set; bool IgnoreNumCopies; bool UseCIEColor; bool LockSafetyParams; gx_page_device_procs page_procs; gx_device_procs procs; gs_memory_t *v_memory; const gx_device_vector_procs *vec_procs; char fname[(260 - 1) + 1]; FILE *file; stream *strm; byte *strmbuf; uint strmbuf_size; int open_options; gs_imager_state state; float dash_pattern[11]; bool fill_used_process_color; bool stroke_used_process_color; gx_hl_saved_color saved_fill_color; gx_hl_saved_color saved_stroke_color; gs_id no_clip_path_id; gs_id clip_path_id; gx_path_type_t fill_options, stroke_options; gs_point scale; bool in_page; gx_device_bbox *bbox_device; gx_color_index black, white; psdf_version version; bool binary_ok; bool HaveCFF; bool HaveTrueTypes; bool HaveCIDSystem; double ParamCompatibilityLevel; psdf_distiller_params params;
7032 } gx_device_psdf;
7033 # 240 "./src/gdevpsdf.h"
7034 extern const gs_memory_struct_type_t st_device_psdf;
7035 # 262 "./src/gdevpsdf.h"
7036 int gdev_psdf_get_params(gx_device *dev, gs_param_list *plist);
7037 int gdev_psdf_put_params(gx_device *dev, gs_param_list *plist);
7038
7039
7040
7041
7042 int psdf_setlinewidth(gx_device_vector * vdev, floatp width);
7043 int psdf_setlinecap(gx_device_vector * vdev, gs_line_cap cap);
7044 int psdf_setlinejoin(gx_device_vector * vdev, gs_line_join join);
7045 int psdf_setmiterlimit(gx_device_vector * vdev, floatp limit);
7046 int psdf_setdash(gx_device_vector * vdev, const float *pattern,
7047    uint count, floatp offset);
7048 int psdf_setflat(gx_device_vector * vdev, floatp flatness);
7049 int psdf_setlogop(gx_device_vector * vdev, gs_logical_operation_t lop,
7050     gs_logical_operation_t diff);
7051
7052
7053
7054 int psdf_dorect(gx_device_vector * vdev, fixed x0, fixed y0, fixed x1,
7055   fixed y1, gx_path_type_t type);
7056 int psdf_beginpath(gx_device_vector * vdev, gx_path_type_t type);
7057 int psdf_moveto(gx_device_vector * vdev, floatp x0, floatp y0,
7058   floatp x, floatp y, gx_path_type_t type);
7059 int psdf_lineto(gx_device_vector * vdev, floatp x0, floatp y0,
7060   floatp x, floatp y, gx_path_type_t type);
7061 int psdf_curveto(gx_device_vector * vdev, floatp x0, floatp y0,
7062    floatp x1, floatp y1, floatp x2,
7063    floatp y2, floatp x3, floatp y3, gx_path_type_t type);
7064 int psdf_closepath(gx_device_vector * vdev, floatp x0, floatp y0,
7065      floatp x_start, floatp y_start, gx_path_type_t type);
7066
7067
7068
7069
7070 typedef struct psdf_binary_writer_s {
7071     gs_memory_t *memory;
7072     stream *target;
7073     stream *strm;
7074     gx_device_psdf *dev;
7075
7076
7077
7078
7079
7080 } psdf_binary_writer;
7081 extern const gs_memory_struct_type_t st_psdf_binary_writer;
7082
7083
7084
7085
7086
7087
7088
7089 int psdf_begin_binary(gx_device_psdf * pdev, psdf_binary_writer * pbw);
7090
7091
7092
7093 int psdf_encode_binary(psdf_binary_writer * pbw,
7094          const stream_template * template, stream_state * ss);
7095
7096
7097
7098 int psdf_CFE_binary(psdf_binary_writer * pbw, int w, int h, bool invert);
7099
7100
7101
7102
7103
7104
7105
7106 int psdf_DCT_filter(gs_param_list *plist ,
7107       stream_state *st,
7108       int Columns, int Rows, int Colors,
7109       psdf_binary_writer *pbw );
7110
7111
7112 bool psdf_is_converting_image_to_RGB(const gx_device_psdf * pdev,
7113   const gs_imager_state * pis, const gs_pixel_image_t * pim);
7114
7115
7116
7117
7118
7119 int psdf_setup_image_filters(gx_device_psdf *pdev, psdf_binary_writer *pbw,
7120         gs_pixel_image_t *pim, const gs_matrix *pctm,
7121         const gs_imager_state * pis, bool lossless,
7122         bool in_line);
7123
7124
7125
7126
7127 int psdf_setup_lossless_filters(gx_device_psdf *pdev, psdf_binary_writer *pbw,
7128     gs_pixel_image_t *pim, bool in_line);
7129
7130
7131 int psdf_end_binary(psdf_binary_writer * pbw);
7132
7133
7134 int psdf_setup_compression_chooser(psdf_binary_writer *pbw,
7135        gx_device_psdf *pdev,
7136        int width, int height, int depth,
7137        int bits_per_sample);
7138
7139
7140 int psdf_setup_image_to_mask_filter(psdf_binary_writer *pbw, gx_device_psdf *pdev,
7141      int width, int height, int depth, int bits_per_sample, uint *MaskColor);
7142
7143
7144 int psdf_setup_image_colors_filter(psdf_binary_writer *pbw,
7145  gx_device_psdf *pdev, gs_pixel_image_t * pim,
7146  const gs_imager_state *pis);
7147 # 389 "./src/gdevpsdf.h"
7148 typedef struct psdf_set_color_commands_s {
7149     const char *setgray;
7150     const char *setrgbcolor;
7151     const char *setcmykcolor;
7152     const char *setcolorspace;
7153     const char *setcolor;
7154     const char *setcolorn;
7155 } psdf_set_color_commands_t;
7156
7157 extern const psdf_set_color_commands_t
7158     psdf_set_fill_color_commands, psdf_set_stroke_color_commands;
7159
7160
7161
7162
7163
7164 gx_color_index psdf_adjust_color_index(gx_device_vector *vdev,
7165            gx_color_index color);
7166
7167
7168 int psdf_set_color(gx_device_vector *vdev, const gx_drawing_color *pdc,
7169      const psdf_set_color_commands_t *ppscc);
7170
7171 double psdf_round(double v, int precision, int radix);
7172
7173
7174 int psdf_get_bits(gx_device *dev, int y, byte *data, byte **actual_data);
7175 int psdf_get_bits_rectangle(gx_device *dev, const gs_int_rect *prect, gs_get_bits_params_t *params, gs_int_rect **unread);
7176
7177
7178 int psdf_create_compositor(gx_device *dev, gx_device **pcdev, const gs_composite_t *pcte, gs_imager_state *pis, gs_memory_t *memory);
7179 # 28 "./src/gdevpdfx.h" 2
7180 # 1 "./src/gxdevmem.h" 1
7181 # 21 "./src/gxdevmem.h"
7182 # 1 "./src/gxrplane.h" 1
7183 # 30 "./src/gxrplane.h"
7184 typedef struct gx_render_plane_s {
7185     int depth;
7186     int shift;
7187     int index;
7188 } gx_render_plane_t;
7189 # 43 "./src/gxrplane.h"
7190 int gx_render_plane_init(gx_render_plane_t *render_plane,
7191     const gx_device *dev, int index);
7192 # 22 "./src/gxdevmem.h" 2
7193 # 76 "./src/gxdevmem.h"
7194 typedef struct gx_device_memory_s gx_device_memory;
7195
7196
7197 struct gx_device_memory_s {
7198     int params_size; const gx_device_procs *static_procs; const char *dname; gs_memory_t *memory; gs_memory_type_ptr_t stype; bool stype_is_dynamic; void (*finalize)(gx_device *); rc_header rc; bool retained; bool is_open; int max_fill_band; gx_device_color_info color_info; gx_device_cached_colors_t cached_colors; int width; int height; int TrayOrientation; float MediaSize[2]; float ImagingBBox[4]; bool ImagingBBox_set; float HWResolution[2]; float MarginsHWResolution[2]; float Margins[2]; float HWMargins[4]; long PageCount; long ShowpageCount; int NumCopies; bool NumCopies_set; bool IgnoreNumCopies; bool UseCIEColor; bool LockSafetyParams; gx_page_device_procs page_procs; gx_device_procs procs; gx_device *target;
7199
7200
7201
7202
7203     uint raster;
7204     byte *base;
7205
7206     gs_memory_t *bitmap_memory;
7207     bool foreign_bits;
7208     gs_memory_t *line_pointer_memory;
7209     bool foreign_line_pointers;
7210
7211
7212
7213
7214
7215     int num_planes;
7216     gx_render_plane_t planes[(8 * 8)];
7217
7218
7219
7220     gs_matrix initial_matrix;
7221     byte **line_ptrs;
7222
7223
7224     gs_const_string palette;
7225
7226     struct _c24 {
7227  gx_color_index rgb;
7228  bits32 rgbr, gbrg, brgb;
7229     } color24;
7230
7231     struct _c40 {
7232  gx_color_index abcde;
7233  bits32 abcd, bcde, cdea, deab, eabc;
7234     } color40;
7235
7236     struct _c48 {
7237  gx_color_index abcdef;
7238  bits32 abcd, cdef, efab;
7239     } color48;
7240
7241     struct _c56 {
7242  gx_color_index abcdefg;
7243  bits32 abcd, bcde, cdef, defg, efga, fgab, gabc;
7244     } color56;
7245
7246     struct _c64 {
7247  gx_color_index abcdefgh;
7248  bits32 abcd, efgh;
7249     } color64;
7250
7251
7252
7253     gs_log2_scale_point log2_scale;
7254     int log2_alpha_bits;
7255     int mapped_x;
7256     int mapped_y;
7257     int mapped_height;
7258     int mapped_start;
7259     gx_color_index save_color;
7260
7261     int plane_depth;
7262 };
7263
7264 extern const gs_memory_struct_type_t st_device_memory;
7265 # 180 "./src/gxdevmem.h"
7266 ulong gdev_mem_bits_size(const gx_device_memory *mdev, int width,
7267     int height);
7268
7269 ulong gdev_mem_line_ptrs_size(const gx_device_memory *mdev, int width,
7270          int height);
7271
7272 ulong gdev_mem_data_size(const gx_device_memory *mdev, int width,
7273     int height);
7274 # 196 "./src/gxdevmem.h"
7275 int gdev_mem_max_height(const gx_device_memory * dev, int width, ulong size,
7276   bool page_uses_transparency);
7277 # 207 "./src/gxdevmem.h"
7278 const gx_device_memory *gdev_mem_device_for_bits(int);
7279
7280
7281 const gx_device_memory *gdev_mem_word_device_for_bits(int);
7282
7283
7284
7285
7286
7287
7288
7289 void gs_make_mem_mono_device(gx_device_memory * mdev, gs_memory_t * mem,
7290         gx_device * target);
7291 void gs_make_mem_device(gx_device_memory * mdev,
7292    const gx_device_memory * mdproto,
7293    gs_memory_t * mem, int page_device,
7294    gx_device * target);
7295 void gs_make_mem_abuf_device(gx_device_memory * adev, gs_memory_t * mem,
7296         gx_device * target,
7297         const gs_log2_scale_point * pscale,
7298         int alpha_bits, int mapped_x);
7299 void gs_make_mem_alpha_device(gx_device_memory * adev, gs_memory_t * mem,
7300          gx_device * target, int alpha_bits);
7301
7302
7303
7304
7305
7306 int gdev_mem_open_scan_lines(gx_device_memory *mdev, int setup_height);
7307 # 250 "./src/gxdevmem.h"
7308 int gdev_mem_set_line_ptrs(gx_device_memory *mdev,
7309       byte *base, int raster, byte **line_ptrs,
7310       int setup_height);
7311
7312
7313 void gdev_mem_mono_set_inverted(gx_device_memory * mdev, bool black_is_1);
7314
7315
7316 bool gs_device_is_memory(const gx_device *);
7317
7318
7319 bool gs_device_is_abuf(const gx_device *);
7320 # 29 "./src/gdevpdfx.h" 2
7321
7322
7323
7324
7325
7326 typedef struct stream_arcfour_state_s stream_arcfour_state;
7327 # 60 "./src/gdevpdfx.h"
7328 typedef enum {
7329     PDF_IN_NONE,
7330     PDF_IN_STREAM,
7331     PDF_IN_TEXT,
7332     PDF_IN_STRING
7333 } pdf_context_t;
7334
7335
7336
7337
7338
7339
7340
7341 typedef struct cos_object_s cos_object_t;
7342 typedef struct cos_stream_s cos_stream_t;
7343 typedef struct cos_dict_s cos_dict_t;
7344 typedef struct cos_array_s cos_array_t;
7345 typedef struct cos_value_s cos_value_t;
7346 typedef struct cos_object_procs_s cos_object_procs_t;
7347 typedef const cos_object_procs_t *cos_type_t;
7348
7349
7350
7351
7352 typedef struct pdf_text_state_s pdf_text_state_t;
7353
7354
7355
7356
7357 typedef struct pdf_char_glyph_pairs_s pdf_char_glyph_pairs_t;
7358
7359
7360
7361
7362
7363 typedef enum {
7364
7365
7366
7367
7368     resourceColorSpace,
7369     resourceExtGState,
7370     resourcePattern,
7371     resourceShading,
7372     resourceXObject,
7373     resourceOther,
7374     resourceFont,
7375
7376
7377
7378     resourceCharProc,
7379     resourceCIDFont,
7380     resourceCMap,
7381     resourceFontDescriptor,
7382     resourceGroup,
7383     resourceSoftMaskDict,
7384     resourceFunction,
7385     resourcePage,
7386     NUM_RESOURCE_TYPES
7387 } pdf_resource_type_t;
7388 # 155 "./src/gdevpdfx.h"
7389 typedef struct pdf_resource_s pdf_resource_t;
7390 struct pdf_resource_s {
7391     pdf_resource_t *next; pdf_resource_t *prev; gs_id rid; bool named; bool global; char rname[1 + (sizeof(long) * 8 / 3 + 1) + 1 ]; ulong where_used; cos_object_t *object;
7392 };
7393
7394
7395 extern const gs_memory_struct_type_t st_pdf_resource;
7396 # 170 "./src/gdevpdfx.h"
7397 typedef struct pdf_x_object_s pdf_x_object_t;
7398 struct pdf_x_object_s {
7399     pdf_x_object_t *next; pdf_resource_t *prev; gs_id rid; bool named; bool global; char rname[1 + (sizeof(long) * 8 / 3 + 1) + 1 ]; ulong where_used; cos_object_t *object;
7400     int width, height;
7401     int data_height;
7402 };
7403
7404
7405
7406
7407
7408
7409 typedef enum {
7410     NoMarks = 0,
7411     ImageB = 1,
7412     ImageC = 2,
7413     ImageI = 4,
7414     Text = 8
7415 } pdf_procset_t;
7416
7417
7418
7419
7420 typedef struct pdf_char_proc_s pdf_char_proc_t;
7421 typedef struct pdf_char_proc_ownership_s pdf_char_proc_ownership_t;
7422 typedef struct pdf_font_s pdf_font_t;
7423 typedef struct pdf_text_data_s pdf_text_data_t;
7424
7425
7426
7427
7428 typedef struct pdf_outline_node_s {
7429     long id, parent_id, prev_id, first_id, last_id;
7430     int count;
7431     cos_dict_t *action;
7432 } pdf_outline_node_t;
7433 typedef struct pdf_outline_level_s {
7434     pdf_outline_node_t first;
7435     pdf_outline_node_t last;
7436     int left;
7437 } pdf_outline_level_t;
7438
7439
7440
7441
7442
7443
7444 typedef struct pdf_bead_s {
7445     long id, article_id, prev_id, next_id, page_id;
7446     gs_rect rect;
7447 } pdf_bead_t;
7448 typedef struct pdf_article_s pdf_article_t;
7449 struct pdf_article_s {
7450     pdf_article_t *next;
7451     cos_dict_t *contents;
7452     pdf_bead_t first;
7453     pdf_bead_t last;
7454 };
7455 # 238 "./src/gdevpdfx.h"
7456 typedef struct pdf_resource_list_s {
7457     pdf_resource_t *chains[16];
7458 } pdf_resource_list_t;
7459 # 249 "./src/gdevpdfx.h"
7460 typedef struct pdf_stream_position_s {
7461     long length_id;
7462     long start_pos;
7463 } pdf_stream_position_t;
7464
7465
7466
7467
7468
7469
7470 typedef struct pdf_text_rotation_s {
7471     long counts[5];
7472     int Rotate;
7473 } pdf_text_rotation_t;
7474
7475
7476
7477
7478
7479 typedef struct pdf_page_dsc_info_s {
7480     int orientation;
7481     int viewing_orientation;
7482     gs_rect bounding_box;
7483 } pdf_page_dsc_info_t;
7484
7485
7486
7487
7488
7489
7490 typedef struct pdf_page_s {
7491     cos_dict_t *Page;
7492     gs_point MediaBox;
7493     pdf_procset_t procsets;
7494     long contents_id;
7495     long resource_ids[resourceFont + 1];
7496     long group_id;
7497     cos_array_t *Annots;
7498     pdf_text_rotation_t text_rotation;
7499     pdf_page_dsc_info_t dsc_info;
7500     bool NumCopies_set;
7501     int NumCopies;
7502 } pdf_page_t;
7503 # 300 "./src/gdevpdfx.h"
7504 typedef struct pdf_temp_file_s {
7505     char file_name[260];
7506     FILE *file;
7507     stream *strm;
7508     byte *strm_buf;
7509     stream *save_strm;
7510 } pdf_temp_file_t;
7511
7512
7513
7514 typedef struct gx_device_pdf_s gx_device_pdf;
7515
7516
7517
7518
7519
7520 typedef struct pdf_font_cache_elem_s pdf_font_cache_elem_t;
7521 struct pdf_font_cache_elem_s {
7522     pdf_font_cache_elem_t *next;
7523     gs_id font_id;
7524     int num_chars;
7525     int num_widths;
7526     struct pdf_font_resource_s *pdfont;
7527     byte *glyph_usage;
7528     double *real_widths;
7529     gx_device_pdf *pdev;
7530 };
7531 # 339 "./src/gdevpdfx.h"
7532 typedef struct pdf_viewer_state_s {
7533     int transfer_not_identity;
7534     gs_id transfer_ids[4];
7535     float opacity_alpha;
7536     float shape_alpha;
7537     gs_blend_mode_t blend_mode;
7538     gs_id halftone_id;
7539     gs_id black_generation_id;
7540     gs_id undercolor_removal_id;
7541     int overprint_mode;
7542     float smoothness;
7543     float flatness;
7544     bool text_knockout;
7545     bool fill_overprint;
7546     bool stroke_overprint;
7547     bool stroke_adjust;
7548     bool fill_used_process_color;
7549     bool stroke_used_process_color;
7550     gx_hl_saved_color saved_fill_color;
7551     gx_hl_saved_color saved_stroke_color;
7552     gx_line_params line_params;
7553     float dash_pattern[11];
7554     gs_id soft_mask_id;
7555 } pdf_viewer_state;
7556
7557
7558
7559
7560
7561 typedef struct pdf_substream_save_s {
7562     pdf_context_t context;
7563     pdf_text_state_t *text_state;
7564     gx_path *clip_path;
7565     gs_id clip_path_id;
7566     int vgstack_bottom;
7567     stream *strm;
7568     cos_dict_t *substream_Resources;
7569     pdf_procset_t procsets;
7570     bool skip_colors;
7571     pdf_resource_t *font3;
7572     pdf_resource_t *accumulating_substream_resource;
7573     bool charproc_just_accumulated;
7574     bool accumulating_a_global_object;
7575     pdf_resource_t *pres_soft_mask_dict;
7576     gs_const_string objname;
7577 } pdf_substream_save;
7578 # 396 "./src/gdevpdfx.h"
7579 typedef enum {
7580     pdf_compress_none,
7581     pdf_compress_LZW,
7582     pdf_compress_Flate
7583 } pdf_compression_type;
7584
7585
7586
7587 struct gx_device_pdf_s {
7588     int params_size; const gx_device_procs *static_procs; const char *dname; gs_memory_t *memory; gs_memory_type_ptr_t stype; bool stype_is_dynamic; void (*finalize)(gx_device *); rc_header rc; bool retained; bool is_open; int max_fill_band; gx_device_color_info color_info; gx_device_cached_colors_t cached_colors; int width; int height; int TrayOrientation; float MediaSize[2]; float ImagingBBox[4]; bool ImagingBBox_set; float HWResolution[2]; float MarginsHWResolution[2]; float Margins[2]; float HWMargins[4]; long PageCount; long ShowpageCount; int NumCopies; bool NumCopies_set; bool IgnoreNumCopies; bool UseCIEColor; bool LockSafetyParams; gx_page_device_procs page_procs; gx_device_procs procs; gs_memory_t *v_memory; const gx_device_vector_procs *vec_procs; char fname[(260 - 1) + 1]; FILE *file; stream *strm; byte *strmbuf; uint strmbuf_size; int open_options; gs_imager_state state; float dash_pattern[11]; bool fill_used_process_color; bool stroke_used_process_color; gx_hl_saved_color saved_fill_color; gx_hl_saved_color saved_stroke_color; gs_id no_clip_path_id; gs_id clip_path_id; gx_path_type_t fill_options, stroke_options; gs_point scale; bool in_page; gx_device_bbox *bbox_device; gx_color_index black, white; psdf_version version; bool binary_ok; bool HaveCFF; bool HaveTrueTypes; bool HaveCIDSystem; double ParamCompatibilityLevel; psdf_distiller_params params;
7589
7590     double CompatibilityLevel;
7591     int EndPage;
7592     int StartPage;
7593     bool Optimize;
7594     bool ParseDSCCommentsForDocInfo;
7595     bool ParseDSCComments;
7596     bool EmitDSCWarnings;
7597     bool CreateJobTicket;
7598     bool PreserveEPSInfo;
7599     bool AutoPositionEPSFiles;
7600     bool PreserveCopyPage;
7601     bool UsePrologue;
7602     int OffOptimizations;
7603
7604
7605     gs_param_float_array PDFXTrimBoxToMediaBoxOffset;
7606     gs_param_float_array PDFXBleedBoxToTrimBoxOffset;
7607     bool PDFXSetBleedBoxToMediaBox;
7608
7609     bool ReAssignCharacters;
7610     bool ReEncodeCharacters;
7611     long FirstObjectNumber;
7612     bool CompressFonts;
7613     bool PrintStatistics;
7614     gs_param_string DocumentUUID;
7615     gs_param_string InstanceUUID;
7616     int DocumentTimeSeq;
7617     bool ForOPDFRead;
7618     gs_param_string OPDFReadProcsetPath;
7619     bool CompressEntireFile;
7620     bool ResourcesBeforeUsage;
7621     bool HavePDFWidths;
7622     bool HaveStrokeColor;
7623     bool HaveTransparency;
7624     bool PatternImagemask;
7625
7626     bool PDFX;
7627     bool PDFA;
7628     long MaxClipPathSize;
7629
7630     long MaxViewerMemorySize;
7631     long MaxShadingBitmapSize;
7632
7633
7634     long MaxInlineImageSize;
7635
7636     gs_param_string OwnerPassword;
7637     gs_param_string UserPassword;
7638     uint KeyLength;
7639     uint Permissions;
7640     uint EncryptionR;
7641     gs_param_string NoEncrypt;
7642     bool EncryptMetadata;
7643
7644     bool ComputeDocumentDigest;
7645
7646     byte EncryptionO[32];
7647     byte EncryptionU[32];
7648     byte EncryptionKey[16];
7649     uint EncryptionV;
7650
7651     bool is_EPS;
7652     pdf_page_dsc_info_t doc_dsc_info;
7653     pdf_page_dsc_info_t page_dsc_info;
7654
7655     bool fill_overprint, stroke_overprint;
7656     int overprint_mode;
7657     gs_id halftone_id;
7658     gs_id transfer_ids[4];
7659     int transfer_not_identity;
7660     gs_id black_generation_id, undercolor_removal_id;
7661
7662     pdf_compression_type compression;
7663     pdf_compression_type compression_at_page_start;
7664 # 490 "./src/gdevpdfx.h"
7665     pdf_temp_file_t xref;
7666
7667
7668
7669
7670     pdf_temp_file_t asides;
7671
7672
7673
7674
7675
7676
7677
7678     pdf_temp_file_t streams;
7679
7680
7681
7682
7683
7684     pdf_temp_file_t pictures;
7685
7686     long next_id;
7687
7688
7689     cos_dict_t *Catalog;
7690     cos_dict_t *Info;
7691     cos_dict_t *Pages;
7692
7693     long outlines_id;
7694     int next_page;
7695     int max_referred_page;
7696     long contents_id;
7697     pdf_context_t context;
7698     long contents_length_id;
7699     long contents_pos;
7700     pdf_procset_t procsets;
7701     pdf_text_data_t *text;
7702     pdf_text_rotation_t text_rotation;
7703
7704     pdf_page_t *pages;
7705     int num_pages;
7706     ulong used_mask;
7707     pdf_resource_list_t resources[NUM_RESOURCE_TYPES];
7708
7709     pdf_resource_t *cs_Patterns[5];
7710     pdf_resource_t *Identity_ToUnicode_CMaps[2];
7711     pdf_resource_t *last_resource;
7712     pdf_outline_level_t outline_levels[32];
7713     int outline_depth;
7714     int closed_outline_depth;
7715     int outlines_open;
7716     pdf_article_t *articles;
7717     cos_dict_t *Dests;
7718     byte fileID[16];
7719
7720     long uuid_time[2];
7721
7722
7723
7724
7725
7726     cos_dict_t *global_named_objects;
7727
7728
7729
7730     cos_dict_t *local_named_objects;
7731
7732
7733
7734
7735
7736     cos_array_t *NI_stack;
7737
7738
7739
7740
7741
7742
7743     cos_array_t *Namespace_stack;
7744     pdf_font_cache_elem_t *font_cache;
7745
7746
7747
7748
7749     gs_point char_width;
7750
7751
7752
7753
7754     gx_path *clip_path;
7755
7756
7757
7758     cos_array_t *PageLabels;
7759     int PageLabels_current_page;
7760     cos_dict_t *PageLabels_current_label;
7761 # 594 "./src/gdevpdfx.h"
7762     gs_text_enum_t *pte;
7763
7764
7765
7766
7767
7768     pdf_viewer_state vgstack[11];
7769     int vgstack_depth;
7770     int vgstack_bottom;
7771     pdf_viewer_state vg_initial;
7772     bool vg_initial_set;
7773
7774
7775     int sbstack_size;
7776     int sbstack_depth;
7777     pdf_substream_save *sbstack;
7778
7779
7780     cos_dict_t *substream_Resources;
7781     gs_color_space_index pcm_color_info_index;
7782     bool skip_colors;
7783     bool AR4_save_bug;
7784     pdf_resource_t *font3;
7785     pdf_resource_t *accumulating_substream_resource;
7786     gs_matrix_fixed charproc_ctm;
7787     bool charproc_just_accumulated;
7788
7789
7790     bool accumulating_a_global_object;
7791
7792
7793
7794
7795     const pdf_char_glyph_pairs_t *cgp;
7796
7797
7798
7799     int substituted_pattern_count;
7800     int substituted_pattern_drop_page;
7801
7802
7803
7804
7805     gs_id image_mask_id;
7806     bool image_mask_is_SMask;
7807     bool image_mask_skip;
7808     gs_matrix converting_image_matrix;
7809     double image_mask_scale;
7810
7811     pdf_resource_t *pres_soft_mask_dict;
7812
7813     gs_const_string objname;
7814     int OPDFRead_procset_length;
7815     void *find_resource_param;
7816 };
7817 # 695 "./src/gdevpdfx.h"
7818 int gdev_pdf_copy_mono(gx_device *dev, const byte *data, int data_x, int raster, gx_bitmap_id id, int x, int y, int width, int height, gx_color_index color0, gx_color_index color1);
7819 int gdev_pdf_copy_color(gx_device *dev, const byte *data, int data_x, int raster, gx_bitmap_id id, int x, int y, int width, int height);
7820 int gdev_pdf_fill_mask(gx_device *dev, const byte *data, int data_x, int raster, gx_bitmap_id id, int x, int y, int width, int height, const gx_drawing_color *pdcolor, int depth, gs_logical_operation_t lop, const gx_clip_path *pcpath);
7821 int gdev_pdf_strip_tile_rectangle(gx_device *dev, const gx_strip_bitmap *tiles, int x, int y, int width, int height, gx_color_index color0, gx_color_index color1, int phase_x, int phase_y);
7822
7823 extern const gx_device_vector_procs pdf_vector_procs;
7824 int gdev_pdf_fill_rectangle(gx_device *dev, int x, int y, int width, int height, gx_color_index color);
7825 int gdev_pdf_fill_path(gx_device *dev, const gs_imager_state *pis, gx_path *ppath, const gx_fill_params *params, const gx_drawing_color *pdcolor, const gx_clip_path *pcpath);
7826 int gdev_pdf_stroke_path(gx_device *dev, const gs_imager_state *pis, gx_path *ppath, const gx_stroke_params *params, const gx_drawing_color *pdcolor, const gx_clip_path *pcpath);
7827
7828 int gdev_pdf_begin_typed_image(gx_device *dev, const gs_imager_state *pis, const gs_matrix *pmat, const gs_image_common_t *pim, const gs_int_rect *prect, const gx_drawing_color *pdcolor, const gx_clip_path *pcpath, gs_memory_t *memory, gx_image_enum_common_t **pinfo);
7829
7830 int gdev_pdf_get_params(gx_device *dev, gs_param_list *plist);
7831 int gdev_pdf_put_params(gx_device *dev, gs_param_list *plist);
7832
7833 int gdev_pdf_text_begin(gx_device *dev, gs_imager_state *pis, const gs_text_params_t *text, gs_font *font, gx_path *path, const gx_device_color *pdcolor, const gx_clip_path *pcpath, gs_memory_t *memory, gs_text_enum_t **ppte);
7834 int gdev_pdf_pattern_manage(gx_device *pdev, gx_bitmap_id id, gs_pattern1_instance_t *pinst, pattern_manage_t function);
7835 int gdev_pdf_fill_rectangle_hl_color(gx_device *dev, const gs_fixed_rect *rect, const gs_imager_state *pis, const gx_drawing_color *pdcolor, const gx_clip_path *pcpath);
7836
7837 int gdev_pdf_include_color_space(gx_device *dev, gs_color_space *cspace, const byte *res_name, int name_length);
7838
7839 int gdev_pdf_create_compositor(gx_device *dev, gx_device **pcdev, const gs_composite_t *pcte, gs_imager_state *pis, gs_memory_t *memory);
7840 int gdev_pdf_begin_transparency_group(gx_device *dev, const gs_transparency_group_params_t *ptgp, const gs_rect *pbbox, gs_imager_state *pis, gs_transparency_state_t **ppts, gs_memory_t *mem);
7841 int gdev_pdf_end_transparency_group(gx_device *dev, gs_imager_state *pis, gs_transparency_state_t **ppts);
7842 int gdev_pdf_begin_transparency_mask(gx_device *dev, const gx_transparency_mask_params_t *ptmp, const gs_rect *pbbox, gs_imager_state *pis, gs_transparency_state_t **ppts, gs_memory_t *mem);
7843 int gdev_pdf_end_transparency_mask(gx_device *dev, gs_transparency_mask_t **pptm);
7844 int gdev_pdf_discard_transparency_layer(gx_device *dev, gs_transparency_state_t **ppts);
7845
7846
7847
7848
7849
7850
7851 void pdf_initialize_ids(gx_device_pdf * pdev);
7852
7853
7854 void pdf_set_process_color_model(gx_device_pdf * pdev, int index);
7855
7856
7857 void pdf_reset_text(gx_device_pdf *pdev);
7858
7859
7860
7861
7862
7863
7864 int pdf_open_document(gx_device_pdf * pdev);
7865
7866
7867
7868
7869 long pdf_obj_ref(gx_device_pdf * pdev);
7870
7871
7872 long pdf_stell(gx_device_pdf * pdev);
7873
7874
7875 long pdf_open_obj(gx_device_pdf * pdev, long id);
7876 long pdf_begin_obj(gx_device_pdf * pdev);
7877
7878
7879 int pdf_end_obj(gx_device_pdf * pdev);
7880
7881
7882
7883
7884
7885 int pdf_open_contents(gx_device_pdf * pdev, pdf_context_t context);
7886
7887
7888 int pdf_close_contents(gx_device_pdf * pdev, bool last);
7889
7890
7891
7892 extern const char *const pdf_resource_type_names[];
7893 extern const gs_memory_struct_type_t *const pdf_resource_type_structs[];
7894 # 781 "./src/gdevpdfx.h"
7895 long pdf_open_separate(gx_device_pdf * pdev, long id);
7896 long pdf_begin_separate(gx_device_pdf * pdev);
7897
7898
7899 void pdf_reserve_object_id(gx_device_pdf * pdev, pdf_resource_t *ppres, long id);
7900
7901
7902 int pdf_alloc_aside(gx_device_pdf * pdev, pdf_resource_t ** plist,
7903   const gs_memory_struct_type_t * pst, pdf_resource_t **ppres,
7904   long id);
7905
7906 int pdf_begin_aside(gx_device_pdf * pdev, pdf_resource_t **plist,
7907       const gs_memory_struct_type_t * pst,
7908       pdf_resource_t **ppres);
7909
7910
7911 int pdf_begin_resource(gx_device_pdf * pdev, pdf_resource_type_t rtype,
7912          gs_id rid, pdf_resource_t **ppres);
7913
7914
7915 int pdf_begin_resource_body(gx_device_pdf * pdev, pdf_resource_type_t rtype,
7916        gs_id rid, pdf_resource_t **ppres);
7917
7918
7919 int pdf_alloc_resource(gx_device_pdf * pdev, pdf_resource_type_t rtype,
7920          gs_id rid, pdf_resource_t **ppres, long id);
7921
7922
7923 int pdf_find_same_resource(gx_device_pdf * pdev,
7924  pdf_resource_type_t rtype, pdf_resource_t **ppres,
7925  int (*eq)(gx_device_pdf * pdev, pdf_resource_t *pres0, pdf_resource_t *pres1));
7926
7927
7928
7929 pdf_resource_t *pdf_find_resource_by_resource_id(gx_device_pdf * pdev,
7930       pdf_resource_type_t rtype, gs_id id);
7931
7932
7933 pdf_resource_t *pdf_find_resource_by_gs_id(gx_device_pdf * pdev,
7934         pdf_resource_type_t rtype,
7935         gs_id rid);
7936
7937 void pdf_drop_resources(gx_device_pdf * pdev, pdf_resource_type_t rtype,
7938  int (*cond)(gx_device_pdf * pdev, pdf_resource_t *pres));
7939
7940
7941 void pdf_print_resource_statistics(gx_device_pdf * pdev);
7942
7943
7944
7945 int pdf_cancel_resource(gx_device_pdf * pdev, pdf_resource_t *pres,
7946  pdf_resource_type_t rtype);
7947
7948
7949 void pdf_forget_resource(gx_device_pdf * pdev, pdf_resource_t *pres1,
7950  pdf_resource_type_t rtype);
7951
7952
7953 int pdf_substitute_resource(gx_device_pdf *pdev, pdf_resource_t **ppres,
7954      pdf_resource_type_t rtype,
7955      int (*eq)(gx_device_pdf *pdev, pdf_resource_t *pres0, pdf_resource_t *pres1),
7956      bool write);
7957
7958
7959 long pdf_resource_id(const pdf_resource_t *pres);
7960
7961
7962 int pdf_end_separate(gx_device_pdf * pdev);
7963
7964
7965 int pdf_end_aside(gx_device_pdf * pdev);
7966
7967
7968 int pdf_end_resource(gx_device_pdf * pdev);
7969
7970
7971
7972
7973 int pdf_write_resource_objects(gx_device_pdf *pdev, pdf_resource_type_t rtype);
7974
7975
7976
7977
7978
7979
7980 void pdf_reverse_resource_chain(gx_device_pdf *pdev, pdf_resource_type_t rtype);
7981
7982
7983
7984
7985 int pdf_free_resource_objects(gx_device_pdf *pdev, pdf_resource_type_t rtype);
7986
7987
7988
7989 int pdf_write_and_free_all_resource_objects(gx_device_pdf *pdev);
7990
7991
7992
7993
7994
7995 int pdf_store_page_resources(gx_device_pdf *pdev, pdf_page_t *page);
7996
7997
7998 void pdf_copy_data(stream *s, FILE *file, long count, stream_arcfour_state *ss);
7999 void pdf_copy_data_safe(stream *s, FILE *file, long position, long count);
8000
8001
8002 int pdf_begin_encrypt(gx_device_pdf * pdev, stream **s, gs_id object_id);
8003
8004 void pdf_end_encrypt(gx_device_pdf * pdev);
8005
8006 int pdf_encrypt_init(const gx_device_pdf * pdev, gs_id object_id, stream_arcfour_state *psarc4);
8007
8008
8009
8010
8011
8012
8013 long pdf_page_id(gx_device_pdf * pdev, int page_num);
8014
8015
8016 pdf_page_t *pdf_current_page(gx_device_pdf *pdev);
8017
8018
8019 cos_dict_t *pdf_current_page_dict(gx_device_pdf *pdev);
8020
8021
8022 int pdf_open_page(gx_device_pdf * pdev, pdf_context_t context);
8023
8024
8025 int pdf_unclip(gx_device_pdf * pdev);
8026
8027
8028 int pdf_write_saved_string(gx_device_pdf * pdev, gs_string * pstr);
8029
8030
8031
8032
8033 int pdf_remember_clip_path(gx_device_pdf * pdev, const gx_clip_path * pcpath);
8034
8035
8036 bool pdf_must_put_clip_path(gx_device_pdf * pdev, const gx_clip_path * pcpath);
8037
8038
8039 int pdf_put_clip_path(gx_device_pdf * pdev, const gx_clip_path * pcpath);
8040
8041
8042
8043 typedef struct pdf_lcvd_s {
8044     gx_device_memory mdev;
8045     gx_device_memory *mask;
8046     gx_device_pdf *pdev;
8047     int (*std_fill_rectangle)(gx_device *dev, int x, int y, int width, int height, gx_color_index color);
8048     int (*std_close_device)(gx_device *dev);
8049     bool mask_is_empty;
8050     bool path_is_empty;
8051     bool mask_is_clean;
8052     bool write_matrix;
8053     bool has_background;
8054     gs_matrix m;
8055     gs_point path_offset;
8056 } pdf_lcvd_t;
8057 # 951 "./src/gdevpdfx.h"
8058 int pdf_setup_masked_image_converter(gx_device_pdf *pdev, gs_memory_t *mem, const gs_matrix *m, pdf_lcvd_t **pcvd,
8059      bool need_mask, int x, int y, int w, int h, bool write_on_close);
8060 int pdf_dump_converted_image(gx_device_pdf *pdev, pdf_lcvd_t *cvd);
8061 void pdf_remove_masked_image_converter(gx_device_pdf *pdev, pdf_lcvd_t *cvd, bool need_mask);
8062
8063
8064
8065
8066
8067
8068 void pdf_store_default_Producer(char buf[200]);
8069
8070
8071 typedef struct pdf_filter_names_s {
8072     const char *ASCII85Decode;
8073     const char *ASCIIHexDecode;
8074     const char *CCITTFaxDecode;
8075     const char *DCTDecode;
8076     const char *DecodeParms;
8077     const char *Filter;
8078     const char *FlateDecode;
8079     const char *LZWDecode;
8080     const char *RunLengthDecode;
8081     const char *JBIG2Decode;
8082     const char *JPXDecode;
8083 } pdf_filter_names_t;
8084 # 985 "./src/gdevpdfx.h"
8085 void pdf_put_matrix(gx_device_pdf *pdev, const char *before,
8086       const gs_matrix *pmat, const char *after);
8087
8088
8089 typedef int (*pdf_put_name_chars_proc_t)(stream *, const byte *, uint);
8090 pdf_put_name_chars_proc_t
8091     pdf_put_name_chars_proc(const gx_device_pdf *pdev);
8092 int pdf_put_name_chars(const gx_device_pdf *pdev, const byte *nstr,
8093    uint size);
8094 int pdf_put_name(const gx_device_pdf *pdev, const byte *nstr, uint size);
8095
8096
8097 int pdf_put_string(const gx_device_pdf *pdev, const byte *str, uint size);
8098
8099
8100 int pdf_write_value(const gx_device_pdf *pdev, const byte *vstr, uint size, gs_id object_id);
8101
8102
8103 int pdf_put_filters(cos_dict_t *pcd, gx_device_pdf *pdev, stream *s,
8104       const pdf_filter_names_t *pfn);
8105
8106
8107 typedef struct pdf_data_writer_s {
8108     psdf_binary_writer binary;
8109     long start;
8110     long length_pos;
8111     pdf_resource_t *pres;
8112     gx_device_pdf *pdev;
8113     long length_id;
8114     bool encrypted;
8115 } pdf_data_writer_t;
8116 # 1025 "./src/gdevpdfx.h"
8117 int pdf_begin_data_stream(gx_device_pdf *pdev, pdf_data_writer_t *pdw,
8118      int options, gs_id object_id);
8119 int pdf_append_data_stream_filters(gx_device_pdf *pdev, pdf_data_writer_t *pdw,
8120         int orig_options, gs_id object_id);
8121
8122 int pdf_begin_data(gx_device_pdf *pdev, pdf_data_writer_t *pdw);
8123
8124
8125 int pdf_end_data(pdf_data_writer_t *pdw);
8126 # 1051 "./src/gdevpdfx.h"
8127 int pdf_function(gx_device_pdf *pdev, const gs_function_t *pfn,
8128    cos_value_t *pvalue);
8129 int pdf_function_scaled(gx_device_pdf *pdev, const gs_function_t *pfn,
8130    const gs_range_t *pranges, cos_value_t *pvalue);
8131
8132
8133 int pdf_write_function(gx_device_pdf *pdev, const gs_function_t *pfn,
8134          long *pid);
8135
8136
8137
8138
8139 int pdf_write_font_bbox(gx_device_pdf *pdev, const gs_int_rect *pbox);
8140 # 1076 "./src/gdevpdfx.h"
8141 bool pdf_key_eq(const gs_param_string * pcs, const char *str);
8142
8143
8144 int pdfmark_scan_int(const gs_param_string * pstr, int *pvalue);
8145
8146
8147 int pdfmark_process(gx_device_pdf * pdev, const gs_param_string_array * pma);
8148
8149
8150 int pdfmark_close_outline(gx_device_pdf * pdev);
8151
8152
8153 int pdfmark_end_pagelabels(gx_device_pdf * pdev);
8154
8155
8156 int pdfmark_write_article(gx_device_pdf * pdev, const pdf_article_t * part);
8157
8158
8159
8160
8161 bool pdf_objname_is_valid(const byte *data, uint size);
8162
8163
8164
8165
8166
8167 int pdf_find_named(gx_device_pdf * pdev, const gs_param_string * pname,
8168      cos_object_t **ppco);
8169
8170
8171
8172
8173
8174 int pdf_create_named(gx_device_pdf *pdev, const gs_param_string *pname,
8175        cos_type_t cotype, cos_object_t **ppco, long id);
8176 int pdf_create_named_dict(gx_device_pdf *pdev, const gs_param_string *pname,
8177      cos_dict_t **ppcd, long id);
8178
8179
8180
8181
8182
8183
8184
8185 int pdf_refer_named(gx_device_pdf *pdev, const gs_param_string *pname,
8186       cos_object_t **ppco);
8187 # 1130 "./src/gdevpdfx.h"
8188 int pdf_make_named(gx_device_pdf * pdev, const gs_param_string * pname,
8189      cos_type_t cotype, cos_object_t **ppco, bool assign_id);
8190 int pdf_make_named_dict(gx_device_pdf * pdev, const gs_param_string * pname,
8191    cos_dict_t **ppcd, bool assign_id);
8192
8193
8194
8195
8196
8197
8198 int pdf_get_named(gx_device_pdf * pdev, const gs_param_string * pname,
8199     cos_type_t cotype, cos_object_t **ppco);
8200
8201
8202
8203
8204
8205 int pdf_push_namespace(gx_device_pdf *pdev);
8206
8207
8208
8209
8210
8211 int pdf_pop_namespace(gx_device_pdf *pdev);
8212
8213
8214
8215
8216
8217
8218
8219 int pdf_scan_token(const byte **pscan, const byte * end, const byte **ptoken);
8220
8221
8222
8223
8224
8225 int pdf_scan_token_composite(const byte **pscan, const byte * end,
8226         const byte **ptoken);
8227
8228
8229 int pdf_replace_names(gx_device_pdf *pdev, const gs_param_string *from,
8230         gs_param_string *to);
8231 # 1184 "./src/gdevpdfx.h"
8232 int pdf_close_text_document(gx_device_pdf *pdev);
8233
8234
8235
8236
8237
8238 pdf_text_data_t *pdf_text_data_alloc(gs_memory_t *mem);
8239 void pdf_set_text_state_default(pdf_text_state_t *pts);
8240 void pdf_text_state_copy(pdf_text_state_t *pts_to, pdf_text_state_t *pts_from);
8241 void pdf_reset_text_page(pdf_text_data_t *ptd);
8242 void pdf_reset_text_state(pdf_text_data_t *ptd);
8243 void pdf_close_text_page(gx_device_pdf *pdev);
8244 int pdf_get_stoted_text_size(pdf_text_state_t *state);
8245
8246
8247
8248 int pdf_char_image_y_offset(const gx_device_pdf *pdev, int x, int y, int h);
8249
8250
8251 int pdf_begin_char_proc(gx_device_pdf * pdev, int w, int h, int x_width,
8252    int y_offset, gs_id id, pdf_char_proc_t **ppcp,
8253    pdf_stream_position_t * ppos);
8254
8255
8256 int pdf_end_char_proc(gx_device_pdf * pdev, pdf_stream_position_t * ppos);
8257
8258
8259 int pdf_do_char_image(gx_device_pdf * pdev, const pdf_char_proc_t * pcp,
8260         const gs_matrix * pimat);
8261
8262
8263 int pdf_start_charproc_accum(gx_device_pdf *pdev);
8264
8265 int pdf_set_charproc_attrs(gx_device_pdf *pdev, gs_font *font, const double *pw, int narg,
8266   gs_text_cache_control_t control, gs_char ch);
8267
8268 int pdf_end_charproc_accum(gx_device_pdf *pdev, gs_font *font, const pdf_char_glyph_pairs_t *cgp,
8269          gs_glyph glyph, gs_char output_char_code, const gs_const_string *gnstr);
8270
8271 int pdf_open_aside(gx_device_pdf *pdev, pdf_resource_type_t rtype,
8272  gs_id id, pdf_resource_t **ppres, bool reserve_object_id, int options);
8273
8274
8275 int pdf_close_aside(gx_device_pdf *pdev);
8276
8277
8278 int pdf_enter_substream(gx_device_pdf *pdev, pdf_resource_type_t rtype,
8279   gs_id id, pdf_resource_t **ppres, bool reserve_object_id, bool compress);
8280
8281
8282 int pdf_exit_substream(gx_device_pdf *pdev);
8283
8284 int pdf_add_procsets(cos_dict_t *pcd, pdf_procset_t procsets);
8285
8286 int pdf_add_resource(gx_device_pdf *pdev, cos_dict_t *pcd, const char *key, pdf_resource_t *pres);
8287
8288
8289
8290
8291 int pdf_from_stream_to_text(gx_device_pdf *pdev);
8292 int pdf_from_string_to_text(gx_device_pdf *pdev);
8293 void pdf_close_text_contents(gx_device_pdf *pdev);
8294 # 24 "./src/gdevpdfe.c" 2
8295 # 1 "./src/gdevpdfg.h" 1
8296 # 24 "./src/gdevpdfg.h"
8297 typedef struct pdf_base_font_s pdf_base_font_t;
8298 # 35 "./src/gdevpdfg.h"
8299 typedef struct pdf_color_space_names_s {
8300     const char *DeviceCMYK;
8301     const char *DeviceGray;
8302     const char *DeviceRGB;
8303     const char *Indexed;
8304 } pdf_color_space_names_t;
8305
8306
8307
8308
8309 extern const pdf_color_space_names_t
8310     pdf_color_space_names,
8311     pdf_color_space_names_short;
8312 # 59 "./src/gdevpdfg.h"
8313 typedef struct pdf_color_space_s pdf_color_space_t;
8314 struct pdf_color_space_s {
8315     pdf_color_space_t *next; pdf_resource_t *prev; gs_id rid; bool named; bool global; char rname[1 + (sizeof(long) * 8 / 3 + 1) + 1 ]; ulong where_used; cos_object_t *object;
8316     const gs_range_t *ranges;
8317     uint serialized_size;
8318     byte *serialized;
8319 };
8320 # 76 "./src/gdevpdfg.h"
8321 int pdf_cspace_init_Device(const gs_memory_t *mem, gs_color_space *pcs, int num_components);
8322 # 90 "./src/gdevpdfg.h"
8323 int pdf_color_space(gx_device_pdf *pdev, cos_value_t *pvalue,
8324       const gs_range_t **ppranges,
8325       const gs_color_space *pcs,
8326       const pdf_color_space_names_t *pcsn,
8327       bool by_name);
8328 int pdf_color_space_named(gx_device_pdf *pdev, cos_value_t *pvalue,
8329       const gs_range_t **ppranges,
8330       const gs_color_space *pcs,
8331       const pdf_color_space_names_t *pcsn,
8332       bool by_name, const byte *res_name, int name_length);
8333
8334
8335 int pdf_cs_Pattern_colored(gx_device_pdf *pdev, cos_value_t *pvalue);
8336 int pdf_cs_Pattern_uncolored(gx_device_pdf *pdev, cos_value_t *pvalue);
8337 int pdf_cs_Pattern_uncolored_hl(gx_device_pdf *pdev,
8338  const gs_color_space *pcs, cos_value_t *pvalue);
8339
8340
8341 void pdf_color_space_procsets(gx_device_pdf *pdev,
8342          const gs_color_space *pcs);
8343
8344
8345
8346
8347 void pdf_viewer_state_from_imager_state(gx_device_pdf * pdev,
8348  const gs_imager_state *pis, const gx_device_color *pdevc);
8349
8350
8351 void pdf_prepare_initial_viewer_state(gx_device_pdf * pdev, const gs_imager_state *pis);
8352
8353
8354 void pdf_reset_graphics(gx_device_pdf *pdev);
8355
8356
8357 void pdf_set_initial_color(gx_device_pdf * pdev, gx_hl_saved_color *saved_fill_color,
8358       gx_hl_saved_color *saved_stroke_color,
8359       bool *fill_used_process_color, bool *stroke_used_process_color);
8360
8361
8362
8363 int pdf_set_pure_color(gx_device_pdf * pdev, gx_color_index color,
8364      gx_hl_saved_color * psc,
8365          bool *used_process_color,
8366      const psdf_set_color_commands_t *ppscc);
8367 int pdf_set_drawing_color(gx_device_pdf * pdev, const gs_imager_state * pis,
8368         const gx_drawing_color *pdc,
8369         gx_hl_saved_color * psc,
8370         bool *used_process_color,
8371         const psdf_set_color_commands_t *ppscc);
8372
8373
8374
8375
8376 int pdf_try_prepare_fill(gx_device_pdf *pdev, const gs_imager_state *pis);
8377 int pdf_prepare_drawing(gx_device_pdf *pdev, const gs_imager_state *pis, pdf_resource_t **ppres);
8378 int pdf_prepare_fill(gx_device_pdf *pdev, const gs_imager_state *pis);
8379 int pdf_prepare_stroke(gx_device_pdf *pdev, const gs_imager_state *pis);
8380 int pdf_prepare_image(gx_device_pdf *pdev, const gs_imager_state *pis);
8381 int pdf_prepare_imagemask(gx_device_pdf *pdev, const gs_imager_state *pis,
8382      const gx_drawing_color *pdcolor);
8383 int pdf_save_viewer_state(gx_device_pdf *pdev, stream *s);
8384 int pdf_restore_viewer_state(gx_device_pdf *pdev, stream *s);
8385 int pdf_end_gstate(gx_device_pdf *pdev, pdf_resource_t *pres);
8386
8387
8388
8389
8390 int pdf_string_to_cos_name(gx_device_pdf *pdev, const byte *str, uint len,
8391          cos_value_t *pvalue);
8392
8393
8394
8395 typedef struct pdf_pattern_s pdf_pattern_t;
8396 struct pdf_pattern_s {
8397     pdf_pattern_t *next; pdf_resource_t *prev; gs_id rid; bool named; bool global; char rname[1 + (sizeof(long) * 8 / 3 + 1) + 1 ]; ulong where_used; cos_object_t *object;
8398     pdf_pattern_t *substitute;
8399 };
8400
8401
8402
8403
8404
8405
8406 pdf_resource_t *pdf_substitute_pattern(pdf_resource_t *pres);
8407
8408
8409
8410
8411
8412
8413
8414 typedef struct pdf_image_names_s {
8415     pdf_color_space_names_t color_spaces;
8416     pdf_filter_names_t filter_names;
8417     const char *BitsPerComponent;
8418     const char *ColorSpace;
8419     const char *Decode;
8420     const char *Height;
8421     const char *ImageMask;
8422     const char *Interpolate;
8423     const char *Width;
8424 } pdf_image_names_t;
8425
8426
8427
8428
8429
8430 extern const pdf_image_names_t pdf_image_names_full, pdf_image_names_short;
8431
8432
8433
8434
8435 int pdf_put_image_values(cos_dict_t *pcd, gx_device_pdf *pdev,
8436     const gs_pixel_image_t *pic,
8437     const pdf_image_names_t *pin,
8438     const cos_value_t *pcsvalue);
8439
8440
8441
8442 int pdf_put_image_filters(cos_dict_t *pcd, gx_device_pdf *pdev,
8443      const psdf_binary_writer * pbw,
8444      const pdf_image_names_t *pin);
8445 # 220 "./src/gdevpdfg.h"
8446 void pdf_make_bitmap_matrix(gs_matrix * pmat, int x, int y, int w, int h,
8447        int h_actual);
8448
8449
8450 void pdf_put_image_matrix(gx_device_pdf * pdev, const gs_matrix * pmat,
8451      floatp y_scale);
8452
8453
8454 int pdf_do_image_by_id(gx_device_pdf * pdev, double scale,
8455       const gs_matrix * pimat, bool in_contents, gs_id id);
8456 int pdf_do_image(gx_device_pdf * pdev, const pdf_resource_t * pres,
8457    const gs_matrix * pimat, bool in_contents);
8458
8459
8460
8461
8462 typedef struct pdf_image_writer_s {
8463     psdf_binary_writer binary[4];
8464     int alt_writer_count;
8465     const pdf_image_names_t *pin;
8466     pdf_resource_t *pres;
8467     int height;
8468     cos_stream_t *data;
8469     const char *end_string;
8470     cos_dict_t *named;
8471     pdf_resource_t *pres_mask;
8472 } pdf_image_writer;
8473 extern const gs_memory_struct_type_t st_pdf_image_writer;
8474
8475
8476
8477
8478
8479
8480 void pdf_image_writer_init(pdf_image_writer * piw);
8481
8482
8483
8484
8485
8486
8487 int pdf_begin_write_image(gx_device_pdf * pdev, pdf_image_writer * piw,
8488      gx_bitmap_id id, int w, int h,
8489      cos_dict_t *pnamed, bool in_line);
8490
8491
8492 int pdf_begin_image_data(gx_device_pdf * pdev, pdf_image_writer * piw,
8493     const gs_pixel_image_t * pim,
8494     const cos_value_t *pcsvalue,
8495     int alt_writer_index);
8496
8497
8498 int pdf_copy_mask_bits(stream *s, const byte *base, int sourcex,
8499          int raster, int w, int h, byte invert);
8500
8501
8502 int pdf_copy_color_bits(stream *s, const byte *base, int sourcex,
8503    int raster, int w, int h, int bytes_per_pixel);
8504
8505
8506 int
8507 pdf_complete_image_data(gx_device_pdf *pdev, pdf_image_writer *piw, int data_h,
8508    int width, int bits_per_pixel);
8509
8510
8511 int pdf_end_image_binary(gx_device_pdf *pdev, pdf_image_writer *piw,
8512     int data_h);
8513
8514
8515
8516
8517
8518 int pdf_end_write_image(gx_device_pdf * pdev, pdf_image_writer * piw);
8519
8520
8521
8522
8523 int pdf_make_alt_stream(gx_device_pdf * pdev, psdf_binary_writer * piw);
8524
8525
8526
8527
8528 int pdf_choose_compression(pdf_image_writer * piw, bool end_binary);
8529
8530
8531 int pdf_register_charproc_resource(gx_device_pdf *pdev, gs_id id, pdf_resource_type_t type);
8532
8533
8534
8535
8536 int pdf_store_pattern1_params(gx_device_pdf *pdev, pdf_resource_t *pres,
8537    gs_pattern1_instance_t *pinst);
8538
8539
8540 int pdf_put_colored_pattern(gx_device_pdf *pdev, const gx_drawing_color *pdc,
8541    const gs_color_space *pcs,
8542    const psdf_set_color_commands_t *ppscc,
8543    bool have_pattern_streams, pdf_resource_t **ppres);
8544
8545
8546 int pdf_put_uncolored_pattern(gx_device_pdf *pdev, const gx_drawing_color *pdc,
8547      const gs_color_space *pcs,
8548      const psdf_set_color_commands_t *ppscc,
8549      bool have_pattern_streams, pdf_resource_t **ppres);
8550
8551
8552 int pdf_put_pattern2(gx_device_pdf *pdev, const gx_drawing_color *pdc,
8553    const psdf_set_color_commands_t *ppscc,
8554    pdf_resource_t **ppres);
8555
8556
8557
8558
8559
8560 int pdf_copy_color_data(gx_device_pdf * pdev, const byte * base, int sourcex,
8561       int raster, gx_bitmap_id id, int x, int y, int w, int h,
8562       gs_image_t *pim, pdf_image_writer *piw,
8563       int for_pattern);
8564
8565
8566
8567
8568
8569
8570 int pdf_document_metadata(gx_device_pdf *pdev);
8571 int pdf_font_metadata(gx_device_pdf *pdev, const pdf_base_font_t *pbfont,
8572     const byte *digest, int digest_length, gs_id *metadata_object_id);
8573 # 25 "./src/gdevpdfe.c" 2
8574 # 1 "./src/gdevpdfo.h" 1
8575 # 59 "./src/gdevpdfo.h"
8576 typedef struct cos_element_s cos_element_t;
8577 typedef struct cos_stream_piece_s cos_stream_piece_t;
8578
8579
8580
8581
8582
8583             struct cos_object_procs_s {
8584
8585
8586
8587  void (*release)(cos_object_t *pco, client_name_t cname);
8588
8589
8590
8591  int (*write)(const cos_object_t *pco, gx_device_pdf *pdev, gs_id object_id);
8592
8593
8594
8595  int (*equal)(const cos_object_t *pco0, const cos_object_t *pco1, gx_device_pdf *pdev);
8596
8597 } ;
8598 # 120 "./src/gdevpdfo.h"
8599 struct cos_object_s { const cos_object_procs_t *cos_procs; long id; cos_element_t *elements; cos_stream_piece_t *pieces; gx_device_pdf *pdev; pdf_resource_t *pres; byte is_open; byte is_graphics; byte written; long length; stream *input_strm; };
8600
8601
8602
8603
8604 extern const cos_object_procs_t cos_generic_procs;
8605 # 140 "./src/gdevpdfo.h"
8606 typedef enum {
8607     COS_VALUE_SCALAR = 0,
8608     COS_VALUE_CONST,
8609     COS_VALUE_OBJECT,
8610     COS_VALUE_RESOURCE
8611 } cos_value_type_t;
8612 struct cos_value_s {
8613     cos_value_type_t value_type;
8614     union vc_ {
8615  gs_string chars;
8616  cos_object_t *object;
8617     } contents;
8618 };
8619 # 165 "./src/gdevpdfo.h"
8620 typedef struct cos_array_element_s cos_array_element_t;
8621 struct cos_array_s { const cos_object_procs_t *cos_procs; long id; cos_array_element_t *elements; cos_stream_piece_t *pieces; gx_device_pdf *pdev; pdf_resource_t *pres; byte is_open; byte is_graphics; byte written; long length; stream *input_strm; };
8622 extern const cos_object_procs_t cos_array_procs;
8623
8624
8625 typedef struct cos_dict_element_s cos_dict_element_t;
8626 struct cos_dict_s { const cos_object_procs_t *cos_procs; long id; cos_dict_element_t *elements; cos_stream_piece_t *pieces; gx_device_pdf *pdev; pdf_resource_t *pres; byte is_open; byte is_graphics; byte written; long length; stream *input_strm; };
8627 extern const cos_object_procs_t cos_dict_procs;
8628
8629
8630 struct cos_stream_s { const cos_object_procs_t *cos_procs; long id; cos_dict_element_t *elements; cos_stream_piece_t *pieces; gx_device_pdf *pdev; pdf_resource_t *pres; byte is_open; byte is_graphics; byte written; long length; stream *input_strm; };
8631 extern const cos_object_procs_t cos_stream_procs;
8632 # 188 "./src/gdevpdfo.h"
8633 cos_object_t *cos_object_alloc(gx_device_pdf *, client_name_t);
8634 cos_array_t *cos_array_alloc(gx_device_pdf *, client_name_t);
8635 cos_array_t *cos_array_from_floats(gx_device_pdf *, const float *, uint,
8636        client_name_t);
8637 cos_dict_t *cos_dict_alloc(gx_device_pdf *, client_name_t);
8638 cos_stream_t *cos_stream_alloc(gx_device_pdf *, client_name_t);
8639
8640
8641 gs_memory_t *cos_object_memory(const cos_object_t *);
8642
8643
8644
8645 int cos_become(cos_object_t *, cos_type_t);
8646
8647
8648 void cos_release(cos_object_t *pco, client_name_t cname);
8649
8650 int cos_write(const cos_object_t *pco, gx_device_pdf *pdev, gs_id object_id);
8651
8652
8653
8654 const cos_value_t *cos_string_value(cos_value_t *, const byte *, uint);
8655 const cos_value_t *cos_c_string_value(cos_value_t *, const char *);
8656 const cos_value_t *cos_object_value(cos_value_t *, cos_object_t *);
8657
8658
8659 const cos_value_t *cos_resource_value(cos_value_t *, cos_object_t *);
8660 # 227 "./src/gdevpdfo.h"
8661 int cos_array_put(cos_array_t *, long, const cos_value_t *);
8662 int cos_array_put_no_copy(cos_array_t *, long, const cos_value_t *);
8663 int cos_array_add(cos_array_t *, const cos_value_t *);
8664 int cos_array_add_no_copy(cos_array_t *, const cos_value_t *);
8665 int cos_array_add_c_string(cos_array_t *, const char *);
8666 int cos_array_add_int(cos_array_t *, int);
8667 int cos_array_add_real(cos_array_t *, floatp);
8668 int cos_array_add_object(cos_array_t *, cos_object_t *);
8669
8670 int cos_array_unadd(cos_array_t *, cos_value_t *);
8671
8672 int cos_dict_put(cos_dict_t *, const byte *, uint, const cos_value_t *);
8673 int cos_dict_put_no_copy(cos_dict_t *, const byte *, uint,
8674     const cos_value_t *);
8675 int cos_dict_put_c_key(cos_dict_t *, const char *, const cos_value_t *);
8676 int cos_dict_put_c_key_string(cos_dict_t *, const char *, const byte *, uint);
8677 int cos_dict_put_c_key_int(cos_dict_t *, const char *, int);
8678 int cos_dict_put_c_key_bool(cos_dict_t *pcd, const char *key, bool value);
8679 int cos_dict_put_c_key_real(cos_dict_t *, const char *, floatp);
8680 int cos_dict_put_c_key_floats(cos_dict_t *, const char *, const float *, uint);
8681 int cos_dict_put_c_key_object(cos_dict_t *, const char *, cos_object_t *);
8682 int cos_dict_put_string(cos_dict_t *, const byte *, uint, const byte *, uint);
8683 int cos_dict_put_string_copy(cos_dict_t *pcd, const char *key, const char *value);
8684 int cos_dict_put_c_strings(cos_dict_t *, const char *, const char *);
8685
8686 int cos_dict_move_all(cos_dict_t *, cos_dict_t *);
8687
8688 int cos_stream_add(cos_stream_t *, uint);
8689 int cos_stream_add_bytes(cos_stream_t *, const byte *, uint);
8690 int cos_stream_add_stream_contents(cos_stream_t *, stream *);
8691 int cos_stream_release_pieces(cos_stream_t *pcs);
8692 cos_dict_t *cos_stream_dict(cos_stream_t *);
8693 # 273 "./src/gdevpdfo.h"
8694 const cos_array_element_t *
8695     cos_array_element_first(const cos_array_t *);
8696 const cos_array_element_t *
8697     cos_array_element_next(const cos_array_element_t *, long *,
8698       const cos_value_t **);
8699
8700
8701 const cos_value_t *cos_dict_find(const cos_dict_t *, const byte *, uint);
8702 const cos_value_t *cos_dict_find_c_key(const cos_dict_t *, const char *);
8703
8704 int cos_dict_forall(const cos_dict_t *pcd, void *client_data,
8705  int (*proc)(void *client_data, const byte *key_data, uint key_size, const cos_value_t *v));
8706
8707
8708 typedef struct cos_param_list_writer_s {
8709     const gs_param_list_procs *procs; gs_memory_t *memory; bool persistent_keys;
8710     cos_dict_t *pcd;
8711     int print_ok;
8712 } cos_param_list_writer_t;
8713 int cos_param_list_writer_init(cos_param_list_writer_t *, cos_dict_t *,
8714           int print_ok);
8715
8716
8717
8718 stream *cos_write_stream_alloc(cos_stream_t *pcs, gx_device_pdf *pdev,
8719           client_name_t cname);
8720
8721
8722 cos_stream_t * cos_stream_from_pipeline(stream *s);
8723
8724 stream * cos_write_stream_from_pipeline(stream *s);
8725
8726
8727 int cos_value_write(const cos_value_t *, gx_device_pdf *);
8728
8729
8730 int cos_dict_elements_write(const cos_dict_t *, gx_device_pdf *);
8731 int cos_stream_elements_write(const cos_stream_t *, gx_device_pdf *);
8732 int cos_stream_contents_write(const cos_stream_t *, gx_device_pdf *);
8733
8734
8735 long cos_stream_length(const cos_stream_t *pcs);
8736
8737
8738
8739 int cos_dict_objects_write(const cos_dict_t *, gx_device_pdf *);
8740 int cos_dict_objects_delete(cos_dict_t *);
8741
8742
8743 int cos_write_object(cos_object_t *pco, gx_device_pdf *pdev);
8744
8745
8746
8747 void cos_value_free(const cos_value_t *, const cos_object_t *, client_name_t);
8748
8749
8750 void cos_free(cos_object_t *pco, client_name_t cname);
8751 # 26 "./src/gdevpdfe.c" 2
8752 # 1 "./src/gdevpdtf.h" 1
8753 # 20 "./src/gdevpdtf.h"
8754 # 1 "./src/gdevpdtx.h" 1
8755 # 20 "./src/gdevpdtx.h"
8756 # 1 "./src/gdevpdt.h" 1
8757 # 38 "./src/gdevpdt.h"
8758 pdf_text_state_t *pdf_text_state_alloc(gs_memory_t *mem);
8759
8760
8761
8762
8763 pdf_text_data_t *pdf_text_data_alloc(gs_memory_t *mem);
8764
8765
8766
8767
8768 void pdf_reset_text_page(pdf_text_data_t *ptd);
8769
8770
8771
8772
8773 void pdf_reset_text_state(pdf_text_data_t *ptd);
8774
8775
8776
8777
8778 void pdf_close_text_page(gx_device_pdf *pdev);
8779
8780
8781
8782
8783
8784 int pdf_close_text_document(gx_device_pdf *pdev);
8785
8786
8787
8788
8789
8790
8791 int pdf_from_stream_to_text(gx_device_pdf *pdev);
8792
8793
8794
8795
8796 int pdf_from_string_to_text(gx_device_pdf *pdev);
8797
8798
8799
8800
8801 void pdf_close_text_contents(gx_device_pdf *pdev);
8802
8803
8804
8805
8806 int pdf_char_image_y_offset(const gx_device_pdf *pdev, int x, int y, int h);
8807
8808
8809 int pdf_begin_char_proc(gx_device_pdf * pdev, int w, int h, int x_width,
8810    int y_offset, gs_id id, pdf_char_proc_t **ppcp,
8811    pdf_stream_position_t * ppos);
8812
8813
8814 int pdf_end_char_proc(gx_device_pdf * pdev,
8815         pdf_stream_position_t * ppos);
8816
8817
8818 int pdf_do_char_image(gx_device_pdf * pdev, const pdf_char_proc_t * pcp,
8819         const gs_matrix * pimat);
8820 # 21 "./src/gdevpdtx.h" 2
8821 # 60 "./src/gdevpdtx.h"
8822 typedef struct pdf_bitmap_fonts_s pdf_bitmap_fonts_t;
8823
8824
8825
8826 typedef struct pdf_outline_fonts_s pdf_outline_fonts_t;
8827
8828
8829
8830
8831
8832
8833
8834 struct pdf_text_data_s {
8835     pdf_outline_fonts_t *outline_fonts;
8836     pdf_bitmap_fonts_t *bitmap_fonts;
8837     pdf_text_state_t *text_state;
8838 };
8839 # 85 "./src/gdevpdtx.h"
8840 typedef struct pdf_font_resource_s pdf_font_resource_t;
8841
8842
8843
8844
8845 long pdf_font_id(const pdf_font_resource_t *pdfont);
8846
8847 int pdf_used_charproc_resources(gx_device_pdf *pdev, pdf_font_resource_t *pdfont);
8848 # 21 "./src/gdevpdtf.h" 2
8849 # 86 "./src/gdevpdtf.h"
8850 typedef struct gs_cmap_s gs_cmap_t;
8851
8852
8853
8854
8855 typedef struct gs_font_type0_s gs_font_type0;
8856 # 101 "./src/gdevpdtf.h"
8857 typedef struct pdf_font_descriptor_s pdf_font_descriptor_t;
8858
8859
8860
8861
8862 typedef struct pdf_char_glyph_pair_s pdf_char_glyph_pair_t;
8863
8864
8865 struct pdf_char_glyph_pair_s {
8866     gs_char chr;
8867     gs_glyph glyph;
8868 };
8869 # 126 "./src/gdevpdtf.h"
8870 typedef int (*pdf_font_write_contents_proc_t)
8871      (gx_device_pdf *, pdf_font_resource_t *);
8872
8873
8874
8875
8876
8877 typedef struct pdf_encoding_element_s {
8878     gs_glyph glyph;
8879     gs_const_string str;
8880     bool is_difference;
8881 } pdf_encoding_element_t;
8882 # 148 "./src/gdevpdtf.h"
8883 struct pdf_base_font_s {
8884 # 160 "./src/gdevpdtf.h"
8885     gs_font_base *copied;
8886     gs_font_base *complete;
8887     enum {
8888  DO_SUBSET_UNKNOWN = 0,
8889  DO_SUBSET_NO,
8890  DO_SUBSET_YES
8891     } do_subset;
8892     bool is_standard;
8893
8894
8895
8896
8897
8898
8899     int num_glyphs;
8900     byte *CIDSet;
8901     gs_string font_name;
8902     bool written;
8903     cos_dict_t *FontFile;
8904 };
8905 # 192 "./src/gdevpdtf.h"
8906 typedef struct {
8907     gs_id id;
8908     pdf_resource_type_t type;
8909 } pdf_resource_ref_t;
8910
8911
8912
8913
8914
8915
8916
8917 struct pdf_font_resource_s {
8918     pdf_font_resource_t *next; pdf_resource_t *prev; gs_id rid; bool named; bool global; char rname[1 + (sizeof(long) * 8 / 3 + 1) + 1 ]; ulong where_used; cos_object_t *object;
8919     font_type FontType;
8920     pdf_font_write_contents_proc_t write_contents;
8921     gs_string BaseFont;
8922     pdf_font_descriptor_t *FontDescriptor;
8923
8924
8925
8926
8927
8928     pdf_base_font_t *base_font;
8929     uint count;
8930     double *Widths;
8931     byte *used;
8932
8933     pdf_resource_t *res_ToUnicode;
8934     gs_cmap_t *cmap_ToUnicode;
8935     gs_glyph_mark_proc_t mark_glyph;
8936     void *mark_glyph_data;
8937     union {
8938
8939  struct {
8940
8941      pdf_font_resource_t *DescendantFont;
8942
8943
8944
8945
8946
8947      char Encoding_name[(((17) > (sizeof(long) * 8 / 3 + 1 + 4)) ? (17) : (sizeof(long) * 8 / 3 + 1 + 4)) + 1
8948
8949
8950
8951      ];
8952      gs_const_string CMapName;
8953
8954      bool cmap_is_standard;
8955      int WMode;
8956
8957  } type0;
8958
8959  struct {
8960
8961
8962      long CIDSystemInfo_id;
8963      ushort *CIDToGIDMap;
8964       gs_id glyphshow_font_id;
8965      double *Widths2;
8966      double *v;
8967      byte *used2;
8968      pdf_font_resource_t *parent;
8969
8970  } cidfont;
8971
8972  struct {
8973
8974      int FirstChar, LastChar;
8975
8976
8977
8978
8979      gs_encoding_index_t BaseEncoding;
8980      pdf_encoding_element_t *Encoding;
8981      gs_point *v;
8982
8983      union {
8984
8985   struct {
8986       bool is_MM_instance;
8987   } type1;
8988
8989   struct {
8990
8991
8992
8993
8994       int _dummy;
8995   } truetype;
8996
8997   struct {
8998       gs_int_rect FontBBox;
8999       gs_matrix FontMatrix;
9000       pdf_char_proc_ownership_t *char_procs;
9001       int max_y_offset;
9002       bool bitmap_font;
9003       cos_dict_t *Resources;
9004       byte *cached;
9005   } type3;
9006
9007      } s;
9008
9009  } simple;
9010
9011     } u;
9012 };
9013 # 308 "./src/gdevpdtf.h"
9014 typedef enum {
9015     FONT_EMBED_STANDARD,
9016     FONT_EMBED_NO,
9017     FONT_EMBED_YES
9018 } pdf_font_embed_t;
9019 # 322 "./src/gdevpdtf.h"
9020 typedef struct pdf_standard_font_s {
9021     pdf_font_resource_t *pdfont;
9022     gs_matrix orig_matrix;
9023 } pdf_standard_font_t;
9024 # 343 "./src/gdevpdtf.h"
9025 struct pdf_outline_fonts_s {
9026     pdf_standard_font_t *standard_fonts;
9027 };
9028 # 358 "./src/gdevpdtf.h"
9029 pdf_outline_fonts_t *pdf_outline_fonts_alloc(gs_memory_t *mem);
9030
9031
9032
9033
9034 pdf_standard_font_t *pdf_standard_fonts(const gx_device_pdf *pdev);
9035
9036
9037
9038
9039 void pdf_clean_standard_fonts(const gx_device_pdf *pdev);
9040
9041
9042 int pdf_free_font_cache(gx_device_pdf *pdev);
9043
9044
9045
9046
9047 int pdf_font_type0_alloc(gx_device_pdf *pdev, pdf_font_resource_t **ppfres,
9048     gs_id rid, pdf_font_resource_t *DescendantFont,
9049     const gs_const_string *CMapName);
9050 int pdf_font_type3_alloc(gx_device_pdf *pdev, pdf_font_resource_t **ppfres,
9051     pdf_font_write_contents_proc_t write_contents);
9052 int pdf_font_std_alloc(gx_device_pdf *pdev, pdf_font_resource_t **ppfres,
9053      bool is_original, gs_id rid, gs_font_base *pfont, int index);
9054 int pdf_font_simple_alloc(gx_device_pdf *pdev, pdf_font_resource_t **ppfres,
9055      gs_id rid, pdf_font_descriptor_t *pfd);
9056 int pdf_font_cidfont_alloc(gx_device_pdf *pdev, pdf_font_resource_t **ppfres,
9057       gs_id rid, pdf_font_descriptor_t *pfd);
9058 int pdf_obtain_cidfont_widths_arrays(gx_device_pdf *pdev, pdf_font_resource_t *pdfont,
9059       int wmode, double **w, double **w0, double **v);
9060 int font_resource_encoded_alloc(gx_device_pdf *pdev, pdf_font_resource_t **ppfres,
9061        gs_id rid, font_type ftype,
9062        pdf_font_write_contents_proc_t write_contents);
9063 int pdf_assign_font_object_id(gx_device_pdf *pdev, pdf_font_resource_t *pdfont);
9064
9065
9066 int pdf_resize_resource_arrays(gx_device_pdf *pdev, pdf_font_resource_t *pfres,
9067  int chars_count);
9068
9069
9070
9071
9072
9073
9074 gs_font_base *pdf_font_resource_font(const pdf_font_resource_t *pdfont, bool complete);
9075
9076
9077
9078
9079
9080
9081
9082 pdf_font_embed_t pdf_font_embed_status(gx_device_pdf *pdev, gs_font *font,
9083            int *pindex,
9084            pdf_char_glyph_pair_t *pairs, int num_glyphs);
9085
9086
9087
9088
9089
9090 int pdf_compute_BaseFont(gx_device_pdf *pdev, pdf_font_resource_t *pdfont, bool finish);
9091
9092
9093
9094
9095
9096 int pdf_close_text_document(gx_device_pdf *pdev);
9097
9098
9099
9100
9101 const gs_font_name *pdf_choose_font_name(gs_font *font, bool key_name);
9102
9103
9104
9105
9106
9107
9108 int pdf_cmap_alloc(gx_device_pdf *pdev, const gs_cmap_t *pcmap,
9109      pdf_resource_t **ppres , int font_index_only);
9110
9111
9112
9113
9114 int pdf_font_add_cid_to_gid(pdf_font_resource_t *pdfont, uint cid, uint gid);
9115 # 27 "./src/gdevpdfe.c" 2
9116
9117
9118 static void
9119 pdf_xml_data_write(stream *s, const byte *data, int data_length)
9120 {
9121     int l = data_length;
9122     const byte *p = data;
9123
9124     for (; l--; p++) {
9125  switch (*p) {
9126      case '<' : stream_puts(s, "&lt;"); break;
9127      case '>' : stream_puts(s, "&gt;"); break;
9128      case '&' : stream_puts(s, "&amp;"); break;
9129      case '\'': stream_puts(s, "&apos;"); break;
9130      case '"' : stream_puts(s, "&quot;"); break;
9131      default:
9132   if (*p < 32 || *p > 127)
9133       pprintd1(s, "&#%d;", *p);
9134   else
9135       spputc(s, *p);
9136  }
9137     }
9138 }
9139
9140
9141 static __inline__ void
9142 pdf_xml_string_write(stream *s, const char *data)
9143 {
9144     pdf_xml_data_write(s, (const byte *)data, strlen(data));
9145 }
9146
9147
9148 static __inline__ void
9149 pdf_xml_tag_open_beg(stream *s, const char *data)
9150 {
9151     spputc(s, '<');
9152     stream_puts(s, data);
9153 }
9154
9155
9156 static __inline__ void
9157 pdf_xml_tag_end(stream *s)
9158 {
9159     spputc(s, '>');
9160 }
9161
9162
9163 static __inline__ void
9164 pdf_xml_tag_end_empty(stream *s)
9165 {
9166     stream_puts(s, "/>");
9167 }
9168
9169
9170 static __inline__ void
9171 pdf_xml_tag_open(stream *s, const char *data)
9172 {
9173     spputc(s, '<');
9174     stream_puts(s, data);
9175     spputc(s, '>');
9176 }
9177
9178
9179 static __inline__ void
9180 pdf_xml_tag_close(stream *s, const char *data)
9181 {
9182     stream_puts(s, "</");
9183     stream_puts(s, data);
9184     spputc(s, '>');
9185 }
9186
9187
9188 static __inline__ void
9189 pdf_xml_attribute_name(stream *s, const char *data)
9190 {
9191     spputc(s, ' ');
9192     stream_puts(s, data);
9193     spputc(s, '=');
9194 }
9195
9196
9197 static __inline__ void
9198 pdf_xml_attribute_value(stream *s, const char *data)
9199 {
9200     spputc(s, '\'');
9201     pdf_xml_string_write(s, data);
9202     spputc(s, '\'');
9203 }
9204
9205 static __inline__ void
9206 pdf_xml_attribute_value_data(stream *s, const byte *data, int data_length)
9207 {
9208     spputc(s, '\'');
9209     pdf_xml_data_write(s, data, data_length);
9210     spputc(s, '\'');
9211 }
9212
9213
9214 static __inline__ void
9215 pdf_xml_ins_beg(stream *s, const char *data)
9216 {
9217     stream_puts(s, "<?");
9218     stream_puts(s, data);
9219 }
9220
9221
9222 static __inline__ void
9223 pdf_xml_ins_end(stream *s)
9224 {
9225     stream_puts(s, "?>");
9226 }
9227
9228
9229 static __inline__ void
9230 pdf_xml_newline(stream *s)
9231 {
9232     stream_puts(s, "\n");
9233 }
9234
9235
9236 static __inline__ void
9237 pdf_xml_copy(stream *s, const char *data)
9238 {
9239     stream_puts(s, data);
9240 }
9241
9242
9243
9244
9245 static void
9246 pdf_xmp_time(char *buf, int buf_length)
9247 {
9248
9249     struct tm tms;
9250     time_t t;
9251     char buf1[4+1+2+1+2+1];
9252
9253     time(&t);
9254     tms = *localtime(&t);
9255     sprintf(buf1,
9256      "%04d-%02d-%02d",
9257      tms.tm_year + 1900, tms.tm_mon + 1, tms.tm_mday);
9258     strncpy(buf, buf1, buf_length);
9259 }
9260
9261 static void
9262 pdf_xmp_write_docinfo_item(gx_device_pdf *pdev, stream *s, const char *key, const char *default_value,
9263       void(*write)(stream *s, const byte *data, int data_length))
9264 {
9265     const cos_value_t *v = cos_dict_find(pdev->Info, (const byte *)key, strlen(key));
9266
9267     if (v != ((void *)0) && (v->value_type == COS_VALUE_SCALAR ||
9268    v->value_type == COS_VALUE_CONST)) {
9269  if (v->contents.chars.size > 2 && v->contents.chars.data[0] == '(')
9270      write(s, v->contents.chars.data + 1, v->contents.chars.size - 2);
9271  else
9272      write(s, v->contents.chars.data, v->contents.chars.size);
9273     } else
9274  stream_puts(s, default_value);
9275 }
9276
9277 static uint64_t
9278 pdf_uuid_time(gx_device_pdf *pdev)
9279 {
9280     long *dt = pdev->uuid_time;
9281     uint64_t t;
9282
9283
9284     t = (uint64_t)10000000 * dt[0] + dt[0] / 100;
9285     t += (uint64_t) (1000*1000*10)
9286        * (uint64_t) (60 * 60 * 24)
9287        * (uint64_t) (17+30+31+365*397+99);
9288     return t;
9289 }
9290
9291 static void writehex(char **p, ulong v, int l)
9292 {
9293     int i = l * 2;
9294     static const char digit[] = "0123456789abcdef";
9295
9296     for (; i--;)
9297  *((*p)++) = digit[v >> (i * 4) & 15];
9298 }
9299
9300 static void
9301 pdf_make_uuid(const byte node[6], uint64_t uuid_time, ulong time_seq, char *buf, int buf_length)
9302 {
9303     char b[40], *p = b;
9304     ulong uuid_time_lo = (ulong)(uuid_time & 0xFFFFFFFF);
9305     ushort uuid_time_md = (ushort)((uuid_time >> 32) & 0xFFFF);
9306     ushort uuid_time_hi = (ushort)((uuid_time >> 48) & 0x0FFF);
9307
9308     writehex(&p, uuid_time_lo, 4);
9309     *(p++) = '-';
9310     writehex(&p, uuid_time_md, 2);
9311     *(p++) = '-';
9312     writehex(&p, uuid_time_hi | (ushort)(1 << 12), 2);
9313     *(p++) = '-';
9314     writehex(&p, (time_seq & 0x3F00) >> 8, 1);
9315     writehex(&p, time_seq & 0xFF, 1);
9316     *(p++) = '-';
9317     writehex(&p, node[0], 1);
9318     writehex(&p, node[1], 1);
9319     writehex(&p, node[2], 1);
9320     writehex(&p, node[3], 1);
9321     writehex(&p, node[4], 1);
9322     writehex(&p, node[5], 1);
9323     *p = 0;
9324     strncpy(buf, b, buf_length);
9325 }
9326
9327 static int
9328 pdf_make_instance_uuid(gx_device_pdf *pdev, const byte digest[6], char *buf, int buf_length)
9329 {
9330     if (pdev->InstanceUUID.size) {
9331  int l = (((buf_length - 1) < (pdev->InstanceUUID.size)) ? (buf_length - 1) : (pdev->InstanceUUID.size));
9332
9333  memcpy(buf, pdev->InstanceUUID.data, l);
9334  buf[l] = 0;
9335     } else
9336  pdf_make_uuid(digest, pdf_uuid_time(pdev), pdev->DocumentTimeSeq, buf, buf_length);
9337     return 0;
9338 }
9339
9340 static int
9341 pdf_make_document_uuid(gx_device_pdf *pdev, const byte digest[6], char *buf, int buf_length)
9342 {
9343     if (pdev->DocumentUUID.size) {
9344  int l = (((buf_length - 1) < (pdev->DocumentUUID.size)) ? (buf_length - 1) : (pdev->DocumentUUID.size));
9345
9346  memcpy(buf, pdev->DocumentUUID.data, l);
9347  buf[l] = 0;
9348     } else
9349  pdf_make_uuid(digest, pdf_uuid_time(pdev), pdev->DocumentTimeSeq, buf, buf_length);
9350     return 0;
9351 }
9352
9353 static char dd[]={'\'', 0xEF, 0xBB, 0xBF, '\'', 0};
9354
9355
9356
9357
9358 static int
9359 pdf_write_document_metadata(gx_device_pdf *pdev, const byte digest[6])
9360 {
9361     char instance_uuid[40], document_uuid[40], date_time[40];
9362     int code;
9363     stream *s = pdev->strm;
9364
9365     code = pdf_make_instance_uuid(pdev, digest, instance_uuid, sizeof(instance_uuid));
9366     if (code < 0)
9367  return code;
9368     code = pdf_make_document_uuid(pdev, digest, document_uuid, sizeof(document_uuid));
9369     if (code < 0)
9370  return code;
9371     pdf_xmp_time(date_time, sizeof(date_time));
9372     pdf_xml_ins_beg(s, "xpacket");
9373     pdf_xml_attribute_name(s, "begin");
9374     pdf_xml_copy(s, dd);
9375     pdf_xml_attribute_name(s, "id");
9376     pdf_xml_attribute_value(s, "W5M0MpCehiHzreSzNTczkc9d");
9377     pdf_xml_ins_end(s);
9378     pdf_xml_newline(s);
9379
9380     pdf_xml_copy(s, "<?adobe-xap-filters esc=\"CRLF\"?>\n");
9381     pdf_xml_copy(s, "<x:xmpmeta xmlns:x='adobe:ns:meta/'"
9382                        " x:xmptk='XMP toolkit 2.9.1-13, framework 1.6'>\n");
9383     {
9384  pdf_xml_copy(s, "<rdf:RDF xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#' "
9385                           "xmlns:iX='http://ns.adobe.com/iX/1.0/'>\n");
9386  {
9387
9388          pdf_xml_tag_open_beg(s, "rdf:Description");
9389      pdf_xml_attribute_name(s, "rdf:about");
9390      pdf_xml_attribute_value(s, instance_uuid);
9391      pdf_xml_attribute_name(s, "xmlns:pdf");
9392      pdf_xml_attribute_value(s, "http://ns.adobe.com/pdf/1.3/");
9393      pdf_xml_attribute_name(s, "pdf:Producer");
9394      pdf_xmp_write_docinfo_item(pdev, s, "/Producer", "UnknownProduicer",
9395    pdf_xml_attribute_value_data);
9396      pdf_xml_tag_end_empty(s);
9397      pdf_xml_newline(s);
9398
9399      pdf_xml_tag_open_beg(s, "rdf:Description");
9400      pdf_xml_attribute_name(s, "rdf:about");
9401      pdf_xml_attribute_value(s, instance_uuid);
9402      pdf_xml_attribute_name(s, "xmlns:xap");
9403      pdf_xml_attribute_value(s, "http://ns.adobe.com/xap/1.0/");
9404      pdf_xml_attribute_name(s, "xap:ModifyDate");
9405      pdf_xml_attribute_value(s, date_time);
9406      pdf_xml_attribute_name(s, "xap:CreateDate");
9407      pdf_xml_attribute_value(s, date_time);
9408      pdf_xml_tag_end(s);
9409      {
9410   pdf_xml_tag_open_beg(s, "xap:CreatorTool");
9411   pdf_xml_tag_end(s);
9412   {
9413       char buf[10];
9414
9415       sprintf(buf, "%d.%02d", (int)(gs_revision / 100), (int)(gs_revision % 100));
9416       pdf_xml_string_write(s, gs_product);
9417       pdf_xml_string_write(s, " ");
9418       pdf_xml_string_write(s, buf);
9419       pdf_xml_string_write(s, " PDF Writer");
9420   }
9421   pdf_xml_tag_close(s, "xap:CreatorTool");
9422      }
9423      pdf_xml_tag_close(s, "rdf:Description");
9424      pdf_xml_newline(s);
9425
9426      pdf_xml_tag_open_beg(s, "rdf:Description");
9427      pdf_xml_attribute_name(s, "rdf:about");
9428      pdf_xml_attribute_value(s, instance_uuid);
9429      pdf_xml_attribute_name(s, "xmlns:xapMM");
9430      pdf_xml_attribute_value(s, "http://ns.adobe.com/xap/1.0/mm/");
9431      pdf_xml_attribute_name(s, "xapMM:DocumentID");
9432      pdf_xml_attribute_value(s, document_uuid);
9433      pdf_xml_tag_end_empty(s);
9434      pdf_xml_newline(s);
9435
9436      pdf_xml_tag_open_beg(s, "rdf:Description");
9437      pdf_xml_attribute_name(s, "rdf:about");
9438      pdf_xml_attribute_value(s, instance_uuid);
9439      pdf_xml_attribute_name(s, "xmlns:dc");
9440      pdf_xml_attribute_value(s, "http://purl.org/dc/elements/1.1/");
9441      pdf_xml_attribute_name(s, "dc:format");
9442      pdf_xml_attribute_value(s,"application/pdf");
9443      pdf_xml_tag_end(s);
9444      {
9445   pdf_xml_tag_open(s, "dc:title");
9446   {
9447       pdf_xml_tag_open(s, "rdf:Alt");
9448       {
9449    pdf_xml_tag_open_beg(s, "rdf:li");
9450    pdf_xml_attribute_name(s, "xml:lang");
9451    pdf_xml_attribute_value(s, "x-default");
9452    pdf_xml_tag_end(s);
9453    {
9454       pdf_xmp_write_docinfo_item(pdev, s, "/Title", "Untitled",
9455         pdf_xml_data_write);
9456    }
9457    pdf_xml_tag_close(s, "rdf:li");
9458       }
9459       pdf_xml_tag_close(s, "rdf:Alt");
9460   }
9461   pdf_xml_tag_close(s, "dc:title");
9462
9463   if (cos_dict_find(pdev->Info, (const byte *)"/Author", 7)) {
9464       pdf_xml_tag_open(s, "dc:creator");
9465       {
9466
9467
9468
9469    pdf_xml_tag_open(s, "rdf:Seq");
9470    {
9471        pdf_xml_tag_open(s, "rdf:li");
9472        {
9473         pdf_xmp_write_docinfo_item(pdev, s, "/Author", "Unknown",
9474          pdf_xml_data_write);
9475        }
9476        pdf_xml_tag_close(s, "rdf:li");
9477    }
9478    pdf_xml_tag_close(s, "rdf:Seq");
9479       }
9480       pdf_xml_tag_close(s, "dc:creator");
9481   }
9482      }
9483      pdf_xml_tag_close(s, "rdf:Description");
9484      pdf_xml_newline(s);
9485  }
9486  pdf_xml_copy(s, "</rdf:RDF>\n");
9487     }
9488     pdf_xml_copy(s, "</x:xmpmeta>\n");
9489
9490     pdf_xml_copy(s, "                                                                        \n");
9491     pdf_xml_copy(s, "                                                                        \n");
9492     pdf_xml_copy(s, "<?xpacket end='w'?>");
9493     return 0;
9494 }
9495
9496 int
9497 pdf_document_metadata(gx_device_pdf *pdev)
9498 {
9499     if (pdev->CompatibilityLevel < 1.4)
9500  return 0;
9501     if (pdev->ParseDSCCommentsForDocInfo || pdev->PreserveEPSInfo) {
9502  pdf_resource_t *pres;
9503  char buf[20];
9504  byte digest[6];
9505  int code;
9506  int options = 0;
9507
9508  (*(pdev->strm)->procs.flush)(pdev->strm);
9509  s_MD5C_get_digest(pdev->strm, digest, sizeof(digest));
9510  if (pdev->EncryptMetadata)
9511      options |= 8;
9512  code = pdf_open_aside(pdev, resourceOther, 0L, &pres, ((bool)1), options);
9513  if (code < 0)
9514      return code;
9515  code = pdf_write_document_metadata(pdev, digest);
9516  if (code < 0)
9517      return code;
9518  code = pdf_close_aside(pdev);
9519  if (code < 0)
9520      return code;
9521  code = cos_write_object(((cos_object_t *)&((pres->object)->cos_procs)), pdev);
9522  if (code < 0)
9523      return code;
9524  sprintf(buf, "%ld 0 R", pres->object->id);
9525  cos_dict_put_c_key_object(pdev->Catalog, "/Metadata", pres->object);
9526     }
9527     return 0;
9528 }
9529
9530
9531
9532
9533 static int
9534 pdf_write_font_metadata(gx_device_pdf *pdev, const pdf_base_font_t *pbfont,
9535    const byte *digest, int digest_length)
9536 {
9537     char instance_uuid[40];
9538     int code;
9539     stream *s = pdev->strm;
9540     gs_font_info_t info;
9541     gs_font_base *pfont = pbfont->complete;
9542
9543     if (pfont == ((void *)0))
9544  pfont = pbfont->copied;
9545
9546     pdf_make_uuid(digest, pdf_uuid_time(pdev), pdev->DocumentTimeSeq, instance_uuid, sizeof(instance_uuid));
9547     code = pfont->procs.font_info((gs_font *)pfont, ((void *)0),
9548       (0x0040 | 0x0080 |
9549    0x1000 | 0x2000),
9550      &info);
9551     if (code < 0)
9552  return code;
9553     pdf_xml_ins_beg(s, "xpacket");
9554     pdf_xml_attribute_name(s, "begin");
9555     pdf_xml_copy(s, dd);
9556     pdf_xml_attribute_name(s, "id");
9557     pdf_xml_attribute_value(s, "W5M0MpCehiHzreSzNTczkc9d");
9558     pdf_xml_ins_end(s);
9559     pdf_xml_newline(s);
9560
9561     pdf_xml_copy(s, "<?adobe-xap-filters esc=\"CRLF\"?>\n");
9562     pdf_xml_copy(s, "<x:xmpmeta xmlns:x='adobe:ns:meta/'"
9563                        " x:xmptk='XMP toolkit 2.9.1-13, framework 1.6'>\n");
9564     {
9565  pdf_xml_copy(s, "<rdf:RDF xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#' "
9566                           "xmlns:iX='http://ns.adobe.com/iX/1.0/'>\n");
9567  {
9568
9569      pdf_xml_tag_open_beg(s, "rdf:Description");
9570      pdf_xml_attribute_name(s, "rdf:about");
9571      pdf_xml_attribute_value(s, instance_uuid);
9572      pdf_xml_attribute_name(s, "xmlns:xmp");
9573      pdf_xml_attribute_value(s, "http://ns.adobe.com/xap/1.0/");
9574      pdf_xml_tag_end(s);
9575      {
9576   pdf_xml_tag_open_beg(s, "xmp:Title");
9577   pdf_xml_tag_end(s);
9578   {
9579       pdf_xml_tag_open(s, "rdf:Alt");
9580       {
9581    pdf_xml_tag_open_beg(s, "rdf:li");
9582    pdf_xml_attribute_name(s, "xml:lang");
9583    pdf_xml_attribute_value(s, "x-default");
9584    pdf_xml_tag_end(s);
9585    {
9586       pdf_xml_data_write(s, pbfont->font_name.data, pbfont->font_name.size);
9587    }
9588    pdf_xml_tag_close(s, "rdf:li");
9589       }
9590       pdf_xml_tag_close(s, "rdf:Alt");
9591   }
9592   pdf_xml_tag_close(s, "xmp:Title");
9593      }
9594      pdf_xml_tag_close(s, "rdf:Description");
9595      pdf_xml_newline(s);
9596
9597
9598      pdf_xml_tag_open_beg(s, "rdf:Description");
9599      pdf_xml_attribute_name(s, "rdf:about");
9600      pdf_xml_attribute_value(s, instance_uuid);
9601      pdf_xml_attribute_name(s, "xmlns:xmpRights");
9602      pdf_xml_attribute_value(s, "http://ns.adobe.com/xap/1.0/rights/");
9603      pdf_xml_tag_end(s);
9604      if (info.members & 0x0040) {
9605   pdf_xml_tag_open_beg(s, "xmpRights:Copyright");
9606   pdf_xml_tag_end(s);
9607   {
9608       pdf_xml_tag_open(s, "rdf:Alt");
9609       {
9610    pdf_xml_tag_open_beg(s, "rdf:li");
9611    pdf_xml_attribute_name(s, "xml:lang");
9612    pdf_xml_attribute_value(s, "x-default");
9613    pdf_xml_tag_end(s);
9614    {
9615       pdf_xml_data_write(s, info.Copyright.data, info.Copyright.size);
9616    }
9617    pdf_xml_tag_close(s, "rdf:li");
9618       }
9619       pdf_xml_tag_close(s, "rdf:Alt");
9620   }
9621   pdf_xml_tag_close(s, "xmpRights:Copyright");
9622
9623
9624   pdf_xml_tag_open_beg(s, "xmpRights:Owner");
9625   pdf_xml_tag_end(s);
9626   {
9627       pdf_xml_tag_open(s, "rdf:Alt");
9628       {
9629    pdf_xml_tag_open_beg(s, "rdf:li");
9630    pdf_xml_attribute_name(s, "xml:lang");
9631    pdf_xml_attribute_value(s, "x-default");
9632    pdf_xml_tag_end(s);
9633    {
9634       pdf_xml_data_write(s, info.Copyright.data, info.Copyright.size);
9635    }
9636    pdf_xml_tag_close(s, "rdf:li");
9637       }
9638       pdf_xml_tag_close(s, "rdf:Alt");
9639   }
9640   pdf_xml_tag_close(s, "xmpRights:Owner");
9641      }
9642      {
9643   pdf_xml_tag_open_beg(s, "xmpRights:Marked");
9644   pdf_xml_tag_end(s);
9645   {
9646       pdf_xml_string_write(s, "True");
9647   }
9648   pdf_xml_tag_close(s, "xmpRights:Marked");
9649      }
9650      if (info.members & 0x0080) {
9651   pdf_xml_tag_open_beg(s, "xmpRights:UsageTerms");
9652   pdf_xml_tag_end(s);
9653   {
9654       pdf_xml_tag_open(s, "rdf:Alt");
9655       {
9656    pdf_xml_tag_open_beg(s, "rdf:li");
9657    pdf_xml_attribute_name(s, "xml:lang");
9658    pdf_xml_attribute_value(s, "x-default");
9659    pdf_xml_tag_end(s);
9660    {
9661       pdf_xml_data_write(s, info.Notice.data, info.Notice.size);
9662    }
9663    pdf_xml_tag_close(s, "rdf:li");
9664       }
9665       pdf_xml_tag_close(s, "rdf:Alt");
9666   }
9667   pdf_xml_tag_close(s, "xmpRights:UsageTerms");
9668      }
9669      pdf_xml_tag_close(s, "rdf:Description");
9670      pdf_xml_newline(s);
9671  }
9672  pdf_xml_copy(s, "</rdf:RDF>\n");
9673     }
9674     pdf_xml_copy(s, "</x:xmpmeta>\n");
9675
9676     pdf_xml_copy(s, "                                                                        \n");
9677     pdf_xml_copy(s, "                                                                        \n");
9678     pdf_xml_copy(s, "<?xpacket end='w'?>");
9679     return 0;
9680 }
9681
9682 int
9683 pdf_font_metadata(gx_device_pdf *pdev, const pdf_base_font_t *pbfont,
9684     const byte *digest, int digest_length, gs_id *metadata_object_id)
9685 {
9686     *metadata_object_id = 0L;
9687     if (pdev->CompatibilityLevel < 1.4)
9688  return 0;
9689
9690
9691
9692
9693
9694
9695     if (pdev->PDFA) {
9696  pdf_resource_t *pres;
9697  byte digest[6];
9698  int code;
9699  int options = 0;
9700
9701  (*(pdev->strm)->procs.flush)(pdev->strm);
9702  s_MD5C_get_digest(pdev->strm, digest, sizeof(digest));
9703  if (pdev->EncryptMetadata)
9704      options |= 8;
9705  code = pdf_open_aside(pdev, resourceOther, 0L, &pres, ((bool)1), options);
9706  if (code < 0)
9707      return code;
9708  code = pdf_write_font_metadata(pdev, pbfont, digest, digest_length);
9709  if (code < 0)
9710      return code;
9711  code = pdf_close_aside(pdev);
9712  if (code < 0)
9713      return code;
9714  code = cos_write_object(((cos_object_t *)&((pres->object)->cos_procs)), pdev);
9715  if (code < 0)
9716      return code;
9717  *metadata_object_id = pres->object->id;
9718     }
9719     return 0;
9720 }