w32tex
About: TeX Live provides a comprehensive TeX system including all the major TeX-related programs, macro packages, and fonts that are free software. Windows sources.
  Fossies Dox: w32tex-src.tar.xz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

pdfdoc.c
Go to the documentation of this file.
1 /* This is dvipdfmx, an eXtended version of dvipdfm by Mark A. Wicks.
2 
3  Copyright (C) 2002-2021 by Jin-Hwan Cho, Matthias Franz, and Shunsaku Hirata,
4  the dvipdfmx project team.
5 
6  Copyright (C) 1998, 1999 by Mark A. Wicks <mwicks@kettering.edu>
7 
8  This program is free software; you can redistribute it and/or modify
9  it under the terms of the GNU General Public License as published by
10  the Free Software Foundation; either version 2 of the License, or
11  (at your option) any later version.
12 
13  This program is distributed in the hope that it will be useful,
14  but WITHOUT ANY WARRANTY; without even the implied warranty of
15  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  GNU General Public License for more details.
17 
18  You should have received a copy of the GNU General Public License
19  along with this program; if not, write to the Free Software
20  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
21 */
22 
23 /*
24  * TODO: Many things...
25  * {begin,end}_{bead,article}, box stack, name tree (not limited to dests)...
26  */
27 
28 #ifdef HAVE_CONFIG_H
29 #include <config.h>
30 #endif
31 
32 #include "system.h"
33 #include "mem.h"
34 #include "error.h"
35 #include "mfileio.h"
36 #include "dpxconf.h"
37 
38 #include "numbers.h"
39 
40 #include "pdfobj.h"
41 #include "pdfparse.h"
42 #include "pdfnames.h"
43 
44 #include "pdfencrypt.h"
45 
46 #include "dvipdfmx.h"
47 
48 #include "pdfdev.h"
49 #include "pdfdraw.h"
50 #include "pdfcolor.h"
51 
52 #include "pdfresource.h"
53 #include "pdffont.h"
54 #include "pdfximage.h"
55 
56 #include "pdflimits.h"
57 
58 #if HAVE_LIBPNG
59 #include "pngimage.h"
60 #endif
61 #include "jpegimage.h"
62 
63 #include "pdfdoc.h"
64 
65 #define PDFDOC_PAGES_ALLOC_SIZE 128u
66 #define PDFDOC_ARTICLE_ALLOC_SIZE 16
67 #define PDFDOC_BEAD_ALLOC_SIZE 16
68 
69 static pdf_obj *
70 read_thumbnail (const char *thumb_filename)
71 {
72  pdf_obj *image_ref;
73  int xobj_id;
74  FILE *fp;
75  load_options options = {1, 0, NULL};
76 
77  fp = MFOPEN(thumb_filename, FOPEN_RBIN_MODE);
78  if (!fp) {
79  WARN("Could not open thumbnail file \"%s\"", thumb_filename);
80  return NULL;
81  }
82  if (!check_for_png(fp) && !check_for_jpeg(fp)) {
83  WARN("Thumbnail \"%s\" not a png/jpeg file!", thumb_filename);
84  MFCLOSE(fp);
85  return NULL;
86  }
87  MFCLOSE(fp);
88 
89  xobj_id = pdf_ximage_load_image(thumb_filename, thumb_filename, options);
90  if (xobj_id < 0) {
91  WARN("Could not read thumbnail file \"%s\".", thumb_filename);
92  image_ref = NULL;
93  } else {
94  image_ref = pdf_ximage_get_reference(xobj_id);
95  }
96 
97  return image_ref;
98 }
99 
100 /* Sorry no appropriate place to put this... */
102 
103 typedef struct pdf_form
104 {
105  char *ident;
106 
109 
113 
115 {
116  int q_depth;
118 
120 };
121 
122 #define USE_MY_MEDIABOX (1 << 0)
123 typedef struct pdf_page
124 {
127 
128  int flags;
129 
130  double ref_x, ref_y;
132 
134 
135  /* Contents */
138 
139  /* global bop, background, contents, global eop */
141 
145 
146 typedef struct pdf_olitem
147 {
149 
150  int is_open;
151 
152  struct pdf_olitem *first;
154 
155  struct pdf_olitem *next;
157 
158 typedef struct pdf_bead
159 {
160  char *id;
161  int page_no;
164 
165 typedef struct pdf_article
166 {
167  char *id;
173 
174 struct name_dict
175 {
176  const char *category;
177  struct ht_table *data;
178 };
179 
180 
181 typedef struct pdf_doc
182 {
183  struct {
185 
191  } root;
192 
194 
195  struct {
198 
199  int num_entries; /* This is not actually total number of pages. */
202  } pages;
203 
204  struct {
209 
210  struct {
211  int num_entries;
212  int max_entries;
215 
216  struct name_dict *names;
217 
219  struct ht_table gotos;
220 
221  struct {
223  struct {
224  double x, y;
228 
230 
233 static pdf_doc pdoc;
234 
235 static void
237 {
238  p->root.viewerpref = NULL;
239  p->root.pagelabels = NULL;
240  p->root.pages = NULL;
241  p->root.names = NULL;
242  p->root.threads = NULL;
243 
244  p->root.dict = pdf_new_dict();
245  pdf_set_root(p->root.dict);
246 
247  return;
248 }
249 
250 static void
252 {
253  pdf_obj *tmp;
254 
255  if (p->root.viewerpref) {
256  tmp = pdf_lookup_dict(p->root.dict, "ViewerPreferences");
257  if (!tmp) {
258  pdf_add_dict(p->root.dict,
259  pdf_new_name("ViewerPreferences"),
260  pdf_ref_obj (p->root.viewerpref));
261  } else if (PDF_OBJ_DICTTYPE(tmp)) {
262  pdf_merge_dict(p->root.viewerpref, tmp);
263  pdf_add_dict(p->root.dict,
264  pdf_new_name("ViewerPreferences"),
265  pdf_ref_obj (p->root.viewerpref));
266  } else { /* Maybe reference */
267  /* What should I do? */
268  WARN("Could not modify ViewerPreferences.");
269  }
270  pdf_release_obj(p->root.viewerpref);
271  p->root.viewerpref = NULL;
272  }
273 
274  if (p->root.pagelabels) {
275  tmp = pdf_lookup_dict(p->root.dict, "PageLabels");
276  if (!tmp) {
277  tmp = pdf_new_dict();
278  pdf_add_dict(tmp, pdf_new_name("Nums"), pdf_link_obj(p->root.pagelabels));
279  pdf_add_dict(p->root.dict,
280  pdf_new_name("PageLabels"), pdf_ref_obj(tmp));
281  pdf_release_obj(tmp);
282  } else { /* Maybe reference */
283  /* What should I do? */
284  WARN("Could not modify PageLabels.");
285  }
286  pdf_release_obj(p->root.pagelabels);
287  p->root.pagelabels = NULL;
288  }
289 
290  pdf_add_dict(p->root.dict,
291  pdf_new_name("Type"), pdf_new_name("Catalog"));
292  pdf_release_obj(p->root.dict);
293  p->root.dict = NULL;
294 
295  return;
296 }
297 
298 /*
299  * Pages are starting at 1.
300  * The page count does not increase until the page is finished.
301  */
302 #define LASTPAGE(p) (&(p->pages.entries[p->pages.num_entries]))
303 #define FIRSTPAGE(p) (&(p->pages.entries[0]))
304 #define PAGECOUNT(p) (p->pages.num_entries)
305 #define MAXPAGES(p) (p->pages.max_entries)
306 
307 static void
309 {
310  if (size > MAXPAGES(p)) {
311  int i;
312 
313  p->pages.entries = RENEW(p->pages.entries, size, struct pdf_page);
314  for (i = p->pages.max_entries; i < size; i++) {
315  p->pages.entries[i].page_obj = NULL;
316  p->pages.entries[i].page_ref = NULL;
317  p->pages.entries[i].flags = 0;
318  p->pages.entries[i].resources = NULL;
319  p->pages.entries[i].background = NULL;
320  p->pages.entries[i].contents = NULL;
321  p->pages.entries[i].content_refs[0] = NULL; /* global bop */
322  p->pages.entries[i].content_refs[1] = NULL; /* background */
323  p->pages.entries[i].content_refs[2] = NULL; /* page body */
324  p->pages.entries[i].content_refs[3] = NULL; /* global eop */
325  p->pages.entries[i].annots = NULL;
326  p->pages.entries[i].beads = NULL;
327  }
328  p->pages.max_entries = size;
329  }
330 
331  return;
332 }
333 
334 static pdf_page *
335 doc_get_page_entry (pdf_doc *p, unsigned int page_no)
336 {
337  pdf_page *page;
338 
339  if (page_no > 65535ul) {
340  ERROR("Page number %ul too large!", page_no);
341  } else if (page_no == 0) {
342  ERROR("Invalid Page number %ul.", page_no);
343  }
344 
345  if (page_no > MAXPAGES(p)) {
347  }
348 
349  page = &(p->pages.entries[page_no - 1]);
350 
351  return page;
352 }
353 
354 static void pdf_doc_init_page_tree (pdf_doc *p, double media_width, double media_height);
355 static void pdf_doc_close_page_tree (pdf_doc *p);
356 
357 static void pdf_doc_init_names (pdf_doc *p, int check_gotos);
358 static void pdf_doc_close_names (pdf_doc *p);
359 
360 static void pdf_doc_add_goto (pdf_obj *annot_dict);
361 
362 static void pdf_doc_init_docinfo (pdf_doc *p);
363 static void pdf_doc_close_docinfo (pdf_doc *p);
364 
365 static void pdf_doc_init_articles (pdf_doc *p);
366 static void pdf_doc_close_articles (pdf_doc *p);
367 static void pdf_doc_init_bookmarks (pdf_doc *p, int bm_open_depth);
368 static void pdf_doc_close_bookmarks (pdf_doc *p);
369 
370 void
371 pdf_doc_set_bop_content (const char *content, unsigned length)
372 {
373  pdf_doc *p = &pdoc;
374 
375  ASSERT(p);
376 
377  if (p->pages.bop) {
378  pdf_release_obj(p->pages.bop);
379  p->pages.bop = NULL;
380  }
381 
382  if (length > 0) {
383  p->pages.bop = pdf_new_stream(STREAM_COMPRESS);
384  pdf_add_stream(p->pages.bop, content, length);
385  } else {
386  p->pages.bop = NULL;
387  }
388 
389  return;
390 }
391 
392 void
393 pdf_doc_set_eop_content (const char *content, unsigned length)
394 {
395  pdf_doc *p = &pdoc;
396 
397  if (p->pages.eop) {
398  pdf_release_obj(p->pages.eop);
399  p->pages.eop = NULL;
400  }
401 
402  if (length > 0) {
403  p->pages.eop = pdf_new_stream(STREAM_COMPRESS);
404  pdf_add_stream(p->pages.eop, content, length);
405  } else {
406  p->pages.eop = NULL;
407  }
408 
409  return;
410 }
411 
412 static void
414 {
415  p->info = pdf_new_dict();
416  pdf_set_info(p->info);
417 
418  return;
419 }
420 
421 static void
423 {
424  pdf_obj *docinfo = p->info;
425 
426  /*
427  * Excerpt from PDF Reference 4th ed., sec. 10.2.1.
428  *
429  * Any entry whose value is not known should be omitted from the dictionary,
430  * rather than included with an empty string as its value.
431  *
432  * ....
433  *
434  * Note: Although viewer applications can store custom metadata in the document
435  * information dictionary, it is inappropriate to store private content or
436  * structural information there; such information should be stored in the
437  * document catalog instead (see Section 3.6.1, Document Catalog ).
438  */
439  const char *keys[] = {
440  "Title", "Author", "Subject", "Keywords", "Creator", "Producer",
441  "CreationDate", "ModDate", /* Date */
442  NULL
443  };
444  pdf_obj *value;
445  int i;
446 
447  for (i = 0; keys[i] != NULL; i++) {
449  if (value) {
450  if (!PDF_OBJ_STRINGTYPE(value)) {
451  WARN("\"%s\" in DocInfo dictionary not string type.", keys[i]);
453  WARN("\"%s\" removed from DocInfo.", keys[i]);
454  } else if (pdf_string_length(value) == 0) {
455  /* The hyperref package often uses emtpy strings. */
457  }
458  }
459  }
460 
461  if (!pdf_lookup_dict(docinfo, "Producer")) {
462  char *banner;
463 
464  banner = NEW(strlen(my_name)+strlen(VERSION)+4, char);
465  sprintf(banner, "%s (%s)", my_name, VERSION);
467  pdf_new_name("Producer"),
469  RELEASE(banner);
470  }
471 
472  if (!pdf_lookup_dict(docinfo, "CreationDate")) {
473  char now[32];
474 
475  dpx_util_format_asn_date(now, 1);
477  pdf_new_name ("CreationDate"),
478  pdf_new_string(now, strlen(now)));
479  }
480 
482  p->info = NULL;
483 
484  return;
485 }
486 
487 static pdf_obj *
488 pdf_doc_get_page_resources (pdf_doc *p, const char *category)
489 {
492  pdf_obj *res_dict;
493 
494  if (!p || !category) {
495  return NULL;
496  }
497 
498  if (p->pending_forms) {
499  if (p->pending_forms->form.resources) {
500  res_dict = p->pending_forms->form.resources;
501  } else {
502  res_dict = p->pending_forms->form.resources = pdf_new_dict();
503  }
504  } else {
506  if (currentpage->resources) {
507  res_dict = currentpage->resources;
508  } else {
509  res_dict = currentpage->resources = pdf_new_dict();
510  }
511  }
512  resources = pdf_lookup_dict(res_dict, category);
513  if (!resources) {
515  pdf_add_dict(res_dict, pdf_new_name(category), resources);
516  } else if (pdf_obj_typeof(resources) == PDF_INDIRECT) {
517  resources = pdf_deref_obj(resources); /* FIXME: deref_obj increment link count */
518  if (!resources) {
519  WARN("Resource %s already released?", category);
520  } else {
521  pdf_release_obj(resources); /* FIXME: just to decrement link count */
522  }
523  }
524 
525  return resources;
526 }
527 
528 void
529 pdf_doc_add_page_resource (const char *category,
530  const char *resource_name, pdf_obj *resource_ref)
531 {
532  pdf_doc *p = &pdoc;
535 
537  if (!resources) {
538  WARN("Can't add object to resource %s", category);
539  return;
540  }
541  duplicate = pdf_lookup_dict(resources, resource_name);
542  if (duplicate) {
543  if (pdf_compare_reference(duplicate, resource_ref)) {
544  WARN("Possibly two different resource using the same name... (page: %d, category: %s, name: %s).",
545  pdf_doc_current_page_number(), category, resource_name);
546  WARN("Ignoring...");
547  }
548  pdf_release_obj(resource_ref); /* Discard */
549  } else {
550  pdf_add_dict(resources, pdf_new_name(resource_name), resource_ref);
551  }
552 
553  return;
554 }
555 
556 static void
558 {
559  pdf_obj *contents_array;
560  int count;
561 
562  pdf_add_dict(page->page_obj,
563  pdf_new_name("Type"), pdf_new_name("Page"));
564  pdf_add_dict(page->page_obj,
565  pdf_new_name("Parent"), parent_ref);
566 
567  /*
568  * Clipping area specified by CropBox is affected by MediaBox which
569  * might be inherit from parent node. If MediaBox of the root node
570  * does not have enough size to cover all page's imaging area, using
571  * CropBox here gives incorrect result.
572  */
573  if (page->flags & USE_MY_MEDIABOX) {
574  pdf_obj *mediabox;
575 
576  mediabox = pdf_new_array();
577  pdf_add_array(mediabox,
578  pdf_new_number(ROUND(page->cropbox.llx, 0.01)));
579  pdf_add_array(mediabox,
580  pdf_new_number(ROUND(page->cropbox.lly, 0.01)));
581  pdf_add_array(mediabox,
582  pdf_new_number(ROUND(page->cropbox.urx, 0.01)));
583  pdf_add_array(mediabox,
584  pdf_new_number(ROUND(page->cropbox.ury, 0.01)));
585  pdf_add_dict(page->page_obj, pdf_new_name("MediaBox"), mediabox);
586  }
587 
588  count = 0;
589  contents_array = pdf_new_array();
590  if (page->content_refs[0]) { /* global bop */
591  pdf_add_array(contents_array, page->content_refs[0]);
592  count++;
593  } else if (p->pages.bop &&
594  pdf_stream_length(p->pages.bop) > 0) {
595  pdf_add_array(contents_array, pdf_ref_obj(p->pages.bop));
596  count++;
597  }
598  if (page->content_refs[1]) { /* background */
599  pdf_add_array(contents_array, page->content_refs[1]);
600  count++;
601  }
602  if (page->content_refs[2]) { /* page body */
603  pdf_add_array(contents_array, page->content_refs[2]);
604  count++;
605  }
606  if (page->content_refs[3]) { /* global eop */
607  pdf_add_array(contents_array, page->content_refs[3]);
608  count++;
609  } else if (p->pages.eop &&
610  pdf_stream_length(p->pages.eop) > 0) {
611  pdf_add_array(contents_array, pdf_ref_obj(p->pages.eop));
612  count++;
613  }
614 
615  if (count == 0) {
616  WARN("Page with empty content found!!!");
617  }
618  page->content_refs[0] = NULL;
619  page->content_refs[1] = NULL;
620  page->content_refs[2] = NULL;
621  page->content_refs[3] = NULL;
622 
623  pdf_add_dict(page->page_obj,
624  pdf_new_name("Contents"), contents_array);
625 
626 
627  if (page->annots) {
628  pdf_add_dict(page->page_obj,
629  pdf_new_name("Annots"), pdf_ref_obj(page->annots));
630  pdf_release_obj(page->annots);
631  }
632  if (page->beads) {
633  pdf_add_dict(page->page_obj,
634  pdf_new_name("B"), pdf_ref_obj(page->beads));
635  pdf_release_obj(page->beads);
636  }
637  pdf_release_obj(page->page_obj);
638  pdf_release_obj(page->page_ref);
639 
640  page->page_obj = NULL;
641  page->page_ref = NULL;
642  page->annots = NULL;
643  page->beads = NULL;
644 
645  return;
646 }
647 
648 /* B-tree? */
649 #define PAGE_CLUSTER 4
650 static pdf_obj *
653  pdf_obj *parent_ref)
654 {
655  pdf_obj *self, *self_ref, *kids;
656  int i;
657 
658  self = pdf_new_dict();
659  /*
660  * This is a slight kludge which allow the subtree dictionary
661  * generated by this routine to be merged with the real
662  * page_tree dictionary, while keeping the indirect object
663  * references right.
664  */
665  self_ref = parent_ref ? pdf_ref_obj(self) : pdf_ref_obj(p->root.pages);
666 
667  pdf_add_dict(self, pdf_new_name("Type"), pdf_new_name("Pages"));
668  pdf_add_dict(self, pdf_new_name("Count"), pdf_new_number((double) num_pages));
669 
670  if (parent_ref != NULL)
671  pdf_add_dict(self, pdf_new_name("Parent"), parent_ref);
672 
673  kids = pdf_new_array();
674  if (num_pages > 0 && num_pages <= PAGE_CLUSTER) {
675  for (i = 0; i < num_pages; i++) {
676  pdf_page *page;
677 
678  page = firstpage + i;
679  if (!page->page_ref)
680  page->page_ref = pdf_ref_obj(page->page_obj);
681  pdf_add_array (kids, pdf_link_obj(page->page_ref));
682  doc_flush_page(p, page, pdf_link_obj(self_ref));
683  }
684  } else if (num_pages > 0) {
685  for (i = 0; i < PAGE_CLUSTER; i++) {
686  int start, end;
687 
689  end = ((i+1)*num_pages)/PAGE_CLUSTER;
690  if (end - start > 1) {
691  pdf_obj *subtree;
692 
693  subtree = build_page_tree(p, firstpage + start, end - start,
694  pdf_link_obj(self_ref));
695  pdf_add_array(kids, pdf_ref_obj(subtree));
696  pdf_release_obj(subtree);
697  } else {
698  pdf_page *page;
699 
700  page = firstpage + start;
701  if (!page->page_ref)
702  page->page_ref = pdf_ref_obj(page->page_obj);
703  pdf_add_array (kids, pdf_link_obj(page->page_ref));
704  doc_flush_page(p, page, pdf_link_obj(self_ref));
705  }
706  }
707  }
708  pdf_add_dict(self, pdf_new_name("Kids"), kids);
709  pdf_release_obj(self_ref);
710 
711  return self;
712 }
713 
714 static void
716 {
717  /*
718  * Create empty page tree.
719  * The docroot.pages is kept open until the document is closed.
720  * This allows the user to write to pages if he so choses.
721  */
722  p->root.pages = pdf_new_dict();
723 
724  p->pages.num_entries = 0;
725  p->pages.max_entries = 0;
726  p->pages.entries = NULL;
727 
728  p->pages.bop = NULL;
729  p->pages.eop = NULL;
730 
731  p->pages.mediabox.llx = 0.0;
732  p->pages.mediabox.lly = 0.0;
733  p->pages.mediabox.urx = media_width;
734  p->pages.mediabox.ury = media_height;
735 
736  return;
737 }
738 
739 static void
741 {
742  pdf_obj *page_tree_root;
743  pdf_obj *mediabox;
744  int page_no;
745 
746  /*
747  * Do consistency check on forward references to pages.
748  */
749  for (page_no = PAGECOUNT(p) + 1; page_no <= MAXPAGES(p); page_no++) {
750  pdf_page *page;
751 
752  page = doc_get_page_entry(p, page_no);
753  if (page->page_obj) {
754  WARN("Nonexistent page #%ld refered.", page_no);
755  pdf_release_obj(page->page_ref);
756  page->page_ref = NULL;
757  }
758  if (page->page_obj) {
759  WARN("Entry for a nonexistent page #%ld created.", page_no);
760  pdf_release_obj(page->page_obj);
761  page->page_obj = NULL;
762  }
763  if (page->annots) {
764  WARN("Annotation attached to a nonexistent page #%ld.", page_no);
765  pdf_release_obj(page->annots);
766  page->annots = NULL;
767  }
768  if (page->beads) {
769  WARN("Article beads attached to a nonexistent page #%ld.", page_no);
770  pdf_release_obj(page->beads);
771  page->beads = NULL;
772  }
773  if (page->resources) {
774  pdf_release_obj(page->resources);
775  page->resources = NULL;
776  }
777  }
778 
779  /*
780  * Connect page tree to root node.
781  */
782  page_tree_root = build_page_tree(p, FIRSTPAGE(p), PAGECOUNT(p), NULL);
783  pdf_merge_dict (p->root.pages, page_tree_root);
784  pdf_release_obj(page_tree_root);
785 
786  /* They must be after build_page_tree() */
787  if (p->pages.bop) {
788  pdf_add_stream (p->pages.bop, "\n", 1);
789  pdf_release_obj(p->pages.bop);
790  p->pages.bop = NULL;
791  }
792  if (p->pages.eop) {
793  pdf_add_stream (p->pages.eop, "\n", 1);
794  pdf_release_obj(p->pages.eop);
795  p->pages.eop = NULL;
796  }
797 
798  /* Create media box at root node and let the other pages inherit it. */
799  mediabox = pdf_new_array();
800  pdf_add_array(mediabox, pdf_new_number(ROUND(p->pages.mediabox.llx, 0.01)));
801  pdf_add_array(mediabox, pdf_new_number(ROUND(p->pages.mediabox.lly, 0.01)));
802  pdf_add_array(mediabox, pdf_new_number(ROUND(p->pages.mediabox.urx, 0.01)));
803  pdf_add_array(mediabox, pdf_new_number(ROUND(p->pages.mediabox.ury, 0.01)));
804  pdf_add_dict(p->root.pages, pdf_new_name("MediaBox"), mediabox);
805 
806  pdf_add_dict(p->root.dict,
807  pdf_new_name("Pages"),
808  pdf_ref_obj (p->root.pages));
809  pdf_release_obj(p->root.pages);
810  p->root.pages = NULL;
811 
812  RELEASE(p->pages.entries);
813  p->pages.entries = NULL;
814  p->pages.num_entries = 0;
815  p->pages.max_entries = 0;
816 
817  return;
818 }
819 
820 int
822 {
823  int count = 0;
825  pdf_obj *catalog;
826 
828 
830 
831  if (!PDF_OBJ_DICTTYPE(page_tree)) {
832  return 0;
833  }
834 
835  {
837  if (!PDF_OBJ_NUMBERTYPE(tmp)) {
838  if (tmp)
839  pdf_release_obj(tmp);
840  return 0;
841  }
842  count = pdf_number_value(tmp);
843  pdf_release_obj(tmp);
844  }
845 
846  return count;
847 }
848 
849 static int
853 {
854  pdf_obj *box = NULL;
855 
856  if (!media_box) {
857  WARN("MediaBox not found in included PDF...");
858  return -1;
859  }
860 #define VALIDATE_BOX(o) if ((o)) {\
861  if (!PDF_OBJ_ARRAYTYPE((o)) || pdf_array_length((o)) != 4) \
862  return -1;\
863 }
869 
870  if (opt_bbox == pdf_page_boundary__auto) {
871  if (crop_box)
873  else if (art_box)
875  else if (trim_box)
877  else if (bleed_box)
879  else {
881  }
882  } else {
883  if (!crop_box) {
885  }
886  if (!art_box) {
888  }
889  if (!trim_box) {
891  }
892  if (!bleed_box) {
894  }
895  /* At this point all boxes must be defined. */
896  switch (opt_bbox) {
899  break;
902  break;
905  break;
908  break;
911  break;
912  default:
914  break;
915  }
916  }
917 
918  if (!box) {
919  /* Impossible */
920  WARN("No appropriate page boudary box found???");
921  return -1;
922  } else {
923  int i;
924 
925  for (i = 4; i--; ) {
926  double x;
928  if (!PDF_OBJ_NUMBERTYPE(tmp)) {
929  pdf_release_obj(tmp);
931  return -1;
932  }
933  x = pdf_number_value(tmp);
934  switch (i) {
935  case 0: bbox->llx = x; break;
936  case 1: bbox->lly = x; break;
937  case 2: bbox->urx = x; break;
938  case 3: bbox->ury = x; break;
939  }
940  pdf_release_obj(tmp);
941  }
942 
943  /* New scheme only for XDV files */
945  opt_bbox != pdf_page_boundary__auto) {
946  for (i = 4; i--; ) {
947  double x;
949  if (!PDF_OBJ_NUMBERTYPE(tmp)) {
950  pdf_release_obj(tmp);
952  return -1;
953  }
954  x = pdf_number_value(tmp);
955  switch (i) {
956  case 0: if (bbox->llx < x) bbox->llx = x; break;
957  case 1: if (bbox->lly < x) bbox->lly = x; break;
958  case 2: if (bbox->urx > x) bbox->urx = x; break;
959  case 3: if (bbox->ury > x) bbox->ury = x; break;
960  }
961  pdf_release_obj(tmp);
962  }
963  }
964  }
966 
967  return 0;
968 }
969 
970 static int
972 {
973  double deg;
974  int rot;
975 
976  matrix->a = matrix->d = 1.0;
977  matrix->b = matrix->c = 0.0;
978  matrix->e = matrix->f = 0.0;
979  /* Handle Rotate */
980  if (rotate) {
981  if (!PDF_OBJ_NUMBERTYPE(rotate)) {
982  return -1;
983  } else {
984  deg = pdf_number_value(rotate);
985  if (deg - (int)deg != 0.0) {
986  WARN("Invalid value specified for /Rotate: %f", deg);
987  return -1;
988  } else if (deg != 0.0) {
989  rot = (int) deg;
990  if (rot % 90 != 0.0) {
991  WARN("Invalid value specified for /Rotate: %f", deg);
992  } else {
993  rot = rot % 360;
994  if (rot < 0) rot += 360;
995  switch (rot) {
996  case 90:
997  matrix->a = matrix->d = 0;
998  matrix->b = -1;
999  matrix->c = 1;
1000  matrix->e = bbox->llx - bbox->lly;
1001  matrix->f = bbox->lly + bbox->urx;
1002  break;
1003  case 180:
1004  matrix->a = matrix->d = -1;
1005  matrix->b = matrix->c = 0;
1006  matrix->e = bbox->llx + bbox->urx;
1007  matrix->f = bbox->lly + bbox->ury;
1008  break;
1009  case 270:
1010  matrix->a = matrix->d = 0;
1011  matrix->b = 1;
1012  matrix->c = -1;
1013  matrix->e = bbox->llx + bbox->ury;
1014  matrix->f = bbox->lly - bbox->llx;
1015  break;
1016  default:
1017  WARN("Invalid value specified for /Rotate: %f", deg);
1018  break;
1019  }
1020  }
1021  }
1022  }
1023  }
1024  return 0;
1025 }
1026 
1027 /*
1028  * From PDFReference15_v6.pdf (p.119 and p.834)
1029  *
1030  * MediaBox rectangle (Required; inheritable)
1031  *
1032  * The media box defines the boundaries of the physical medium on which the
1033  * page is to be printed. It may include any extended area surrounding the
1034  * finished page for bleed, printing marks, or other such purposes. It may
1035  * also include areas close to the edges of the medium that cannot be marked
1036  * because of physical limitations of the output device. Content falling
1037  * outside this boundary can safely be discarded without affecting the
1038  * meaning of the PDF file.
1039  *
1040  * CropBox rectangle (Optional; inheritable)
1041  *
1042  * The crop box defines the region to which the contents of the page are to be
1043  * clipped (cropped) when displayed or printed. Unlike the other boxes, the
1044  * crop box has no defined meaning in terms of physical page geometry or
1045  * intended use; it merely imposes clipping on the page contents. However,
1046  * in the absence of additional information (such as imposition instructions
1047  * specified in a JDF or PJTF job ticket), the crop box will determine how
1048  * the page's contents are to be positioned on the output medium. The default
1049  * value is the page's media box.
1050  *
1051  * BleedBox rectangle (Optional; PDF 1.3)
1052  *
1053  * The bleed box (PDF 1.3) defines the region to which the contents of the
1054  * page should be clipped when output in a production environment. This may
1055  * include any extra "bleed area" needed to accommodate the physical
1056  * limitations of cutting, folding, and trimming equipment. The actual printed
1057  * page may include printing marks that fall outside the bleed box.
1058  * The default value is the page's crop box.
1059  *
1060  * TrimBox rectangle (Optional; PDF 1.3)
1061  *
1062  * The trim box (PDF 1.3) defines the intended dimensions of the finished page
1063  * after trimming. It may be smaller than the media box, to allow for
1064  * production-related content such as printing instructions, cut marks, or
1065  * color bars. The default value is the page's crop box.
1066  *
1067  * ArtBox rectangle (Optional; PDF 1.3)
1068  *
1069  * The art box (PDF 1.3) defines the extent of the page's meaningful content
1070  * (including potential white space) as intended by the page's creator.
1071  * The default value is the page's crop box.
1072  *
1073  * Rotate integer (Optional; inheritable)
1074  *
1075  * The number of degrees by which the page should be rotated clockwise when
1076  * displayed or printed. The value must be a multiple of 90. Default value: 0.
1077  */
1078 
1079 /* count_p removed: Please use different interface if you want to get total page
1080  * number. pdf_doc_get_page() is obviously not an interface to do such.
1081  */
1082 pdf_obj *
1084  int page_no, enum pdf_page_boundary opt_bbox, /* load options */
1085  pdf_rect *bbox, pdf_tmatrix *matrix, /* returned value */
1086  pdf_obj **resources_p /* returned values */
1087  ) {
1089  pdf_obj *resources = NULL, *rotate = NULL;
1092  int error = 0;
1093 
1095 
1097 
1099  goto error_exit;
1100 
1101  {
1102  int count;
1103  pdf_obj *tmp = pdf_deref_obj(pdf_lookup_dict(page_tree, "Count"));
1104  if (!PDF_OBJ_NUMBERTYPE(tmp)) {
1105  if (tmp)
1106  pdf_release_obj(tmp);
1107  goto error_exit;
1108  }
1109  count = pdf_number_value(tmp);
1110  pdf_release_obj(tmp);
1111  if (page_no <= 0 || page_no > count) {
1112  WARN("Page %ld does not exist.", page_no);
1113  goto error_silent;
1114  }
1115  }
1116 
1117  /*
1118  * Seek correct page. Get MediaBox, CropBox and Resources.
1119  * (Note that these entries can be inherited.)
1120  */
1121  {
1122  pdf_obj *kids, *tmp;
1123  int depth = PDF_OBJ_MAX_DEPTH;
1124  int page_idx = page_no - 1, kids_length = 1, i = 0;
1125 
1126  while (--depth && i != kids_length) {
1127  if ((tmp = pdf_deref_obj(pdf_lookup_dict(page_tree, "MediaBox")))) {
1128  if (media_box)
1130  media_box = tmp;
1131  }
1132  if ((tmp = pdf_deref_obj(pdf_lookup_dict(page_tree, "CropBox")))) {
1133  if (crop_box)
1135  crop_box = tmp;
1136  }
1137  if ((tmp = pdf_deref_obj(pdf_lookup_dict(page_tree, "ArtBox")))) {
1138  if (art_box)
1140  art_box = tmp;
1141  }
1142  if ((tmp = pdf_deref_obj(pdf_lookup_dict(page_tree, "TrimBox")))) {
1143  if (trim_box)
1145  trim_box = tmp;
1146  }
1147  if ((tmp = pdf_deref_obj(pdf_lookup_dict(page_tree, "BleedBox")))) {
1148  if (bleed_box)
1150  bleed_box = tmp;
1151  }
1152  if ((tmp = pdf_deref_obj(pdf_lookup_dict(page_tree, "Rotate")))) {
1153  if (rotate)
1155  rotate = tmp;
1156  }
1157  if ((tmp = pdf_deref_obj(pdf_lookup_dict(page_tree, "Resources")))) {
1158  if (resources)
1160  resources = tmp;
1161  }
1162 
1163  kids = pdf_deref_obj(pdf_lookup_dict(page_tree, "Kids"));
1164  if (!kids)
1165  break;
1166  else if (!PDF_OBJ_ARRAYTYPE(kids)) {
1167  pdf_release_obj(kids);
1168  goto error_exit;
1169  }
1170  kids_length = pdf_array_length(kids);
1171 
1172  for (i = 0; i < kids_length; i++) {
1173  int count;
1174 
1178  goto error_exit;
1179 
1180  tmp = pdf_deref_obj(pdf_lookup_dict(page_tree, "Count"));
1181  if (PDF_OBJ_NUMBERTYPE(tmp)) {
1182  /* Pages object */
1183  count = pdf_number_value(tmp);
1184  pdf_release_obj(tmp);
1185  } else if (!tmp)
1186  /* Page object */
1187  count = 1;
1188  else {
1189  pdf_release_obj(tmp);
1190  goto error_exit;
1191  }
1192  if (page_idx < count)
1193  break;
1194  page_idx -= count;
1195  }
1196  pdf_release_obj(kids);
1197  }
1198  if (!depth || kids_length == i)
1199  goto error_exit;
1200  }
1201 
1203  goto error_exit;
1204  if (resources_p)
1205  *resources_p = pdf_link_obj(resources);
1206 
1207  /* Select page boundary box */
1209  if (error)
1210  goto error_exit;
1211  /* Set transformation matrix */
1213  if (error)
1214  goto error_exit;
1215 
1216 goto clean_exit; /* Success */
1217 
1218  error_exit:
1219  WARN("Error found in including PDF image.");
1220  error_silent:
1221  if (page_tree)
1223  page_tree = NULL;
1224 
1225 clean_exit:
1226  if (crop_box)
1228  if (bleed_box)
1230  if (trim_box)
1232  if (art_box)
1234  if (media_box)
1236  if (rotate)
1238  if (resources)
1240 
1241  return page_tree;
1242 }
1243 
1244 #ifndef BOOKMARKS_OPEN_DEFAULT
1245 #define BOOKMARKS_OPEN_DEFAULT 0
1246 #endif
1247 
1248 static int clean_bookmarks (pdf_olitem *item);
1249 static int flush_bookmarks (pdf_olitem *item,
1250  pdf_obj *parent_ref,
1251  pdf_obj *parent_dict);
1252 
1253 static void
1254 pdf_doc_init_bookmarks (pdf_doc *p, int bm_open_depth)
1255 {
1256  pdf_olitem *item;
1257 
1258 #define MAX_OUTLINE_DEPTH 256u
1259  p->options.outline_open_depth =
1260  ((bm_open_depth >= 0) ?
1261  bm_open_depth : MAX_OUTLINE_DEPTH - bm_open_depth);
1262 
1263  p->outlines.current_depth = 1;
1264 
1265  item = NEW(1, pdf_olitem);
1266  item->dict = NULL;
1267  item->next = NULL;
1268  item->first = NULL;
1269  item->parent = NULL;
1270  item->is_open = 1;
1271 
1272  p->outlines.current = item;
1273  p->outlines.first = item;
1274 
1275  return;
1276 }
1277 
1278 static int
1280 {
1281  pdf_olitem *next;
1282 
1283  while (item) {
1284  next = item->next;
1285  if (item->dict)
1286  pdf_release_obj(item->dict);
1287  if (item->first)
1288  clean_bookmarks(item->first);
1289  RELEASE(item);
1290 
1291  item = next;
1292  }
1293 
1294  return 0;
1295 }
1296 
1297 static int
1299  pdf_obj *parent_ref, pdf_obj *parent_dict)
1300 {
1301  int retval;
1302  int count;
1303  pdf_olitem *item;
1304  pdf_obj *this_ref, *prev_ref, *next_ref;
1305 
1306  ASSERT(node->dict);
1307 
1308  this_ref = pdf_ref_obj(node->dict);
1309  pdf_add_dict(parent_dict,
1310  pdf_new_name("First"), pdf_link_obj(this_ref));
1311 
1312  retval = 0;
1313  for (item = node, prev_ref = NULL;
1314  item && item->dict; item = item->next) {
1315  if (item->first && item->first->dict) {
1316  count = flush_bookmarks(item->first, this_ref, item->dict);
1317  if (item->is_open) {
1318  pdf_add_dict(item->dict,
1319  pdf_new_name("Count"),
1321  retval += count;
1322  } else {
1323  pdf_add_dict(item->dict,
1324  pdf_new_name("Count"),
1325  pdf_new_number(-count));
1326  }
1327  }
1328  pdf_add_dict(item->dict,
1329  pdf_new_name("Parent"),
1330  pdf_link_obj(parent_ref));
1331  if (prev_ref) {
1332  pdf_add_dict(item->dict,
1333  pdf_new_name("Prev"),
1334  prev_ref);
1335  }
1336  if (item->next && item->next->dict) {
1337  next_ref = pdf_ref_obj(item->next->dict);
1338  pdf_add_dict(item->dict,
1339  pdf_new_name("Next"),
1340  pdf_link_obj(next_ref));
1341  } else {
1342  next_ref = NULL;
1343  }
1344 
1345  pdf_release_obj(item->dict);
1346  item->dict = NULL;
1347 
1348  prev_ref = this_ref;
1349  this_ref = next_ref;
1350  retval++;
1351  }
1352 
1353  pdf_add_dict(parent_dict,
1354  pdf_new_name("Last"),
1355  pdf_link_obj(prev_ref));
1356 
1357  pdf_release_obj(prev_ref);
1358  pdf_release_obj(node->dict);
1359  node->dict = NULL;
1360 
1361  return retval;
1362 }
1363 
1364 int
1366 {
1367  pdf_doc *p = &pdoc;
1368  pdf_olitem *parent, *item;
1369 
1370  item = p->outlines.current;
1371  if (!item || !item->parent) {
1372  WARN("Can't go up above the bookmark root node!");
1373  return -1;
1374  }
1375  parent = item->parent;
1376  item = parent->next;
1377  if (!parent->next) {
1378  parent->next = item = NEW(1, pdf_olitem);
1379  item->dict = NULL;
1380  item->first = NULL;
1381  item->next = NULL;
1382  item->is_open = 0;
1383  item->parent = parent->parent;
1384  }
1385  p->outlines.current = item;
1386  p->outlines.current_depth--;
1387 
1388  return 0;
1389 }
1390 
1391 int
1393 {
1394  pdf_doc *p = &pdoc;
1395  pdf_olitem *item, *first;
1396 
1397  item = p->outlines.current;
1398  if (!item->dict) {
1399  pdf_obj *tcolor, *action;
1400 
1401  WARN("Empty bookmark node!");
1402  WARN("You have tried to jump more than 1 level.");
1403 
1404  item->dict = pdf_new_dict();
1405 
1406 #define TITLE_STRING "<No Title>"
1407  pdf_add_dict(item->dict,
1408  pdf_new_name("Title"),
1410 
1411  tcolor = pdf_new_array();
1412  pdf_add_array(tcolor, pdf_new_number(1.0));
1413  pdf_add_array(tcolor, pdf_new_number(0.0));
1414  pdf_add_array(tcolor, pdf_new_number(0.0));
1415  pdf_add_dict (item->dict,
1416  pdf_new_name("C"), pdf_link_obj(tcolor));
1417  pdf_release_obj(tcolor);
1418 
1419  pdf_add_dict (item->dict,
1420  pdf_new_name("F"), pdf_new_number(1.0));
1421 
1422 #define JS_CODE "app.alert(\"The author of this document made this bookmark item empty!\", 3, 0)"
1423  action = pdf_new_dict();
1425  pdf_new_name("S"), pdf_new_name("JavaScript"));
1428  pdf_add_dict(item->dict,
1431  }
1432 
1433  item->first = first = NEW(1, pdf_olitem);
1434  first->dict = NULL;
1435  first->is_open = 0;
1436  first->parent = item;
1437  first->next = NULL;
1438  first->first = NULL;
1439 
1440  p->outlines.current = first;
1441  p->outlines.current_depth++;
1442 
1443  return 0;
1444 }
1445 
1446 int
1448 {
1449  pdf_doc *p = &pdoc;
1450 
1451  return p->outlines.current_depth;
1452 }
1453 
1454 void
1456 {
1457  pdf_doc *p = &pdoc;
1458  pdf_olitem *item, *next;
1459 
1460  ASSERT(p && dict);
1461 
1462  item = p->outlines.current;
1463 
1464  if (!item) {
1465  item = NEW(1, pdf_olitem);
1466  item->parent = NULL;
1467  p->outlines.first = item;
1468  } else if (item->dict) { /* go to next item */
1469  item = item->next;
1470  }
1471 
1472 #define BMOPEN(b,p) (((b) < 0) ? (((p)->outlines.current_depth > (p)->options.outline_open_depth) ? 0 : 1) : (b))
1473 
1474 #if 0
1475  item->dict = pdf_link_obj(dict);
1476 #endif
1477  item->dict = dict;
1478  item->first = NULL;
1479  item->is_open = BMOPEN(is_open, p);
1480 
1481  item->next = next = NEW(1, pdf_olitem);
1482  next->dict = NULL;
1483  next->parent = item->parent;
1484  next->first = NULL;
1485  next->is_open = -1;
1486  next->next = NULL;
1487 
1488  p->outlines.current = item;
1489 
1490  pdf_doc_add_goto(dict);
1491 
1492  return;
1493 }
1494 
1495 static void
1497 {
1498  pdf_obj *catalog = p->root.dict;
1499  pdf_olitem *item;
1500  int count;
1501  pdf_obj *bm_root, *bm_root_ref;
1502 
1503  item = p->outlines.first;
1504  if (item->dict) {
1505  bm_root = pdf_new_dict();
1506  bm_root_ref = pdf_ref_obj(bm_root);
1507  count = flush_bookmarks(item, bm_root_ref, bm_root);
1508  pdf_add_dict(bm_root,
1509  pdf_new_name("Count"),
1512  pdf_new_name("Outlines"),
1513  bm_root_ref);
1514  pdf_release_obj(bm_root);
1515  }
1517 
1518  p->outlines.first = NULL;
1519  p->outlines.current = NULL;
1520  p->outlines.current_depth = 0;
1521 
1522  return;
1523 }
1524 
1525 
1526 static const char *name_dict_categories[] = {
1527  "Dests", "AP", "JavaScript", "Pages",
1528  "Templates", "IDS", "URLS", "EmbeddedFiles",
1529  "AlternatePresentations", "Renditions"
1530 };
1531 #define NUM_NAME_CATEGORY (sizeof(name_dict_categories)/sizeof(name_dict_categories[0]))
1532 
1533 static void
1534 pdf_doc_init_names (pdf_doc *p, int check_gotos)
1535 {
1536  int i;
1537 
1538  p->root.names = NULL;
1539 
1540  p->names = NEW(NUM_NAME_CATEGORY + 1, struct name_dict);
1541  for (i = 0; i < NUM_NAME_CATEGORY; i++) {
1542  p->names[i].category = name_dict_categories[i];
1543  p->names[i].data = strcmp(name_dict_categories[i], "Dests") ?
1544  NULL : pdf_new_name_tree();
1545  /*
1546  * We need a non-null entry for PDF destinations in order to find
1547  * broken links even if no destination is defined in the DVI file.
1548  */
1549  }
1550  p->names[NUM_NAME_CATEGORY].category = NULL;
1551  p->names[NUM_NAME_CATEGORY].data = NULL;
1552 
1553  p->check_gotos = check_gotos;
1554  ht_init_table(&p->gotos, (void (*) (void *)) pdf_release_obj);
1555 
1556  return;
1557 }
1558 
1559 int
1560 pdf_doc_add_names (const char *category,
1561  const void *key, int keylen, pdf_obj *value)
1562 {
1563  pdf_doc *p = &pdoc;
1564  int i;
1565 
1566  for (i = 0; p->names[i].category != NULL; i++) {
1567  if (!strcmp(p->names[i].category, category)) {
1568  break;
1569  }
1570  }
1571  if (p->names[i].category == NULL) {
1572  WARN("Unknown name dictionary category \"%s\".", category);
1573  return -1;
1574  }
1575  if (!p->names[i].data) {
1576  p->names[i].data = pdf_new_name_tree();
1577  }
1578 
1579  return pdf_names_add_object(p->names[i].data, key, keylen, value);
1580 }
1581 
1582 static void
1584 {
1585  pdf_obj *subtype = NULL, *A = NULL, *S = NULL, *D = NULL, *D_new, *dict;
1586  const char *dest, *key;
1587  int destlen = 0;
1588 
1589  if (!pdoc.check_gotos)
1590  return;
1591 
1592  /*
1593  * An annotation dictionary coming from an annotation special
1594  * must have a "Subtype". An annotation dictionary coming from
1595  * an outline special has none.
1596  */
1598  if (subtype) {
1600  goto undefined;
1601  else if (!PDF_OBJ_NAMETYPE(subtype))
1602  goto error;
1603  else if (strcmp(pdf_name_value(subtype), "Link"))
1604  goto cleanup;
1605  }
1606 
1607  dict = annot_dict;
1608  key = "Dest";
1610  if (PDF_OBJ_UNDEFINED(D))
1611  goto undefined;
1612 
1614  if (A) {
1615  if (PDF_OBJ_UNDEFINED(A))
1616  goto undefined;
1617  else if (D || !PDF_OBJ_DICTTYPE(A))
1618  goto error;
1619  else {
1620  S = pdf_deref_obj(pdf_lookup_dict(A, "S"));
1621  if (PDF_OBJ_UNDEFINED(S))
1622  goto undefined;
1623  else if (!PDF_OBJ_NAMETYPE(S))
1624  goto error;
1625  else if (strcmp(pdf_name_value(S), "GoTo"))
1626  goto cleanup;
1627 
1628  dict = A;
1629  key = "D";
1631  }
1632  }
1633 
1634  if (PDF_OBJ_STRINGTYPE(D)) {
1635  dest = (char *) pdf_string_value(D);
1636  destlen = pdf_string_length(D);
1637  }
1638 #if 0
1639  /* Names as destinations are not supported by dvipdfmx */
1640  else if (PDF_OBJ_NAMETYPE(D))
1641  dest = pdf_name_value(D);
1642 #endif
1643  else if (PDF_OBJ_ARRAYTYPE(D))
1644  goto cleanup;
1645  else if (PDF_OBJ_UNDEFINED(D))
1646  goto undefined;
1647  else
1648  goto error;
1649 
1650  D_new = ht_lookup_table(&pdoc.gotos, dest, destlen);
1651  if (!D_new) {
1652  char buf[10];
1653 
1654  /* We use hexadecimal notation for our numeric destinations.
1655  * Other bases (e.g., 10+26 or 10+2*26) would be more efficient.
1656  */
1657  sprintf(buf, "%x", ht_table_size(&pdoc.gotos));
1658  D_new = pdf_new_string(buf, strlen(buf));
1659  ht_append_table(&pdoc.gotos, dest, destlen, D_new);
1660  }
1661 
1662  {
1663  pdf_obj *key_obj = pdf_new_name(key);
1664  if (!pdf_add_dict(dict, key_obj, pdf_link_obj(D_new)))
1665  pdf_release_obj(key_obj);
1666  }
1667 
1668  cleanup:
1669  if (subtype)
1671  if (A)
1672  pdf_release_obj(A);
1673  if (S)
1674  pdf_release_obj(S);
1675  if (D)
1676  pdf_release_obj(D);
1677 
1678  return;
1679 
1680  error:
1681  WARN("Unknown PDF annotation format. Output file may be broken.");
1682  goto cleanup;
1683 
1684  undefined:
1685  WARN("Cannot optimize PDF annotations. Output file may be broken."
1686  " Please restart with option \"-C 0x10\"\n");
1687  goto cleanup;
1688 }
1689 
1690 static void
1691 warn_undef_dests (struct ht_table *dests, struct ht_table *gotos)
1692 {
1693  struct ht_iter iter;
1694 
1695  if (ht_set_iter(gotos, &iter) < 0)
1696  return;
1697 
1698  do {
1699  int keylen;
1700  char *key = ht_iter_getkey(&iter, &keylen);
1701  if (!ht_lookup_table(dests, key, keylen)) {
1702  char *dest = NEW(keylen+1, char);
1703  memcpy(dest, key, keylen);
1704  dest[keylen] = 0;
1705  WARN("PDF destination \"%s\" not defined.", dest);
1706  RELEASE(dest);
1707  }
1708  } while (ht_iter_next(&iter) >= 0);
1709 
1710  ht_clear_iter(&iter);
1711 }
1712 
1713 static void
1715 {
1716  pdf_obj *tmp;
1717  int i;
1718 
1719  for (i = 0; p->names[i].category != NULL; i++) {
1720  if (p->names[i].data) {
1721  struct ht_table *data = p->names[i].data;
1722  pdf_obj *name_tree;
1723  int count;
1724 
1725  if (!pdoc.check_gotos || strcmp(p->names[i].category, "Dests"))
1726  name_tree = pdf_names_create_tree(data, &count, NULL);
1727  else {
1728  name_tree = pdf_names_create_tree(data, &count, &pdoc.gotos);
1729 
1730  if (dpx_conf.verbose_level > 0 && count < data->count)
1731  MESG("\nRemoved %ld unused PDF destinations\n", data->count-count);
1732 
1733  if (count < pdoc.gotos.count)
1735  }
1736 
1737  if (name_tree) {
1738  if (!p->root.names)
1739  p->root.names = pdf_new_dict();
1740  pdf_add_dict(p->root.names,
1741  pdf_new_name(p->names[i].category),
1742  pdf_ref_obj(name_tree));
1743  pdf_release_obj(name_tree);
1744  }
1745  pdf_delete_name_tree(&p->names[i].data);
1746  }
1747  }
1748 
1749  if (p->root.names) {
1750  tmp = pdf_lookup_dict(p->root.dict, "Names");
1751  if (!tmp) {
1752  pdf_add_dict(p->root.dict,
1753  pdf_new_name("Names"),
1754  pdf_ref_obj (p->root.names));
1755  } else if (PDF_OBJ_DICTTYPE(tmp)) {
1756  pdf_merge_dict(p->root.names, tmp);
1757  pdf_add_dict(p->root.dict,
1758  pdf_new_name("Names"),
1759  pdf_ref_obj (p->root.names));
1760  } else { /* Maybe reference */
1761  /* What should I do? */
1762  WARN("Could not modify Names dictionary.");
1763  }
1764  pdf_release_obj(p->root.names);
1765  p->root.names = NULL;
1766  }
1767 
1768  RELEASE(p->names);
1769  p->names = NULL;
1770 
1771  ht_clear_table(&p->gotos);
1772 
1773  return;
1774 }
1775 
1776 static void pdf_doc_get_mediabox (unsigned page_no, pdf_rect *mediabox);
1777 
1778 void
1779 pdf_doc_add_annot (unsigned page_no, const pdf_rect *rect,
1780  pdf_obj *annot_dict, int new_annot)
1781 {
1782  pdf_doc *p = &pdoc;
1783  pdf_page *page;
1784  pdf_obj *rect_array;
1785 
1786  page = doc_get_page_entry(p, page_no);
1787  if (!page->annots)
1788  page->annots = pdf_new_array();
1789 
1790  {
1791  pdf_rect mediabox;
1792 
1793  pdf_doc_get_mediabox(page_no, &mediabox);
1794  if (rect->llx < mediabox.llx || rect->urx > mediabox.urx ||
1795  rect->lly < mediabox.lly || rect->ury > mediabox.ury) {
1796  WARN("Annotation out of page boundary.");
1797  WARN("Current page's MediaBox: [%g %g %g %g]",
1798  mediabox.llx, mediabox.lly, mediabox.urx, mediabox.ury);
1799  WARN("Annotation: [%g %g %g %g]",
1800  rect->llx, rect->lly, rect->urx, rect->ury);
1801  WARN("Maybe incorrect paper size specified.");
1802  }
1803  if (rect->llx > rect->urx || rect->lly > rect->ury) {
1804  WARN("Rectangle with negative width/height: [%g %g %g %g]",
1805  rect->llx, rect->lly, rect->urx, rect->ury);
1806  }
1807  }
1808 
1809  rect_array = pdf_new_array();
1810  pdf_add_array(rect_array, pdf_new_number(ROUND(rect->llx, 0.001)));
1811  pdf_add_array(rect_array, pdf_new_number(ROUND(rect->lly, 0.001)));
1812  pdf_add_array(rect_array, pdf_new_number(ROUND(rect->urx, 0.001)));
1813  pdf_add_array(rect_array, pdf_new_number(ROUND(rect->ury, 0.001)));
1814  pdf_add_dict (annot_dict, pdf_new_name("Rect"), rect_array);
1815 
1817 
1818  if (new_annot)
1820 
1821  return;
1822 }
1823 
1824 
1825 /*
1826  * PDF Article Thread
1827  */
1828 static void
1830 {
1831  p->root.threads = NULL;
1832 
1833  p->articles.num_entries = 0;
1834  p->articles.max_entries = 0;
1835  p->articles.entries = NULL;
1836 
1837  return;
1838 }
1839 
1840 void
1841 pdf_doc_begin_article (const char *article_id, pdf_obj *article_info)
1842 {
1843  pdf_doc *p = &pdoc;
1844  pdf_article *article;
1845 
1846  if (article_id == NULL || strlen(article_id) == 0)
1847  ERROR("Article thread without internal identifier.");
1848 
1849  if (p->articles.num_entries >= p->articles.max_entries) {
1850  p->articles.max_entries += PDFDOC_ARTICLE_ALLOC_SIZE;
1851  p->articles.entries = RENEW(p->articles.entries,
1852  p->articles.max_entries, struct pdf_article);
1853  }
1854  article = &(p->articles.entries[p->articles.num_entries]);
1855 
1856  article->id = NEW(strlen(article_id)+1, char);
1857  strcpy(article->id, article_id);
1858  article->info = article_info;
1859  article->num_beads = 0;
1860  article->max_beads = 0;
1861  article->beads = NULL;
1862 
1863  p->articles.num_entries++;
1864 
1865  return;
1866 }
1867 
1868 static pdf_bead *
1869 find_bead (pdf_article *article, const char *bead_id)
1870 {
1871  pdf_bead *bead;
1872  int i;
1873 
1874  bead = NULL;
1875  for (i = 0; i < article->num_beads; i++) {
1876  if (!strcmp(article->beads[i].id, bead_id)) {
1877  bead = &(article->beads[i]);
1878  break;
1879  }
1880  }
1881 
1882  return bead;
1883 }
1884 
1885 void
1886 pdf_doc_add_bead (const char *article_id,
1887  const char *bead_id, int page_no, const pdf_rect *rect)
1888 {
1889  pdf_doc *p = &pdoc;
1890  pdf_article *article;
1891  pdf_bead *bead;
1892  int i;
1893 
1894  if (!article_id) {
1895  ERROR("No article identifier specified.");
1896  }
1897 
1898  article = NULL;
1899  for (i = 0; i < p->articles.num_entries; i++) {
1900  if (!strcmp(p->articles.entries[i].id, article_id)) {
1901  article = &(p->articles.entries[i]);
1902  break;
1903  }
1904  }
1905  if (!article) {
1906  ERROR("Specified article thread that doesn't exist.");
1907  return;
1908  }
1909 
1910  bead = bead_id ? find_bead(article, bead_id) : NULL;
1911  if (!bead) {
1912  if (article->num_beads >= article->max_beads) {
1913  article->max_beads += PDFDOC_BEAD_ALLOC_SIZE;
1914  article->beads = RENEW(article->beads,
1915  article->max_beads, struct pdf_bead);
1916  for (i = article->num_beads; i < article->max_beads; i++) {
1917  article->beads[i].id = NULL;
1918  article->beads[i].page_no = -1;
1919  }
1920  }
1921  bead = &(article->beads[article->num_beads]);
1922  if (bead_id) {
1923  bead->id = NEW(strlen(bead_id)+1, char);
1924  strcpy(bead->id, bead_id);
1925  } else {
1926  bead->id = NULL;
1927  }
1928  article->num_beads++;
1929  }
1930  bead->rect.llx = rect->llx;
1931  bead->rect.lly = rect->lly;
1932  bead->rect.urx = rect->urx;
1933  bead->rect.ury = rect->ury;
1934  bead->page_no = page_no;
1935 
1936  return;
1937 }
1938 
1939 static pdf_obj *
1941  pdf_article *article,
1942  const char **bead_ids, int num_beads,
1943  pdf_obj *article_info)
1944 {
1945  pdf_obj *art_dict;
1946  pdf_obj *first, *prev, *last;
1947  int i, n;
1948 
1949  if (!article)
1950  return NULL;
1951 
1952  art_dict = pdf_new_dict();
1953  first = prev = last = NULL;
1954  /*
1955  * The bead_ids represents logical order of beads in an article thread.
1956  * If bead_ids is not given, we create an article thread in the order of
1957  * beads appeared.
1958  */
1959  n = bead_ids ? num_beads : article->num_beads;
1960  for (i = 0; i < n; i++) {
1961  pdf_bead *bead;
1962 
1963  bead = bead_ids ? find_bead(article, bead_ids[i]) : &(article->beads[i]);
1964  if (!bead || bead->page_no < 0) {
1965  continue;
1966  }
1967  last = pdf_new_dict();
1968  if (prev == NULL) {
1969  first = last;
1971  pdf_new_name("T"), pdf_ref_obj(art_dict));
1972  } else {
1974  pdf_new_name("N"), pdf_ref_obj(last));
1976  pdf_new_name("V"), pdf_ref_obj(prev));
1977  /* We must link first to last. */
1978  if (prev != first)
1980  }
1981 
1982  /* Realize bead now. */
1983  {
1984  pdf_page *page;
1985  pdf_obj *rect;
1986 
1987  page = doc_get_page_entry(p, bead->page_no);
1988  if (!page->beads) {
1989  page->beads = pdf_new_array();
1990  }
1991  pdf_add_dict(last, pdf_new_name("P"), pdf_link_obj(page->page_ref));
1992  rect = pdf_new_array();
1993  pdf_add_array(rect, pdf_new_number(ROUND(bead->rect.llx, 0.01)));
1994  pdf_add_array(rect, pdf_new_number(ROUND(bead->rect.lly, 0.01)));
1995  pdf_add_array(rect, pdf_new_number(ROUND(bead->rect.urx, 0.01)));
1996  pdf_add_array(rect, pdf_new_number(ROUND(bead->rect.ury, 0.01)));
1998  pdf_add_array(page->beads, pdf_ref_obj(last));
1999  }
2000 
2001  prev = last;
2002  }
2003 
2004  if (first && last) {
2006  pdf_new_name("N"), pdf_ref_obj(first));
2008  pdf_new_name("V"), pdf_ref_obj(last));
2009  if (first != last) {
2011  }
2012  pdf_add_dict(art_dict,
2013  pdf_new_name("F"), pdf_ref_obj(first));
2014  /* If article_info is supplied, we override article->info. */
2015  if (article_info) {
2016  pdf_add_dict(art_dict,
2017  pdf_new_name("I"), article_info);
2018  } else if (article->info) {
2019  pdf_add_dict(art_dict,
2020  pdf_new_name("I"), pdf_ref_obj(article->info));
2021  pdf_release_obj(article->info);
2022  article->info = NULL; /* We do not write as object reference. */
2023  }
2025  } else {
2026  pdf_release_obj(art_dict);
2027  art_dict = NULL;
2028  }
2029 
2030  return art_dict;
2031 }
2032 
2033 static void
2035 {
2036  if (!article)
2037  return;
2038 
2039  if (article->beads) {
2040  int i;
2041 
2042  for (i = 0; i < article->num_beads; i++) {
2043  if (article->beads[i].id)
2044  RELEASE(article->beads[i].id);
2045  }
2046  RELEASE(article->beads);
2047  article->beads = NULL;
2048  }
2049 
2050  if (article->id)
2051  RELEASE(article->id);
2052  article->id = NULL;
2053  article->num_beads = 0;
2054  article->max_beads = 0;
2055 
2056  return;
2057 }
2058 
2059 static void
2061 {
2062  int i;
2063 
2064  for (i = 0; i < p->articles.num_entries; i++) {
2065  pdf_article *article;
2066 
2067  article = &(p->articles.entries[i]);
2068  if (article->beads) {
2069  pdf_obj *art_dict;
2070 
2071  art_dict = make_article(p, article, NULL, 0, NULL);
2072  if (!p->root.threads) {
2073  p->root.threads = pdf_new_array();
2074  }
2075  pdf_add_array(p->root.threads, pdf_ref_obj(art_dict));
2076  pdf_release_obj(art_dict);
2077  }
2078  clean_article(article);
2079  }
2080  RELEASE(p->articles.entries);
2081  p->articles.entries = NULL;
2082  p->articles.num_entries = 0;
2083  p->articles.max_entries = 0;
2084 
2085  if (p->root.threads) {
2086  pdf_add_dict(p->root.dict,
2087  pdf_new_name("Threads"),
2088  pdf_ref_obj (p->root.threads));
2089  pdf_release_obj(p->root.threads);
2090  p->root.threads = NULL;
2091  }
2092 
2093  return;
2094 }
2095 
2096 /* page_no = 0 for root page tree node. */
2097 void
2098 pdf_doc_set_mediabox (unsigned page_no, const pdf_rect *mediabox)
2099 {
2100  pdf_doc *p = &pdoc;
2101  pdf_page *page;
2102 
2103  if (page_no == 0) {
2104  p->pages.mediabox.llx = mediabox->llx;
2105  p->pages.mediabox.lly = mediabox->lly;
2106  p->pages.mediabox.urx = mediabox->urx;
2107  p->pages.mediabox.ury = mediabox->ury;
2108  } else {
2109  page = doc_get_page_entry(p, page_no);
2110  page->cropbox.llx = mediabox->llx;
2111  page->cropbox.lly = mediabox->lly;
2112  page->cropbox.urx = mediabox->urx;
2113  page->cropbox.ury = mediabox->ury;
2114  page->flags |= USE_MY_MEDIABOX;
2115  }
2116 
2117  return;
2118 }
2119 
2120 static void
2121 pdf_doc_get_mediabox (unsigned page_no, pdf_rect *mediabox)
2122 {
2123  pdf_doc *p = &pdoc;
2124  pdf_page *page;
2125 
2126  if (page_no == 0) {
2127  mediabox->llx = p->pages.mediabox.llx;
2128  mediabox->lly = p->pages.mediabox.lly;
2129  mediabox->urx = p->pages.mediabox.urx;
2130  mediabox->ury = p->pages.mediabox.ury;
2131  } else {
2132  page = doc_get_page_entry(p, page_no);
2133  if (page->flags & USE_MY_MEDIABOX) {
2134  mediabox->llx = page->cropbox.llx;
2135  mediabox->lly = page->cropbox.lly;
2136  mediabox->urx = page->cropbox.urx;
2137  mediabox->ury = page->cropbox.ury;
2138  } else {
2139  mediabox->llx = p->pages.mediabox.llx;
2140  mediabox->lly = p->pages.mediabox.lly;
2141  mediabox->urx = p->pages.mediabox.urx;
2142  mediabox->ury = p->pages.mediabox.ury;
2143  }
2144  }
2145 
2146  return;
2147 }
2148 
2149 pdf_obj *
2151 {
2152  pdf_obj *resources;
2153  pdf_doc *p = &pdoc;
2155 
2156  if (p->pending_forms) {
2157  if (p->pending_forms->form.resources) {
2158  resources = p->pending_forms->form.resources;
2159  } else {
2160  resources = p->pending_forms->form.resources = pdf_new_dict();
2161  }
2162  } else {
2163  currentpage = LASTPAGE(p);
2164  if (currentpage->resources) {
2165  resources = currentpage->resources;
2166  } else {
2167  resources = currentpage->resources = pdf_new_dict();
2168  }
2169  }
2170 
2171  return resources;
2172 }
2173 
2174 pdf_obj *
2175 pdf_doc_get_dictionary (const char *category)
2176 {
2177  pdf_doc *p = &pdoc;
2178  pdf_obj *dict = NULL;
2179 
2180  ASSERT(category);
2181 
2182  if (!strcmp(category, "Names")) {
2183  if (!p->root.names)
2184  p->root.names = pdf_new_dict();
2185  dict = p->root.names;
2186  } else if (!strcmp(category, "Pages")) {
2187  if (!p->root.pages)
2188  p->root.pages = pdf_new_dict();
2189  dict = p->root.pages;
2190  } else if (!strcmp(category, "Catalog")) {
2191  if (!p->root.dict)
2192  p->root.dict = pdf_new_dict();
2193  dict = p->root.dict;
2194  } else if (!strcmp(category, "Info")) {
2195  if (!p->info)
2196  p->info = pdf_new_dict();
2197  dict = p->info;
2198  } else if (!strcmp(category, "@THISPAGE")) {
2199  /* Sorry for this... */
2201 
2202  currentpage = LASTPAGE(p);
2203  dict = currentpage->page_obj;
2204  }
2205 
2206  if (!dict) {
2207  ERROR("Document dict. \"%s\" not exist. ", category);
2208  }
2209 
2210  return dict;
2211 }
2212 
2213 int
2215 {
2216  pdf_doc *p = &pdoc;
2217 
2218  return (int) (PAGECOUNT(p) + 1);
2219 }
2220 
2221 pdf_obj *
2222 pdf_doc_ref_page (unsigned page_no)
2223 {
2224  pdf_doc *p = &pdoc;
2225  pdf_page *page;
2226 
2227  page = doc_get_page_entry(p, page_no);
2228  if (!page->page_obj) {
2229  page->page_obj = pdf_new_dict();
2230  page->page_ref = pdf_ref_obj(page->page_obj);
2231  }
2232 
2233  return pdf_link_obj(page->page_ref);
2234 }
2235 
2236 pdf_obj *
2237 pdf_doc_get_reference (const char *category)
2238 {
2239  pdf_obj *ref = NULL;
2240  int page_no;
2241 
2242  ASSERT(category);
2243 
2244  page_no = pdf_doc_current_page_number();
2245  if (!strcmp(category, "@THISPAGE")) {
2246  ref = pdf_doc_ref_page(page_no);
2247  } else if (!strcmp(category, "@PREVPAGE")) {
2248  if (page_no <= 1) {
2249  ERROR("Reference to previous page, but no pages have been completed yet.");
2250  }
2251  ref = pdf_doc_ref_page(page_no - 1);
2252  } else if (!strcmp(category, "@NEXTPAGE")) {
2253  ref = pdf_doc_ref_page(page_no + 1);
2254  }
2255 
2256  if (!ref) {
2257  ERROR("Reference to \"%s\" not exist. ", category);
2258  }
2259 
2260  return ref;
2261 }
2262 
2263 static void
2265 {
2267 
2268  if (PAGECOUNT(p) >= MAXPAGES(p)) {
2270  }
2271 
2272  /*
2273  * This is confusing. pdf_doc_finish_page() have increased page count!
2274  */
2275  currentpage = LASTPAGE(p);
2276  /* Was this page already instantiated by a forward reference to it? */
2277  if (!currentpage->page_ref) {
2278  currentpage->page_obj = pdf_new_dict();
2279  currentpage->page_ref = pdf_ref_obj(currentpage->page_obj);
2280  }
2281 
2282  currentpage->background = NULL;
2284  currentpage->resources = pdf_new_dict();
2285 
2286  currentpage->annots = NULL;
2287  currentpage->beads = NULL;
2288 
2289  return;
2290 }
2291 
2292 /* This only closes contents and resources. */
2293 static void
2295 {
2297 
2298  if (p->pending_forms) {
2299  ERROR("A pending form XObject at the end of page.");
2300  }
2301 
2302  currentpage = LASTPAGE(p);
2303  if (!currentpage->page_obj)
2304  currentpage->page_obj = pdf_new_dict();
2305 
2306  /*
2307  * Make Contents array.
2308  */
2309 
2310  /*
2311  * Global BOP content stream.
2312  * pdf_ref_obj() returns reference itself when the object is
2313  * indirect reference, not reference to the indirect reference.
2314  * We keep bop itself but not reference to it since it is
2315  * expected to be small.
2316  */
2317  if (p->pages.bop &&
2318  pdf_stream_length(p->pages.bop) > 0) {
2319  currentpage->content_refs[0] = pdf_ref_obj(p->pages.bop);
2320  } else {
2321  currentpage->content_refs[0] = NULL;
2322  }
2323  /*
2324  * Current page background content stream.
2325  */
2326  if (currentpage->background) {
2327  if (pdf_stream_length(currentpage->background) > 0) {
2328  currentpage->content_refs[1] = pdf_ref_obj(currentpage->background);
2329  pdf_add_stream (currentpage->background, "\n", 1);
2330  }
2331  pdf_release_obj(currentpage->background);
2332  currentpage->background = NULL;
2333  } else {
2334  currentpage->content_refs[1] = NULL;
2335  }
2336 
2337  /* Content body of current page */
2338  currentpage->content_refs[2] = pdf_ref_obj(currentpage->contents);
2339  pdf_add_stream (currentpage->contents, "\n", 1);
2340  pdf_release_obj(currentpage->contents);
2341  currentpage->contents = NULL;
2342 
2343  /*
2344  * Global EOP content stream.
2345  */
2346  if (p->pages.eop &&
2347  pdf_stream_length(p->pages.eop) > 0) {
2348  currentpage->content_refs[3] = pdf_ref_obj(p->pages.eop);
2349  } else {
2350  currentpage->content_refs[3] = NULL;
2351  }
2352 
2353  /*
2354  * Page resources.
2355  */
2356  if (currentpage->resources) {
2357  pdf_obj *procset;
2358  /*
2359  * ProcSet is obsolete in PDF-1.4 but recommended for compatibility.
2360  */
2361 
2362  procset = pdf_new_array ();
2363  pdf_add_array(procset, pdf_new_name("PDF"));
2364  pdf_add_array(procset, pdf_new_name("Text"));
2365  pdf_add_array(procset, pdf_new_name("ImageC"));
2366  pdf_add_array(procset, pdf_new_name("ImageB"));
2367  pdf_add_array(procset, pdf_new_name("ImageI"));
2368  pdf_add_dict(currentpage->resources, pdf_new_name("ProcSet"), procset);
2369 
2370  pdf_add_dict(currentpage->page_obj,
2371  pdf_new_name("Resources"),
2372  pdf_ref_obj(currentpage->resources));
2373  pdf_release_obj(currentpage->resources);
2374  currentpage->resources = NULL;
2375  }
2376 
2377  if (p->options.enable_manual_thumb) {
2378  char *thumb_filename;
2379  pdf_obj *thumb_ref;
2380 
2381  thumb_filename = NEW(strlen(p->thumb_basename)+7, char);
2382  sprintf(thumb_filename, "%s.%ld",
2383  p->thumb_basename, (p->pages.num_entries % 99999) + 1L);
2384  thumb_ref = read_thumbnail(thumb_filename);
2385  RELEASE(thumb_filename);
2386  if (thumb_ref)
2387  pdf_add_dict(currentpage->page_obj, pdf_new_name("Thumb"), thumb_ref);
2388  }
2389 
2390  p->pages.num_entries++;
2391 
2392  return;
2393 }
2394 
2395 static pdf_color bgcolor = { -1, PDF_COLORSPACE_TYPE_GRAY, 1, NULL, { 1.0 }, -1};
2396 
2397 void
2399 {
2400  if (color) {
2402  } else { /* as clear... */
2404  }
2405 }
2406 
2407 static void
2409 {
2411  pdf_rect r;
2412  int cm;
2413  pdf_obj *saved_content;
2414 
2416  if (!cm || pdf_color_is_white(&bgcolor)) {
2417  return;
2418  }
2419 
2421 
2422  currentpage = LASTPAGE(p);
2424 
2425  if (!currentpage->background)
2427 
2428  saved_content = currentpage->contents;
2429  currentpage->contents = currentpage->background;
2430 
2431  pdf_dev_gsave();
2433  pdf_dev_rectfill(r.llx, r.lly, r.urx - r.llx, r.ury - r.lly);
2434  pdf_dev_grestore();
2435 
2436  currentpage->contents = saved_content;
2437 
2438  return;
2439 }
2440 
2441 void
2442 pdf_doc_begin_page (double scale, double x_origin, double y_origin)
2443 {
2444  pdf_doc *p = &pdoc;
2445  pdf_tmatrix M;
2446 
2447  M.a = scale; M.b = 0.0;
2448  M.c = 0.0 ; M.d = scale;
2449  M.e = x_origin;
2450  M.f = y_origin;
2451 
2452  /* pdf_doc_new_page() allocates page content stream. */
2454  pdf_dev_bop(&M);
2455 
2456  return;
2457 }
2458 
2459 void
2461 {
2462  pdf_doc *p = &pdoc;
2463 
2464  pdf_dev_eop();
2466 
2468 
2469  return;
2470 }
2471 
2472 void
2473 pdf_doc_add_page_content (const char *buffer, unsigned length)
2474 {
2475  pdf_doc *p = &pdoc;
2477 
2478  if (p->pending_forms) {
2479  pdf_add_stream(p->pending_forms->form.contents, buffer, length);
2480  } else {
2481  currentpage = LASTPAGE(p);
2482  pdf_add_stream(currentpage->contents, buffer, length);
2483  }
2484 
2485  return;
2486 }
2487 
2488 void
2490  const char *creator,
2491  const unsigned char *id1, const unsigned char *id2,
2492  struct pdf_setting settings)
2493 {
2494  pdf_doc *p = &pdoc;
2495 
2496  pdf_out_init(filename, id1, id2,
2497  settings.ver_major, settings.ver_minor, settings.object.compression_level,
2498  settings.enable_encrypt,
2499  settings.object.enable_objstm, settings.object.enable_predictor);
2500  pdf_files_init();
2501 
2503 
2504  /* After Catalog is created... */
2505  if (settings.enable_encrypt) {
2507  settings.encrypt.oplain, settings.encrypt.uplain,
2508  1, 1);
2509  }
2510 
2511  p->options.annot_grow.x = settings.annot_grow_amount.x;
2512  p->options.annot_grow.y = settings.annot_grow_amount.y;
2513  p->options.outline_open_depth = settings.outline_open_depth;
2514 
2516  pdf_init_colors();
2517  pdf_init_fonts();
2518  /* Thumbnail want this to be initialized... */
2519  pdf_init_images();
2520 
2522  if (creator) {
2523  pdf_add_dict(p->info,
2524  pdf_new_name("Creator"),
2525  pdf_new_string(creator, strlen(creator)));
2526  }
2527 
2530  pdf_doc_init_names (p, settings.check_gotos);
2531  pdf_doc_init_page_tree(p, settings.media_width, settings.media_height);
2532 
2534 
2535  p->options.enable_manual_thumb = settings.enable_manual_thumb;
2536  /* Create a default name for thumbnail image files */
2537  if (p->options.enable_manual_thumb) {
2538  if (strlen(filename) > 4 &&
2539  !strncmp(".pdf", filename + strlen(filename) - 4, 4)) {
2540  size_t len = strlen(filename) - strlen(".pdf");
2541  p->thumb_basename = NEW(len+1, char);
2542  strncpy(p->thumb_basename, filename, len);
2543  p->thumb_basename[len] = 0;
2544  } else {
2545  p->thumb_basename = NEW(strlen(filename)+1, char);
2546  strcpy(p->thumb_basename, filename);
2547  }
2548  }
2549 
2550  p->pending_forms = NULL;
2551 
2552  pdf_init_device(settings.device.dvi2pts, settings.device.precision,
2553  settings.device.ignore_colors);
2554 
2555 
2557 
2558  return;
2559 }
2560 
2561 void
2563 {
2564  pdf_doc *p = &pdoc;
2565 
2567 
2568  pdf_close_device();
2569 
2570  /*
2571  * Following things were kept around so user can add dictionary items.
2572  */
2578 
2580 
2581  pdf_close_images();
2582  pdf_close_fonts ();
2583  pdf_close_colors();
2584 
2585  pdf_close_resources(); /* Should be at last. */
2586 
2587  pdf_files_close();
2588  pdf_out_flush();
2589 
2590  if (p->thumb_basename)
2591  RELEASE(p->thumb_basename);
2592 
2593  return;
2594 }
2595 
2596 /*
2597  * All this routine does is give the form a name and add a unity scaling matrix.
2598  * It fills in required fields. The caller must initialize the stream.
2599  */
2600 static void
2602  pdf_rect *bbox,
2604  pdf_obj *resources,
2605  pdf_obj *attrib)
2606 {
2607  pdf_obj *xform_dict;
2608  pdf_obj *tmp;
2609 
2610  xform_dict = pdf_stream_dict(xform);
2611  pdf_add_dict(xform_dict,
2612  pdf_new_name("Type"), pdf_new_name("XObject"));
2613  pdf_add_dict(xform_dict,
2614  pdf_new_name("Subtype"), pdf_new_name("Form"));
2615  pdf_add_dict(xform_dict,
2616  pdf_new_name("FormType"), pdf_new_number(1.0));
2617 
2618  if (!bbox)
2619  ERROR("No BoundingBox supplied.");
2620 
2621  tmp = pdf_new_array();
2622  pdf_add_array(tmp, pdf_new_number(ROUND(bbox->llx, .001)));
2623  pdf_add_array(tmp, pdf_new_number(ROUND(bbox->lly, .001)));
2624  pdf_add_array(tmp, pdf_new_number(ROUND(bbox->urx, .001)));
2625  pdf_add_array(tmp, pdf_new_number(ROUND(bbox->ury, .001)));
2626  pdf_add_dict(xform_dict, pdf_new_name("BBox"), tmp);
2627 
2628  if (matrix) {
2629  tmp = pdf_new_array();
2630  pdf_add_array(tmp, pdf_new_number(ROUND(matrix->a, .00001)));
2631  pdf_add_array(tmp, pdf_new_number(ROUND(matrix->b, .00001)));
2632  pdf_add_array(tmp, pdf_new_number(ROUND(matrix->c, .00001)));
2633  pdf_add_array(tmp, pdf_new_number(ROUND(matrix->d, .00001)));
2634  pdf_add_array(tmp, pdf_new_number(ROUND(matrix->e, .001 )));
2635  pdf_add_array(tmp, pdf_new_number(ROUND(matrix->f, .001 )));
2636  pdf_add_dict(xform_dict, pdf_new_name("Matrix"), tmp);
2637  }
2638 
2639  if (attrib) {
2640  pdf_merge_dict(xform_dict, attrib);
2641  }
2642 
2643  pdf_add_dict(xform_dict, pdf_new_name("Resources"), resources);
2644 
2645  return;
2646 }
2647 
2648 /*
2649  * begin_form_xobj creates an xobject with its "origin" at
2650  * xpos and ypos that is clipped to the specified bbox. Note
2651  * that the origin is not the lower left corner of the bbox.
2652  */
2653 int
2655  double ref_x, double ref_y, const pdf_rect *cropbox)
2656 {
2657  int xobj_id = -1;
2658  pdf_doc *p = &pdoc;
2659  pdf_form *form;
2660  struct form_list_node *fnode;
2661  xform_info info;
2662 
2664 
2665  fnode = NEW(1, struct form_list_node);
2666 
2667  fnode->prev = p->pending_forms;
2668  fnode->q_depth = pdf_dev_current_depth();
2669  form = &fnode->form;
2670 
2671  /*
2672  * The reference point of an Xobject is at the lower left corner
2673  * of the bounding box. Since we would like to have an arbitrary
2674  * reference point, we use a transformation matrix, translating
2675  * the reference point to (0,0).
2676  */
2677 
2678  form->matrix.a = 1.0; form->matrix.b = 0.0;
2679  form->matrix.c = 0.0; form->matrix.d = 1.0;
2680  form->matrix.e = -ref_x;
2681  form->matrix.f = -ref_y;
2682 
2683  form->cropbox.llx = ref_x + cropbox->llx;
2684  form->cropbox.lly = ref_y + cropbox->lly;
2685  form->cropbox.urx = ref_x + cropbox->urx;
2686  form->cropbox.ury = ref_y + cropbox->ury;
2687 
2690 
2692 
2693  info.matrix.a = 1.0; info.matrix.b = 0.0;
2694  info.matrix.c = 0.0; info.matrix.d = 1.0;
2695  info.matrix.e = -ref_x;
2696  info.matrix.f = -ref_y;
2697 
2698  info.bbox.llx = cropbox->llx;
2699  info.bbox.lly = cropbox->lly;
2700  info.bbox.urx = cropbox->urx;
2701  info.bbox.ury = cropbox->ury;
2702 
2703  /* Use reference since content itself isn't available yet.
2704  * - 2020/07/21 Changed... "forward reference" support requires object itself.
2705  */
2706  xobj_id = pdf_ximage_defineresource(ident,
2709 
2710  p->pending_forms = fnode;
2711 
2712  /*
2713  * Make sure the object is self-contained by adding the
2714  * current font and color to the object stream.
2715  */
2717  pdf_dev_reset_color(1); /* force color operators to be added to stream */
2719 
2720  return xobj_id;
2721 }
2722 
2723 void
2725 {
2726  pdf_form *form;
2727  pdf_obj *procset;
2728  pdf_doc *p = &pdoc;
2729  struct form_list_node *fnode;
2730 
2731  if (!p->pending_forms) {
2732  WARN("Tried to close a nonexistent form XOject.");
2733  return;
2734  }
2735 
2736  fnode = p->pending_forms;
2737  form = &fnode->form;
2738 
2739  pdf_dev_grestore_to(fnode->q_depth);
2740 
2741  /*
2742  * ProcSet is obsolete in PDF-1.4 but recommended for compatibility.
2743  */
2744  procset = pdf_new_array();
2745  pdf_add_array(procset, pdf_new_name("PDF"));
2746  pdf_add_array(procset, pdf_new_name("Text"));
2747  pdf_add_array(procset, pdf_new_name("ImageC"));
2748  pdf_add_array(procset, pdf_new_name("ImageB"));
2749  pdf_add_array(procset, pdf_new_name("ImageI"));
2750  pdf_add_dict (form->resources, pdf_new_name("ProcSet"), procset);
2751 
2753  &form->cropbox, &form->matrix,
2754  pdf_ref_obj(form->resources), attrib);
2757  if (attrib) pdf_release_obj(attrib);
2758 
2759  p->pending_forms = fnode->prev;
2760 
2762 
2766 
2767  RELEASE(fnode);
2768 
2769  return;
2770 }
2771 
2772 static struct
2773 {
2774  int dirty;
2775  int broken;
2778 } breaking_state = {0, 0, NULL, {0.0, 0.0, 0.0, 0.0}};
2779 
2780 static void
2782 {
2783  breaking_state.rect.llx = breaking_state.rect.lly = HUGE_VAL;
2784  breaking_state.rect.urx = breaking_state.rect.ury = -HUGE_VAL;
2785  breaking_state.dirty = 0;
2786 }
2787 
2788 void
2790 {
2791  breaking_state.annot_dict = dict;
2792  breaking_state.broken = 0;
2793  reset_box();
2794 }
2795 
2796 void
2798 {
2800  if (breaking_state.annot_dict)
2801  pdf_release_obj(breaking_state.annot_dict);
2802  breaking_state.annot_dict = NULL;
2803 }
2804 
2805 void
2807 {
2808  pdf_doc *p = &pdoc;
2809  double g_x = p->options.annot_grow.x;
2810  double g_y = p->options.annot_grow.y;
2811 
2812  if (breaking_state.dirty) {
2813  pdf_obj *annot_dict, *annot_copy;
2814  pdf_rect rect;
2815 
2816  /* Copy dict */
2817  annot_dict = breaking_state.annot_dict;
2818  annot_copy = pdf_new_dict();
2819  pdf_merge_dict(annot_copy, breaking_state.annot_dict);
2820  breaking_state.annot_dict = annot_copy;
2821  rect = breaking_state.rect;
2822  rect.llx -= g_x;
2823  rect.lly -= g_y;
2824  rect.urx += g_x;
2825  rect.ury += g_y;
2827  annot_dict, !breaking_state.broken);
2829 
2830  breaking_state.broken = 1;
2831  }
2832  reset_box();
2833 }
2834 
2835 void
2837 {
2838  breaking_state.rect.llx = MIN(breaking_state.rect.llx, rect->llx);
2839  breaking_state.rect.lly = MIN(breaking_state.rect.lly, rect->lly);
2840  breaking_state.rect.urx = MAX(breaking_state.rect.urx, rect->urx);
2841  breaking_state.rect.ury = MAX(breaking_state.rect.ury, rect->ury);
2842  breaking_state.dirty = 1;
2843 }
2844 
2845 #if 0
2846 /* This should be number tree */
2847 void
2848 pdf_doc_set_pagelabel (int pg_start,
2849  const char *type,
2850  const void *prefix, int prfx_len, int start)
2851 {
2852  pdf_doc *p = &pdoc;
2853  pdf_obj *label_dict;
2854 
2855  if (!p->root.pagelabels)
2856  p->root.pagelabels = pdf_new_array();
2857 
2858  label_dict = pdf_new_dict();
2859  if (!type || type[0] == '\0') /* Set back to default. */
2860  pdf_add_dict(label_dict, pdf_new_name("S"), pdf_new_name("D"));
2861  else {
2862  if (type)
2863  pdf_add_dict(label_dict, pdf_new_name("S"), pdf_new_name(type));
2864  if (prefix && prfx_len > 0)
2865  pdf_add_dict(label_dict,
2866  pdf_new_name("P"),
2867  pdf_new_string(prefix, prfx_len));
2868  if (start != 1)
2869  pdf_add_dict(label_dict,
2871  }
2872 
2873  pdf_add_array(p->root.pagelabels, pdf_new_number(pg_start));
2874  pdf_add_array(p->root.pagelabels, label_dict);
2875 
2876  return;
2877 }
2878 #endif
return _Result< 0 ? -1 :_Result;} #line 1069 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _vsnwprintf_s_l(wchar_t *const _Buffer, size_t const _BufferCount, size_t const _MaxCount, wchar_t const *const _Format, _locale_t const _Locale, va_list _ArgList) { int const _Result=__stdio_common_vsnwprintf_s((*__local_stdio_printf_options()), _Buffer, _BufferCount, _MaxCount, _Format, _Locale, _ArgList);return _Result< 0 ? -1 :_Result;} #line 1091 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _vsnwprintf_s(wchar_t *const _Buffer, size_t const _BufferCount, size_t const _MaxCount, wchar_t const *const _Format, va_list _ArgList) { return _vsnwprintf_s_l(_Buffer, _BufferCount, _MaxCount, _Format,((void *) 0), _ArgList);} #line 1108 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __declspec(deprecated("This function or variable may be unsafe. Consider using " "_snwprintf_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) __inline int __cdecl _snwprintf(wchar_t *_Buffer, size_t _BufferCount, wchar_t const *_Format,...);__declspec(deprecated("This function or variable may be unsafe. Consider using " "_vsnwprintf_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) __inline int __cdecl _vsnwprintf(wchar_t *_Buffer, size_t _BufferCount, wchar_t const *_Format, va_list _Args);__declspec(deprecated("This function or variable may be unsafe. Consider using " "_vsnwprintf_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) __inline int __cdecl _vsnwprintf(wchar_t *_Buffer, size_t _BufferCount, wchar_t const *_Format, va_list _ArgList) { return _vsnwprintf_l(_Buffer, _BufferCount, _Format,((void *) 0), _ArgList);} #line 1133 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _vswprintf_c_l(wchar_t *const _Buffer, size_t const _BufferCount, wchar_t const *const _Format, _locale_t const _Locale, va_list _ArgList) { int const _Result=__stdio_common_vswprintf((*__local_stdio_printf_options()), _Buffer, _BufferCount, _Format, _Locale, _ArgList);return _Result< 0 ? -1 :_Result;} #line 1163 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _vswprintf_c(wchar_t *const _Buffer, size_t const _BufferCount, wchar_t const *const _Format, va_list _ArgList) { return _vswprintf_c_l(_Buffer, _BufferCount, _Format,((void *) 0), _ArgList);} #line 1179 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _vswprintf_l(wchar_t *const _Buffer, size_t const _BufferCount, wchar_t const *const _Format, _locale_t const _Locale, va_list _ArgList) { return _vswprintf_c_l(_Buffer, _BufferCount, _Format, _Locale, _ArgList);} #line 1196 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl __vswprintf_l(wchar_t *const _Buffer, wchar_t const *const _Format, _locale_t const _Locale, va_list _ArgList) { return _vswprintf_l(_Buffer,(size_t) -1, _Format, _Locale, _ArgList);} #line 1212 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _vswprintf(wchar_t *const _Buffer, wchar_t const *const _Format, va_list _ArgList) { return _vswprintf_l(_Buffer,(size_t) -1, _Format,((void *) 0), _ArgList);} #line 1227 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl vswprintf(wchar_t *const _Buffer, size_t const _BufferCount, wchar_t const *const _Format, va_list _ArgList) { return _vswprintf_c_l(_Buffer, _BufferCount, _Format,((void *) 0), _ArgList);} #line 1243 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _vswprintf_s_l(wchar_t *const _Buffer, size_t const _BufferCount, wchar_t const *const _Format, _locale_t const _Locale, va_list _ArgList) { int const _Result=__stdio_common_vswprintf_s((*__local_stdio_printf_options()), _Buffer, _BufferCount, _Format, _Locale, _ArgList);return _Result< 0 ? -1 :_Result;} #line 1264 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl vswprintf_s(wchar_t *const _Buffer, size_t const _BufferCount, wchar_t const *const _Format, va_list _ArgList) { return _vswprintf_s_l(_Buffer, _BufferCount, _Format,((void *) 0), _ArgList);} #line 1281 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" #line 1283 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _vswprintf_p_l(wchar_t *const _Buffer, size_t const _BufferCount, wchar_t const *const _Format, _locale_t const _Locale, va_list _ArgList) { int const _Result=__stdio_common_vswprintf_p((*__local_stdio_printf_options()), _Buffer, _BufferCount, _Format, _Locale, _ArgList);return _Result< 0 ? -1 :_Result;} #line 1312 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _vswprintf_p(wchar_t *const _Buffer, size_t const _BufferCount, wchar_t const *const _Format, va_list _ArgList) { return _vswprintf_p_l(_Buffer, _BufferCount, _Format,((void *) 0), _ArgList);} #line 1328 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _vscwprintf_l(wchar_t const *const _Format, _locale_t const _Locale, va_list _ArgList) { int const _Result=__stdio_common_vswprintf((*__local_stdio_printf_options())|(1ULL<< 1),((void *) 0), 0, _Format, _Locale, _ArgList);return _Result< 0 ? -1 :_Result;} #line 1347 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _vscwprintf(wchar_t const *const _Format, va_list _ArgList) { return _vscwprintf_l(_Format,((void *) 0), _ArgList);} #line 1361 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _vscwprintf_p_l(wchar_t const *const _Format, _locale_t const _Locale, va_list _ArgList) { int const _Result=__stdio_common_vswprintf_p((*__local_stdio_printf_options())|(1ULL<< 1),((void *) 0), 0, _Format, _Locale, _ArgList);return _Result< 0 ? -1 :_Result;} #line 1380 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _vscwprintf_p(wchar_t const *const _Format, va_list _ArgList) { return _vscwprintf_p_l(_Format,((void *) 0), _ArgList);} #line 1394 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl __swprintf_l(wchar_t *const _Buffer, wchar_t const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=__vswprintf_l(_Buffer, _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1414 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _swprintf_l(wchar_t *const _Buffer, size_t const _BufferCount, wchar_t const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vswprintf_c_l(_Buffer, _BufferCount, _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1435 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _swprintf(wchar_t *const _Buffer, wchar_t const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=__vswprintf_l(_Buffer, _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1454 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl swprintf(wchar_t *const _Buffer, size_t const _BufferCount, wchar_t const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vswprintf_c_l(_Buffer, _BufferCount, _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1474 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __declspec(deprecated("This function or variable may be unsafe. Consider using " "__swprintf_l_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) __inline int __cdecl __swprintf_l(wchar_t *_Buffer, wchar_t const *_Format, _locale_t _Locale,...);__declspec(deprecated("This function or variable may be unsafe. Consider using " "_vswprintf_s_l" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) __inline int __cdecl __vswprintf_l(wchar_t *_Buffer, wchar_t const *_Format, _locale_t _Locale, va_list _Args);__declspec(deprecated("This function or variable may be unsafe. Consider using " "swprintf_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) __inline int __cdecl _swprintf(wchar_t *_Buffer, wchar_t const *_Format,...);__declspec(deprecated("This function or variable may be unsafe. Consider using " "vswprintf_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) __inline int __cdecl _vswprintf(wchar_t *_Buffer, wchar_t const *_Format, va_list _Args);__inline int __cdecl _swprintf_s_l(wchar_t *const _Buffer, size_t const _BufferCount, wchar_t const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vswprintf_s_l(_Buffer, _BufferCount, _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1511 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl swprintf_s(wchar_t *const _Buffer, size_t const _BufferCount, wchar_t const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vswprintf_s_l(_Buffer, _BufferCount, _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1532 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" #line 1534 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _swprintf_p_l(wchar_t *const _Buffer, size_t const _BufferCount, wchar_t const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vswprintf_p_l(_Buffer, _BufferCount, _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1562 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _swprintf_p(wchar_t *const _Buffer, size_t const _BufferCount, wchar_t const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vswprintf_p_l(_Buffer, _BufferCount, _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1582 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _swprintf_c_l(wchar_t *const _Buffer, size_t const _BufferCount, wchar_t const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vswprintf_c_l(_Buffer, _BufferCount, _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1603 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _swprintf_c(wchar_t *const _Buffer, size_t const _BufferCount, wchar_t const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vswprintf_c_l(_Buffer, _BufferCount, _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1623 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __declspec(deprecated("This function or variable may be unsafe. Consider using " "_snwprintf_s_l" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) __inline int __cdecl _snwprintf_l(wchar_t *const _Buffer, size_t const _BufferCount, wchar_t const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vsnwprintf_l(_Buffer, _BufferCount, _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1646 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _snwprintf(wchar_t *_Buffer, size_t _BufferCount, wchar_t const *_Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vsnwprintf_l(_Buffer, _BufferCount, _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1668 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _snwprintf_s_l(wchar_t *const _Buffer, size_t const _BufferCount, size_t const _MaxCount, wchar_t const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vsnwprintf_s_l(_Buffer, _BufferCount, _MaxCount, _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1690 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _snwprintf_s(wchar_t *const _Buffer, size_t const _BufferCount, size_t const _MaxCount, wchar_t const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vsnwprintf_s_l(_Buffer, _BufferCount, _MaxCount, _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1711 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _scwprintf_l(wchar_t const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vscwprintf_l(_Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1737 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _scwprintf(wchar_t const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vscwprintf_l(_Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1755 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _scwprintf_p_l(wchar_t const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vscwprintf_p_l(_Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1774 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _scwprintf_p(wchar_t const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vscwprintf_p_l(_Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1792 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" #pragma warning(push) #pragma warning(disable:4141 6054) #pragma warning(pop) #line 1856 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" int __cdecl __stdio_common_vswscanf(unsigned __int64 _Options, wchar_t const *_Buffer, size_t _BufferCount, wchar_t const *_Format, _locale_t _Locale, va_list _ArgList);__inline int __cdecl _vswscanf_l(wchar_t const *const _Buffer, wchar_t const *const _Format, _locale_t const _Locale, va_list _ArgList) { return __stdio_common_vswscanf((*__local_stdio_scanf_options()), _Buffer,(size_t) -1, _Format, _Locale, _ArgList);} #line 1897 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl vswscanf(wchar_t const *_Buffer, wchar_t const *_Format, va_list _ArgList) { return _vswscanf_l(_Buffer, _Format,((void *) 0), _ArgList);} #line 1912 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _vswscanf_s_l(wchar_t const *const _Buffer, wchar_t const *const _Format, _locale_t const _Locale, va_list _ArgList) { return __stdio_common_vswscanf((*__local_stdio_scanf_options())|(1ULL<< 0), _Buffer,(size_t) -1, _Format, _Locale, _ArgList);} #line 1930 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl vswscanf_s(wchar_t const *const _Buffer, wchar_t const *const _Format, va_list _ArgList) { return _vswscanf_s_l(_Buffer, _Format,((void *) 0), _ArgList);} #line 1947 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" #line 1949 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __declspec(deprecated("This function or variable may be unsafe. Consider using " "_vsnwscanf_s_l" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) __inline int __cdecl _vsnwscanf_l(wchar_t const *const _Buffer, size_t const _BufferCount, wchar_t const *const _Format, _locale_t const _Locale, va_list _ArgList) { return __stdio_common_vswscanf((*__local_stdio_scanf_options()), _Buffer, _BufferCount, _Format, _Locale, _ArgList);} #line 1976 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _vsnwscanf_s_l(wchar_t const *const _Buffer, size_t const _BufferCount, wchar_t const *const _Format, _locale_t const _Locale, va_list _ArgList) { return __stdio_common_vswscanf((*__local_stdio_scanf_options())|(1ULL<< 0), _Buffer, _BufferCount, _Format, _Locale, _ArgList);} #line 1995 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __declspec(deprecated("This function or variable may be unsafe. Consider using " "_swscanf_s_l" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) __inline int __cdecl _swscanf_l(wchar_t const *const _Buffer, wchar_t const *const _Format, _locale_t _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vswscanf_l(_Buffer, _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 2015 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __declspec(deprecated("This function or variable may be unsafe. Consider using " "swscanf_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) __inline int __cdecl swscanf(wchar_t const *const _Buffer, wchar_t const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vswscanf_l(_Buffer, _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 2034 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _swscanf_s_l(wchar_t const *const _Buffer, wchar_t const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vswscanf_s_l(_Buffer, _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 2054 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl swscanf_s(wchar_t const *const _Buffer, wchar_t const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vswscanf_s_l(_Buffer, _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 2075 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" #line 2077 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __declspec(deprecated("This function or variable may be unsafe. Consider using " "_snwscanf_s_l" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) __inline int __cdecl _snwscanf_l(wchar_t const *const _Buffer, size_t const _BufferCount, wchar_t const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vsnwscanf_l(_Buffer, _BufferCount, _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 2100 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __declspec(deprecated("This function or variable may be unsafe. Consider using " "_snwscanf_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) __inline int __cdecl _snwscanf(wchar_t const *const _Buffer, size_t const _BufferCount, wchar_t const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vsnwscanf_l(_Buffer, _BufferCount, _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 2122 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _snwscanf_s_l(wchar_t const *const _Buffer, size_t const _BufferCount, wchar_t const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vsnwscanf_s_l(_Buffer, _BufferCount, _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 2143 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _snwscanf_s(wchar_t const *const _Buffer, size_t const _BufferCount, wchar_t const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vsnwscanf_s_l(_Buffer, _BufferCount, _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 2163 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __pragma(pack(pop))#pragma warning(pop) #pragma warning(push)#pragma warning(disable:4324 4514 4574 4710 4793 4820 4995 4996 28719 28726 28727) __pragma(pack(push, 8)) typedef __int64 fpos_t;errno_t __cdecl _get_stream_buffer_pointers(FILE *_Stream, char ***_Base, char ***_Pointer, int **_Count);errno_t __cdecl clearerr_s(FILE *_Stream);errno_t __cdecl fopen_s(FILE **_Stream, char const *_FileName, char const *_Mode);size_t __cdecl fread_s(void *_Buffer, size_t _BufferSize, size_t _ElementSize, size_t _ElementCount, FILE *_Stream);errno_t __cdecl freopen_s(FILE **_Stream, char const *_FileName, char const *_Mode, FILE *_OldStream);char *__cdecl gets_s(char *_Buffer, rsize_t _Size);errno_t __cdecl tmpfile_s(FILE **_Stream);errno_t __cdecl tmpnam_s(char *_Buffer, rsize_t _Size);#line 145 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" void __cdecl clearerr(FILE *_Stream);int __cdecl fclose(FILE *_Stream);int __cdecl _fcloseall(void);FILE *__cdecl _fdopen(int _FileHandle, char const *_Mode);int __cdecl feof(FILE *_Stream);int __cdecl ferror(FILE *_Stream);int __cdecl fflush(FILE *_Stream);int __cdecl fgetc(FILE *_Stream);int __cdecl _fgetchar(void);int __cdecl fgetpos(FILE *_Stream, fpos_t *_Position);char *__cdecl fgets(char *_Buffer, int _MaxCount, FILE *_Stream);int __cdecl _fileno(FILE *_Stream);int __cdecl _flushall(void);__declspec(deprecated("This function or variable may be unsafe. Consider using " "fopen_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) FILE *__cdecl fopen(char const *_FileName, char const *_Mode);int __cdecl fputc(int _Character, FILE *_Stream);int __cdecl _fputchar(int _Character);int __cdecl fputs(char const *_Buffer, FILE *_Stream);size_t __cdecl fread(void *_Buffer, size_t _ElementSize, size_t _ElementCount, FILE *_Stream);__declspec(deprecated("This function or variable may be unsafe. Consider using " "freopen_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) FILE *__cdecl freopen(char const *_FileName, char const *_Mode, FILE *_Stream);FILE *__cdecl _fsopen(char const *_FileName, char const *_Mode, int _ShFlag);int __cdecl fsetpos(FILE *_Stream, fpos_t const *_Position);int __cdecl fseek(FILE *_Stream, long _Offset, int _Origin);int __cdecl _fseeki64(FILE *_Stream, __int64 _Offset, int _Origin);long __cdecl ftell(FILE *_Stream);__int64 __cdecl _ftelli64(FILE *_Stream);size_t __cdecl fwrite(void const *_Buffer, size_t _ElementSize, size_t _ElementCount, FILE *_Stream);int __cdecl getc(FILE *_Stream);int __cdecl getchar(void);int __cdecl _getmaxstdio(void);int __cdecl _getw(FILE *_Stream);void __cdecl perror(char const *_ErrorMessage);int __cdecl _pclose(FILE *_Stream);FILE *__cdecl _popen(char const *_Command, char const *_Mode);#line 344 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" int __cdecl putc(int _Character, FILE *_Stream);int __cdecl putchar(int _Character);int __cdecl puts(char const *_Buffer);int __cdecl _putw(int _Word, FILE *_Stream);int __cdecl remove(char const *_FileName);int __cdecl rename(char const *_OldFileName, char const *_NewFileName);int __cdecl _unlink(char const *_FileName);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_unlink" ". See online help for details.")) int __cdecl unlink(char const *_FileName);#line 391 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" void __cdecl rewind(FILE *_Stream);int __cdecl _rmtmp(void);__declspec(deprecated("This function or variable may be unsafe. Consider using " "setvbuf" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) void __cdecl setbuf(FILE *_Stream, char *_Buffer);int __cdecl _setmaxstdio(int _Maximum);int __cdecl setvbuf(FILE *_Stream, char *_Buffer, int _Mode, size_t _Size);__declspec(allocator) char *__cdecl _tempnam(char const *_DirectoryName, char const *_FilePrefix);__declspec(deprecated("This function or variable may be unsafe. Consider using " "tmpfile_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) FILE *__cdecl tmpfile(void);__declspec(deprecated("This function or variable may be unsafe. Consider using " "tmpnam_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) char *__cdecl tmpnam(char *_Buffer);int __cdecl ungetc(int _Character, FILE *_Stream);void __cdecl _lock_file(FILE *_Stream);void __cdecl _unlock_file(FILE *_Stream);int __cdecl _fclose_nolock(FILE *_Stream);int __cdecl _fflush_nolock(FILE *_Stream);int __cdecl _fgetc_nolock(FILE *_Stream);int __cdecl _fputc_nolock(int _Character, FILE *_Stream);size_t __cdecl _fread_nolock(void *_Buffer, size_t _ElementSize, size_t _ElementCount, FILE *_Stream);size_t __cdecl _fread_nolock_s(void *_Buffer, size_t _BufferSize, size_t _ElementSize, size_t _ElementCount, FILE *_Stream);int __cdecl _fseek_nolock(FILE *_Stream, long _Offset, int _Origin);int __cdecl _fseeki64_nolock(FILE *_Stream, __int64 _Offset, int _Origin);long __cdecl _ftell_nolock(FILE *_Stream);__int64 __cdecl _ftelli64_nolock(FILE *_Stream);size_t __cdecl _fwrite_nolock(void const *_Buffer, size_t _ElementSize, size_t _ElementCount, FILE *_Stream);int __cdecl _getc_nolock(FILE *_Stream);int __cdecl _putc_nolock(int _Character, FILE *_Stream);int __cdecl _ungetc_nolock(int _Character, FILE *_Stream);int *__cdecl __p__commode(void);#line 596 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" int __cdecl __stdio_common_vfprintf(unsigned __int64 _Options, FILE *_Stream, char const *_Format, _locale_t _Locale, va_list _ArgList);int __cdecl __stdio_common_vfprintf_s(unsigned __int64 _Options, FILE *_Stream, char const *_Format, _locale_t _Locale, va_list _ArgList);int __cdecl __stdio_common_vfprintf_p(unsigned __int64 _Options, FILE *_Stream, char const *_Format, _locale_t _Locale, va_list _ArgList);__inline int __cdecl _vfprintf_l(FILE *const _Stream, char const *const _Format, _locale_t const _Locale, va_list _ArgList) { return __stdio_common_vfprintf((*__local_stdio_printf_options()), _Stream, _Format, _Locale, _ArgList);} #line 648 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl vfprintf(FILE *const _Stream, char const *const _Format, va_list _ArgList) { return _vfprintf_l(_Stream, _Format,((void *) 0), _ArgList);} #line 662 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _vfprintf_s_l(FILE *const _Stream, char const *const _Format, _locale_t const _Locale, va_list _ArgList) { return __stdio_common_vfprintf_s((*__local_stdio_printf_options()), _Stream, _Format, _Locale, _ArgList);} #line 677 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl vfprintf_s(FILE *const _Stream, char const *const _Format, va_list _ArgList) { return _vfprintf_s_l(_Stream, _Format,((void *) 0), _ArgList);} #line 693 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" #line 695 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _vfprintf_p_l(FILE *const _Stream, char const *const _Format, _locale_t const _Locale, va_list _ArgList) { return __stdio_common_vfprintf_p((*__local_stdio_printf_options()), _Stream, _Format, _Locale, _ArgList);} #line 710 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _vfprintf_p(FILE *const _Stream, char const *const _Format, va_list _ArgList) { return _vfprintf_p_l(_Stream, _Format,((void *) 0), _ArgList);} #line 724 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _vprintf_l(char const *const _Format, _locale_t const _Locale, va_list _ArgList) { return _vfprintf_l((__acrt_iob_func(1)), _Format, _Locale, _ArgList);} #line 738 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl vprintf(char const *const _Format, va_list _ArgList) { return _vfprintf_l((__acrt_iob_func(1)), _Format,((void *) 0), _ArgList);} #line 751 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _vprintf_s_l(char const *const _Format, _locale_t const _Locale, va_list _ArgList) { return _vfprintf_s_l((__acrt_iob_func(1)), _Format, _Locale, _ArgList);} #line 765 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl vprintf_s(char const *const _Format, va_list _ArgList) { return _vfprintf_s_l((__acrt_iob_func(1)), _Format,((void *) 0), _ArgList);} #line 780 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" #line 782 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _vprintf_p_l(char const *const _Format, _locale_t const _Locale, va_list _ArgList) { return _vfprintf_p_l((__acrt_iob_func(1)), _Format, _Locale, _ArgList);} #line 796 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _vprintf_p(char const *const _Format, va_list _ArgList) { return _vfprintf_p_l((__acrt_iob_func(1)), _Format,((void *) 0), _ArgList);} #line 809 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _fprintf_l(FILE *const _Stream, char const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vfprintf_l(_Stream, _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 828 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl fprintf(FILE *const _Stream, char const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vfprintf_l(_Stream, _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 846 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" int __cdecl _set_printf_count_output(int _Value);int __cdecl _get_printf_count_output(void);__inline int __cdecl _fprintf_s_l(FILE *const _Stream, char const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vfprintf_s_l(_Stream, _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 871 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl fprintf_s(FILE *const _Stream, char const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vfprintf_s_l(_Stream, _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 891 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" #line 893 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _fprintf_p_l(FILE *const _Stream, char const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vfprintf_p_l(_Stream, _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 912 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _fprintf_p(FILE *const _Stream, char const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vfprintf_p_l(_Stream, _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 930 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _printf_l(char const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vfprintf_l((__acrt_iob_func(1)), _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 948 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl printf(char const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vfprintf_l((__acrt_iob_func(1)), _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 965 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _printf_s_l(char const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vfprintf_s_l((__acrt_iob_func(1)), _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 983 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl printf_s(char const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vfprintf_s_l((__acrt_iob_func(1)), _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1002 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" #line 1004 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _printf_p_l(char const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vfprintf_p_l((__acrt_iob_func(1)), _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1022 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _printf_p(char const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vfprintf_p_l((__acrt_iob_func(1)), _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1039 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" int __cdecl __stdio_common_vfscanf(unsigned __int64 _Options, FILE *_Stream, char const *_Format, _locale_t _Locale, va_list _Arglist);__inline int __cdecl _vfscanf_l(FILE *const _Stream, char const *const _Format, _locale_t const _Locale, va_list _ArgList) { return __stdio_common_vfscanf((*__local_stdio_scanf_options()), _Stream, _Format, _Locale, _ArgList);} #line 1070 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl vfscanf(FILE *const _Stream, char const *const _Format, va_list _ArgList) { return _vfscanf_l(_Stream, _Format,((void *) 0), _ArgList);} #line 1084 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _vfscanf_s_l(FILE *const _Stream, char const *const _Format, _locale_t const _Locale, va_list _ArgList) { return __stdio_common_vfscanf((*__local_stdio_scanf_options())|(1ULL<< 0), _Stream, _Format, _Locale, _ArgList);} #line 1101 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl vfscanf_s(FILE *const _Stream, char const *const _Format, va_list _ArgList) { return _vfscanf_s_l(_Stream, _Format,((void *) 0), _ArgList);} #line 1118 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" #line 1120 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _vscanf_l(char const *const _Format, _locale_t const _Locale, va_list _ArgList) { return _vfscanf_l((__acrt_iob_func(0)), _Format, _Locale, _ArgList);} #line 1134 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl vscanf(char const *const _Format, va_list _ArgList) { return _vfscanf_l((__acrt_iob_func(0)), _Format,((void *) 0), _ArgList);} #line 1147 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _vscanf_s_l(char const *const _Format, _locale_t const _Locale, va_list _ArgList) { return _vfscanf_s_l((__acrt_iob_func(0)), _Format, _Locale, _ArgList);} #line 1161 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl vscanf_s(char const *const _Format, va_list _ArgList) { return _vfscanf_s_l((__acrt_iob_func(0)), _Format,((void *) 0), _ArgList);} #line 1176 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" #line 1178 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __declspec(deprecated("This function or variable may be unsafe. Consider using " "_fscanf_s_l" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) __inline int __cdecl _fscanf_l(FILE *const _Stream, char const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vfscanf_l(_Stream, _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1197 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __declspec(deprecated("This function or variable may be unsafe. Consider using " "fscanf_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) __inline int __cdecl fscanf(FILE *const _Stream, char const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vfscanf_l(_Stream, _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1215 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _fscanf_s_l(FILE *const _Stream, char const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vfscanf_s_l(_Stream, _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1234 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl fscanf_s(FILE *const _Stream, char const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vfscanf_s_l(_Stream, _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1254 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" #line 1256 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __declspec(deprecated("This function or variable may be unsafe. Consider using " "_scanf_s_l" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) __inline int __cdecl _scanf_l(char const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vfscanf_l((__acrt_iob_func(0)), _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1274 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __declspec(deprecated("This function or variable may be unsafe. Consider using " "scanf_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) __inline int __cdecl scanf(char const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vfscanf_l((__acrt_iob_func(0)), _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1291 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _scanf_s_l(char const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vfscanf_s_l((__acrt_iob_func(0)), _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1309 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl scanf_s(char const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vfscanf_s_l((__acrt_iob_func(0)), _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1328 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" #line 1330 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" int __cdecl __stdio_common_vsprintf(unsigned __int64 _Options, char *_Buffer, size_t _BufferCount, char const *_Format, _locale_t _Locale, va_list _ArgList);int __cdecl __stdio_common_vsprintf_s(unsigned __int64 _Options, char *_Buffer, size_t _BufferCount, char const *_Format, _locale_t _Locale, va_list _ArgList);int __cdecl __stdio_common_vsnprintf_s(unsigned __int64 _Options, char *_Buffer, size_t _BufferCount, size_t _MaxCount, char const *_Format, _locale_t _Locale, va_list _ArgList);int __cdecl __stdio_common_vsprintf_p(unsigned __int64 _Options, char *_Buffer, size_t _BufferCount, char const *_Format, _locale_t _Locale, va_list _ArgList);__declspec(deprecated("This function or variable may be unsafe. Consider using " "_vsnprintf_s_l" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) __inline int __cdecl _vsnprintf_l(char *const _Buffer, size_t const _BufferCount, char const *const _Format, _locale_t const _Locale, va_list _ArgList) { int const _Result=__stdio_common_vsprintf((*__local_stdio_printf_options())|(1ULL<< 0), _Buffer, _BufferCount, _Format, _Locale, _ArgList);return _Result< 0 ? -1 :_Result;} #line 1399 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _vsnprintf(char *const _Buffer, size_t const _BufferCount, char const *const _Format, va_list _ArgList) { return _vsnprintf_l(_Buffer, _BufferCount, _Format,((void *) 0), _ArgList);} #line 1415 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl vsnprintf(char *const _Buffer, size_t const _BufferCount, char const *const _Format, va_list _ArgList) { int const _Result=__stdio_common_vsprintf((*__local_stdio_printf_options())|(1ULL<< 1), _Buffer, _BufferCount, _Format,((void *) 0), _ArgList);return _Result< 0 ? -1 :_Result;} #line 1446 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __declspec(deprecated("This function or variable may be unsafe. Consider using " "_vsprintf_s_l" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) __inline int __cdecl _vsprintf_l(char *const _Buffer, char const *const _Format, _locale_t const _Locale, va_list _ArgList) { return _vsnprintf_l(_Buffer,(size_t) -1, _Format, _Locale, _ArgList);} #line 1462 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __declspec(deprecated("This function or variable may be unsafe. Consider using " "vsprintf_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) __inline int __cdecl vsprintf(char *const _Buffer, char const *const _Format, va_list _ArgList) { return _vsnprintf_l(_Buffer,(size_t) -1, _Format,((void *) 0), _ArgList);} #line 1477 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _vsprintf_s_l(char *const _Buffer, size_t const _BufferCount, char const *const _Format, _locale_t const _Locale, va_list _ArgList) { int const _Result=__stdio_common_vsprintf_s((*__local_stdio_printf_options()), _Buffer, _BufferCount, _Format, _Locale, _ArgList);return _Result< 0 ? -1 :_Result;} #line 1498 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl vsprintf_s(char *const _Buffer, size_t const _BufferCount, char const *const _Format, va_list _ArgList) { return _vsprintf_s_l(_Buffer, _BufferCount, _Format,((void *) 0), _ArgList);} #line 1516 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" #line 1526 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _vsprintf_p_l(char *const _Buffer, size_t const _BufferCount, char const *const _Format, _locale_t const _Locale, va_list _ArgList) { int const _Result=__stdio_common_vsprintf_p((*__local_stdio_printf_options()), _Buffer, _BufferCount, _Format, _Locale, _ArgList);return _Result< 0 ? -1 :_Result;} #line 1547 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _vsprintf_p(char *const _Buffer, size_t const _BufferCount, char const *const _Format, va_list _ArgList) { return _vsprintf_p_l(_Buffer, _BufferCount, _Format,((void *) 0), _ArgList);} #line 1563 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _vsnprintf_s_l(char *const _Buffer, size_t const _BufferCount, size_t const _MaxCount, char const *const _Format, _locale_t const _Locale, va_list _ArgList) { int const _Result=__stdio_common_vsnprintf_s((*__local_stdio_printf_options()), _Buffer, _BufferCount, _MaxCount, _Format, _Locale, _ArgList);return _Result< 0 ? -1 :_Result;} #line 1585 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _vsnprintf_s(char *const _Buffer, size_t const _BufferCount, size_t const _MaxCount, char const *const _Format, va_list _ArgList) { return _vsnprintf_s_l(_Buffer, _BufferCount, _MaxCount, _Format,((void *) 0), _ArgList);} #line 1602 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl vsnprintf_s(char *const _Buffer, size_t const _BufferCount, size_t const _MaxCount, char const *const _Format, va_list _ArgList) { return _vsnprintf_s_l(_Buffer, _BufferCount, _MaxCount, _Format,((void *) 0), _ArgList);} #line 1630 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" #line 1641 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _vscprintf_l(char const *const _Format, _locale_t const _Locale, va_list _ArgList) { int const _Result=__stdio_common_vsprintf((*__local_stdio_printf_options())|(1ULL<< 1),((void *) 0), 0, _Format, _Locale, _ArgList);return _Result< 0 ? -1 :_Result;} #line 1659 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _vscprintf(char const *const _Format, va_list _ArgList) { return _vscprintf_l(_Format,((void *) 0), _ArgList);} #line 1672 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _vscprintf_p_l(char const *const _Format, _locale_t const _Locale, va_list _ArgList) { int const _Result=__stdio_common_vsprintf_p((*__local_stdio_printf_options())|(1ULL<< 1),((void *) 0), 0, _Format, _Locale, _ArgList);return _Result< 0 ? -1 :_Result;} #line 1690 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _vscprintf_p(char const *const _Format, va_list _ArgList) { return _vscprintf_p_l(_Format,((void *) 0), _ArgList);} #line 1703 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _vsnprintf_c_l(char *const _Buffer, size_t const _BufferCount, char const *const _Format, _locale_t const _Locale, va_list _ArgList) { int const _Result=__stdio_common_vsprintf((*__local_stdio_printf_options()), _Buffer, _BufferCount, _Format, _Locale, _ArgList);return _Result< 0 ? -1 :_Result;} #line 1723 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _vsnprintf_c(char *const _Buffer, size_t const _BufferCount, char const *const _Format, va_list _ArgList) { return _vsnprintf_c_l(_Buffer, _BufferCount, _Format,((void *) 0), _ArgList);} #line 1739 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __declspec(deprecated("This function or variable may be unsafe. Consider using " "_sprintf_s_l" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) __inline int __cdecl _sprintf_l(char *const _Buffer, char const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vsprintf_l(_Buffer, _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1761 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl sprintf(char *const _Buffer, char const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vsprintf_l(_Buffer, _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1782 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __declspec(deprecated("This function or variable may be unsafe. Consider using " "sprintf_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) int __cdecl sprintf(char *_Buffer, char const *_Format,...);__declspec(deprecated("This function or variable may be unsafe. Consider using " "vsprintf_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) int __cdecl vsprintf(char *_Buffer, char const *_Format, va_list _Args);__inline int __cdecl _sprintf_s_l(char *const _Buffer, size_t const _BufferCount, char const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vsprintf_s_l(_Buffer, _BufferCount, _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1810 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl sprintf_s(char *const _Buffer, size_t const _BufferCount, char const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vsprintf_s_l(_Buffer, _BufferCount, _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1832 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" #line 1834 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _sprintf_p_l(char *const _Buffer, size_t const _BufferCount, char const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vsprintf_p_l(_Buffer, _BufferCount, _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1862 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _sprintf_p(char *const _Buffer, size_t const _BufferCount, char const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vsprintf_p_l(_Buffer, _BufferCount, _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1882 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __declspec(deprecated("This function or variable may be unsafe. Consider using " "_snprintf_s_l" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) __inline int __cdecl _snprintf_l(char *const _Buffer, size_t const _BufferCount, char const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vsnprintf_l(_Buffer, _BufferCount, _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1905 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl snprintf(char *const _Buffer, size_t const _BufferCount, char const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=vsnprintf(_Buffer, _BufferCount, _Format, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1936 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _snprintf(char *const _Buffer, size_t const _BufferCount, char const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vsnprintf(_Buffer, _BufferCount, _Format, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1956 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __declspec(deprecated("This function or variable may be unsafe. Consider using " "_snprintf_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) int __cdecl _snprintf(char *_Buffer, size_t _BufferCount, char const *_Format,...);__declspec(deprecated("This function or variable may be unsafe. Consider using " "_vsnprintf_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) int __cdecl _vsnprintf(char *_Buffer, size_t _BufferCount, char const *_Format, va_list _Args);__inline int __cdecl _snprintf_c_l(char *const _Buffer, size_t const _BufferCount, char const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vsnprintf_c_l(_Buffer, _BufferCount, _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1986 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _snprintf_c(char *const _Buffer, size_t const _BufferCount, char const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vsnprintf_c_l(_Buffer, _BufferCount, _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 2006 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _snprintf_s_l(char *const _Buffer, size_t const _BufferCount, size_t const _MaxCount, char const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vsnprintf_s_l(_Buffer, _BufferCount, _MaxCount, _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 2028 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _snprintf_s(char *const _Buffer, size_t const _BufferCount, size_t const _MaxCount, char const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vsnprintf_s_l(_Buffer, _BufferCount, _MaxCount, _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 2049 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _scprintf_l(char const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vscprintf_l(_Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 2075 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _scprintf(char const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vscprintf_l(_Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 2092 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _scprintf_p_l(char const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vscprintf_p_l(_Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 2110 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _scprintf_p(char const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vscprintf_p(_Format, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 2127 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" int __cdecl __stdio_common_vsscanf(unsigned __int64 _Options, char const *_Buffer, size_t _BufferCount, char const *_Format, _locale_t _Locale, va_list _ArgList);__inline int __cdecl _vsscanf_l(char const *const _Buffer, char const *const _Format, _locale_t const _Locale, va_list _ArgList) { return __stdio_common_vsscanf((*__local_stdio_scanf_options()), _Buffer,(size_t) -1, _Format, _Locale, _ArgList);} #line 2158 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl vsscanf(char const *const _Buffer, char const *const _Format, va_list _ArgList) { return _vsscanf_l(_Buffer, _Format,((void *) 0), _ArgList);} #line 2172 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _vsscanf_s_l(char const *const _Buffer, char const *const _Format, _locale_t const _Locale, va_list _ArgList) { return __stdio_common_vsscanf((*__local_stdio_scanf_options())|(1ULL<< 0), _Buffer,(size_t) -1, _Format, _Locale, _ArgList);} #line 2189 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" #pragma warning(push) #pragma warning(disable:6530) __inline int __cdecl vsscanf_s(char const *const _Buffer, char const *const _Format, va_list _ArgList) { return _vsscanf_s_l(_Buffer, _Format,((void *) 0), _ArgList);} #line 2208 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" #pragma warning(pop) #line 2219 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __declspec(deprecated("This function or variable may be unsafe. Consider using " "_sscanf_s_l" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) __inline int __cdecl _sscanf_l(char const *const _Buffer, char const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vsscanf_l(_Buffer, _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 2238 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __declspec(deprecated("This function or variable may be unsafe. Consider using " "sscanf_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) __inline int __cdecl sscanf(char const *const _Buffer, char const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vsscanf_l(_Buffer, _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 2256 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _sscanf_s_l(char const *const _Buffer, char const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vsscanf_s_l(_Buffer, _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 2275 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl sscanf_s(char const *const _Buffer, char const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=vsscanf_s(_Buffer, _Format, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 2297 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" #line 2299 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" #pragma warning(push) #pragma warning(disable:6530) __declspec(deprecated("This function or variable may be unsafe. Consider using " "_snscanf_s_l" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) __inline int __cdecl _snscanf_l(char const *const _Buffer, size_t const _BufferCount, char const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=__stdio_common_vsscanf((*__local_stdio_scanf_options()), _Buffer, _BufferCount, _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 2326 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __declspec(deprecated("This function or variable may be unsafe. Consider using " "_snscanf_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) __inline int __cdecl _snscanf(char const *const _Buffer, size_t const _BufferCount, char const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=__stdio_common_vsscanf((*__local_stdio_scanf_options()), _Buffer, _BufferCount, _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 2349 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _snscanf_s_l(char const *const _Buffer, size_t const _BufferCount, char const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=__stdio_common_vsscanf((*__local_stdio_scanf_options())|(1ULL<< 0), _Buffer, _BufferCount, _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 2374 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _snscanf_s(char const *const _Buffer, size_t const _BufferCount, char const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=__stdio_common_vsscanf((*__local_stdio_scanf_options())|(1ULL<< 0), _Buffer, _BufferCount, _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 2397 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" #pragma warning(pop) __declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_tempnam" ". See online help for details.")) char *__cdecl tempnam(char const *_Directory, char const *_FilePrefix);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_fcloseall" ". See online help for details.")) int __cdecl fcloseall(void);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_fdopen" ". See online help for details.")) FILE *__cdecl fdopen(int _FileHandle, char const *_Format);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_fgetchar" ". See online help for details.")) int __cdecl fgetchar(void);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_fileno" ". See online help for details.")) int __cdecl fileno(FILE *_Stream);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_flushall" ". See online help for details.")) int __cdecl flushall(void);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_fputchar" ". See online help for details.")) int __cdecl fputchar(int _Ch);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_getw" ". See online help for details.")) int __cdecl getw(FILE *_Stream);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_putw" ". See online help for details.")) int __cdecl putw(int _Ch, FILE *_Stream);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_rmtmp" ". See online help for details.")) int __cdecl rmtmp(void);#line 2441 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h"__pragma(pack(pop))#pragma warning(pop) #pragma once#pragma once#pragma once#pragma once#pragma warning(push)#pragma warning(disable:4324 4514 4574 4710 4793 4820 4995 4996 28719 28726 28727) __pragma(pack(push, 8)) int *__cdecl _errno(void);errno_t __cdecl _set_errno(int _Value);errno_t __cdecl _get_errno(int *_Value);unsigned long *__cdecl __doserrno(void);errno_t __cdecl _set_doserrno(unsigned long _Value);errno_t __cdecl _get_doserrno(unsigned long *_Value);__pragma(pack(pop))#pragma warning(pop) #pragma once#pragma warning(push)#pragma warning(disable:4514 4820) __pragma(pack(push, 8)) void *__cdecl memchr(void const *_Buf, int _Val, size_t _MaxCount);int __cdecl memcmp(void const *_Buf1, void const *_Buf2, size_t _Size);void *__cdecl memcpy(void *_Dst, void const *_Src, size_t _Size);void *__cdecl memmove(void *_Dst, void const *_Src, size_t _Size);void *__cdecl memset(void *_Dst, int _Val, size_t _Size);char *__cdecl strchr(char const *_Str, int _Val);char *__cdecl strrchr(char const *_Str, int _Ch);char *__cdecl strstr(char const *_Str, char const *_SubStr);wchar_t *__cdecl wcschr(wchar_t const *_Str, wchar_t _Ch);wchar_t *__cdecl wcsrchr(wchar_t const *_Str, wchar_t _Ch);wchar_t *__cdecl wcsstr(wchar_t const *_Str, wchar_t const *_SubStr);__pragma(pack(pop))#pragma warning(pop) #pragma warning(push)#pragma warning(disable:4324 4514 4574 4710 4793 4820 4995 4996 28719 28726 28727) __pragma(pack(push, 8)) static __inline errno_t __cdecl memcpy_s(void *const _Destination, rsize_t const _DestinationSize, void const *const _Source, rsize_t const _SourceSize) { if(_SourceSize==0) { return 0;} { int _Expr_val=!!(_Destination !=((void *) 0));if(!(_Expr_val)) {(*_errno())=22;_invalid_parameter_noinfo();return 22;} } ;if(_Source==((void *) 0)||_DestinationSize< _SourceSize) { memset(_Destination, 0, _DestinationSize);{ int _Expr_val=!!(_Source !=((void *) 0));if(!(_Expr_val)) {(*_errno())=22;_invalid_parameter_noinfo();return 22;} } ;{ int _Expr_val=!!(_DestinationSize >=_SourceSize);if(!(_Expr_val)) {(*_errno())=34;_invalid_parameter_noinfo();return 34;} } ;return 22 ;} memcpy(_Destination, _Source, _SourceSize);return 0;} static __inline errno_t __cdecl memmove_s(void *const _Destination, rsize_t const _DestinationSize, void const *const _Source, rsize_t const _SourceSize) { if(_SourceSize==0) { return 0;} { int _Expr_val=!!(_Destination !=((void *) 0));if(!(_Expr_val)) {(*_errno())=22;_invalid_parameter_noinfo();return 22;} } ;{ int _Expr_val=!!(_Source !=((void *) 0));if(!(_Expr_val)) {(*_errno())=22;_invalid_parameter_noinfo();return 22;} } ;{ int _Expr_val=!!(_DestinationSize >=_SourceSize);if(!(_Expr_val)) {(*_errno())=34;_invalid_parameter_noinfo();return 34;} } ;memmove(_Destination, _Source, _SourceSize);return 0;}#pragma warning(pop) __pragma(pack(pop))#pragma warning(push)#pragma warning(disable:4324 4514 4574 4710 4793 4820 4995 4996 28719 28726 28727) __pragma(pack(push, 8)) int __cdecl _memicmp(void const *_Buf1, void const *_Buf2, size_t _Size);int __cdecl _memicmp_l(void const *_Buf1, void const *_Buf2, size_t _Size, _locale_t _Locale);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_memccpy" ". See online help for details.")) void *__cdecl memccpy(void *_Dst, void const *_Src, int _Val, size_t _Size);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_memicmp" ". See online help for details.")) int __cdecl memicmp(void const *_Buf1, void const *_Buf2, size_t _Size);__pragma(pack(pop))#pragma warning(pop) #pragma once#pragma warning(push)#pragma warning(disable:4324 4514 4574 4710 4793 4820 4995 4996 28719 28726 28727) __pragma(pack(push, 8)) errno_t __cdecl wcscat_s(wchar_t *_Destination, rsize_t _SizeInWords, wchar_t const *_Source);errno_t __cdecl wcscpy_s(wchar_t *_Destination, rsize_t _SizeInWords, wchar_t const *_Source);errno_t __cdecl wcsncat_s(wchar_t *_Destination, rsize_t _SizeInWords, wchar_t const *_Source, rsize_t _MaxCount);errno_t __cdecl wcsncpy_s(wchar_t *_Destination, rsize_t _SizeInWords, wchar_t const *_Source, rsize_t _MaxCount);wchar_t *__cdecl wcstok_s(wchar_t *_String, wchar_t const *_Delimiter, wchar_t **_Context);__declspec(allocator) wchar_t *__cdecl _wcsdup(wchar_t const *_String);__declspec(deprecated("This function or variable may be unsafe. Consider using " "wcscat_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) wchar_t *__cdecl wcscat(wchar_t *_Destination, wchar_t const *_Source);int __cdecl wcscmp(wchar_t const *_String1, wchar_t const *_String2);__declspec(deprecated("This function or variable may be unsafe. Consider using " "wcscpy_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) wchar_t *__cdecl wcscpy(wchar_t *_Destination, wchar_t const *_Source);size_t __cdecl wcscspn(wchar_t const *_String, wchar_t const *_Control);size_t __cdecl wcslen(wchar_t const *_String);size_t __cdecl wcsnlen(wchar_t const *_Source, size_t _MaxCount);static __inline size_t __cdecl wcsnlen_s(wchar_t const *_Source, size_t _MaxCount) { return(_Source==0) ? 0 :wcsnlen(_Source, _MaxCount);}__declspec(deprecated("This function or variable may be unsafe. Consider using " "wcsncat_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) wchar_t *__cdecl wcsncat(wchar_t *_Destination, wchar_t const *_Source, size_t _Count);int __cdecl wcsncmp(wchar_t const *_String1, wchar_t const *_String2, size_t _MaxCount);__declspec(deprecated("This function or variable may be unsafe. Consider using " "wcsncpy_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) wchar_t *__cdecl wcsncpy(wchar_t *_Destination, wchar_t const *_Source, size_t _Count);wchar_t *__cdecl wcspbrk(wchar_t const *_String, wchar_t const *_Control);size_t __cdecl wcsspn(wchar_t const *_String, wchar_t const *_Control);__declspec(deprecated("This function or variable may be unsafe. Consider using " "wcstok_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) wchar_t *__cdecl wcstok(wchar_t *_String, wchar_t const *_Delimiter, wchar_t **_Context);#line 237 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstring.h" __declspec(deprecated("This function or variable may be unsafe. Consider using " "wcstok_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) static __inline wchar_t *__cdecl _wcstok(wchar_t *const _String, wchar_t const *const _Delimiter) { return wcstok(_String, _Delimiter, 0);} __declspec(deprecated("This function or variable may be unsafe. Consider using " "_wcserror_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) wchar_t *__cdecl _wcserror(int _ErrorNumber);errno_t __cdecl _wcserror_s(wchar_t *_Buffer, size_t _SizeInWords, int _ErrorNumber);__declspec(deprecated("This function or variable may be unsafe. Consider using " "__wcserror_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) wchar_t *__cdecl __wcserror(wchar_t const *_String);errno_t __cdecl __wcserror_s(wchar_t *_Buffer, size_t _SizeInWords, wchar_t const *_ErrorMessage);int __cdecl _wcsicmp(wchar_t const *_String1, wchar_t const *_String2);int __cdecl _wcsicmp_l(wchar_t const *_String1, wchar_t const *_String2, _locale_t _Locale);int __cdecl _wcsnicmp(wchar_t const *_String1, wchar_t const *_String2, size_t _MaxCount);int __cdecl _wcsnicmp_l(wchar_t const *_String1, wchar_t const *_String2, size_t _MaxCount, _locale_t _Locale);errno_t __cdecl _wcsnset_s(wchar_t *_Destination, size_t _SizeInWords, wchar_t _Value, size_t _MaxCount);__declspec(deprecated("This function or variable may be unsafe. Consider using " "_wcsnset_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) wchar_t *__cdecl _wcsnset(wchar_t *_String, wchar_t _Value, size_t _MaxCount);wchar_t *__cdecl _wcsrev(wchar_t *_String);errno_t __cdecl _wcsset_s(wchar_t *_Destination, size_t _SizeInWords, wchar_t _Value);__declspec(deprecated("This function or variable may be unsafe. Consider using " "_wcsset_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) wchar_t *__cdecl _wcsset(wchar_t *_String, wchar_t _Value);errno_t __cdecl _wcslwr_s(wchar_t *_String, size_t _SizeInWords);__declspec(deprecated("This function or variable may be unsafe. Consider using " "_wcslwr_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) wchar_t *__cdecl _wcslwr(wchar_t *_String);errno_t __cdecl _wcslwr_s_l(wchar_t *_String, size_t _SizeInWords, _locale_t _Locale);__declspec(deprecated("This function or variable may be unsafe. Consider using " "_wcslwr_s_l" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) wchar_t *__cdecl _wcslwr_l(wchar_t *_String, _locale_t _Locale);errno_t __cdecl _wcsupr_s(wchar_t *_String, size_t _Size);__declspec(deprecated("This function or variable may be unsafe. Consider using " "_wcsupr_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) wchar_t *__cdecl _wcsupr(wchar_t *_String);errno_t __cdecl _wcsupr_s_l(wchar_t *_String, size_t _Size, _locale_t _Locale);__declspec(deprecated("This function or variable may be unsafe. Consider using " "_wcsupr_s_l" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) wchar_t *__cdecl _wcsupr_l(wchar_t *_String, _locale_t _Locale);size_t __cdecl wcsxfrm(wchar_t *_Destination, wchar_t const *_Source, size_t _MaxCount);size_t __cdecl _wcsxfrm_l(wchar_t *_Destination, wchar_t const *_Source, size_t _MaxCount, _locale_t _Locale);int __cdecl wcscoll(wchar_t const *_String1, wchar_t const *_String2);int __cdecl _wcscoll_l(wchar_t const *_String1, wchar_t const *_String2, _locale_t _Locale);int __cdecl _wcsicoll(wchar_t const *_String1, wchar_t const *_String2);int __cdecl _wcsicoll_l(wchar_t const *_String1, wchar_t const *_String2, _locale_t _Locale);int __cdecl _wcsncoll(wchar_t const *_String1, wchar_t const *_String2, size_t _MaxCount);int __cdecl _wcsncoll_l(wchar_t const *_String1, wchar_t const *_String2, size_t _MaxCount, _locale_t _Locale);int __cdecl _wcsnicoll(wchar_t const *_String1, wchar_t const *_String2, size_t _MaxCount);int __cdecl _wcsnicoll_l(wchar_t const *_String1, wchar_t const *_String2, size_t _MaxCount, _locale_t _Locale);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_wcsdup" ". See online help for details.")) wchar_t *__cdecl wcsdup(wchar_t const *_String);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_wcsicmp" ". See online help for details.")) int __cdecl wcsicmp(wchar_t const *_String1, wchar_t const *_String2);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_wcsnicmp" ". See online help for details.")) int __cdecl wcsnicmp(wchar_t const *_String1, wchar_t const *_String2, size_t _MaxCount);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_wcsnset" ". See online help for details.")) wchar_t *__cdecl wcsnset(wchar_t *_String, wchar_t _Value, size_t _MaxCount);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_wcsrev" ". See online help for details.")) wchar_t *__cdecl wcsrev(wchar_t *_String);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_wcsset" ". See online help for details.")) wchar_t *__cdecl wcsset(wchar_t *_String, wchar_t _Value);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_wcslwr" ". See online help for details.")) wchar_t *__cdecl wcslwr(wchar_t *_String);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_wcsupr" ". See online help for details.")) wchar_t *__cdecl wcsupr(wchar_t *_String);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_wcsicoll" ". See online help for details.")) int __cdecl wcsicoll(wchar_t const *_String1, wchar_t const *_String2);__pragma(pack(pop))#pragma warning(pop) #pragma warning(push)#pragma warning(disable:4324 4514 4574 4710 4793 4820 4995 4996 28719 28726 28727) __pragma(pack(push, 8)) errno_t __cdecl strcpy_s(char *_Destination, rsize_t _SizeInBytes, char const *_Source);errno_t __cdecl strcat_s(char *_Destination, rsize_t _SizeInBytes, char const *_Source);errno_t __cdecl strerror_s(char *_Buffer, size_t _SizeInBytes, int _ErrorNumber);errno_t __cdecl strncat_s(char *_Destination, rsize_t _SizeInBytes, char const *_Source, rsize_t _MaxCount);errno_t __cdecl strncpy_s(char *_Destination, rsize_t _SizeInBytes, char const *_Source, rsize_t _MaxCount);char *__cdecl strtok_s(char *_String, char const *_Delimiter, char **_Context);void *__cdecl _memccpy(void *_Dst, void const *_Src, int _Val, size_t _MaxCount);__declspec(deprecated("This function or variable may be unsafe. Consider using " "strcat_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) char *__cdecl strcat(char *_Destination, char const *_Source);int __cdecl strcmp(char const *_Str1, char const *_Str2);int __cdecl _strcmpi(char const *_String1, char const *_String2);int __cdecl strcoll(char const *_String1, char const *_String2);int __cdecl _strcoll_l(char const *_String1, char const *_String2, _locale_t _Locale);__declspec(deprecated("This function or variable may be unsafe. Consider using " "strcpy_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) char *__cdecl strcpy(char *_Destination, char const *_Source);size_t __cdecl strcspn(char const *_Str, char const *_Control);__declspec(allocator) char *__cdecl _strdup(char const *_Source);__declspec(deprecated("This function or variable may be unsafe. Consider using " "_strerror_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) char *__cdecl _strerror(char const *_ErrorMessage);errno_t __cdecl _strerror_s(char *_Buffer, size_t _SizeInBytes, char const *_ErrorMessage);__declspec(deprecated("This function or variable may be unsafe. Consider using " "strerror_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) char *__cdecl strerror(int _ErrorMessage);int __cdecl _stricmp(char const *_String1, char const *_String2);int __cdecl _stricoll(char const *_String1, char const *_String2);int __cdecl _stricoll_l(char const *_String1, char const *_String2, _locale_t _Locale);int __cdecl _stricmp_l(char const *_String1, char const *_String2, _locale_t _Locale);size_t __cdecl strlen(char const *_Str);errno_t __cdecl _strlwr_s(char *_String, size_t _Size);__declspec(deprecated("This function or variable may be unsafe. Consider using " "_strlwr_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) char *__cdecl _strlwr(char *_String);errno_t __cdecl _strlwr_s_l(char *_String, size_t _Size, _locale_t _Locale);__declspec(deprecated("This function or variable may be unsafe. Consider using " "_strlwr_s_l" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) char *__cdecl _strlwr_l(char *_String, _locale_t _Locale);__declspec(deprecated("This function or variable may be unsafe. Consider using " "strncat_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) char *__cdecl strncat(char *_Destination, char const *_Source, size_t _Count);int __cdecl strncmp(char const *_Str1, char const *_Str2, size_t _MaxCount);int __cdecl _strnicmp(char const *_String1, char const *_String2, size_t _MaxCount);int __cdecl _strnicmp_l(char const *_String1, char const *_String2, size_t _MaxCount, _locale_t _Locale);int __cdecl _strnicoll(char const *_String1, char const *_String2, size_t _MaxCount);int __cdecl _strnicoll_l(char const *_String1, char const *_String2, size_t _MaxCount, _locale_t _Locale);int __cdecl _strncoll(char const *_String1, char const *_String2, size_t _MaxCount);int __cdecl _strncoll_l(char const *_String1, char const *_String2, size_t _MaxCount, _locale_t _Locale);size_t __cdecl __strncnt(char const *_String, size_t _Count);__declspec(deprecated("This function or variable may be unsafe. Consider using " "strncpy_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) char *__cdecl strncpy(char *_Destination, char const *_Source, size_t _Count);size_t __cdecl strnlen(char const *_String, size_t _MaxCount);static __inline size_t __cdecl strnlen_s(char const *_String, size_t _MaxCount) { return _String==0 ? 0 :strnlen(_String, _MaxCount);} errno_t __cdecl _strnset_s(char *_String, size_t _SizeInBytes, int _Value, size_t _MaxCount);__declspec(deprecated("This function or variable may be unsafe. Consider using " "_strnset_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) char *__cdecl _strnset(char *_Destination, int _Value, size_t _Count);char *__cdecl strpbrk(char const *_Str, char const *_Control);char *__cdecl _strrev(char *_Str);errno_t __cdecl _strset_s(char *_Destination, size_t _DestinationSize, int _Value);__declspec(deprecated("This function or variable may be unsafe. Consider using " "_strset_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) char *__cdecl _strset(char *_Destination, int _Value);size_t __cdecl strspn(char const *_Str, char const *_Control);__declspec(deprecated("This function or variable may be unsafe. Consider using " "strtok_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) char *__cdecl strtok(char *_String, char const *_Delimiter);errno_t __cdecl _strupr_s(char *_String, size_t _Size);__declspec(deprecated("This function or variable may be unsafe. Consider using " "_strupr_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) char *__cdecl _strupr(char *_String);errno_t __cdecl _strupr_s_l(char *_String, size_t _Size, _locale_t _Locale);__declspec(deprecated("This function or variable may be unsafe. Consider using " "_strupr_s_l" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) char *__cdecl _strupr_l(char *_String, _locale_t _Locale);size_t __cdecl strxfrm(char *_Destination, char const *_Source, size_t _MaxCount);size_t __cdecl _strxfrm_l(char *_Destination, char const *_Source, size_t _MaxCount, _locale_t _Locale);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_strdup" ". See online help for details.")) char *__cdecl strdup(char const *_String);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_strcmpi" ". See online help for details.")) int __cdecl strcmpi(char const *_String1, char const *_String2);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_stricmp" ". See online help for details.")) int __cdecl stricmp(char const *_String1, char const *_String2);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_strlwr" ". See online help for details.")) char *__cdecl strlwr(char *_String);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_strnicmp" ". See online help for details.")) int __cdecl strnicmp(char const *_String1, char const *_String2, size_t _MaxCount);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_strnset" ". See online help for details.")) char *__cdecl strnset(char *_String, int _Value, size_t _MaxCount);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_strrev" ". See online help for details.")) char *__cdecl strrev(char *_String);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_strset" ". See online help for details.")) char *__cdecl strset(char *_String, int _Value);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_strupr" ". See online help for details.")) char *__cdecl strupr(char *_String);__pragma(pack(pop))#pragma warning(pop) #pragma once#pragma warning(push)#pragma warning(disable:4514 4820) __pragma(pack(push, 8)) __pragma(pack(pop))#pragma warning(pop) #pragma once#pragma warning(push)#pragma warning(disable:4324 4514 4574 4710 4793 4820 4995 4996 28719 28726 28727) typedef unsigned short _ino_t;typedef _ino_t ino_t;#line 24 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\sys/types.h" typedef unsigned int _dev_t;typedef _dev_t dev_t;#line 36 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\sys/types.h" typedef long _off_t;typedef _off_t off_t;#line 48 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\sys/types.h"#pragma warning(pop) typedef char *sds;#pragma pack(push, 1) struct sdshdr5 { unsigned char flags;char buf[];};struct sdshdr8 { uint8_t len;uint8_t alloc;unsigned char flags;char buf[];};struct sdshdr16 { uint16_t len;uint16_t alloc;unsigned char flags;char buf[];};struct sdshdr32 { uint32_t len;uint32_t alloc;unsigned char flags;char buf[];};struct sdshdr64 { uint64_t len;uint64_t alloc;unsigned char flags;char buf[];};#pragma pack(pop) static inline size_t sdslen(const sds s) { unsigned char flags=s[-1];switch(flags &7) { case 0 :return((flags) >> 3) ;case 1 :return((struct sdshdr8 *)((s) -(sizeof(struct sdshdr8)))) ->len;case 2 :return((struct sdshdr16 *)((s) -(sizeof(struct sdshdr16)))) ->len;case 3 :return((struct sdshdr32 *)((s) -(sizeof(struct sdshdr32)))) ->len;case 4 :return((struct sdshdr64 *)((s) -(sizeof(struct sdshdr64)))) ->len;} return 0;}static inline size_t sdsavail(const sds s) { unsigned char flags=s[-1];switch(flags &7) { case 0 :{ return 0;} case 1 :{ struct sdshdr8 *sh=(void *)((s) -(sizeof(struct sdshdr8)));;return sh->alloc - sh->len;} case 2 :{ struct sdshdr16 *sh=(void *)((s) -(sizeof(struct sdshdr16)));;return sh->alloc - sh->len;} case 3 :{ struct sdshdr32 *sh=(void *)((s) -(sizeof(struct sdshdr32)));;return sh->alloc - sh->len;} case 4 :{ struct sdshdr64 *sh=(void *)((s) -(sizeof(struct sdshdr64)));;return sh->alloc - sh->len;} } return 0;}static inline void sdssetlen(sds s, size_t newlen) { unsigned char flags=s[-1];switch(flags &7) { case 0 :{ unsigned char *fp=((unsigned char *) s) - 1;*fp=0|(newlen<< 3);} break;case 1 :((struct sdshdr8 *)((s) -(sizeof(struct sdshdr8)))) ->len=(uint8_t) newlen;break;case 2 :((struct sdshdr16 *)((s) -(sizeof(struct sdshdr16)))) ->len=(uint16_t) newlen;break;case 3 :((struct sdshdr32 *)((s) -(sizeof(struct sdshdr32)))) -> len
Definition: CPAL.d:15583
static int pf(int(*writeFunc)(void *stream, const char *data, int size), void *stream, const char *fmt,...)
Definition: HTMLGen.cc:254
#define type(a)
Definition: aptex-macros.h:171
#define depth(a)
Definition: aptex-macros.h:199
#define count(a)
Definition: aptex-macros.h:781
#define subtype(a)
Definition: aptex-macros.h:172
#define next(a)
Definition: aptex-macros.h:924
#define banner
Definition: bg5conv.c:1
static int item
Definition: brushtopbm.c:66
#define n
Definition: t4ht.c:1290
#define FOPEN_RBIN_MODE
Definition: dvips.h:86
printlisttype * currentpage
Definition: dvi2tty.c:95
printlisttype * firstpage
Definition: dvi2tty.c:96
char * strncpy()
short x_origin
Definition: dvi2xx.h:572
int strcmp()
Definition: coll.cpp:143
short y_origin
Definition: dvi2xx.h:573
char * strcpy()
#define info
Definition: dviinfo.c:42
#define error(a)
Definition: dviinfo.c:48
struct rect data
Definition: dvipdfm.c:64
#define A
Definition: fmt.h:35
static void
Definition: fpif.c:118
static FIELD_PTR prev
Definition: genind.c:36
@ VERSION
Definition: genrb.cpp:69
#define memcpy(d, s, n)
Definition: gsftopk.c:64
const unsigned D
Definition: image.cpp:30
const unsigned M
Definition: image.cpp:28
static void error_exit(j_common_ptr cinfo)
Definition: jerror.c:70
#define MIN(a, b)
Definition: jpegint.h:269
#define MAX(a, b)
Definition: jpegint.h:267
#define NULL
Definition: ftobjs.h:61
small capitals from c petite p
Definition: afcover.h:72
small capitals from c petite p scientific i
Definition: afcover.h:80
#define NEW
Definition: gdkanji.c:77
struct _dpx_conf dpx_conf
Definition: dpxconf.c:33
@ dpx_mode_xdv_mode
Definition: dpxconf.h:29
char * ht_iter_getkey(struct ht_iter *iter, int *keylen)
Definition: dpxutil.c:625
int ht_iter_next(struct ht_iter *iter)
Definition: dpxutil.c:653
int ht_set_iter(struct ht_table *ht, struct ht_iter *iter)
Definition: dpxutil.c:596
int ht_table_size(struct ht_table *ht)
Definition: dpxutil.c:442
void ht_append_table(struct ht_table *ht, const void *key, int keylen, void *value)
Definition: dpxutil.c:567
void * ht_lookup_table(struct ht_table *ht, const void *key, int keylen)
Definition: dpxutil.c:463
void ht_clear_table(struct ht_table *ht)
Definition: dpxutil.c:413
int dpx_util_format_asn_date(char *date_string, int need_timezone)
Definition: dpxutil.c:227
void ht_init_table(struct ht_table *ht, hval_free_func hval_free_fn)
Definition: dpxutil.c:399
void ht_clear_iter(struct ht_iter *iter)
Definition: dpxutil.c:615
static unsigned int num_pages
Definition: dvi.c:88
#define buf
action
Definition: epdf.c:220
void WARN(const char *fmt,...)
Definition: error.c:62
void MESG(const char *fmt,...)
Definition: error.c:49
#define ASSERT(e)
Definition: error.h:48
int check_for_jpeg(FILE *fp)
Definition: jpegimage.c:214
#define RENEW(p, n, type)
Definition: mem.h:38
#define RELEASE(p)
Definition: mem.h:39
#define MFOPEN(name, mode)
Definition: mfileio.h:42
#define MFCLOSE(file)
Definition: mfileio.h:44
int pdf_color_is_white(const pdf_color *color)
Definition: pdfcolor.c:204
void pdf_close_colors(void)
Definition: pdfcolor.c:1541
void pdf_color_copycolor(pdf_color *color1, const pdf_color *color2)
Definition: pdfcolor.c:163
void pdf_init_colors(void)
Definition: pdfcolor.c:1533
#define pdf_color_white(c)
Definition: pdfcolor.h:68
#define PDF_COLORSPACE_TYPE_GRAY
Definition: pdfcolor.h:31
void pdf_close_device(void)
Definition: pdfdev.c:1151
void pdf_dev_reset_fonts(int newpage)
Definition: pdfdev.c:1178
int pdf_dev_get_param(int param_type)
Definition: pdfdev.c:1606
void pdf_init_device(double dvi2pts, int precision, int black_and_white)
Definition: pdfdev.c:1101
void pdf_dev_eop(void)
Definition: pdfdev.c:1227
void pdf_dev_reset_color(int force)
Definition: pdfdev.c:1200
void pdf_dev_bop(const pdf_tmatrix *M)
Definition: pdfdev.c:1210
#define PDF_DEV_PARAM_COLORMODE
Definition: pdfdev.h:141
struct ht_table * global_names
Definition: pdfdoc.c:101
void pdf_doc_begin_article(const char *article_id, pdf_obj *article_info)
Definition: pdfdoc.c:1841
static void pdf_doc_close_catalog(pdf_doc *p)
Definition: pdfdoc.c:251
void pdf_open_document(const char *filename, const char *creator, const unsigned char *id1, const unsigned char *id2, struct pdf_setting settings)
Definition: pdfdoc.c:2489
int broken
Definition: pdfdoc.c:2775
int pdf_doc_current_page_number(void)
Definition: pdfdoc.c:2214
static pdf_color bgcolor
Definition: pdfdoc.c:2395
pdf_obj * pdf_doc_get_reference(const char *category)
Definition: pdfdoc.c:2237
#define PAGECOUNT(p)
Definition: pdfdoc.c:304
static void doc_fill_page_background(pdf_doc *p)
Definition: pdfdoc.c:2408
void pdf_doc_begin_page(double scale, double x_origin, double y_origin)
Definition: pdfdoc.c:2442
static void pdf_doc_close_page_tree(pdf_doc *p)
Definition: pdfdoc.c:740
#define USE_MY_MEDIABOX
Definition: pdfdoc.c:122
static pdf_bead * find_bead(pdf_article *article, const char *bead_id)
Definition: pdfdoc.c:1869
pdf_obj * pdf_doc_get_dictionary(const char *category)
Definition: pdfdoc.c:2175
#define MAX_OUTLINE_DEPTH
static void pdf_doc_init_page_tree(pdf_doc *p, double media_width, double media_height)
Definition: pdfdoc.c:715
static pdf_doc pdoc
Definition: pdfdoc.c:233
void pdf_doc_add_page_content(const char *buffer, unsigned length)
Definition: pdfdoc.c:2473
struct pdf_page pdf_page
static void pdf_doc_make_xform(pdf_obj *xform, pdf_rect *bbox, pdf_tmatrix *matrix, pdf_obj *resources, pdf_obj *attrib)
Definition: pdfdoc.c:2601
void pdf_doc_add_page_resource(const char *category, const char *resource_name, pdf_obj *resource_ref)
Definition: pdfdoc.c:529
void pdf_doc_add_bead(const char *article_id, const char *bead_id, int page_no, const pdf_rect *rect)
Definition: pdfdoc.c:1886
int pdf_doc_bookmarks_up(void)
Definition: pdfdoc.c:1365
static void pdf_doc_get_mediabox(unsigned page_no, pdf_rect *mediabox)
Definition: pdfdoc.c:2121
static void pdf_doc_add_goto(pdf_obj *annot_dict)
Definition: pdfdoc.c:1583
static void doc_flush_page(pdf_doc *p, pdf_page *page, pdf_obj *parent_ref)
Definition: pdfdoc.c:557
static void warn_undef_dests(struct ht_table *dests, struct ht_table *gotos)
Definition: pdfdoc.c:1691
struct pdf_olitem pdf_olitem
pdf_obj * pdf_doc_current_page_resources(void)
Definition: pdfdoc.c:2150
static int clean_bookmarks(pdf_olitem *item)
Definition: pdfdoc.c:1279
struct pdf_form pdf_form
static void pdf_doc_new_page(pdf_doc *p)
Definition: pdfdoc.c:2264
static void doc_resize_page_entries(pdf_doc *p, int size)
Definition: pdfdoc.c:308
static int set_bounding_box(pdf_rect *bbox, enum pdf_page_boundary opt_bbox, pdf_obj *media_box, pdf_obj *crop_box, pdf_obj *art_box, pdf_obj *trim_box, pdf_obj *bleed_box)
Definition: pdfdoc.c:850
static void pdf_doc_init_catalog(pdf_doc *p)
Definition: pdfdoc.c:236
#define BMOPEN(b, p)
static void pdf_doc_init_bookmarks(pdf_doc *p, int bm_open_depth)
Definition: pdfdoc.c:1254
#define JS_CODE
struct pdf_doc pdf_doc
pdf_rect rect
Definition: pdfdoc.c:2777
void pdf_doc_bookmarks_add(pdf_obj *dict, int is_open)
Definition: pdfdoc.c:1455
static pdf_obj * read_thumbnail(const char *thumb_filename)
Definition: pdfdoc.c:70
#define FIRSTPAGE(p)
Definition: pdfdoc.c:303
int pdf_doc_begin_grabbing(const char *ident, double ref_x, double ref_y, const pdf_rect *cropbox)
Definition: pdfdoc.c:2654
static void pdf_doc_close_bookmarks(pdf_doc *p)
Definition: pdfdoc.c:1496
void pdf_doc_end_grabbing(pdf_obj *attrib)
Definition: pdfdoc.c:2724
static void pdf_doc_close_names(pdf_doc *p)
Definition: pdfdoc.c:1714
static pdf_obj * pdf_doc_get_page_resources(pdf_doc *p, const char *category)
Definition: pdfdoc.c:488
static int flush_bookmarks(pdf_olitem *item, pdf_obj *parent_ref, pdf_obj *parent_dict)
Definition: pdfdoc.c:1298
static pdf_obj * build_page_tree(pdf_doc *p, pdf_page *firstpage, int num_pages, pdf_obj *parent_ref)
Definition: pdfdoc.c:651
void pdf_doc_set_bop_content(const char *content, unsigned length)
Definition: pdfdoc.c:371
void pdf_doc_set_bgcolor(const pdf_color *color)
Definition: pdfdoc.c:2398
int pdf_doc_bookmarks_depth(void)
Definition: pdfdoc.c:1447
pdf_obj * pdf_doc_ref_page(unsigned page_no)
Definition: pdfdoc.c:2222
int pdf_doc_get_page_count(pdf_file *pf)
Definition: pdfdoc.c:821
static pdf_obj * make_article(pdf_doc *p, pdf_article *article, const char **bead_ids, int num_beads, pdf_obj *article_info)
Definition: pdfdoc.c:1940
void pdf_doc_begin_annot(pdf_obj *dict)
Definition: pdfdoc.c:2789
static struct @133 breaking_state
#define PAGE_CLUSTER
Definition: pdfdoc.c:649
static void pdf_doc_init_docinfo(pdf_doc *p)
Definition: pdfdoc.c:413
int pdf_doc_add_names(const char *category, const void *key, int keylen, pdf_obj *value)
Definition: pdfdoc.c:1560
#define MAXPAGES(p)
Definition: pdfdoc.c:305
static void clean_article(pdf_article *article)
Definition: pdfdoc.c:2034
void pdf_doc_end_page(void)
Definition: pdfdoc.c:2460
static void pdf_doc_close_articles(pdf_doc *p)
Definition: pdfdoc.c:2060
pdf_obj * annot_dict
Definition: pdfdoc.c:2776
static const char * name_dict_categories[]
Definition: pdfdoc.c:1526
static void pdf_doc_init_articles(pdf_doc *p)
Definition: pdfdoc.c:1829
void pdf_doc_end_annot(void)
Definition: pdfdoc.c:2797
#define PDFDOC_PAGES_ALLOC_SIZE
Definition: pdfdoc.c:65
static void pdf_doc_close_docinfo(pdf_doc *p)
Definition: pdfdoc.c:422
pdf_obj * pdf_doc_get_page(pdf_file *pf, int page_no, enum pdf_page_boundary opt_bbox, pdf_rect *bbox, pdf_tmatrix *matrix, pdf_obj **resources_p)
Definition: pdfdoc.c:1083
void pdf_doc_expand_box(const pdf_rect *rect)
Definition: pdfdoc.c:2836
static void pdf_doc_finish_page(pdf_doc *p)
Definition: pdfdoc.c:2294
void pdf_doc_break_annot(void)
Definition: pdfdoc.c:2806
#define VALIDATE_BOX(o)
#define TITLE_STRING
#define LASTPAGE(p)
Definition: pdfdoc.c:302
void pdf_doc_set_mediabox(unsigned page_no, const pdf_rect *mediabox)
Definition: pdfdoc.c:2098
static pdf_page * doc_get_page_entry(pdf_doc *p, unsigned int page_no)
Definition: pdfdoc.c:335
void pdf_doc_add_annot(unsigned page_no, const pdf_rect *rect, pdf_obj *annot_dict, int new_annot)
Definition: pdfdoc.c:1779
static void pdf_doc_init_names(pdf_doc *p, int check_gotos)
Definition: pdfdoc.c:1534
static void reset_box(void)
Definition: pdfdoc.c:2781
struct pdf_bead pdf_bead
#define PDFDOC_ARTICLE_ALLOC_SIZE
Definition: pdfdoc.c:66
static int set_transform_matrix(pdf_tmatrix *matrix, pdf_rect *bbox, pdf_obj *rotate)
Definition: pdfdoc.c:971
struct pdf_article pdf_article
int dirty
Definition: pdfdoc.c:2774
void pdf_close_document(void)
Definition: pdfdoc.c:2562
#define NUM_NAME_CATEGORY
Definition: pdfdoc.c:1531
int pdf_doc_bookmarks_down(void)
Definition: pdfdoc.c:1392
#define PDFDOC_BEAD_ALLOC_SIZE
Definition: pdfdoc.c:67
void pdf_doc_set_eop_content(const char *content, unsigned length)
Definition: pdfdoc.c:393
pdf_page_boundary
Definition: pdfdoc.h:30
@ pdf_page_boundary_trimbox
Definition: pdfdoc.h:35
@ pdf_page_boundary__auto
Definition: pdfdoc.h:31
@ pdf_page_boundary_mediabox
Definition: pdfdoc.h:32
@ pdf_page_boundary_cropbox
Definition: pdfdoc.h:33
@ pdf_page_boundary_bleedbox
Definition: pdfdoc.h:36
@ pdf_page_boundary_artbox
Definition: pdfdoc.h:34
int pdf_dev_pop_gstate(void)
Definition: pdfdraw.c:1263
int pdf_dev_push_gstate(void)
Definition: pdfdraw.c:1247
int pdf_dev_current_depth(void)
Definition: pdfdraw.c:1282
void pdf_dev_grestore_to(int depth)
Definition: pdfdraw.c:1288
int pdf_dev_gsave(void)
Definition: pdfdraw.c:1209
int pdf_dev_rectfill(double x, double y, double w, double h)
Definition: pdfdraw.c:1863
int pdf_dev_grestore(void)
Definition: pdfdraw.c:1225
int pdf_dev_reset_xgstate(int force)
Definition: pdfdraw.c:1047
#define pdf_dev_set_nonstrokingcolor(c)
Definition: pdfdraw.h:159
void pdf_close_fonts(void)
Definition: pdffont.c:485
void pdf_init_fonts(void)
Definition: pdffont.c:233
void pdf_delete_name_tree(struct ht_table **names)
Definition: pdfnames.c:133
pdf_obj * pdf_names_create_tree(struct ht_table *names, int *count, struct ht_table *filter)
Definition: pdfnames.c:453
struct ht_table * pdf_new_name_tree(void)
Definition: pdfnames.c:99
int pdf_names_add_object(struct ht_table *names, const void *key, int keylen, pdf_obj *object)
Definition: pdfnames.c:145
pdf_obj * pdf_new_array(void)
Definition: pdfobj.c:1421
pdf_obj * pdf_new_name(const char *name)
Definition: pdfobj.c:1330
void pdf_out_flush(void)
Definition: pdfobj.c:659
pdf_obj * pdf_file_get_catalog(pdf_file *pf)
Definition: pdfobj.c:4236
pdf_obj * pdf_new_number(double value)
Definition: pdfobj.c:1076
pdf_obj * pdf_ref_obj(pdf_obj *object)
Definition: pdfobj.c:960
pdf_obj * pdf_deref_obj(pdf_obj *obj)
Definition: pdfobj.c:3688
char * pdf_name_value(pdf_obj *object)
Definition: pdfobj.c:1404
void pdf_files_close(void)
Definition: pdfobj.c:4327
pdf_obj * pdf_new_stream(int flags)
Definition: pdfobj.c:1863
double pdf_number_value(pdf_obj *object)
Definition: pdfobj.c:1119
void pdf_release_obj(pdf_obj *object)
Definition: pdfobj.c:3217
void pdf_remove_dict(pdf_obj *dict, const char *name)
Definition: pdfobj.c:1841
void pdf_set_root(pdf_obj *object)
Definition: pdfobj.c:764
void pdf_set_info(pdf_obj *object)
Definition: pdfobj.c:781
int pdf_obj_typeof(pdf_obj *object)
Definition: pdfobj.c:900
int pdf_compare_reference(pdf_obj *ref1, pdf_obj *ref2)
Definition: pdfobj.c:4508
void pdf_merge_dict(pdf_obj *dict1, pdf_obj *dict2)
Definition: pdfobj.c:1763
void pdf_files_init(void)
Definition: pdfobj.c:4211
pdf_out * pdf_out_init(const char *filename, const unsigned char *id1, const unsigned char *id2, int ver_major, int ver_minor, int compression_level, int enable_encrypt, int enable_objstm, int enable_predictor)
Definition: pdfobj.c:450
unsigned pdf_string_length(pdf_obj *object)
Definition: pdfobj.c:1167
pdf_obj * pdf_lookup_dict(pdf_obj *dict, const char *name)
Definition: pdfobj.c:1800
pdf_obj * pdf_stream_dict(pdf_obj *stream)
Definition: pdfobj.c:2374
void pdf_add_stream(pdf_obj *stream, const void *stream_data, int length)
Definition: pdfobj.c:2424
void pdf_out_set_encrypt(int keybits, int32_t permission, const char *opasswd, const char *upasswd, int use_aes, int encrypt_metadata)
Definition: pdfobj.c:531
pdf_obj * pdf_new_string(const void *str, unsigned length)
Definition: pdfobj.c:1131
pdf_obj * pdf_link_obj(pdf_obj *object)
Definition: pdfobj.c:948
pdf_obj * pdf_get_array(pdf_obj *array, int idx)
Definition: pdfobj.c:1461
void * pdf_string_value(pdf_obj *object)
Definition: pdfobj.c:1155
int pdf_stream_length(pdf_obj *stream)
Definition: pdfobj.c:2398
void pdf_add_array(pdf_obj *array, pdf_obj *object)
Definition: pdfobj.c:1511
pdf_obj * pdf_new_dict(void)
Definition: pdfobj.c:1645
unsigned pdf_array_length(pdf_obj *array)
Definition: pdfobj.c:1479
int pdf_add_dict(pdf_obj *dict, pdf_obj *key, pdf_obj *value)
Definition: pdfobj.c:1680
#define PDF_INDIRECT
Definition: pdfobj.h:40
#define PDF_OBJ_NAMETYPE(o)
Definition: pdfobj.h:80
#define PDF_OBJ_NUMBERTYPE(o)
Definition: pdfobj.h:77
#define PDF_OBJ_STRINGTYPE(o)
Definition: pdfobj.h:79
#define PDF_OBJ_MAX_DEPTH
Definition: pdfobj.h:49
#define PDF_OBJ_ARRAYTYPE(o)
Definition: pdfobj.h:81
#define STREAM_COMPRESS
Definition: pdfobj.h:45
#define PDF_OBJ_UNDEFINED(o)
Definition: pdfobj.h:86
#define PDF_OBJ_DICTTYPE(o)
Definition: pdfobj.h:83
void pdf_close_resources(void)
Definition: pdfresource.c:155
static struct res_cache resources[(sizeof(pdf_resource_categories)/sizeof(pdf_resource_categories[0]))]
Definition: pdfresource.c:92
void pdf_init_resources(void)
Definition: pdfresource.c:142
int pdf_ximage_defineresource(const char *ident, int subtype, void *info, pdf_obj *resource)
Definition: pdfximage.c:725
void pdf_init_images(void)
Definition: pdfximage.c:178
pdf_obj * pdf_ximage_get_reference(int id)
Definition: pdfximage.c:709
int pdf_ximage_load_image(const char *ident, const char *filename, load_options options)
Definition: pdfximage.c:396
void pdf_close_images(void)
Definition: pdfximage.c:187
void pdf_ximage_init_form_info(xform_info *info)
Definition: pdfximage.c:544
#define PDF_XOBJECT_TYPE_FORM
Definition: pdfximage.h:29
static UNSIGNED_QUAD media_width
Definition: dvi.c:51
static UNSIGNED_QUAD media_height
Definition: dvi.c:51
#define ERROR(string)
Definition: error.h:36
static pdf_obj * catalog
Definition: pdfdoc.c:47
static pdf_obj * page_tree
Definition: pdfdoc.c:49
int check_for_png(FILE *png_file)
Definition: pngimage.c:39
#define length(c)
Definition: ctangleboot.c:65
#define dest
static int is_open(int fd)
Definition: error.c:132
int strncmp()
#define sprintf
Definition: snprintf.c:44
#define my_name
Definition: luatex-api.h:62
float x
Definition: cordic.py:15
def ref(x)
Definition: pdf-org.py:104
union value value
Definition: obx.h:44
char * filename[256]
Definition: pbmtopk.c:46
float ** matrix()
set set set set set set set macro pixldst1 abits if abits op else op endif endm macro pixldst2 abits if abits op else op endif endm macro pixldst4 abits if abits op else op endif endm macro pixldst0 abits op endm macro pixldst3 mem_operand op endm macro pixldst30 mem_operand op endm macro pixldst abits if abits elseif abits elseif abits elseif abits elseif abits pixldst0 abits else pixldst0 abits pixldst0 abits pixldst0 abits pixldst0 abits endif elseif abits else pixldst0 abits pixldst0 abits endif elseif abits else error unsupported bpp *numpix else pixst endif endm macro pixld1_s mem_operand if asr adds SRC_WIDTH_FIXED bpl add asl mov asr adds SRC_WIDTH_FIXED bpl add asl mov asr adds SRC_WIDTH_FIXED bpl add asl mov asr adds SRC_WIDTH_FIXED bpl add asl elseif asr adds SRC_WIDTH_FIXED bpl add asl mov asr adds SRC_WIDTH_FIXED bpl add asl else error unsupported endif endm macro pixld2_s mem_operand if mov asr add asl add asl mov asr sub UNIT_X add asl mov asr add asl add asl mov asr add UNIT_X add asl else pixld1_s mem_operand pixld1_s mem_operand endif endm macro pixld0_s mem_operand if asr adds SRC_WIDTH_FIXED bpl add asl elseif asr adds SRC_WIDTH_FIXED bpl add asl endif endm macro pixld_s_internal mem_operand if mem_operand pixld2_s mem_operand pixdeinterleave basereg elseif mem_operand elseif mem_operand elseif mem_operand elseif mem_operand pixld0_s mem_operand else pixld0_s mem_operand pixld0_s mem_operand pixld0_s mem_operand pixld0_s mem_operand endif elseif mem_operand else pixld0_s mem_operand pixld0_s mem_operand endif elseif mem_operand else error unsupported mem_operand if bpp mem_operand endif endm macro vuzp8 reg2 vuzp d d &reg2 endm macro vzip8 reg2 vzip d d &reg2 endm macro pixdeinterleave basereg basereg basereg basereg basereg endif endm macro pixinterleave basereg basereg basereg basereg basereg endif endm macro PF boost_increment endif if endif PF tst PF addne PF subne PF cmp ORIG_W if endif if endif if endif PF subge ORIG_W PF subges if endif if endif if endif endif endm macro cache_preload_simple endif if dst_r_bpp pld[DST_R, #(PREFETCH_DISTANCE_SIMPLE *dst_r_bpp/8)] endif if mask_bpp pld cleanup[MASK, #(PREFETCH_DISTANCE_SIMPLE *mask_bpp/8)] endif endif endm macro fetch_mask_pixblock pixld mask_basereg pixblock_size MASK endm macro ensure_destination_ptr_alignment process_pixblock_tail_head if beq irp skip1 beq endif SRC MASK if dst_r_bpp DST_R else add endif PF add sub src_basereg pixdeinterleave mask_basereg pixdeinterleave dst_r_basereg process_pixblock_head pixblock_size cache_preload_simple process_pixblock_tail pixinterleave dst_w_basereg irp beq endif process_pixblock_tail_head tst beq irp if pixblock_size chunk_size tst beq pixld_src SRC pixld MASK if DST_R else pixld DST_R endif if src_basereg pixdeinterleave mask_basereg pixdeinterleave dst_r_basereg process_pixblock_head if pixblock_size cache_preload_simple endif process_pixblock_tail pixinterleave dst_w_basereg irp if pixblock_size chunk_size tst beq if DST_W else pixst DST_W else mov ORIG_W endif add lsl if lsl endif if lsl endif lsl endif lsl endif lsl endif subs mov DST_W if regs_shortage str endif bge start_of_loop_label endm macro generate_composite_function
#define fp
double scale
Definition: pnmhistmap.c:38
#define ROUND(x)
Definition: pnmnlfilt.c:322
static int32_t last
Definition: ppagelist.c:29
static int32_t first
Definition: ppagelist.c:29
static int size
Definition: ppmlabel.c:24
int r
Definition: ppmqvga.c:68
#define parent(a, t)
Definition: interp.c:105
#define rotate(D, num)
Definition: md5.c:38
int verbose_level
Definition: dpxconf.h:35
enum dpx_mode compat_mode
Definition: dpxconf.h:36
Definition: nsfix.c:44
t2b llx
Definition: nsfix.c:45
t2b lly
Definition: nsfix.c:46
t2b urx
Definition: nsfix.c:47
t2b ury
Definition: nsfix.c:48
Definition: jquant2.c:258
Definition: utils.c:300
Definition: pdfdev.c:706
Definition: pdfdoc.c:607
pdf_form form
Definition: pdfdoc.c:117
struct form_list_node * prev
Definition: pdfdoc.c:119
int count
Definition: dpxutil.h:97
Definition: psspecial.c:52
struct ht_table * data
Definition: pdfdoc.c:177
const char * category
Definition: pdfdoc.c:176
Definition: mendex.h:14
Definition: pdfdoc.c:166
int max_beads
Definition: pdfdoc.c:170
pdf_obj * info
Definition: pdfdoc.c:168
char * id
Definition: pdfdoc.c:167
pdf_bead * beads
Definition: pdfdoc.c:171
int num_beads
Definition: pdfdoc.c:169
pdf_rect rect
Definition: pdfdoc.c:162
char * id
Definition: pdfdoc.c:160
int page_no
Definition: pdfdoc.c:161
int precision
Definition: pdfdoc.h:43
int ignore_colors
Definition: pdfdoc.h:44
double dvi2pts
Definition: pdfdoc.h:42
pdf_page * entries
Definition: pdfdoc.c:201
int max_entries
Definition: pdfdoc.c:200
double y
Definition: pdfdoc.c:224
pdf_obj * pagelabels
Definition: pdfdoc.c:187
struct name_dict * names
Definition: pdfdoc.c:216
struct form_list_node * pending_forms
Definition: pdfdoc.c:229
pdf_obj * eop
Definition: pdfdoc.c:197
pdf_obj * info
Definition: pdfdoc.c:193
pdf_olitem * current
Definition: pdfdoc.c:206
pdf_obj * dict
Definition: pdfdoc.c:184
struct pdf_doc::@134 root
int enable_manual_thumb
Definition: pdfdoc.c:226
pdf_obj * viewerpref
Definition: pdfdoc.c:186
struct pdf_doc::@138::@139 annot_grow
struct ht_table gotos
Definition: pdfdoc.c:219
char * thumb_basename
Definition: pdfdoc.c:231
struct pdf_doc::@137 articles
struct pdf_doc::@136 outlines
pdf_article * entries
Definition: pdfdoc.c:213
int outline_open_depth
Definition: pdfdoc.c:222
pdf_obj * pages
Definition: pdfdoc.c:188
pdf_obj * names
Definition: pdfdoc.c:189
int current_depth
Definition: pdfdoc.c:207
int num_entries
Definition: pdfdoc.c:199
pdf_olitem * first
Definition: pdfdoc.c:205
double x
Definition: pdfdoc.c:224
int check_gotos
Definition: pdfdoc.c:218
pdf_obj * bop
Definition: pdfdoc.c:197
struct pdf_doc::@138 options
pdf_rect mediabox
Definition: pdfdoc.c:196
pdf_obj * threads
Definition: pdfdoc.c:190
const char * uplain
Definition: pdfdoc.h:50
const char * oplain
Definition: pdfdoc.h:50
uint32_t permission
Definition: pdfdoc.h:49
int key_size
Definition: pdfdoc.h:48
pdf_obj * contents
Definition: pdfdoc.c:111
pdf_tmatrix matrix
Definition: pdfdoc.c:107
pdf_rect cropbox
Definition: pdfdoc.c:108
char * ident
Definition: pdfdoc.c:105
pdf_obj * resources
Definition: pdfdoc.c:110
int compression_level
Definition: pdfdoc.h:58
int enable_objstm
Definition: pdfdoc.h:56
int enable_predictor
Definition: pdfdoc.h:57
Definition: pdfobj.c:63
struct pdf_olitem * parent
Definition: pdfdoc.c:153
struct pdf_olitem * next
Definition: pdfdoc.c:155
struct pdf_olitem * first
Definition: pdfdoc.c:152
pdf_obj * dict
Definition: pdfdoc.c:148
int is_open
Definition: pdfdoc.c:150
pdf_obj * annots
Definition: pdfdoc.c:142
pdf_obj * resources
Definition: pdfdoc.c:133
pdf_rect cropbox
Definition: pdfdoc.c:131
pdf_obj * content_refs[4]
Definition: pdfdoc.c:140
double ref_y
Definition: pdfdoc.c:130
double ref_x
Definition: pdfdoc.c:130
pdf_obj * page_obj
Definition: pdfdoc.c:125
pdf_obj * page_ref
Definition: pdfdoc.c:126
pdf_obj * contents
Definition: pdfdoc.c:137
pdf_obj * background
Definition: pdfdoc.c:136
int flags
Definition: pdfdoc.c:128
pdf_obj * beads
Definition: pdfdoc.c:143
double lly
Definition: pdfdev.h:41
double ury
Definition: pdfdev.h:41
double llx
Definition: pdfdev.h:41
double urx
Definition: pdfdev.h:41
int ver_minor
Definition: pdfdoc.h:63
struct pdf_dev_setting device
Definition: pdfdoc.h:73
double x
Definition: pdfdoc.h:66
struct pdf_enc_setting encrypt
Definition: pdfdoc.h:72
double media_height
Definition: pdfdoc.h:64
struct pdf_obj_setting object
Definition: pdfdoc.h:74
double media_width
Definition: pdfdoc.h:64
int outline_open_depth
Definition: pdfdoc.h:68
int enable_encrypt
Definition: pdfdoc.h:71
int ver_major
Definition: pdfdoc.h:63
double y
Definition: pdfdoc.h:66
int enable_manual_thumb
Definition: pdfdoc.h:70
int check_gotos
Definition: pdfdoc.h:69
struct pdf_setting::@140 annot_grow_amount
double a
Definition: pdfdev.h:36
double d
Definition: pdfdev.h:36
double f
Definition: pdfdev.h:36
double e
Definition: pdfdev.h:36
double c
Definition: pdfdev.h:36
double b
Definition: pdfdev.h:36
Definition: dvipdfm.c:55
#define FILE
Definition: t1stdio.h:34
*job_name strlen((char *) job_name) - 4)
#define key
Definition: tex2xindy.c:753
page
Definition: tex4ht.c:3916
return() int(((double) *(font_tbl[cur_fnt].wtbl+(int)(*(font_tbl[cur_fnt].char_wi+(int)(ch - font_tbl[cur_fnt].char_f)% 256)))/(double)(1L<< 20)) *(double) font_tbl[cur_fnt].scale)
@ duplicate
Definition: regex.c:435
char ident[]
Definition: ttf2pk.c:40
@ S
Definition: ubidiimp.h:53
Definition: obx.h:51
@ start
Definition: preamble.c:52
#define end(cp)
Definition: zic.c:71