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)  

pdfgen.c
Go to the documentation of this file.
1 /*
2 
3 Copyright 2009-2013 Taco Hoekwater <taco@luatex.org>
4 
5 This file is part of LuaTeX.
6 
7 LuaTeX is free software; you can redistribute it and/or modify it under
8 the terms of the GNU General Public License as published by the Free
9 Software Foundation; either version 2 of the License, or (at your
10 option) any later version.
11 
12 LuaTeX is distributed in the hope that it will be useful, but WITHOUT
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
15 License for more details.
16 
17 You should have received a copy of the GNU General Public License along
18 with LuaTeX; if not, see <http://www.gnu.org/licenses/>.
19 
20 */
21 
22 #include "ptexlib.h"
23 
24 #include <kpathsea/c-dir.h>
25 #include <kpathsea/c-ctype.h>
26 #include "lua/luatex-api.h"
27 #include "md5.h"
28 
29 #define check_nprintf(size_get, size_want) \
30  if ((unsigned)(size_get) >= (unsigned)(size_want)) \
31  formatted_error("pdf backend","snprintf() failed in file %s at line %d", __FILE__, __LINE__);
32 
34 
35 /*tex The commandline interface: */
36 
42 
43 /*tex Additional keys of the |/Info| dictionary: */
44 
46 
47 /*tex Additional keys of the |/Catalog| and its |/OpenAction| dictionary: */
48 
50 
52 
53 /*tex Additional keys of the |/Names| dictionary: */
54 
56 
57 /*tex Additional keys of the |/Trailer| dictionary" */
58 
60 
61 /*tex Set to |shipping_mode| when |ship_out| starts */
62 
64 
65 /*tex
66 
67  Create a new buffer |strbuf_s| of size |size| and maximum allowed size
68  |limit|. Initialize it and set |p| to begin of data.
69 
70 */
71 
72 strbuf_s *new_strbuf(size_t size, size_t limit)
73 {
74  strbuf_s *b;
75  b = xtalloc(1, strbuf_s);
76  b->size = size;
77  b->limit = limit;
78  if (size > 0) {
79  b->p = b->data = xtalloc(b->size, unsigned char);
80  } else {
81  /*tex For other alloc: */
82  b->p = b->data = NULL;
83  }
84  return b;
85 }
86 
87 /*tex Check that |n| bytes more fit into buffer; increase it if required. */
88 
89 static void strbuf_room(strbuf_s * b, size_t n)
90 {
91  unsigned int a;
92  size_t l = (size_t) (b->p - b->data);
93  if (n > b->limit - l)
94  overflow("PDF buffer", (unsigned) b->size);
95  if (n + l > b->size) {
96  a = (unsigned int) (b->size >> 2);
97  if (n + l > b->size + a)
98  b->size = n + l;
99  else if (b->size < b->limit - a)
100  b->size = b->size + a;
101  else
102  b->size = b->limit;
103  b->data = xreallocarray(b->data, unsigned char, (unsigned) b->size);
104  b->p = b->data + l;
105  }
106 }
107 
108 /*tex Seek to position |offset| within buffer. Position must be valid. */
109 
111 {
112  b->p = b->data + offset;
113 }
114 
115 /*tex Get the current buffer fill level, the number of characters.*/
116 
118 {
119  return (size_t) (b->p - b->data);
120 }
121 
122 /*tex Put one character into buffer. Make room before if needed. */
123 
124 void strbuf_putchar(strbuf_s * b, unsigned char c)
125 {
126  if ((size_t) (b->p - b->data + 1) > b->size)
127  strbuf_room(b, 1);
128  *b->p++ = c;
129 }
130 
131 /*tex Dump filled buffer part to the \PDF\ file. */
132 
134 {
135  pdf_out_block(pdf, (const char *) b->data, strbuf_offset(b));
136  strbuf_seek(b, 0);
137 }
138 
139 /*tex We free all dynamically allocated buffer structures. */
140 
142 {
143  xfree(b->data);
144  xfree(b);
145 }
146 
147 /*tex This |init_pdf_struct| is called early and only once. */
148 
150 {
151  os_struct *os;
153  memset(pdf, 0, sizeof(pdf_output_file));
154  pdf->job_name = makecstring(job_name);
155  /*tex This will be set by |fix_o_mode|: */
157  /*tex Used by synctex, we need to use output_mode_used there. */
158  pdf->o_mode = output_mode_used;
159  pdf->o_state = ST_INITIAL;
160  /*tex Initialize \PDF\ and object stream writing */
161  pdf->os = os = xtalloc(1, os_struct);
162  memset(pdf->os, 0, sizeof(os_struct));
166  os->cur_objstm = 0;
167  os->curbuf = PDFOUT_BUF;
168  pdf->buf = os->buf[os->curbuf];
169  /*tex
170  Later ttf_seek_outbuf(TABDIR_OFF + n * 4 * TTF_ULONG_SIZE); in
171  ttf_init_font we need 236 bytes, so we start with 256 bytes as in \PDFTEX.
172  */
173  pdf->fb = new_strbuf(256, 100000000);
174  pdf->stream_deflate = false;
175  pdf->stream_writing = false;
176  /*tex
177  Sometimes it is neccesary to allocate memory for PDF output that cannot be
178  deallocated then, so we use |mem| for this purpose.
179  */
180  pdf->mem_size = inf_pdf_mem_size;
181  pdf->mem = xtalloc(pdf->mem_size, int);
182  /*tex
183  The first word is not used so we can use zero as a value for testing
184  whether a pointer to |mem| is valid.
185  */
186  pdf->mem_ptr = 1;
187  pdf->pstruct = NULL;
188  pdf->posstruct = xtalloc(1, posstructure);
189  pdf->posstruct->pos.h = 0;
190  pdf->posstruct->pos.v = 0;
191  pdf->posstruct->dir = dir_TLT;
192  /*tex Allocated size of |obj_tab| array> */
193  pdf->obj_tab_size = (unsigned) inf_obj_tab_size;
194  pdf->obj_tab = xtalloc(pdf->obj_tab_size + 1, obj_entry);
195  memset(pdf->obj_tab, 0, sizeof(obj_entry));
196  pdf->minor_version = -1;
197  pdf->major_version = -1;
198  pdf->decimal_digits = 4;
199  pdf->gamma = 65536;
200  pdf->image_gamma = 65536;
201  pdf->image_hicolor = 1;
202  pdf->image_apply_gamma = 0;
203  pdf->objcompresslevel = 0;
204  pdf->compress_level = 0;
205  pdf->force_file = 0;
206  pdf->recompress = 0;
207  pdf->draftmode = 0;
208  pdf->inclusion_copy_font = 1;
209  pdf->pk_resolution = 0;
210  pdf->pk_fixed_dpi = 0;
211  pdf->pk_scale_factor = 0;
213  pdf->page_resources = NULL;
215  pdf->vfstruct = new_vfstruct();
216  return pdf;
217 }
218 
219 /*tex We use |pdf_get_mem| to allocate memory in |mem|. */
220 
221 int pdf_get_mem(PDF pdf, int s)
222 {
223  int a;
224  int ret;
225  if (s > sup_pdf_mem_size - pdf->mem_ptr)
226  overflow("pdf memory size (pdf_mem_size)", (unsigned) pdf->mem_size);
227  if (pdf->mem_ptr + s > pdf->mem_size) {
228  a = pdf->mem_size >> 2;
229  if (pdf->mem_ptr + s > pdf->mem_size + a) {
230  pdf->mem_size = pdf->mem_ptr + s;
231  } else if (pdf->mem_size < sup_pdf_mem_size - a) {
232  pdf->mem_size = pdf->mem_size + a;
233  } else {
234  pdf->mem_size = sup_pdf_mem_size;
235  }
236  pdf->mem = xreallocarray(pdf->mem, int, (unsigned) pdf->mem_size);
237  }
238  ret = pdf->mem_ptr;
239  pdf->mem_ptr = pdf->mem_ptr + s;
240  return ret;
241 }
242 
243 /*tex
244 
245  This ensures that |pdfmajorversion| and |pdfminorversion| are set only before
246  any bytes have been written to the generated \PDF\ file. Here also all
247  variables for \PDF\ output are initialized, the \PDF\ file is opened by
248  |ensure_pdf_open|, and the \PDF\ header is written.
249 
250 */
251 
253 {
254  if (pdf->major_version < 0) {
255  /*tex It is unset. */
256  if (pdf_major_version == 0) {
257  normal_warning("pdf backend","unset major version, using 1 instead");
258  pdf->major_version = 1;
259  } else if ((pdf_major_version < 0) || (pdf_major_version > 2)) {
260  formatted_warning("pdf backend","illegal major version %d, using 1 instead",pdf_major_version);
261  pdf->major_version = 1;
262  } else {
263  pdf->major_version = pdf_major_version;
264  }
265  } else if (pdf->major_version != pdf_major_version) {
266  normal_warning("pdf backend", "the major version cannot be changed after data is written to the PDF file");
267  }
268  if (pdf->minor_version < 0) {
269  /*tex It is unset. */
270  if ((pdf_minor_version < 0) || (pdf_minor_version > 9)) {
271  formatted_warning("pdf backend","illegal minor version %d, using 4 instead",pdf_minor_version);
272  pdf->minor_version = 4;
273  } else {
274  pdf->minor_version = pdf_minor_version;
275  }
276  } else if (pdf->minor_version != pdf_minor_version) {
277  normal_warning("pdf backend", "minorversion cannot be changed after data is written to the PDF file");
278  }
279 }
280 
282 {
283  if (pdf->draftmode != draft_mode_par)
284  normal_warning("pdf backend", "draftmode cannot be changed after data is written to the PDF file");
285  if (pdf->draftmode != 0) {
286  /*tex Fix these as they might have been changed in between. */
287  pdf->compress_level = 0;
288  pdf->objcompresslevel = 0;
289  }
290 }
291 
292 #define ZIP_BUF_SIZE 32768
293 
294 #define check_err(f, fn) \
295  if (f != Z_OK) \
296  formatted_error("pdf backend","zlib %s() failed (error code %d)", fn, f)
297 
298 static void write_zip(PDF pdf)
299 {
300  int flush, err = Z_OK;
301  uInt zip_len;
302  strbuf_s *buf = pdf->buf;
303  z_stream *s = pdf->c_stream;
304  boolean finish = pdf->zip_write_state == ZIP_FINISH;
305  if (pdf->stream_length == 0) {
306  if (s == NULL) {
307  s = pdf->c_stream = xtalloc(1, z_stream);
308  s->zalloc = (alloc_func) 0;
309  s->zfree = (free_func) 0;
310  s->opaque = (voidpf) 0;
311  check_err(deflateInit(s, pdf->compress_level), "deflateInit");
312  pdf->zipbuf = xtalloc(ZIP_BUF_SIZE, char);
313  } else
314  check_err(deflateReset(s), "deflateReset");
315  s->next_out = (Bytef *) pdf->zipbuf;
316  s->avail_out = ZIP_BUF_SIZE;
317  }
318  s->next_in = buf->data;
319  s->avail_in = (uInt) (buf->p - buf->data);
320  while (true) {
321  if (s->avail_out == 0 || (finish && s->avail_out < ZIP_BUF_SIZE)) {
322  zip_len = ZIP_BUF_SIZE - s->avail_out;
323  pdf->gone += (off_t) xfwrite(pdf->zipbuf, 1, zip_len, pdf->file);
324  pdf->last_byte = pdf->zipbuf[zip_len - 1];
325  s->next_out = (Bytef *) pdf->zipbuf;
326  s->avail_out = ZIP_BUF_SIZE;
327  }
328  if (finish) {
329  if (err == Z_STREAM_END) {
330  xfflush(pdf->file);
331  pdf->zip_write_state = NO_ZIP;
332  break;
333  }
334  flush = Z_FINISH;
335  } else {
336  if (s->avail_in == 0)
337  break;
338  flush = Z_NO_FLUSH;
339  }
340  err = deflate(s, flush);
341  if (err != Z_OK && err != Z_STREAM_END)
342  formatted_error("pdf backend","zlib deflate() failed (error code %d)", err);
343  }
344  pdf->stream_length = (off_t) s->total_out;
345 }
346 
348 {
349  if (pdf->zipbuf != NULL) {
350  check_err(deflateEnd(pdf->c_stream), "deflateEnd");
351  xfree(pdf->zipbuf);
352  }
353  xfree(pdf->c_stream);
354 }
355 
356 static void write_nozip(PDF pdf)
357 {
358  strbuf_s *buf = pdf->buf;
359  size_t l = strbuf_offset(buf);
360  if (l == 0)
361  return;
362  pdf->stream_length = pdf_offset(pdf) - pdf->save_offset;
363  pdf->gone += (off_t) xfwrite((char *) buf->data, sizeof(char), l, pdf->file);
364  pdf->last_byte = *(buf->p - 1);
365 }
366 
367 /*tex
368 
369  The PDF buffer is flushed by calling |pdf_flush|, which checks the variable
370  |zip_write_state| and will compress the buffer before flushing if neccesary.
371  We call |pdf_begin_stream| to begin a stream and |pdf_end_stream| to finish
372  it. The stream contents will be compressed if compression is turn on.
373 
374 */
375 
377 {
378  os_struct *os = pdf->os;
379  off_t saved_pdf_gone = pdf->gone;
380  switch (os->curbuf) {
381  case PDFOUT_BUF:
382  if (pdf->draftmode == 0) {
383  switch (pdf->zip_write_state) {
384  case NO_ZIP:
385  write_nozip(pdf);
386  break;
387  case ZIP_WRITING:
388  case ZIP_FINISH:
389  write_zip(pdf);
390  break;
391  default:
392  normal_error("pdf backend", "bad zip state");
393  }
394  } else
395  pdf->zip_write_state = NO_ZIP;
396  strbuf_seek(pdf->buf, 0);
397  if (saved_pdf_gone > pdf->gone)
398  normal_error("pdf backend", "file size exceeds architectural limits (pdf_gone wraps around)");
399  break;
400  case OBJSTM_BUF:
401  break;
402  default:
403  normal_error("pdf backend", "bad buffer state");
404  }
405 }
406 
408 {
409  os_struct *os = pdf->os;
410  if (pdf->os_enable && buf == OBJSTM_BUF) {
411  /*tex Switch to object stream: */
412  os->curbuf = OBJSTM_BUF;
413  } else {
414  /*tex Switch to \PDF\ stream: */
415  os->curbuf = PDFOUT_BUF;
416  }
417  pdf->buf = os->buf[pdf->os->curbuf];
418 }
419 
420 /*tex
421 
422  We create new |/ObjStm| object if required, and set up cross reference info.
423 
424 */
425 
426 static void pdf_prepare_obj(PDF pdf, int k, int pdf_os_threshold)
427 {
428  os_struct *os = pdf->os;
429  strbuf_s *obuf = os->buf[OBJSTM_BUF];
430  if (pdf->objcompresslevel >= pdf_os_threshold)
432  else
434  switch (os->curbuf) {
435  case PDFOUT_BUF:
437  /*tex Mark it as not included in any |ObjStm|. */
439  break;
440  case OBJSTM_BUF:
441  if (os->cur_objstm == 0) {
442  os->cur_objstm =
443  (unsigned int) pdf_create_obj(pdf, obj_type_objstm, 0);
444  os->idx = 0;
445  /*tex Start a fresh object stream. */
446  obuf->p = obuf->data;
447  /*tex Keep some statistics. */
448  os->ostm_ctr++;
449  }
450  obj_os_idx(pdf, k) = (int) os->idx;
451  obj_os_objnum(pdf, k) = (int) os->cur_objstm;
452  os->obj[os->idx].num = k;
453  os->obj[os->idx].off = obuf->p - obuf->data;
454  break;
455  default:
456  normal_error("pdf backend", "bad object state");
457  }
458 }
459 
460 /*tex
461 
462  We set the active buffer pointer and make sure that there are at least |n|
463  bytes free in that buffer, flushing happens if needed.
464 
465 */
466 
467 inline void pdf_room(PDF pdf, int n)
468 {
469  strbuf_s *buf = pdf->buf;
470  if ((size_t) (n + buf->p - buf->data) <= buf->size)
471  return;
472  if (pdf->os->curbuf == PDFOUT_BUF) {
473  if ((size_t) n > buf->size)
474  overflow("PDF output buffer", (unsigned) buf->size);
475  if ((size_t) (n + buf->p - buf->data) < buf->limit)
476  strbuf_room(buf, (size_t) n);
477  else
478  pdf_flush(pdf);
479  } else {
480  strbuf_room(buf, (size_t) n);
481  }
482 }
483 
484 void pdf_out_block(PDF pdf, const char *s, size_t n)
485 {
486  size_t l;
487  strbuf_s *buf = pdf->buf;
488  do {
489  l = n;
490  if (l > buf->size)
491  l = buf->size;
492  pdf_room(pdf, (int) l);
493  (void) memcpy(buf->p, s, l);
494  buf->p += l;
495  s += l;
496  n -= l;
497  } while (n > 0);
498 }
499 
500 __attribute__ ((format(printf, 2, 3)))
502 {
503  va_list args;
504  va_start(args, fmt);
505  if (pdf->printf_buf == NULL) {
506  pdf->printf_buf = xtalloc(PRINTF_BUF_SIZE, char);
507  }
508  (void) vsnprintf(pdf->printf_buf, PRINTF_BUF_SIZE, fmt, args);
509  pdf_puts(pdf, pdf->printf_buf);
510  va_end(args);
511 }
512 
514 {
515  const char *ss;
516  size_t l;
517  if (s >= STRING_OFFSET) {
518  ss = (const char *) str_string(s);
519  l = str_length(s);
520  pdf_out_block(pdf, ss, l);
521  } else {
522  pdf_out(pdf, s);
523  }
524 }
525 
527 {
528  char s[24];
529  int w;
530  w = snprintf(s, 23, "%" LONGINTEGER_PRI "d", (LONGINTEGER_TYPE) n);
531  check_nprintf(w, 23);
532  pdf_out_block(pdf, (const char *) s, (size_t) w);
533 }
534 
536 {
537  int64_t m = f.m;
538  if (m == 0) {
539  pdf_out(pdf, '0');
540  } else {
541  int e = f.e;
542  if (e == 0) {
543  /*tex division by |ten_pow[0] == 1| */
544  if (m == 1) {
545  pdf_out(pdf, '1');
546  } else {
547  char a[24];
548  snprintf(a, 23, "%" LONGINTEGER_PRI "i", (LONGINTEGER_TYPE) m);
549  pdf_puts(pdf, a);
550  }
551  } else {
552  int t = ten_pow[e] ;
553  if (t == m) {
554  pdf_out(pdf, '1');
555  } else {
556  int i, l, w;
557  char a[24];
558  if (m < 0) {
559  pdf_out(pdf, '-');
560  m *= -1;
561  }
562  l = m / t;
563  w = snprintf(a, 23, "%i", l);
564  pdf_out_block(pdf, (const char *) a, (size_t) w);
565  l = m % t;
566  if (l != 0) {
567  pdf_out(pdf, '.');
568  snprintf(a, 23, "%d", l + t);
569  for (i = e; i > 0; i--) {
570  if (a[i] != '0')
571  break;
572  a[i] = '\0';
573  }
574  pdf_puts(pdf, (a + 1));
575  }
576  }
577  }
578  }
579 }
580 
581 void pdf_print_str(PDF pdf, const char *s)
582 {
583  const char *orig = s;
584  /*tex This initializes at the last string index. */
585  int l = (int) strlen(s) - 1;
586  if (l < 0) {
587  pdf_puts(pdf, "()");
588  return;
589  }
590  /*tex
591  The next might not really be safe as the string could be ``(a)xx(b)'' but
592  so far we never had an issue.
593  */
594  if ((s[0] == '(') && (s[l] == ')')) {
595  pdf_puts(pdf, s);
596  return;
597  }
598  if ((s[0] != '<') || (s[l] != '>') || odd((l + 1))) {
599  pdf_out(pdf, '(');
600  pdf_puts(pdf, s);
601  pdf_out(pdf, ')');
602  return;
603  }
604  s++;
605  while (isxdigit((unsigned char)*s))
606  s++;
607  if (s != orig + l) {
608  pdf_out(pdf, '(');
609  pdf_puts(pdf, orig);
610  pdf_out(pdf, ')');
611  return;
612  }
613  pdf_puts(pdf, orig);
614 }
615 
616 /*tex A stream needs to have a stream dictionary also. */
617 
619 {
620  pdf_puts(pdf, "\nstream\n");
622  pdf_flush(pdf);
623  if (pdf->stream_deflate) {
624  pdf->zip_write_state = ZIP_WRITING;
625  }
626  pdf->stream_writing = true;
627  pdf->stream_length = 0;
628  pdf->last_byte = 0;
629 }
630 
632 {
633  os_struct *os = pdf->os;
634  switch (os->curbuf) {
635  case PDFOUT_BUF:
636  if (pdf->zip_write_state == ZIP_WRITING)
637  pdf->zip_write_state = ZIP_FINISH;
638  /*tex This sets| pdf->last_byte|. */
639  pdf_flush(pdf);
640  break;
641  case OBJSTM_BUF:
642  normal_error("pdf backend", "bad buffer in end stream, case 1");
643  break;
644  default:
645  normal_error("pdf backend", "bad buffer in end stream, case 2");
646  }
647  pdf->stream_deflate = false;
648  pdf->stream_writing = false;
649  /*tex This doesn't really belong to the stream: */
650  pdf_out(pdf, '\n');
651  pdf_puts(pdf, "endstream");
652  /*tex Write the stream |/Length|. */
653 
654  if (pdf->seek_write_length && pdf->draftmode == 0) {
655  xfseeko(pdf->file, (off_t)pdf->stream_length_offset+12, SEEK_SET, pdf->job_name);
656  fprintf(pdf->file, " ");
657  xfseeko(pdf->file, (off_t)pdf->stream_length_offset, SEEK_SET, pdf->job_name);
658  fprintf(pdf->file, "%" LONGINTEGER_PRI "i >>", (LONGINTEGER_TYPE) pdf->stream_length);
659 #ifdef _WIN32 /* --ak */
660  xfseeko(pdf->file, (off_t)0, SEEK_END, pdf->job_name);
661 #else /* --ak */
662  xfseeko(pdf->file, 0, SEEK_END, pdf->job_name);
663 #endif /* _WIN32 --ak */
664  }
665  pdf->seek_write_length = false;
666 }
667 
668 /*tex
669 
670  To print |scaled| value to \PDF\ output we need some subroutines to ensure
671  accurary.
672 
673 */
674 
675 
676 /*tex We max out at $2^{31}-1$. */
677 
678 #define max_integer 0x7FFFFFFF
679 
680 /*tex scaled value corresponds to 100in, exact, 473628672 */
681 
682 scaled one_hundred_inch = 7227 * 65536;
683 
684 /*tex scaled value corresponds to 1in (rounded to 4736287) */
685 
686 scaled one_inch = (7227 * 65536 + 50) / 100;
687 
688 /*tex scaled value corresponds to 1truein (rounded!) */
689 
690 scaled one_true_inch = (7227 * 65536 + 50) / 100;
691 
692 /*tex scaled value corresponds to 100bp */
693 
694 scaled one_hundred_bp = (7227 * 65536) / 72;
695 
696 /*tex scaled value corresponds to 1bp (rounded to 65782) */
697 
698 scaled one_bp = 65781;
699 
700 /*tex
701 
702  One basepoint is set to exactly 65781, as in \TEX\ itself, because this value
703  is also used for |\pdfpxdimen|.
704 
705 */
706 
707 int ten_pow[10] = {
708  1, 10, 100, 1000, 10000, 100000, 1000000, 10000000, 100000000, 1000000000 /* $10^0..10^9$ */
709 };
710 
711 /*tex
712 
713  The function |divide_scaled| divides |s| by |m| using |dd| decimal digits of
714  precision.
715 
716 */
717 
718 scaled round_xn_over_d(scaled x, int n, unsigned int d)
719 {
720  boolean positive = true;
721  unsigned t, u, v;
722  if (x < 0) {
723  positive = !positive;
724  x = -(x);
725  }
726  if (n < 0) {
727  positive = !positive;
728  n = -(n);
729  }
730  t = (unsigned) ((x % 0100000) * n);
731  u = (unsigned) (((unsigned) (x) / 0100000) * (unsigned) n + (t / 0100000));
732  v = (u % d) * 0100000 + (t % 0100000);
733  if (u / d >= 0100000)
734  arith_error = true;
735  else
736  u = 0100000 * (u / d) + (v / d);
737  v = v % d;
738  if (2 * v >= d)
739  u++;
740  if (positive)
741  return (scaled) u;
742  else
743  return (-(scaled) u);
744 }
745 
747 {
748  pdffloat a;
749  pdfstructure *p = pdf->pstruct;
750  a.m = i64round(s * p->k1);
751  a.e = pdf->decimal_digits;
753  print_pdffloat(pdf, a);
755 }
756 
757 typedef struct {
758  int obj_type;
760 } pr_entry;
761 
762 static int comp_page_resources(const void *pa, const void *pb, void *p)
763 {
764  int a = ((const pr_entry *) pa)->obj_type;
765  int b = ((const pr_entry *) pb)->obj_type;
766  (void) p;
767  if (a > b)
768  return 1;
769  if (a < b)
770  return -1;
771  return 0;
772 }
773 
775 {
777  pr_entry *pr, tmp;
778  void **pp;
779  pdf_object_list *p, *item = NULL;
780  re = pdf->page_resources;
781  if (re->resources_tree == NULL) {
783  if (re->resources_tree == NULL)
784  formatted_error("pdf backend","addto_page_resources(): avl_create() page_resource_tree failed");
785  }
786  tmp.obj_type = t;
787  pr = (pr_entry *) avl_find(re->resources_tree, &tmp);
788  if (pr == NULL) {
789  pr = xtalloc(1, pr_entry);
790  pr->obj_type = t;
791  pr->list = NULL;
792  pp = avl_probe(re->resources_tree, pr);
793  if (pp == NULL)
794  formatted_error("pdf backend","addto_page_resources(): avl_probe() out of memory in insertion");
795  }
796  if (pr->list == NULL) {
798  item->link = NULL;
799  item->info = k;
800  pr->list = item;
801  if (obj_type(pdf, k) == (int)t) {
802  /*tex |k| is an object number. */
804  }
805  } else {
806  for (p = pr->list; p->info != k && p->link != NULL; p = p->link);
807  if (p->info != k) {
809  item->link = NULL;
810  item->info = k;
811  p->link = item;
812  if (obj_type(pdf, k) == (int)t)
814  }
815  }
816 }
817 
819 {
820  pdf_resource_struct *re = pdf->page_resources;
821  pr_entry *pr, tmp;
822  if (re == NULL || re->resources_tree == NULL)
823  return NULL;
824  tmp.obj_type = t;
825  pr = (pr_entry *) avl_find(re->resources_tree, &tmp);
826  if (pr == NULL)
827  return NULL;
828  return pr->list;
829 }
830 
832 {
833  pdf_resource_struct *re = pdf->page_resources;
834  pr_entry *p;
835  struct avl_traverser t;
836  pdf_object_list *l1, *l2;
837  if (re == NULL || re->resources_tree == NULL)
838  return;
839  avl_t_init(&t, re->resources_tree);
840  for (p = avl_t_first(&t, re->resources_tree); p != NULL; p = avl_t_next(&t)) {
841  if (p->list != NULL) {
842  for (l1 = p->list; l1 != NULL; l1 = l2) {
843  l2 = l1->link;
844  free(l1);
845  }
846  /*tex We reset but the AVL tree remains! */
847  p->list = NULL;
848  }
849  }
850 }
851 
852 static void destroy_pg_res_tree(void *pa, void *param)
853 {
854  (void) param;
855  xfree(pa);
856 }
857 
859 {
860  pdf_resource_struct *re = pdf->page_resources;
862  if (re->resources_tree != NULL)
864  re->resources_tree = NULL;
865 }
866 
868 {
869  unsigned char digits[11];
870 
871  int k = 10;
872  do {
873  k--;
874  digits[k] = (unsigned char) ('0' + (n % 10));
875  n /= 10;
876  } while (k != 0);
877  if (n!=0) {
878  /*tex The absolute value of $n$ is greater than 9999999999. */
879  normal_error("pdf backend", "offset exceeds 10 bytes, try enabling object compression.");
880  }
881  digits[10]='\0';
882  pdf_puts(pdf, (const char *) digits);
883 }
884 
885 /*tex
886 
887  We print out an integer |n| as a fixed number |w| of bytes,. This is used in
888  the |XRef| cross-reference stream creator.
889 
890 */
891 
892 static void pdf_out_bytes(PDF pdf, longinteger n, size_t w)
893 {
894  /*tex The number of digits in a number being output. */
895  unsigned char bytes[8];
896  int k = (int) w;
897  do {
898  k--;
899  bytes[k] = (unsigned char) (n % 256);
900  n /= 256;
901  } while (k != 0);
902  pdf_out_block(pdf, (const char *) bytes, w);
903 }
904 
905 void pdf_print_str_ln(PDF pdf, const char *s)
906 {
907  pdf_print_str(pdf, s);
908  pdf_out(pdf, '\n');
909 }
910 
912 {
913  int len = 0;
914  char *s = tokenlist_to_cstring(p, true, &len);
915  if (len > 0) {
917  pdf_puts(pdf, s);
919  }
920  xfree(s);
921 }
922 
923 /*
924 void pdf_add_rect_spec(PDF pdf, halfword r)
925 {
926  pdf_add_bp(pdf, pdf_ann_left(r));
927  pdf_add_bp(pdf, pdf_ann_bottom(r));
928  pdf_add_bp(pdf, pdf_ann_right(r));
929  pdf_add_bp(pdf, pdf_ann_top(r));
930 }
931 */
932 
934 {
935  /* the check is now here */
940 }
941 
943 {
944  pdf_add_name(pdf, "Rect");
948 }
949 
951 {
952  int pk_mode;
953  pdf->draftmode = fix_int(draft_mode_par, 0, 1);
954  pdf->compress_level = fix_int(pdf_compress_level, 0, 9);
955  pdf->decimal_digits = fix_int(pdf_decimal_digits, 3, 5);
956  pdf->gamma = fix_int(pdf_gamma, 0, 1000000);
957  pdf->image_gamma = fix_int(pdf_image_gamma, 0, 1000000);
958  pdf->image_hicolor = fix_int(pdf_image_hicolor, 0, 1);
959  pdf->image_apply_gamma = fix_int(pdf_image_apply_gamma, 0, 1);
960  pdf->objcompresslevel = fix_int(pdf_obj_compress_level, 0, MAX_OBJ_COMPRESS_LEVEL);
961  pdf->recompress = fix_int(pdf_recompress, 0, 1);
962  pdf->inclusion_copy_font = fix_int(pdf_inclusion_copy_font, 0, 1);
963  pdf->pk_resolution = fix_int(pdf_pk_resolution, 72, 8000);
964  pdf->pk_fixed_dpi = fix_int(pdf_pk_fixed_dpi, 0, 1);
965  if (((pdf->major_version > 1) || (pdf->minor_version >= 5)) && (pdf->objcompresslevel > 0)) {
966  pdf->os_enable = true;
967  } else {
968  if (pdf->objcompresslevel > 0) {
969  normal_warning("pdf backend","objcompresslevel > 0 requires minorversion > 4");
970  pdf->objcompresslevel = 0;
971  }
972  pdf->os_enable = false;
973  }
974  if (pdf->pk_resolution == 0) {
975  /*tex If not set from format file or by user take it from \.{texmf.cnf}. */
976  pdf->pk_resolution = pk_dpi;
977  }
978  pdf->pk_scale_factor = divide_scaled(72, pdf->pk_resolution, pk_decimal_digits(pdf,5));
980  pk_mode = pdf_pk_mode;
981  if (pk_mode != null) {
982  char *s = tokenlist_to_cstring(pk_mode, true, NULL);
983  kpse_init_prog("LUATEX", (unsigned) pdf->pk_resolution, s, nil);
984  xfree(s);
985  } else {
986  kpse_init_prog("LUATEX", (unsigned) pdf->pk_resolution, nil, nil);
987  }
988  if (!kpse_var_value("MKTEXPK"))
989  kpse_set_program_enabled(kpse_pk_format, 1, kpse_src_cmdline);
990  }
992  if ((pdf_unique_resname > 0) && (pdf->resname_prefix == NULL))
993  pdf->resname_prefix = get_resname_prefix(pdf);
994 }
995 
996 /*tex
997 
998  This checks that we have a name for the generated PDF file and that it's
999  open.
1000 
1001 */
1002 
1004 {
1005  /*tex Initialize variables for \PDF\ output. */
1009  /*tex Write \PDF\ header */
1010  pdf_printf(pdf, "%%PDF-%d.%d\n", pdf->major_version, pdf->minor_version);
1011  /* Some binary crap. */
1012  pdf_out(pdf, '%');
1013  pdf_out(pdf, 'L' + 128);
1014  pdf_out(pdf, 'U' + 128);
1015  pdf_out(pdf, 'A' + 128);
1016  pdf_out(pdf, 'T' + 128);
1017  pdf_out(pdf, 'E' + 128);
1018  pdf_out(pdf, 'X' + 128);
1019  pdf_out(pdf, 'P' + 128);
1020  pdf_out(pdf, 'D' + 128);
1021  pdf_out(pdf, 'F' + 128);
1022  pdf_out(pdf, '\n');
1023 }
1024 
1026  ensure_output_file_open(pdf, ".pdf");
1027 }
1028 
1030 {
1031  if (pdf->o_state < s) {
1032  if (s > ST_INITIAL) {
1033  ensure_output_state(pdf, s - 1);
1034  }
1035  switch (s - 1) {
1036  case ST_INITIAL:
1037  fix_o_mode();
1038  break;
1039  case ST_OMODE_FIX:
1041  break;
1042  case ST_FILE_OPEN:
1044  break;
1045  case ST_HEADER_WRITTEN:
1046  break;
1047  case ST_FILE_CLOSED:
1048  break;
1049  default:
1050  normal_error("pdf backend","weird output state");
1051  }
1052  pdf->o_state++;
1053  }
1054 }
1055 
1056 /*tex
1057 
1058  Write out an accumulated object stream. The object number and byte offset
1059  pairs are generated and appended to the ready buffered object stream. By this
1060  the value of \.{/First} can be calculated. Then a new \.{/ObjStm} object is
1061  generated, and everything is copied to the PDF output buffer, where also
1062  compression is done. When calling this procedure, |pdf_os_mode| must be
1063  |true|.
1064 
1065 */
1066 
1068 {
1069  os_struct *os = pdf->os;
1070  /*tex |n1|, |n2|: |ObjStm| buffer may be reallocated! */
1071  unsigned int i, j, n1, n2;
1072  strbuf_s *obuf = os->buf[OBJSTM_BUF];
1073  if (os->cur_objstm == 0) {
1074  /*tex No object stream started. */
1075  return;
1076  }
1077  /*tex Remember end of collected object stream contents. */
1078  n1 = (unsigned int) strbuf_offset(obuf);
1079  /*tex This is needed here to calculate |/First| for the |ObjStm| dict */
1080  for (i = 0, j = 0; i < os->idx; i++) {
1081  /*tex Add object-number/byte-offset list to buffer. */
1082  pdf_print_int(pdf, (int) os->obj[i].num);
1083  pdf_out(pdf, ' ');
1084  pdf_print_int(pdf, (int) os->obj[i].off);
1085  if (j == 9 || i == os->idx - 1) {
1086  /*tex Print out in groups of ten for better readability. */
1087  pdf_out(pdf, '\n');
1088  j = 0;
1089  } else {
1090  pdf_out(pdf, ' ');
1091  j++;
1092  }
1093  }
1094  /*tex Remember current buffer end. */
1095  n2 = (unsigned int) strbuf_offset(obuf);
1096  /*tex Switch to \PDF\ stream writing. */
1099  pdf_dict_add_name(pdf, "Type", "ObjStm");
1100  /*tex The number of objects in |ObjStm|. */
1101  pdf_dict_add_int(pdf, "N", (int) os->idx);
1102  pdf_dict_add_int(pdf, "First", (int) (n2 - n1));
1104  pdf_end_dict(pdf);
1106  /*tex Write object-number/byte-offset list. */
1107  pdf_out_block(pdf, (const char *) (obuf->data + n1), (size_t) (n2 - n1));
1108  /*tex Write collected object stream contents. */
1109  pdf_out_block(pdf, (const char *) obuf->data, (size_t) n1);
1111  pdf_end_obj(pdf);
1112  /*tex We force object stream generation next time. */
1113  os->cur_objstm = 0;
1114 }
1115 
1116 /*tex Here comes a bunch of flushers: */
1117 
1119 {
1121  pdf_puts(pdf, "<<");
1122  pdf_set_space(pdf);
1123 }
1124 
1126 {
1128  pdf_puts(pdf, ">>");
1129  pdf_set_space(pdf);
1130 }
1131 
1132 void pdf_dict_add_bool(PDF pdf, const char *key, int i)
1133 {
1134  pdf_add_name(pdf, key);
1135  pdf_add_bool(pdf, i);
1136 }
1137 
1138 void pdf_dict_add_int(PDF pdf, const char *key, int i)
1139 {
1140  pdf_add_name(pdf, key);
1141  pdf_add_int(pdf, i);
1142 }
1143 
1144 void pdf_dict_add_name(PDF pdf, const char *key, const char *val)
1145 {
1146  pdf_add_name(pdf, key);
1147  pdf_add_name(pdf, val);
1148 }
1149 
1150 void pdf_dict_add_string(PDF pdf, const char *key, const char *val)
1151 {
1152  if (val == NULL)
1153  return;
1154  pdf_add_name(pdf, key);
1156  pdf_print_str(pdf, val);
1157  pdf_set_space(pdf);
1158 }
1159 
1160 void pdf_dict_add_ref(PDF pdf, const char *key, int num)
1161 {
1162  pdf_add_name(pdf, key);
1163  pdf_add_ref(pdf, num);
1164 }
1165 
1167 {
1169  pdf_puts(pdf, "null");
1170  pdf_set_space(pdf);
1171 }
1172 
1173 void pdf_add_bool(PDF pdf, int i)
1174 {
1176  if (i == 0)
1177  pdf_puts(pdf, "false");
1178  else
1179  pdf_puts(pdf, "true");
1180  pdf_set_space(pdf);
1181 }
1182 
1183 void pdf_add_int(PDF pdf, int i)
1184 {
1186  pdf_print_int(pdf, i);
1187  pdf_set_space(pdf);
1188 }
1189 
1191 {
1193  pdf_print_int(pdf, n);
1194  pdf_set_space(pdf);
1195 }
1196 
1197 void pdf_add_string(PDF pdf, const char *s)
1198 {
1200  pdf_print_str(pdf, s);
1201  pdf_set_space(pdf);
1202 }
1203 
1204 void pdf_add_name(PDF pdf, const char *name)
1205 {
1207  pdf_out(pdf, '/');
1208  pdf_puts(pdf, name);
1209  pdf_set_space(pdf);
1210 }
1211 
1213 {
1215  pdf_print_int(pdf, num);
1216  pdf_puts(pdf, " 0 R");
1217  pdf_set_space(pdf);
1218 }
1219 
1220 /*tex
1221 
1222  When we add the stream length and filter entries to a stream dictionary,
1223  remember file position for seek.
1224 
1225 */
1226 
1228 {
1229  if (pdf->compress_level > 0) {
1230  pdf_dict_add_name(pdf, "Filter", "FlateDecode");
1231  pdf->stream_deflate = true;
1232  }
1233  pdf_add_name(pdf, "Length");
1234  pdf->stream_length_offset = pdf_offset(pdf) + 1;
1235  /*tex Fill in length at |pdf_end_stream| call. */
1236  pdf->seek_write_length = true;
1237  /*tex We reserve space for 10 decimal digits plus space. */
1238  pdf_puts(pdf, " x ");
1239  pdf_set_space(pdf);
1240 }
1241 
1243 {
1245  pdf_out(pdf, '[');
1246  pdf_set_space(pdf);
1247 }
1248 
1250 {
1252  pdf_out(pdf, ']');
1253  pdf_set_space(pdf);
1254 }
1255 
1256 void pdf_begin_obj(PDF pdf, int i, int pdf_os_threshold)
1257 {
1258  os_struct *os = pdf->os;
1260  pdf_prepare_obj(pdf, i, pdf_os_threshold);
1261  switch (os->curbuf) {
1262  case PDFOUT_BUF:
1263  pdf_printf(pdf, "%d 0 obj\n", (int) i);
1264  break;
1265  case OBJSTM_BUF:
1266  if (pdf->compress_level == 0) {
1267  /*tex Some debugging help. */
1268  pdf_printf(pdf, "%% %d 0 obj\n", (int) i);
1269  }
1270  break;
1271  default:
1272  normal_error("pdf backend","weird begin object");
1273  }
1275 }
1276 
1278 {
1279  os_struct *os = pdf->os;
1280  switch (os->curbuf) {
1281  case PDFOUT_BUF:
1282  /*tex End a \PDF\ object. */
1283  pdf_puts(pdf, "\nendobj\n");
1284  break;
1285  case OBJSTM_BUF:
1286  /*tex Tthe number of objects collected so far in ObjStm: */
1287  os->idx++;
1288  /*tex Only for statistics: */
1289  os->o_ctr++;
1290  if (os->idx == PDF_OS_MAX_OBJS) {
1292  } else {
1293  /*tex Adobe Reader seems to need this. */
1294  pdf_out(pdf, '\n');
1295  }
1296  break;
1297  default:
1298  normal_error("pdf backend","weird end object");
1299  }
1300 }
1301 
1302 /*
1303  Needed for embedding fonts.
1304 
1305 */
1306 
1308 {
1309  pdf_obj *stream = xmalloc(sizeof(pdf_obj));
1310  stream->length = 0;
1311  stream->data = NULL;
1312  return stream;
1313 }
1314 
1315 void pdf_add_stream(pdf_obj * stream, unsigned char *buf, long len)
1316 {
1317  int i;
1318  assert(stream != NULL);
1319  if (stream->data == NULL) {
1320  stream->data = xmalloc((unsigned) len);
1321  } else {
1322  stream->data =
1323  xrealloc(stream->data, (unsigned) len + (unsigned) stream->length);
1324  }
1325  for (i = 0; i < len; i++) {
1326  *(stream->data + stream->length + i) = *(buf + i);
1327  }
1328  stream->length += (unsigned) len;
1329 }
1330 
1332 {
1333  if (stream != NULL) {
1334  if (stream->data != NULL) {
1335  xfree(stream->data);
1336  }
1337  xfree(stream);
1338  }
1339 }
1340 
1341 /*
1342 
1343  This one converts any string given in in in an allowed PDF string which can
1344  be handled by printf et.al.: \.{\\} is escaped to \.{\\\\}, parenthesis are
1345  escaped and control characters are octal encoded. This assumes that the
1346  string does not contain any already escaped characters!
1347 
1348 */
1349 
1350 char *convertStringToPDFString(const char *in, int len)
1351 {
1352  static char pstrbuf[MAX_PSTRING_LEN];
1353  char *out = pstrbuf;
1354  int i, j, k;
1355  char buf[5];
1356  j = 0;
1357  for (i = 0; i < len; i++) {
1358  check_buf((unsigned) j + sizeof(buf), MAX_PSTRING_LEN);
1359  if (((unsigned char) in[i] < '!') || ((unsigned char) in[i] > '~')) {
1360  /*tex Convert control characters into octal. */
1361  k = snprintf(buf, sizeof(buf), "\\%03o", (unsigned int) (unsigned char) in[i]);
1362  check_nprintf(k, sizeof(buf));
1363  out[j++] = buf[0];
1364  out[j++] = buf[1];
1365  out[j++] = buf[2];
1366  out[j++] = buf[3];
1367  } else if ((in[i] == '(') || (in[i] == ')')) {
1368  /*tex Escape parenthesis: */
1369  out[j++] = '\\';
1370  out[j++] = in[i];
1371  } else if (in[i] == '\\') {
1372  /*tex Escape backslash: */
1373  out[j++] = '\\';
1374  out[j++] = '\\';
1375  } else {
1376  /* Copy char : */
1377  out[j++] = in[i];
1378  }
1379  }
1380  out[j] = '\0';
1381  return pstrbuf;
1382 }
1383 
1384 /*tex
1385 
1386  This one converts any string given in in in an allowed PDF string which is
1387  hexadecimal encoded; |sizeof(out)| should be at least $|lin|*2+1$.
1388 
1389 */
1390 
1391 static void convertStringToHexString(const char *in, char *out, int lin)
1392 {
1393  int i, k;
1394  char buf[3];
1395  int j = 0;
1396  for (i = 0; i < lin; i++) {
1397  k = snprintf(buf, sizeof(buf), "%02X", (unsigned int) (unsigned char) in[i]);
1398  check_nprintf(k, sizeof(buf));
1399  out[j++] = buf[0];
1400  out[j++] = buf[1];
1401  }
1402  out[j] = '\0';
1403 }
1404 
1405 /*tex
1406 
1407  We compute the ID string as per PDF specification 1.4 9.3 that stipulates
1408  only that the two IDs must be identical when the file is created and that
1409  they should be reasonably unique. Since it's difficult to get the file size
1410  at this point in the execution of pdfTeX and scanning the info dict is also
1411  difficult, we start with a simpler implementation using just the first two
1412  items.
1413 
1414  A user supplied trailerid had better be an array! So maybe we need to check
1415  for |[]| and error otherwise.
1416 
1417 */
1418 
1419 static void print_ID(PDF pdf)
1420 {
1421  if ((pdf_suppress_optional_info & 512) == 0) {
1422  const char *p = NULL;
1423  pdf_add_name(pdf, "ID");
1424  p = get_pdf_table_string("trailerid");
1425  if (p && strlen(p) > 0) {
1426  pdf_puts(pdf,p);
1427  } else if (pdf_trailer_id != 0) {
1428  /*tex The user provided one: */
1430  } else {
1431  /*tex The system provided one: */
1432  time_t t;
1433  size_t size;
1434  char time_str[32];
1436  md5_byte_t digest[16];
1437  char id[64];
1438  char pwd[4096];
1439  md5_init(&state);
1440  t = pdf->start_time;
1441  size = strftime(time_str, sizeof(time_str), "%Y%m%dT%H%M%SZ", gmtime(&t));
1442  md5_append(&state, (const md5_byte_t *) time_str, (int) size);
1443  if (getcwd(pwd, sizeof(pwd)) == NULL) {
1444  formatted_error("pdf backend","getcwd() failed (%s), (path too long?)", strerror(errno));
1445  }
1446 #ifdef WIN32
1447  {
1448  char *p;
1449  for (p = pwd; *p; p++) {
1450  if (*p == '\\')
1451  *p = '/';
1452  else if (IS_KANJI(p))
1453  p++;
1454  }
1455  }
1456 #endif
1457  md5_append(&state, (const md5_byte_t *) pwd, (int) strlen(pwd));
1458  md5_append(&state, (const md5_byte_t *) "/", 1);
1459  md5_append(&state, (const md5_byte_t *) pdf->file_name, (int) strlen(pdf->file_name));
1460  md5_finish(&state, digest);
1461  convertStringToHexString((char *) digest, id, 16);
1464  pdf_printf(pdf, "<%s> <%s>", id, id);
1465  pdf_set_space(pdf);
1466  pdf_end_array(pdf);
1467  }
1468  }
1469 }
1470 
1471 /*tex
1472 
1473  Here we print the |/CreationDate| entry in the form
1474  |(D:YYYYMMDDHHmmSSOHH'mm')|. The main difficulty is get the time zone offset.
1475  |strftime()| does this in ISO C99 (e.g. newer glibc) with \%z, but we have to
1476  work with other systems (e.g. Solaris 2.5).
1477 
1478 */
1479 
1480 #define TIME_STR_SIZE 30
1481 
1482 static void makepdftime(PDF pdf)
1483 {
1484  struct tm lt, gmt;
1485  size_t size;
1486  int i, off, off_hours, off_mins;
1487  time_t t = pdf->start_time;
1488  char *time_str = pdf->start_time_str;
1489  /*tex Get the time. */
1490  if (utc_option) {
1491  lt = *gmtime(&t);
1492  } else {
1493  lt = *localtime(&t);
1494  }
1495  size = strftime(time_str, TIME_STR_SIZE, "D:%Y%m%d%H%M%S", &lt);
1496  /*tex Expected format: |YYYYmmddHHMMSS|. */
1497  if (size == 0) {
1498  /*tex Unexpected, contents of |time_str| is undefined .*/
1499  time_str[0] = '\0';
1500  return;
1501  }
1502  /*tex
1503  A correction for seconds. the PDF reference expects 00..59, therefore we
1504  map 60 and 61 to 59.
1505  */
1506  if (time_str[14] == '6') {
1507  time_str[14] = '5';
1508  time_str[15] = '9';
1509  /*tex For safety: */
1510  time_str[16] = '\0';
1511  }
1512  /*tex Get the time zone offset. */
1513  gmt = *gmtime(&t);
1514  off = 60 * (lt.tm_hour - gmt.tm_hour) + lt.tm_min - gmt.tm_min;
1515  if (lt.tm_year != gmt.tm_year) {
1516  off += (lt.tm_year > gmt.tm_year) ? 1440 : -1440;
1517  } else if (lt.tm_yday != gmt.tm_yday) {
1518  off += (lt.tm_yday > gmt.tm_yday) ? 1440 : -1440;
1519  }
1520  if (off == 0) {
1521  time_str[size++] = 'Z';
1522  time_str[size] = 0;
1523  } else {
1524  off_hours = off / 60;
1525  off_mins = abs(off - off_hours * 60);
1526  i = snprintf(&time_str[size], 9, "%+03d'%02d'", off_hours, off_mins);
1527  check_nprintf(i, 9);
1528  }
1529  pdf->start_time = t;
1530 }
1531 
1533 {
1534  if (pdf->start_time == 0) {
1535  pdf->start_time = get_start_time();
1536  pdf->start_time_str = xtalloc(TIME_STR_SIZE, char);
1537  makepdftime(pdf);
1538  }
1539 }
1540 
1542 {
1544  return pdf->start_time_str;
1545 }
1546 
1548 {
1549  if (pdf != NULL) {
1550  if (!kpathsea_debug && pdf->file_name && (pdf->draftmode == 0)) {
1551  xfclose(pdf->file, pdf->file_name);
1552  remove(pdf->file_name);
1553  }
1554  }
1555 }
1556 
1557 /*tex We use this checker in other modules. It is not pdf specific. */
1558 
1559 void check_o_mode(PDF pdf, const char *s, int o_mode_bitpattern, boolean strict)
1560 {
1561 
1562  output_mode o_mode;
1563  const char *m = NULL;
1564  if (lua_only) {
1565  normal_error("lua only","no backend present, needed for what you asked for");
1566  return ;
1567  }
1569  o_mode = get_o_mode();
1570  else
1571  o_mode = output_mode_used;
1572  /*tex This is used by synctex, we need to use output_mode_used there. */
1573  pdf->o_mode = output_mode_used;
1574  if (!((1 << o_mode) & o_mode_bitpattern)) {
1575  switch (o_mode) {
1576  case OMODE_DVI:
1577  m = "DVI";
1578  break;
1579  case OMODE_PDF:
1580  m = "PDF";
1581  break;
1582  default:
1583  normal_error("pdf backend","weird output state");
1584  }
1585  if (strict)
1586  formatted_error("pdf backend", "%s not allowed in %s mode (outputmode = %d)",s, m, (int) output_mode_par);
1587  else
1588  formatted_warning("pdf backend", "%s not allowed in %s mode (outputmode = %d)",s, m, (int) output_mode_par);
1589  } else if (strict)
1591 }
1592 
1594 {
1595  char *fn;
1596  if (pdf->file_name != NULL)
1597  return;
1598  if (job_name == 0)
1599  open_log_file();
1600  fn = pack_job_name(ext);
1601  if (pdf->draftmode == 0 || output_mode_used == OMODE_DVI) {
1602  while (!lua_b_open_out(&pdf->file, fn))
1603  fn = prompt_file_name("file name for output", ext);
1604  }
1605  pdf->file_name = fn;
1606 }
1607 
1608 /*tex till here */
1609 
1610 void set_job_id(PDF pdf, int year, int month, int day, int time)
1611 {
1612  char *name_string, *format_string, *s;
1613  size_t slen;
1614  int i;
1615  if (pdf->job_id_string != NULL)
1616  return;
1617  name_string = makecstring(job_name);
1618  format_string = makecstring(format_ident);
1619  slen = SMALL_BUF_SIZE + strlen(name_string) + strlen(format_string) + strlen(luatex_banner);
1620  s = xtalloc(slen, char);
1621  /*tex The \WEBC\ version string starts with a space. (Really?) */
1622  i = snprintf(s, slen, "%.4d/%.2d/%.2d %.2d:%.2d %s %s %s", year, month, day, time / 60, time % 60, name_string, format_string, luatex_banner);
1623  check_nprintf(i, slen);
1624  pdf->job_id_string = xstrdup(s);
1625  xfree(s);
1626  xfree(name_string);
1627  xfree(format_string);
1628 }
1629 
1631 {
1632  static char name_str[] = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
1633  /*tex We make a tag of 6 characters long. */
1634  static char prefix[7];
1635  short i;
1636  size_t base = strlen(name_str);
1637  unsigned long crc = crc32(0L, Z_NULL, 0);
1638  crc = crc32(crc, (Bytef *) pdf->job_id_string, (uInt) strlen(pdf->job_id_string));
1639  for (i = 0; i < 6; i++) {
1640  prefix[i] = name_str[crc % base];
1641  crc /= base;
1642  }
1643  prefix[6] = '\0';
1644  return prefix;
1645 }
1646 
1648 {
1649  int xform_attributes;
1650  int xform_type = 0;
1651  scaled form_margin = pdf_xform_margin;
1654  if (pdf->page_resources == NULL) {
1655  pdf->page_resources = xtalloc(1, pdf_resource_struct);
1656  pdf->page_resources->resources_tree = NULL;
1657  }
1658  pdf->page_resources->last_resources = pdf_create_obj(pdf, obj_type_others, 0);
1660 
1662  pdf->last_page = pdf_get_obj(pdf, obj_type_page, total_pages + 1, 0);
1663  /*tex Mark that this page has been created. */
1664  set_obj_aux(pdf, pdf->last_page, 1);
1665  pdf->last_stream = pdf_create_obj(pdf, obj_type_pagestream, 0);
1666  pdf_begin_obj(pdf, pdf->last_stream, OBJSTM_NEVER);
1667  pdf->last_thread = null;
1669  } else {
1670  xform_type = obj_xform_type(pdf, pdf_cur_form) ;
1672  pdf->last_stream = pdf_cur_form;
1673  /*tex Write out the |Form| stream header */
1675  if (xform_type == 0) {
1676  pdf_dict_add_name(pdf, "Type", "XObject");
1677  pdf_dict_add_name(pdf, "Subtype", "Form");
1678  pdf_dict_add_int(pdf, "FormType", 1);
1679  }
1680  xform_attributes = pdf_xform_attr;
1681  /*tex Now stored in the object: */
1682  form_margin = obj_xform_margin(pdf, pdf_cur_form);
1683  if (xform_attributes != null)
1684  pdf_print_toks(pdf, xform_attributes);
1685  if (obj_xform_attr(pdf, pdf_cur_form) != null) {
1689  }
1690  if (obj_xform_attr_str(pdf, pdf_cur_form) != null) {
1694  }
1695  if (xform_type == 0 || xform_type == 1 || xform_type == 3) {
1696  pdf_add_name(pdf, "BBox");
1698  pdf_add_bp(pdf, -form_margin);
1699  pdf_add_bp(pdf, -form_margin);
1700  pdf_add_bp(pdf, pdf->page_size.h + form_margin);
1701  pdf_add_bp(pdf, pdf->page_size.v + form_margin);
1702  pdf_end_array(pdf);
1703  }
1704  if (xform_type == 0 || xform_type == 2 || xform_type == 3) {
1705  pdf_add_name(pdf, "Matrix");
1707  pdf_add_int(pdf, 1);
1708  pdf_add_int(pdf, 0);
1709  pdf_add_int(pdf, 0);
1710  pdf_add_int(pdf, 1);
1711  pdf_add_int(pdf, 0);
1712  pdf_add_int(pdf, 0);
1713  pdf_end_array(pdf);
1714  }
1715  pdf_dict_add_ref(pdf, "Resources", pdf->page_resources->last_resources);
1716  }
1717  /*tex Start a stream of page or form contents: */
1719  pdf_end_dict(pdf);
1721  /*tex Start with an empty stack: */
1722  pos_stack_used = 0;
1725  }
1728 }
1729 
1730 void print_pdf_table_string(PDF pdf, const char *s)
1731 {
1732  size_t len;
1733  const char *ls;
1736  lua_pushstring(Luas, s);
1737  lua_rawget(Luas, -2);
1738  if (lua_type(Luas, -1) == LUA_TSTRING) {
1739  ls = lua_tolstring(Luas, -1, &len);
1740  if (len > 0) {
1742  pdf_out_block(pdf, ls, len);
1743  pdf_set_space(pdf);
1744  }
1745  }
1746  lua_pop(Luas, 2);
1747 }
1748 
1749 const char *get_pdf_table_string(const char *s)
1750 {
1751  const_lstring ls;
1754  lua_pushstring(Luas, s);
1755  lua_rawget(Luas, -2);
1756  if (lua_type(Luas, -1) == LUA_TSTRING) {
1757  ls.s = lua_tolstring(Luas, -1, &ls.l);
1758  /*tex
1759  Here |s| is supposed to be anchored (e.g.\ in the registry) so it's
1760  not garbage collected.
1761  */
1762  lua_pop(Luas, 2);
1763  return ls.s;
1764  }
1765  lua_pop(Luas, 2);
1766  return NULL ;
1767 }
1768 
1770 {
1771  char s[64], *p;
1772  int j, annots = 0, beads = 0, callback_id;
1773  pdf_resource_struct *res_p = pdf->page_resources;
1774  pdf_resource_struct local_page_resources;
1775  pdf_object_list *annot_list, *bead_list, *link_list, *ol, *ol1;
1776  /*tex We save |pdf->page_size| during flushing pending forms: */
1777  scaledpos save_cur_page_size;
1778  shipping_mode_e save_shipping_mode;
1779  int save_pdf_cur_form;
1780  int xform_resources;
1781  int page_resources, page_attributes;
1782  int procset = PROCSET_PDF;
1783  /*tex Finish the stream of page or form contents: */
1785  if (pos_stack_used > 0) {
1786  formatted_error("pdf backend","%u unmatched 'save' after %s shipout", (unsigned int) pos_stack_used,
1787  ((global_shipping_mode == SHIPPING_PAGE) ? "page" : "form"));
1788  }
1790  pdf_end_obj(pdf);
1792  if (callback_id > 0)
1793  run_callback(callback_id, "b->",(global_shipping_mode == SHIPPING_PAGE));
1795  int location = 0;
1796  int callback_id = callback_defined(page_order_index_callback);
1797  if (callback_id) {
1798  run_callback(callback_id, "d->d", total_pages, &location);
1799  }
1800  pdf->last_pages = pdf_do_page_divert(pdf, pdf->last_page, location);
1801  /*tex Write out the |/Page| object. */
1802  pdf_begin_obj(pdf, pdf->last_page, OBJSTM_ALWAYS);
1804  pdf_dict_add_name(pdf, "Type", "Page");
1805  pdf_dict_add_ref(pdf, "Contents", pdf->last_stream);
1806  pdf_dict_add_ref(pdf, "Resources", res_p->last_resources);
1807  pdf_add_name(pdf, "MediaBox");
1809  pdf_add_int(pdf, 0);
1810  pdf_add_int(pdf, 0);
1811  pdf_add_bp(pdf, pdf->page_size.h);
1812  pdf_add_bp(pdf, pdf->page_size.v);
1813  pdf_end_array(pdf);
1814  page_attributes = pdf_page_attr ;
1815  if (page_attributes != null)
1816  pdf_print_toks(pdf, page_attributes);
1817  print_pdf_table_string(pdf, "pageattributes");
1818  pdf_dict_add_ref(pdf, "Parent", pdf->last_pages);
1819  if (pdf->img_page_group_val != 0) {
1820  pdf_dict_add_ref(pdf, "Group", pdf->img_page_group_val);
1821  }
1824  if (annot_list != NULL || link_list != NULL) {
1825  annots = pdf_create_obj(pdf, obj_type_annots, 0);
1826  pdf_dict_add_ref(pdf, "Annots", annots);
1827  }
1829  if (bead_list != NULL) {
1830  beads = pdf_create_obj(pdf, obj_type_beads, 0);
1831  pdf_dict_add_ref(pdf, "B", beads);
1832  }
1833  pdf_end_dict(pdf);
1834  pdf_end_obj(pdf);
1835  pdf->img_page_group_val = 0;
1836  /*tex Generate an array of annotations or beads in page. */
1837  if (annot_list != NULL || link_list != NULL) {
1838  pdf_begin_obj(pdf, annots, OBJSTM_ALWAYS);
1840  while (annot_list != NULL) {
1841  pdf_add_ref(pdf, annot_list->info);
1842  annot_list = annot_list->link;
1843  }
1844  while (link_list != NULL) {
1845  pdf_add_ref(pdf, link_list->info);
1846  link_list = link_list->link;
1847  }
1848  pdf_end_array(pdf);
1849  pdf_end_obj(pdf);
1850  }
1851  if (bead_list != NULL) {
1852  pdf_begin_obj(pdf, beads, OBJSTM_ALWAYS);
1854  while (bead_list != NULL) {
1855  pdf_add_ref(pdf, bead_list->info);
1856  bead_list = bead_list->link;
1857  }
1858  pdf_end_array(pdf);
1859  pdf_end_obj(pdf);
1860  }
1861  }
1862  /*tex Write out the resource lists and pending raw objects. */
1864  while (ol != NULL) {
1865  if (!is_obj_written(pdf, ol->info))
1866  pdf_write_obj(pdf, ol->info);
1867  ol = ol->link;
1868  }
1869  /*tex
1870  When flushing pending forms we need to save and restore resource lists
1871  which are also used by page shipping. Saving and restoring
1872  |pdf->page_size| is needed for proper writing out pending \PDF\ marks.
1873  */
1875  while (ol != NULL) {
1876  if (!is_obj_written(pdf, ol->info)) {
1877  save_pdf_cur_form = pdf_cur_form;
1878  pdf_cur_form = ol->info;
1879  save_cur_page_size = pdf->page_size;
1880  save_shipping_mode = global_shipping_mode;
1881  pdf->page_resources = &local_page_resources;
1882  local_page_resources.resources_tree = NULL;
1884  /*tex Restore the page size and page resources. */
1885  pdf->page_size = save_cur_page_size;
1886  global_shipping_mode = save_shipping_mode;
1888  pdf->page_resources = res_p;
1889  pdf_cur_form = save_pdf_cur_form;
1890  }
1891  ol = ol->link;
1892  }
1893  /*tex Write out pending images. */
1895  while (ol != NULL) {
1896  if (!is_obj_written(pdf, ol->info))
1897  pdf_write_image(pdf, ol->info);
1898  ol = ol->link;
1899  }
1901  /*tex Write out pending \PDF\ marks and annotations. */
1903  while (ol != NULL) {
1904  if (ol->info > 0 && obj_type(pdf, ol->info) == obj_type_annot) {
1905  /*tex Here |j| points to |pdf_annot_node|: */
1906  j = obj_annot_ptr(pdf, ol->info);
1909  pdf_dict_add_name(pdf, "Type", "Annot");
1911  pdf_rectangle(pdf, j);
1912  pdf_end_dict(pdf);
1913  pdf_end_obj(pdf);
1914  }
1915  ol = ol->link;
1916  }
1917  /*tex Write out PDF link annotations. */
1918  if ((ol = get_page_resources_list(pdf, obj_type_link)) != NULL) {
1919  while (ol != NULL) {
1920  j = obj_annot_ptr(pdf, ol->info);
1923  pdf_dict_add_name(pdf, "Type", "Annot");
1925  pdf_dict_add_name(pdf, "Subtype", "Link");
1926  if (pdf_link_attr(j) != null)
1928  pdf_rectangle(pdf, j);
1930  pdf_puts(pdf, "/A ");
1932  pdf_end_dict(pdf);
1933  pdf_end_obj(pdf);
1934  ol = ol->link;
1935  }
1936  /*tex Flush |pdf_start_link_node|'s created by |append_link|. */
1938  while (ol != NULL) {
1939  j = obj_annot_ptr(pdf, ol->info);
1940  /*tex
1941  Nodes with |subtype = pdf_link_data_node| were created by
1942  |append_link| and must be flushed here, as they are not
1943  linked in any list.
1944  */
1945  if (subtype(j) == pdf_link_data_node)
1946  flush_node(j);
1947  ol = ol->link;
1948  }
1949  }
1950  /*tex Write out \PDF\ mark destinations. */
1952  /*tex Write out \PDF\ bead rectangle specifications. */
1954  }
1955  /*tex Write out resources dictionary. */
1958  /*tex Print additional resources. */
1960  page_resources = pdf_page_resources;
1961  if (page_resources != null) {
1962  pdf_print_toks(pdf, page_resources);
1963  }
1964  print_pdf_table_string(pdf, "pageresources");
1965  } else {
1966  xform_resources = pdf_xform_resources;
1967  if (xform_resources != null) {
1968  pdf_print_toks(pdf, xform_resources);
1969  }
1970  if (obj_xform_resources(pdf, pdf_cur_form) != null) {
1974  }
1975  if (obj_xform_resources_str(pdf, pdf_cur_form) != null) {
1979  }
1980  }
1981  /*tex Generate font resources. */
1982  if ((ol = get_page_resources_list(pdf, obj_type_font)) != NULL) {
1983  pdf_add_name(pdf, "Font");
1985  while (ol != NULL) {
1986  p = s;
1987  p += snprintf(p, 20, "F%i", obj_info(pdf, ol->info));
1988  if (pdf->resname_prefix != NULL)
1989  p += snprintf(p, 20, "%s", pdf->resname_prefix);
1990  pdf_dict_add_ref(pdf, s, ol->info);
1991  ol = ol->link;
1992  }
1993  pdf_end_dict(pdf);
1994  procset |= PROCSET_TEXT;
1995  }
1996  /*tex Generate |XObject| resources. */
1999  if (ol != NULL || ol1 != NULL) {
2000  pdf_add_name(pdf, "XObject");
2002  while (ol != NULL) {
2003  p = s;
2004  p += snprintf(p, 20, "Fm%i", obj_info(pdf, ol->info));
2005  if (pdf->resname_prefix != NULL)
2006  p += snprintf(p, 20, "%s", pdf->resname_prefix);
2007  pdf_dict_add_ref(pdf, s, ol->info);
2008  ol = ol->link;
2009  }
2010  while (ol1 != null) {
2011  p = s;
2012  p += snprintf(p, 20, "Im%i", obj_info(pdf, ol1->info));
2013  if (pdf->resname_prefix != NULL)
2014  p += snprintf(p, 20, "%s", pdf->resname_prefix);
2015  pdf_dict_add_ref(pdf, s, ol1->info);
2016  procset |= img_procset(idict_array[obj_data_ptr(pdf, ol1->info)]);
2017  ol1 = ol1->link;
2018  }
2019  pdf_end_dict(pdf);
2020  }
2021  /*tex Generate |ProcSet| in version 1.*/
2022  if (pdf->major_version == 1) {
2023  pdf_add_name(pdf, "ProcSet");
2025  if ((procset & PROCSET_PDF) != 0)
2026  pdf_add_name(pdf, "PDF");
2027  if ((procset & PROCSET_TEXT) != 0)
2028  pdf_add_name(pdf, "Text");
2029  if ((procset & PROCSET_IMAGE_B) != 0)
2030  pdf_add_name(pdf, "ImageB");
2031  if ((procset & PROCSET_IMAGE_C) != 0)
2032  pdf_add_name(pdf, "ImageC");
2033  if ((procset & PROCSET_IMAGE_I) != 0)
2034  pdf_add_name(pdf, "ImageI");
2035  pdf_end_array(pdf);
2036  }
2037  pdf_end_dict(pdf);
2038  pdf_end_obj(pdf);
2039 }
2040 
2041 /*tex
2042 
2043  We're now ready to wrap up the output file. Destinations that have been
2044  referenced but don't exists have |obj_dest_ptr=null|. Leaving them undefined
2045  might cause troubles for PDF browsers, so we need to fix them; they point to
2046  the last page.
2047 
2048 */
2049 
2051 {
2052  int k;
2053  for (k = pdf->head_tab[obj_type_dest]; k != 0; k = obj_link(pdf, k)) {
2054  if (obj_dest_ptr(pdf, k) == null) {
2055  if (obj_info(pdf, k) < 0) {
2056  char *ss = makecstring(-obj_info(pdf, k));
2057  formatted_warning("pdf backend", "unreferenced destination with name '%s'",ss);
2058  } else {
2059  formatted_warning("pdf backend", "unreferenced destination with num '%d'",obj_info(pdf,k));
2060  }
2061 
2064  pdf_add_ref(pdf, pdf->last_page);
2065  pdf_add_name(pdf, "Fit");
2066  pdf_end_array(pdf);
2067  pdf_end_obj(pdf);
2068  }
2069  }
2070 }
2071 
2073 {
2074  struct avl_traverser t;
2075  oentry *p;
2076  struct avl_table *page_tree = pdf->obj_tree[obj_type_page];
2077  avl_t_init(&t, page_tree);
2078  /*tex Search from the end backward until the last real page is found. */
2079  for (p = avl_t_last(&t, page_tree); p != NULL && obj_aux(pdf, p->objptr) == 0; p = avl_t_prev(&t)) {
2080  formatted_warning("pdf backend", "page %d has been referenced but does not exist",obj_info(pdf, p->objptr));
2081  }
2082 }
2083 
2084 /*tex
2085 
2086  If the same keys in a dictionary are given several times, then it is not
2087  defined which value is choosen by an application. Therefore the keys
2088  |/Producer| and |/Creator| are only set if the token list |pdf_info_toks|
2089  converted to a string does not contain these key strings.
2090 
2091 */
2092 
2093 static boolean substr_of_str(const char *s, const char *t)
2094 {
2095  if (strstr(t, s) == NULL)
2096  return false;
2097  return true;
2098 }
2099 
2100 static int pdf_print_info(PDF pdf, int luatexversion, str_number luatexrevision)
2101 {
2102  boolean creator_given = false;
2103  boolean producer_given = false;
2104  boolean creationdate_given = false;
2105  boolean moddate_given = false;
2106  boolean trapped_given = false;
2107  char *s = NULL;
2108  const char *p = NULL;
2109  int k, len = 0;
2111  pdf_begin_obj(pdf, k, 3);
2113  if (pdf_info_toks != 0) {
2115  creator_given = substr_of_str("/Creator", s);
2116  producer_given = substr_of_str("/Producer", s);
2117  creationdate_given = substr_of_str("/CreationDate", s);
2118  moddate_given = substr_of_str("/ModDate", s);
2119  trapped_given = substr_of_str("/Trapped", s);
2120  }
2121  p = get_pdf_table_string("info");
2122  if (p && strlen(p) > 0) {
2123  creator_given = creator_given || substr_of_str("/Creator", p);
2124  producer_given = producer_given || substr_of_str("/Producer", p);
2125  creationdate_given = creationdate_given || substr_of_str("/CreationDate", p);
2126  moddate_given = moddate_given || substr_of_str("/ModDate", p);
2127  trapped_given = trapped_given || substr_of_str("/Trapped", p);
2128  }
2129  if (pdf_info_toks != null) {
2130  if (len > 0) {
2132  pdf_puts(pdf, s);
2133  pdf_set_space(pdf);
2134  xfree(s);
2135  }
2137  pdf_info_toks = null;
2138  }
2139  if (p && strlen(p) > 0) {
2141  pdf_puts(pdf, p);
2142  pdf_set_space(pdf);
2143  }
2144  if ((pdf_suppress_optional_info & 128) == 0 && !producer_given) {
2145  pdf_add_name(pdf, "Producer");
2146  pdf_puts(pdf, " (LuaTeX-");
2148  pdf_out(pdf, ')');
2149  }
2150  if ((pdf_suppress_optional_info & 16) == 0 && !creator_given) {
2151  pdf_dict_add_string(pdf, "Creator", "TeX");
2152  }
2153  if ((pdf_suppress_optional_info & 32) == 0 && !creationdate_given) {
2155  pdf_dict_add_string(pdf, "CreationDate", pdf->start_time_str);
2156  }
2157  if ((pdf_suppress_optional_info & 64) == 0 && !moddate_given) {
2159  pdf_dict_add_string(pdf, "ModDate", pdf->start_time_str);
2160  }
2161  if ((pdf_suppress_optional_info & 256) == 0 && !trapped_given) {
2162  pdf_dict_add_name(pdf, "Trapped", "False");
2163  }
2164  if ((pdf_suppress_optional_info & 1) == 0) {
2165  pdf_dict_add_string(pdf, "PTEX.FullBanner", luatex_banner);
2166  }
2167  pdf_end_dict(pdf);
2168  pdf_end_obj(pdf);
2169  return k;
2170 }
2171 
2173 {
2174  int k;
2175  int l = 0;
2176  /*tex A |null| object at the begin of a list of free objects. */
2177  set_obj_fresh(pdf, l);
2178  for (k = 1; k <= pdf->obj_ptr; k++) {
2179  if (!is_obj_written(pdf, k)) {
2180  set_obj_link(pdf, l, k);
2181  l = k;
2182  }
2183  }
2184  set_obj_link(pdf, l, 0);
2185 }
2186 
2187 /*tex
2188 
2189  Now we can the finish of \PDF\ output file. At this moment all |/Page|
2190  objects are already written completely to \PDF\ output file.
2191 
2192 */
2193 
2195  if (fatal_error) {
2196  remove_pdffile(static_pdf); /* will become remove_output_file */
2197  print_err(" ==> Fatal error occurred, no output PDF file produced!");
2198  } else {
2199  int i, j, k;
2200  int root, info;
2201  int xref_stm = 0;
2202  int outlines = 0;
2203  int threads = 0;
2204  int names_tree = 0;
2205  int prerolled = 0;
2206  size_t xref_offset_width;
2207  int luatexversion = luatex_version;
2209  int callback_id = callback_defined(stop_run_callback);
2210  int callback_id1 = callback_defined(finish_pdffile_callback);
2211  if (total_pages == 0 && !pdf->force_file) {
2212  if (callback_id == 0) {
2213  normal_warning("pdf backend","no pages of output.");
2214  } else if (callback_id > 0) {
2215  run_callback(callback_id, "->");
2216  }
2217  if (pdf->gone > 0) {
2218  /* number of bytes gone */
2219  normal_error("pdf backend","already written content discarded, no output file produced.");
2220  }
2221  } else {
2222  if (pdf->draftmode == 0) {
2223  /*tex We make sure that the output file name has been already created. */
2224  pdf_flush(pdf);
2225  /*tex Flush page 0 objects from JBIG2 images, if any. */
2227  if (callback_id1 > 0) {
2228  run_callback(callback_id1, "->");
2229  }
2230  if (total_pages > 0) {
2233  }
2234  /*tex
2235  Output fonts definition.
2236  */
2237  pdf->gen_tounicode = pdf_gen_tounicode;
2238  pdf->omit_cidset = pdf_omit_cidset;
2239  pdf->omit_charset = pdf_omit_charset;
2240  /*tex
2241  The first pass over the list will flag the slots that are
2242  used so that we can do a preroll for type 3 fonts.
2243  */
2244  for (k = 1; k <= max_font_id(); k++) {
2245  if (font_used(k) && (pdf_font_num(k) < 0)) {
2246  i = -pdf_font_num(k);
2247  for (j = font_bc(k); j <= font_ec(k); j++)
2248  if (quick_char_exists(k, j) && pdf_char_marked(k, j))
2249  pdf_mark_char(i, j);
2250  }
2251  }
2252  k = pdf->head_tab[obj_type_font];
2253  while (k != 0) {
2254  int f = obj_info(pdf, k);
2255  if (do_pdf_preroll_font(pdf, f)) {
2256  prerolled = 1;
2257  }
2258  k = obj_link(pdf, k);
2259  }
2260  /*tex
2261  Just in case the user type 3 font has used fonts, we need to
2262  do a second pass. We also collect some additional data here.
2263  */
2264  for (k = 1; k <= max_font_id(); k++) {
2265  if (font_used(k) && (pdf_font_num(k) < 0)) {
2266  i = -pdf_font_num(k);
2267  if (prerolled) {
2268  for (j = font_bc(k); j <= font_ec(k); j++)
2269  if (quick_char_exists(k, j) && pdf_char_marked(k, j))
2270  pdf_mark_char(i, j);
2271  } else {
2272  /*tex No need to waste time on checking again. */
2273  }
2274  if ((pdf_font_attr(i) == 0) && (pdf_font_attr(k) != 0)) {
2276  } else if ((pdf_font_attr(k) == 0) && (pdf_font_attr(i) != 0)) {
2278  } else if ((pdf_font_attr(i) != 0) && (pdf_font_attr(k) != 0) && (!str_eq_str(pdf_font_attr(i), pdf_font_attr(k)))) {
2279  formatted_warning("pdf backend","fontattr of font %d and %d are conflicting, %k is used",i,k,i);
2280  }
2281  }
2282  }
2283  k = pdf->head_tab[obj_type_font];
2284  while (k != 0) {
2285  int f = obj_info(pdf, k);
2286  do_pdf_font(pdf, f);
2287  k = obj_link(pdf, k);
2288  }
2290  /*tex
2291  We're done with the fonts.
2292  */
2293  if (total_pages > 0) {
2294  pdf->last_pages = output_pages_tree(pdf);
2295  /*tex Output outlines. */
2296  outlines = print_outlines(pdf);
2297  /*tex
2298  The name tree is very similiar to Pages tree so its construction
2299  should be certain from Pages tree construction. For intermediate
2300  node |obj_info| will be the first name and |obj_link| will be the
2301  last name in \.{\\Limits} array. Note that |pdf_dest_names_ptr|
2302  will be less than |obj_ptr|, so we test if |k <
2303  pdf_dest_names_ptr| then |k| is index of leaf in |dest_names|;
2304  else |k| will be index in |obj_tab| of some intermediate node.
2305  */
2306  names_tree = output_name_tree(pdf);
2307  /*tex Output article threads. */
2308  if (pdf->head_tab[obj_type_thread] != 0) {
2309  threads = pdf_create_obj(pdf, obj_type_others, 0);
2310  pdf_begin_obj(pdf, threads, OBJSTM_ALWAYS);
2312  k = pdf->head_tab[obj_type_thread];
2313  while (k != 0) {
2314  pdf_add_ref(pdf, k);
2315  k = obj_link(pdf, k);
2316  }
2317  pdf_end_array(pdf);
2318  pdf_end_obj(pdf);
2319  k = pdf->head_tab[obj_type_thread];
2320  while (k != 0) {
2321  out_thread(pdf, k);
2322  k = obj_link(pdf, k);
2323  }
2324  } else {
2325  threads = 0;
2326  }
2327  }
2328  /*tex Output the |/Catalog| object. */
2332  pdf_dict_add_name(pdf, "Type", "Catalog");
2333  if (total_pages > 0) {
2334  pdf_dict_add_ref(pdf, "Pages", pdf->last_pages);
2335  if (threads != 0) {
2336  pdf_dict_add_ref(pdf, "Threads", threads);
2337  }
2338  if (outlines != 0) {
2339  pdf_dict_add_ref(pdf, "Outlines", outlines);
2340  }
2341  if (names_tree != 0) {
2342  pdf_dict_add_ref(pdf, "Names", names_tree);
2343  }
2344  if (pdf_catalog_toks != null) {
2347  pdf_catalog_toks = null;
2348  }
2349  }
2350  if (pdf_catalog_openaction != 0) {
2352  }
2353  print_pdf_table_string(pdf, "catalog");
2354  pdf_end_dict(pdf);
2355  pdf_end_obj(pdf);
2356  info = pdf_print_info(pdf, luatexversion, luatexrevision);
2357  if (pdf->os_enable) {
2360  pdf_flush(pdf);
2362  /*tex Output the cross-reference stream dictionary. */
2363  xref_stm = pdf_create_obj(pdf, obj_type_others, 0);
2364  pdf_begin_obj(pdf, xref_stm, OBJSTM_NEVER);
2365  if ((obj_offset(pdf, pdf->obj_ptr) / 256) > 16777215)
2366  xref_offset_width = 5;
2367  else if (obj_offset(pdf, pdf->obj_ptr) > 16777215)
2368  xref_offset_width = 4;
2369  else if (obj_offset(pdf, pdf->obj_ptr) > 65535)
2370  xref_offset_width = 3;
2371  else
2372  xref_offset_width = 2;
2373  /*tex Build a linked list of free objects. */
2376  pdf_dict_add_name(pdf, "Type", "XRef");
2377  pdf_add_name(pdf, "Index");
2379  pdf_add_int(pdf, 0);
2380  pdf_add_int(pdf, pdf->obj_ptr + 1);
2381  pdf_end_array(pdf);
2382  pdf_dict_add_int(pdf, "Size", pdf->obj_ptr + 1);
2383  pdf_add_name(pdf, "W");
2385  pdf_add_int(pdf, 1);
2386  pdf_add_int(pdf, (int) xref_offset_width);
2387  pdf_add_int(pdf, 1);
2388  pdf_end_array(pdf);
2389  pdf_dict_add_ref(pdf, "Root", root);
2390  pdf_dict_add_ref(pdf, "Info", info);
2391  if (pdf_trailer_toks != null) {
2394  pdf_trailer_toks = null;
2395  }
2396  print_pdf_table_string(pdf, "trailer");
2397  print_ID(pdf);
2399  pdf_end_dict(pdf);
2401  for (k = 0; k <= pdf->obj_ptr; k++) {
2402  if (!is_obj_written(pdf, k)) {
2403  /*tex A free object: */
2404  pdf_out(pdf, 0);
2405  pdf_out_bytes(pdf, obj_link(pdf, k), xref_offset_width);
2406  pdf_out(pdf, 255);
2407  } else if (obj_os_idx(pdf, k) == PDF_OS_MAX_OBJS) {
2408  /*tex An object not in object stream: */
2409  pdf_out(pdf, 1);
2410  pdf_out_bytes(pdf, obj_offset(pdf, k), xref_offset_width);
2411  pdf_out(pdf, 0);
2412  } else {
2413  /*tex An object in object stream: */
2414  pdf_out(pdf, 2);
2415  pdf_out_bytes(pdf, obj_offset(pdf, k), xref_offset_width);
2416  pdf_out(pdf, obj_os_idx(pdf, k));
2417  }
2418  }
2420  pdf_end_obj(pdf);
2421  pdf_flush(pdf);
2422  } else {
2423  /*tex Output the |obj_tab| and build a linked list of free objects. */
2426  pdf_puts(pdf, "xref\n");
2427  pdf_puts(pdf, "0 ");
2428  pdf_print_int_ln(pdf, pdf->obj_ptr + 1);
2430  pdf_puts(pdf, " 65535 f \n");
2431  for (k = 1; k <= pdf->obj_ptr; k++) {
2432  if (!is_obj_written(pdf, k)) {
2434  pdf_puts(pdf, " 00000 f \n");
2435  } else {
2437  pdf_puts(pdf, " 00000 n \n");
2438  }
2439  }
2440  }
2441  /*tex Output the trailer. */
2442  if (!pdf->os_enable) {
2443  pdf_puts(pdf, "trailer\n");
2446  pdf_dict_add_int(pdf, "Size", pdf->obj_ptr + 1);
2447  pdf_dict_add_ref(pdf, "Root", root);
2448  pdf_dict_add_ref(pdf, "Info", info);
2449  if (pdf_trailer_toks != null) {
2452  pdf_trailer_toks = null;
2453  }
2454  print_ID(pdf);
2455  pdf_end_dict(pdf);
2456  pdf_out(pdf, '\n');
2457  }
2458  pdf_puts(pdf, "startxref\n");
2460  if (pdf->os_enable)
2461  pdf_add_longint(pdf, (longinteger) obj_offset(pdf, xref_stm));
2462  else
2463  pdf_add_longint(pdf, (longinteger) pdf->save_offset);
2464  pdf_puts(pdf, "\n%%EOF\n");
2465  pdf_flush(pdf);
2466  if (callback_id == 0) {
2467  tprint_nl("Output written on ");
2468  tprint(pdf->file_name);
2469  tprint(" (");
2471  tprint(" page");
2472  if (total_pages != 1)
2473  print_char('s');
2474  tprint(", ");
2476  tprint(" bytes).");
2477  print_ln();
2478  } else if (callback_id > 0) {
2479  run_callback(callback_id, "->");
2480  }
2481  libpdffinish(pdf);
2482  close_file(pdf->file);
2483  } else {
2484  if (callback_id > 0) {
2485  run_callback(callback_id, "->");
2486  }
2487  libpdffinish(pdf);
2488  normal_warning("pdf backend","draftmode enabled, not changing output pdf");
2489  }
2490  }
2491  if (callback_id == 0) {
2492  if (log_opened_global) {
2493  fprintf(log_file, "\nPDF statistics: %d PDF objects out of %d (max. %d)\n",
2494  (int) pdf->obj_ptr, (int) pdf->obj_tab_size,
2495  (int) sup_obj_tab_size);
2496  if (pdf->os->ostm_ctr > 0) {
2497  fprintf(log_file, " %d compressed objects within %d object stream%s\n",
2498  (int) pdf->os->o_ctr, (int) pdf->os->ostm_ctr,
2499  (pdf->os->ostm_ctr > 1 ? "s" : ""));
2500  }
2501  fprintf(log_file, " %d named destinations out of %d (max. %d)\n",
2502  (int) pdf->dest_names_ptr, (int) pdf->dest_names_size,
2503  (int) sup_dest_names_size);
2504  fprintf(log_file, " %d words of extra memory for PDF output out of %d (max. %d)\n",
2505  (int) pdf->mem_ptr, (int) pdf->mem_size,
2506  (int) sup_pdf_mem_size);
2507  }
2508  }
2509  }
2510 }
2511 
2513 {
2514  halfword p;
2515  scan_toks(false, true);
2517  if (scan_keyword("openaction")) {
2518  if (pdf_catalog_openaction != 0) {
2519  normal_error("pdf backend", "duplicate of openaction");
2520  } else {
2521  check_o_mode(pdf, "catalog", 1 << OMODE_PDF, true);
2522  p = scan_action(pdf);
2525  write_action(pdf, p);
2526  pdf_end_obj(pdf);
2528  }
2529  }
2530 }
2531 
2532 /*tex
2533 
2534  This function converts double to pdffloat; very small and very large numbers
2535  are {\em not} converted to scientific notation. Here n must be a number or
2536  real conforming to the implementation limits of \PDF\ as specified in
2537  appendix C.1 of the \PDF\ standard. The maximum value of ints is |+2^32|, the
2538  maximum value of reals is |+2^15| and the smallest values of reals is
2539  |1/(2^16)|. We are quite large on precision, because it could happen that a
2540  pdf file imported as figure has real numbers with an unusual (and possibly useless)
2541  high precision. Later the formatter will write the numbers in the correct format.
2542 
2543 */
2544 
2546 {
2547  pdffloat a;
2548 /* was a.e = 6; */
2549  a.e = 9 ;
2550  a.m = i64round(n * ten_pow[a.e]);
2551  return a;
2552 }
2553 
2554 void pdf_add_real(PDF pdf, double d)
2555 {
2558  pdf_set_space(pdf);
2559 }
2560 
2561 void pdf_push_list(PDF pdf, scaledpos *saved_pos, int *saved_loc) {
2562  /* nothing */
2563 }
2564 
2565 void pdf_pop_list(PDF pdf, scaledpos *saved_pos, int *saved_loc) {
2566  /* nothing */
2567 }
2568 
2570 {
2571  refpoint->pos.h = pdf_h_origin;
2572  refpoint->pos.v = pdf->page_size.v - pdf_v_origin;
2573 }
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 pr(int(*writeFunc)(void *stream, const char *data, int size), void *stream, const char *data)
Definition: HTMLGen.cc:249
#define prompt_file_name(s, e)
static void print_err(const char *s)
pointer scan_toks(boolean macro_def, boolean xpand)
Definition: aptex-src.c:18221
void print_int(integer n)
Definition: aptex-src.c:7042
#define pack_job_name(s)
void print_char(ASCII_code s)
Definition: aptex-src.c:6782
void delete_token_ref(pointer p)
Definition: aptex-src.c:10267
void open_log_file(void)
Definition: aptex-src.c:19506
#define year
Definition: aptex-macros.h:808
#define state
Definition: aptex-macros.h:996
#define day
Definition: aptex-macros.h:806
#define pdf_compress_level
Definition: aptex-macros.h:855
#define pdf_v_origin
Definition: aptex-macros.h:920
#define pdf_major_version
Definition: aptex-macros.h:856
#define name
#define subtype(a)
Definition: aptex-macros.h:172
#define month
Definition: aptex-macros.h:807
#define pdf_h_origin
Definition: aptex-macros.h:919
#define param(a, b)
#define pdf_minor_version
Definition: aptex-macros.h:857
static void ship_out(pointer p)
Definition: aptex-src.c:21011
static boolean scan_keyword(char *s)
Definition: aptex-src.c:15130
static char time_str[38]
Definition: aptex-utils.c:62
integer str_number
Definition: aptex.h:196
static boolean arith_error
Definition: aptex.h:332
static str_number format_ident
Definition: aptex.h:716
int fix_int(int val, int min, int max)
Definition: arithmetic.c:812
void fix_o_mode(void)
Definition: backend.c:113
output_mode get_o_mode(void)
Definition: backend.c:103
backend_function * backend_out_control
Definition: backend.c:11
@ backend_control_open_file
Definition: backend.h:20
@ backend_control_write_header
Definition: backend.h:21
static int item
Definition: brushtopbm.c:66
#define n
Definition: t4ht.c:1290
#define b
Definition: jpegint.h:372
#define fatal_error(i, s, t)
Definition: ctie-k.c:22
#define free(a)
Definition: decNumber.cpp:310
int w
Definition: dviconv.c:26
int v
Definition: dviconv.c:10
unsigned short halfword
Definition: dvips.h:68
#define check_buf(size, buf_size)
Definition: ptexmac.h:37
#define xfree(p)
Definition: ptexmac.h:85
#define PRINTF_BUF_SIZE
Definition: ptexmac.h:35
#define xtalloc
Definition: ptexmac.h:87
#define nil
Definition: dvi2tty.h:53
int printf()
static SIGNED_PAIR total_pages
Definition: dvicore.c:57
#define info
Definition: dviinfo.c:42
int close_file(FILE *f)
Definition: search.c:351
#define MAX_PSTRING_LEN
Definition: ptexmac.h:61
#define SMALL_BUF_SIZE
Definition: ptexmac.h:62
#define day_par
Definition: equivalents.h:782
#define time_par
Definition: equivalents.h:781
#define year_par
Definition: equivalents.h:784
@ dir_TLT
Definition: equivalents.h:537
#define draft_mode_par
Definition: equivalents.h:787
#define month_par
Definition: equivalents.h:783
#define output_mode_par
Definition: equivalents.h:786
halfword concat_tokens(halfword q, halfword r)
Definition: extensions.c:646
static void
Definition: fpif.c:118
Boolean_T str_eq_str(StrNumber_T s1, StrNumber_T s2)
mpz_t * f
Definition: gen-fib.c:34
mpz_t pp
Definition: gen-psqr.c:108
#define s
Definition: afcover.h:80
#define t
Definition: afcover.h:96
#define c(n)
Definition: gpos-common.c:150
#define a(n)
Definition: gpos-common.c:148
#define d(n)
Definition: gpos-common.c:151
static void * xrealloc(char *oldp, unsigned size)
Definition: gsftopk.c:643
int base
Definition: gsftopk.c:1502
#define memcpy(d, s, n)
Definition: gsftopk.c:64
FILE * out
Definition: hbf2gf.c:286
#define slen
Definition: hpcdtoppm.c:1329
assert(pcxLoadImage24((char *)((void *) 0), fp, pinfo, hdr))
#define SEEK_SET
Definition: jmemansi.c:26
#define NULL
Definition: ftobjs.h:61
small capitals from c petite p scientific f u
Definition: afcover.h:88
small capitals from c petite p
Definition: afcover.h:72
small capitals from c petite p scientific i
Definition: afcover.h:80
#define const
Definition: ftzconf.h:91
unsigned int uInt
Definition: ftzconf.h:221
Byte * voidpf
Definition: ftzconf.h:239
Byte Bytef
Definition: ftzconf.h:228
#define SEEK_END
Definition: ftzconf.h:251
void(* free_func)()
Definition: zlib.h:64
voidpf(* alloc_func)()
Definition: zlib.h:63
#define Z_STREAM_END
Definition: zlib.h:133
#define Z_FINISH
Definition: zlib.h:129
#define Z_OK
Definition: zlib.h:132
#define Z_NO_FLUSH
Definition: zlib.h:125
#define Z_NULL
Definition: zlib.h:164
#define deflateInit(strm, level)
Definition: zlib.h:815
signed __int64 int64_t
Definition: stdint.h:89
png_uint_32 crc
Definition: png.c:2247
static int strict
Definition: pngtest.c:145
unsigned long crc32(unsigned long crc, unsigned char *buf, uInt len)
Definition: crc32.c:237
int deflate(z_streamp strm, int flush)
Definition: deflate.c:763
int deflateReset(z_streamp strm)
Definition: deflate.c:505
int deflateEnd(z_streamp strm)
Definition: deflate.c:1076
int errno
int num
Definition: disdvi.c:621
#define xstrdup(s)
Definition: writet1.c:34
#define xmalloc(size)
Definition: writet1.c:33
#define xfclose(f, filename)
Definition: writet1.c:35
#define buf
static void pdf_write_obj(pdf_out *p, pdf_obj *object)
Definition: pdfobj.c:3081
static pdf_obj * page_tree
Definition: pdfdoc.c:49
char * strstr()
#define kpathsea_debug
Definition: types.h:321
@ kpse_src_cmdline
Definition: types.h:176
@ kpse_pk_format
Definition: types.h:104
#define getcwd
Definition: win32lib.h:77
#define xfseeko
Definition: win32lib.h:287
static int ret
Definition: convert.c:72
#define fprintf
Definition: mendex.h:64
static int flush(unsigned char *buff, int num, FILE *fp)
Definition: ptexenc.c:462
static char * strerror(int errnum)
Definition: error.c:56
#define xreallocarray(ptr, type, size)
Definition: cpascal.h:171
void overflow(const char *)
Definition: cwebboot.c:1385
#define root
Definition: ctangleboot.c:69
#define prefix
Definition: cwebboot.c:154
void md5_append(md5_state_t *pms, const md5_byte_t *data, int nbytes)
Definition: md5.c:323
void md5_init(md5_state_t *pms)
Definition: md5.c:313
void md5_finish(md5_state_t *pms, md5_byte_t digest[16])
Definition: md5.c:361
unsigned char md5_byte_t
Definition: md5.h:63
void * avl_t_prev(struct avl_traverser *trav)
Definition: avl.c:568
void * avl_t_last(struct avl_traverser *trav, struct avl_table *tree)
Definition: avl.c:418
void * avl_t_next(struct avl_traverser *trav)
Definition: avl.c:524
void * avl_t_first(struct avl_traverser *trav, struct avl_table *tree)
Definition: avl.c:393
void ** avl_probe(struct avl_table *tree, void *item)
Definition: avl.c:85
void avl_t_init(struct avl_traverser *trav, struct avl_table *tree)
Definition: avl.c:382
struct libavl_allocator avl_xallocator
Definition: avlstuff.c:41
size_t xfwrite(void *, size_t size, size_t nmemb, FILE *)
Definition: utils.c:355
void libpdffinish(void)
Definition: utils.c:408
int xfflush(FILE *)
Definition: utils.c:362
static void colorstackpagestart(void)
Definition: utils.c:1234
static int pos_stack_used
Definition: utils.c:1303
#define __attribute__(A)
Definition: synctex.c:338
#define print_ln(v)
Definition: tie.c:37
__int64 longinteger
Definition: config.h:81
#define LONGINTEGER_TYPE
Definition: config.h:93
#define LONGINTEGER_PRI
Definition: config.h:94
char args[100]
Definition: fixwrites.c:7
long time_t
Definition: types.h:18
long off_t
Definition: types.h:34
int remove()
#define vsnprintf
Definition: snprintf.c:40
#define snprintf
Definition: snprintf.c:41
int run_callback(int i, const char *values,...)
Definition: lcallbacklib.c:259
struct tm * localtime(const time_t *const timep)
Definition: localtime.c:1332
static struct tm tm
Definition: localtime.c:216
static const char gmt[]
Definition: localtime.c:66
struct tm * gmtime(const time_t *const timep)
Definition: localtime.c:1379
static const char * luatexrevision(void)
Definition: lstatslib.c:115
void normal_error(const char *t, const char *p)
Definition: errors.c:951
void formatted_error(const char *t, const char *fmt,...)
Definition: errors.c:1038
int lua_only
Definition: luainit.c:206
int utc_option
Definition: luainit.c:217
void lua_pdf_literal(PDF pdf, int i, int noline)
Definition: luanode.c:331
const char * luatex_banner
Definition: luatex.c:534
output_mode
Definition: luatex-api.h:25
@ OMODE_PDF
Definition: luatex-api.h:25
@ OMODE_NONE
Definition: luatex-api.h:25
@ OMODE_DVI
Definition: luatex-api.h:25
#define lua_key_index(a)
Definition: luatex-api.h:320
void formatted_warning(const char *t, const char *fmt,...)
Definition: errors.c:1048
int get_start_time(void)
Definition: luatex.c:176
int luatex_version
Definition: luatex.c:35
char * luatex_version_string
Definition: luatex.c:37
@ stop_run_callback
@ finish_pdfpage_callback
@ read_pk_file_callback
@ finish_pdffile_callback
@ page_order_index_callback
#define callback_defined(a)
vf_struct * new_vfstruct(void)
Definition: vfpacket.c:53
void do_pdf_font(PDF, internal_font_number)
Definition: writefont.c:792
int do_pdf_preroll_font(PDF, internal_font_number)
Definition: writefont.c:866
void write_fontstuff(PDF)
Definition: writefont.c:694
str_number get_luatexrevision(void)
Definition: mainbody.c:314
#define size_t
Definition: glob.c:257
static lua_State * Luas[1]
Definition: mfluac.c:37
void normal_warning(const char *t, const char *p)
Definition: errors.c:981
@ err
Definition: mtxline.h:24
float x
Definition: cordic.py:15
string fn
Definition: fc-lang.py:335
dictionary off
Definition: fc-lang.py:226
Definition: pdf.py:1
int k
Definition: otp-parser.c:70
unsigned digits[12]
Definition: out_routines.c:255
static int format
Definition: pbmclean.c:15
#define abs(a)
Definition: pbmplus.h:225
#define odd(n)
Definition: pbmplus.h:227
void write_action(PDF pdf, halfword p)
Definition: pdfaction.c:99
halfword scan_action(PDF pdf)
Definition: pdfaction.c:26
#define delete_action_ref(a)
Definition: pdfaction.h:36
#define obj_annot_ptr
Definition: pdfannot.h:27
void pdf_out_colorstack_startpage(PDF pdf)
void init_dest_names(PDF pdf)
Definition: pdfdest.c:32
void write_out_pdf_mark_destinations(PDF pdf)
Definition: pdfdest.c:127
int output_name_tree(PDF pdf)
Definition: pdfdest.c:297
#define sup_dest_names_size
Definition: pdfdest.h:53
#define obj_dest_ptr
Definition: pdfdest.h:44
PDF static_pdf
Definition: pdfgen.c:33
pdf_object_list * get_page_resources_list(PDF pdf, pdf_obj_type t)
Definition: pdfgen.c:818
scaled one_true_inch
Definition: pdfgen.c:690
scaled one_bp
Definition: pdfgen.c:698
char * getcreationdate(PDF pdf)
Definition: pdfgen.c:1541
char * convertStringToPDFString(const char *in, int len)
Definition: pdfgen.c:1350
static void write_nozip(PDF pdf)
Definition: pdfgen.c:356
char * get_resname_prefix(PDF pdf)
Definition: pdfgen.c:1630
halfword pdf_info_toks
Definition: pdfgen.c:45
void pdf_add_longint(PDF pdf, longinteger n)
Definition: pdfgen.c:1190
pdf_obj * pdf_new_stream(void)
Definition: pdfgen.c:1307
void set_job_id(PDF pdf, int year, int month, int day, int time)
Definition: pdfgen.c:1610
void pdf_end_dict(PDF pdf)
Definition: pdfgen.c:1125
void pdf_begin_obj(PDF pdf, int i, int pdf_os_threshold)
Definition: pdfgen.c:1256
void pdf_add_stream(pdf_obj *stream, unsigned char *buf, long len)
Definition: pdfgen.c:1315
void pdf_begin_stream(PDF pdf)
Definition: pdfgen.c:618
#define TIME_STR_SIZE
Definition: pdfgen.c:1480
int draft_mode_option
Definition: pdfgen.c:40
int ten_pow[10]
Definition: pdfgen.c:707
void pdf_dict_add_string(PDF pdf, const char *key, const char *val)
Definition: pdfgen.c:1150
static void pdf_out_bytes(PDF pdf, longinteger n, size_t w)
Definition: pdfgen.c:892
void pdf_begin_array(PDF pdf)
Definition: pdfgen.c:1242
void ensure_output_state(PDF pdf, output_state s)
Definition: pdfgen.c:1029
void zip_free(PDF pdf)
Definition: pdfgen.c:347
void pdf_add_bp(PDF pdf, scaled s)
Definition: pdfgen.c:746
static void fix_pdf_draftmode(PDF pdf)
Definition: pdfgen.c:281
static void check_nonexisting_pages(PDF pdf)
Definition: pdfgen.c:2072
void pdf_finish_file(PDF pdf, int fatal_error)
Definition: pdfgen.c:2194
void pdf_room(PDF pdf, int n)
Definition: pdfgen.c:467
void strbuf_seek(strbuf_s *b, off_t offset)
Definition: pdfgen.c:110
static void build_free_object_list(PDF pdf)
Definition: pdfgen.c:2172
scaled one_hundred_inch
Definition: pdfgen.c:682
static void pdf_print_fw_int(PDF pdf, longinteger n)
Definition: pdfgen.c:867
void initialize_start_time(PDF pdf)
Definition: pdfgen.c:1532
void strbuf_putchar(strbuf_s *b, unsigned char c)
Definition: pdfgen.c:124
void pdf_print_str_ln(PDF pdf, const char *s)
Definition: pdfgen.c:905
void pdf_add_bool(PDF pdf, int i)
Definition: pdfgen.c:1173
static int pdf_print_info(PDF pdf, int luatexversion, str_number luatexrevision)
Definition: pdfgen.c:2100
static void destroy_pg_res_tree(void *pa, void *param)
Definition: pdfgen.c:852
void strbuf_free(strbuf_s *b)
Definition: pdfgen.c:141
shipping_mode_e global_shipping_mode
Definition: pdfgen.c:63
void pdf_add_rect_spec(PDF pdf, halfword r)
Definition: pdfgen.c:933
void check_o_mode(PDF pdf, const char *s, int o_mode_bitpattern, boolean strict)
Definition: pdfgen.c:1559
static void print_ID(PDF pdf)
Definition: pdfgen.c:1419
void pdf_flush(PDF pdf)
Definition: pdfgen.c:376
void strbuf_flush(PDF pdf, strbuf_s *b)
Definition: pdfgen.c:133
static void makepdftime(PDF pdf)
Definition: pdfgen.c:1482
void print_pdf_table_string(PDF pdf, const char *s)
Definition: pdfgen.c:1730
static void convertStringToHexString(const char *in, char *out, int lin)
Definition: pdfgen.c:1391
PDF init_pdf_struct(PDF pdf)
Definition: pdfgen.c:149
static boolean substr_of_str(const char *s, const char *t)
Definition: pdfgen.c:2093
int pdf_get_mem(PDF pdf, int s)
Definition: pdfgen.c:221
void pdf_add_null(PDF pdf)
Definition: pdfgen.c:1166
static void check_nonexisting_destinations(PDF pdf)
Definition: pdfgen.c:2050
void print_pdffloat(PDF pdf, pdffloat f)
Definition: pdfgen.c:535
size_t strbuf_offset(strbuf_s *b)
Definition: pdfgen.c:117
#define check_err(f, fn)
Definition: pdfgen.c:294
static void destroy_page_resources_tree(PDF pdf)
Definition: pdfgen.c:858
#define ZIP_BUF_SIZE
Definition: pdfgen.c:292
scaled round_xn_over_d(scaled x, int n, unsigned int d)
Definition: pdfgen.c:718
#define check_nprintf(size_get, size_want)
Definition: pdfgen.c:29
void pdf_write_header(PDF pdf)
Definition: pdfgen.c:1003
void pdf_add_real(PDF pdf, double d)
Definition: pdfgen.c:2554
void scan_pdfcatalog(PDF pdf)
Definition: pdfgen.c:2512
void remove_pdffile(PDF pdf)
Definition: pdfgen.c:1547
const char * get_pdf_table_string(const char *s)
Definition: pdfgen.c:1749
void pdf_dict_add_streaminfo(PDF pdf)
Definition: pdfgen.c:1227
void pdf_begin_page(PDF pdf)
Definition: pdfgen.c:1647
halfword pdf_catalog_toks
Definition: pdfgen.c:49
void pdf_open_file(PDF pdf)
Definition: pdfgen.c:1025
void pdf_begin_dict(PDF pdf)
Definition: pdfgen.c:1118
void pdf_end_array(PDF pdf)
Definition: pdfgen.c:1249
void pdf_push_list(PDF pdf, scaledpos *saved_pos, int *saved_loc)
Definition: pdfgen.c:2561
static pdffloat conv_double_to_pdffloat(double n)
Definition: pdfgen.c:2545
void pdf_print_toks(PDF pdf, halfword p)
Definition: pdfgen.c:911
int output_mode_used
Definition: pdfgen.c:37
halfword pdf_trailer_toks
Definition: pdfgen.c:59
void fix_pdf_version(PDF pdf)
Definition: pdfgen.c:252
static void pdf_prepare_obj(PDF pdf, int k, int pdf_os_threshold)
Definition: pdfgen.c:426
static void write_zip(PDF pdf)
Definition: pdfgen.c:298
void pdf_out_block(PDF pdf, const char *s, size_t n)
Definition: pdfgen.c:484
static void strbuf_room(strbuf_s *b, size_t n)
Definition: pdfgen.c:89
void pdf_release_obj(pdf_obj *stream)
Definition: pdfgen.c:1331
void pdf_print(PDF pdf, str_number s)
Definition: pdfgen.c:513
void addto_page_resources(PDF pdf, pdf_obj_type t, int k)
Definition: pdfgen.c:774
void pdf_pop_list(PDF pdf, scaledpos *saved_pos, int *saved_loc)
Definition: pdfgen.c:2565
strbuf_s * new_strbuf(size_t size, size_t limit)
Definition: pdfgen.c:72
static void reset_page_resources(PDF pdf)
Definition: pdfgen.c:831
void ensure_output_file_open(PDF pdf, const char *ext)
Definition: pdfgen.c:1593
void pdf_print_int(PDF pdf, longinteger n)
Definition: pdfgen.c:526
void pdf_print_str(PDF pdf, const char *s)
Definition: pdfgen.c:581
static void pdf_os_write_objstream(PDF pdf)
Definition: pdfgen.c:1067
void pdf_add_name(PDF pdf, const char *name)
Definition: pdfgen.c:1204
static void pdf_buffer_select(PDF pdf, buffer_e buf)
Definition: pdfgen.c:407
void pdf_end_page(PDF pdf)
Definition: pdfgen.c:1769
halfword pdf_names_toks
Definition: pdfgen.c:55
void pdf_add_ref(PDF pdf, int num)
Definition: pdfgen.c:1212
void pdf_dict_add_bool(PDF pdf, const char *key, int i)
Definition: pdfgen.c:1132
static int comp_page_resources(const void *pa, const void *pb, void *p)
Definition: pdfgen.c:762
void pdf_add_string(PDF pdf, const char *s)
Definition: pdfgen.c:1197
void pdf_end_obj(PDF pdf)
Definition: pdfgen.c:1277
void pdf_set_reference_point(PDF pdf, posstructure *refpoint)
Definition: pdfgen.c:2569
scaled one_hundred_bp
Definition: pdfgen.c:694
int output_mode_value
Definition: pdfgen.c:39
static void init_pdf_outputparameters(PDF pdf)
Definition: pdfgen.c:950
void pdf_dict_add_name(PDF pdf, const char *key, const char *val)
Definition: pdfgen.c:1144
scaled one_inch
Definition: pdfgen.c:686
void pdf_dict_add_ref(PDF pdf, const char *key, int num)
Definition: pdfgen.c:1160
int output_mode_option
Definition: pdfgen.c:38
void pdf_rectangle(PDF pdf, halfword r)
Definition: pdfgen.c:942
void pdf_printf(PDF pdf, const char *fmt,...)
Definition: pdfgen.c:501
void pdf_end_stream(PDF pdf)
Definition: pdfgen.c:631
int draft_mode_value
Definition: pdfgen.c:41
void pdf_add_int(PDF pdf, int i)
Definition: pdfgen.c:1183
halfword pdf_catalog_openaction
Definition: pdfgen.c:51
void pdf_dict_add_int(PDF pdf, const char *key, int i)
Definition: pdfgen.c:1138
#define inf_pdf_mem_size
Definition: pdfgen.h:30
#define PDF_OS_MAX_OBJS
Definition: pdfgen.h:51
#define PROCSET_PDF
Definition: pdfgen.h:24
#define PROCSET_IMAGE_I
Definition: pdfgen.h:28
#define inf_objstm_buf_size
Definition: pdfgen.h:48
#define inf_obj_tab_size
Definition: pdfgen.h:53
#define pdf_print_int_ln(pdf, A)
Definition: pdfgen.h:112
#define sup_objstm_buf_size
Definition: pdfgen.h:49
#define pdf_save_offset(pdf)
Definition: pdfgen.h:59
#define sup_obj_tab_size
Definition: pdfgen.h:54
#define sup_pdfout_buf_size
Definition: pdfgen.h:47
#define sup_pdf_mem_size
Definition: pdfgen.h:31
#define inf_pdfout_buf_size
Definition: pdfgen.h:46
#define PROCSET_TEXT
Definition: pdfgen.h:25
#define PROCSET_IMAGE_B
Definition: pdfgen.h:26
#define pdf_offset(pdf)
Definition: pdfgen.h:58
#define PROCSET_IMAGE_C
Definition: pdfgen.h:27
shipping_mode_e
Definition: pdfgen.h:68
@ NOT_SHIPPING
Definition: pdfgen.h:69
@ SHIPPING_FORM
Definition: pdfgen.h:71
@ SHIPPING_PAGE
Definition: pdfgen.h:70
int print_outlines(PDF pdf)
Definition: pdfoutline.c:195
void init_pdf_pagecalculations(PDF pdf)
Definition: pdfpage.c:29
void pdf_goto_pagemode(PDF pdf)
Definition: pdfpage.c:242
int output_pages_tree(PDF pdf)
Definition: pdfpagetree.c:225
int pdf_do_page_divert(PDF pdf, int objnum, int divnum)
Definition: pdfpagetree.c:103
int pdf_get_obj(PDF pdf, int t, int i, boolean byname)
Definition: pdftables.c:179
#define obj_info(pdf, A)
Definition: pdftables.h:67
#define set_obj_aux(pdf, A, B)
Definition: pdftables.h:85
#define set_obj_scheduled(pdf, A)
Definition: pdftables.h:90
#define pdf_image_gamma
Definition: pdftables.h:184
#define obj_data_ptr
Definition: pdftables.h:78
#define pdf_image_hicolor
Definition: pdftables.h:185
#define pdf_decimal_digits
Definition: pdftables.h:173
#define pdf_xform_attr
Definition: pdftables.h:205
#define pdf_gen_tounicode
Definition: pdftables.h:188
#define pk_decimal_digits(pdf, delta)
Definition: pdftables.h:223
#define set_obj_link(pdf, A, B)
Definition: pdftables.h:80
#define pdf_image_apply_gamma
Definition: pdftables.h:183
int pdf_cur_form
Definition: pdfxform.c:27
#define obj_offset(pdf, A)
Definition: pdftables.h:71
#define obj_aux(pdf, A)
Definition: pdftables.h:74
#define pdf_pk_resolution
Definition: pdftables.h:175
#define is_obj_written(pdf, A)
Definition: pdftables.h:92
#define pdf_omit_cidset
Definition: pdftables.h:191
#define obj_link(pdf, A)
Definition: pdftables.h:69
#define pdf_obj_compress_level
Definition: pdftables.h:172
#define pdf_trailer_id
Definition: pdftables.h:208
#define obj_os_idx(pdf, A)
Definition: pdftables.h:73
#define obj_os_objnum(pdf, A)
Definition: pdftables.h:72
#define pdf_page_resources
Definition: pdftables.h:203
#define pdf_gamma
Definition: pdftables.h:182
#define pdf_pk_fixed_dpi
Definition: pdftables.h:189
#define pdf_inclusion_copy_font
Definition: pdftables.h:187
#define pdf_unique_resname
Definition: pdftables.h:176
#define set_obj_fresh(pdf, A)
Definition: pdftables.h:89
#define pdf_pk_mode
Definition: pdftables.h:207
#define pdf_recompress
Definition: pdftables.h:193
#define pdf_xform_resources
Definition: pdftables.h:206
#define pdf_suppress_optional_info
Definition: pdftables.h:190
#define obj_type(pdf, A)
Definition: pdftables.h:76
#define pdf_xform_margin
Definition: pdftables.h:200
#define pdf_page_attr
Definition: pdftables.h:202
#define pdf_omit_charset
Definition: pdftables.h:192
void out_thread(PDF pdf, int t)
Definition: pdfthread.c:184
void print_bead_rectangles(PDF pdf)
Definition: pdfthread.c:254
static bool pdf
Definition: pdftocairo.cc:93
#define pdf_reset_space(pdf)
Definition: pdftoepdf.c:48
#define pdf_set_space(pdf)
Definition: pdftoepdf.c:45
#define pdf_out(pdf, A)
Definition: pdftoepdf.c:36
#define pdf_check_space(pdf)
Definition: pdftoepdf.c:38
@ ZIP_FINISH
Definition: pdftypes.h:58
@ NO_ZIP
Definition: pdftypes.h:56
@ ZIP_WRITING
Definition: pdftypes.h:57
#define OBJSTM_NEVER
Definition: pdftypes.h:51
#define OBJSTM_ALWAYS
Definition: pdftypes.h:50
pdf_obj_type
Definition: pdftypes.h:202
@ obj_type_info
Definition: pdftypes.h:214
@ obj_type_annots
Definition: pdftypes.h:217
@ obj_type_objstm
Definition: pdftypes.h:220
@ obj_type_beads
Definition: pdftypes.h:219
@ obj_type_font
Definition: pdftypes.h:203
@ obj_type_link
Definition: pdftypes.h:215
@ obj_type_catalog
Definition: pdftypes.h:213
@ obj_type_obj
Definition: pdftypes.h:206
@ obj_type_page
Definition: pdftypes.h:211
@ obj_type_dest
Definition: pdftypes.h:205
@ obj_type_others
Definition: pdftypes.h:221
@ obj_type_bead
Definition: pdftypes.h:218
@ obj_type_annot
Definition: pdftypes.h:216
@ obj_type_xform
Definition: pdftypes.h:207
@ obj_type_thread
Definition: pdftypes.h:209
@ obj_type_ximage
Definition: pdftypes.h:208
@ obj_type_pagestream
Definition: pdftypes.h:210
buffer_e
Definition: pdftypes.h:61
@ OBJSTM_BUF
Definition: pdftypes.h:63
@ PDFOUT_BUF
Definition: pdftypes.h:62
#define i64round(a)
Definition: pdftypes.h:44
@ ST_OMODE_FIX
Definition: pdftypes.h:122
@ ST_FILE_OPEN
Definition: pdftypes.h:123
@ ST_HEADER_WRITTEN
Definition: pdftypes.h:124
@ ST_FILE_CLOSED
Definition: pdftypes.h:125
#define MAX_OBJ_COMPRESS_LEVEL
Definition: pdftypes.h:48
#define obj_xform_attr(pdf, A)
Definition: pdfxform.h:31
#define obj_xform_box(pdf, A)
Definition: pdfxform.h:30
#define set_obj_xform_attr(pdf, A, B)
Definition: pdfxform.h:43
#define obj_xform_attr_str(pdf, A)
Definition: pdfxform.h:33
#define obj_xform_resources(pdf, A)
Definition: pdfxform.h:32
#define obj_xform_margin(pdf, A)
Definition: pdfxform.h:36
#define set_obj_xform_resources(pdf, A, B)
Definition: pdfxform.h:44
#define obj_xform_resources_str(pdf, A)
Definition: pdfxform.h:34
#define obj_xform_type(pdf, A)
Definition: pdfxform.h:35
#define set_obj_xform_resources_str(pdf, A, B)
Definition: pdfxform.h:46
#define set_obj_xform_attr_str(pdf, A, B)
Definition: pdfxform.h:45
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 if[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(dst_w_bpp<=(lowbit *8)) &&((lowbit *8)<(pixblock_size *dst_w_bpp)) .if lowbit< 16 tst DST_R
static int size
Definition: ppmlabel.c:24
int r
Definition: ppmqvga.c:68
static int offset
Definition: ppmtogif.c:642
void tprint(const char *sss)
Definition: printing.c:415
void tprint_nl(const char *s)
Definition: printing.c:521
bstring c int memset(void *s, int c, int length)
static long bytes
Definition: psutil.c:35
time_t time()
struct stream_s stream
Definition: pts_fax.h:93
#define uInt
static uint8_t obuf[8192]
Definition: buildvm_lib.c:13
int lua_rawget(lua_State *L, int idx)
Definition: lapi.c:647
int lua_type(lua_State *L, int idx)
Definition: lapi.c:251
const char * lua_pushstring(lua_State *L, const char *s)
Definition: lapi.c:491
const char * lua_tolstring(lua_State *L, int idx, size_t *len)
Definition: lapi.c:373
int lua_rawgeti(lua_State *L, int idx, lua_Integer n)
Definition: lapi.c:658
void luaL_unref(lua_State *L, int t, int ref)
Definition: lauxlib.c:616
#define LUA_REGISTRYINDEX
Definition: lua.h:41
#define LUA_TSTRING
Definition: lua.h:67
#define lua_pop(L, n)
Definition: lua.h:343
#define avl_find
Definition: avl.h:18
#define avl_create
Definition: avl.h:19
#define avl_destroy
Definition: avl.h:20
static void digest(const WORD32 *m, WORD32 *d)
Definition: md5.c:89
int pdf_create_obj(PDF pdf, int t, int i)
Definition: pdftables.c:121
#define pdf_puts(pdf, s)
Definition: epdf.h:108
#define img_procset(N)
Definition: image.h:174
idict_entry * idict_array
Definition: writeimg.c:701
void pdf_write_image(PDF pdf, int n)
Definition: writeimg.c:652
void flush_jbig2_page0_objects(PDF pdf)
Definition: writejbig2.c:848
#define pdf_mark_char(f, c)
Definition: ptexlib.h:327
#define pdf_char_marked
Definition: ptexlib.h:330
int divide_scaled(int s, int m, int dd)
ShellFileEnvironment e
Definition: sh6.c:388
static FILE * in
Definition: squeeze.c:36
char * makecstring(int s)
Definition: stringpool.c:284
#define STRING_OFFSET
Definition: stringpool.h:41
#define str_string(a)
Definition: stringpool.h:60
#define str_length(a)
Definition: stringpool.h:59
@ ST_INITIAL
Definition: struct.h:339
Definition: usprintf.c:39
Definition: avl.h:61
const char * s
Definition: stringpool.h:32
Definition: t1part.c:78
Definition: pdftypes.h:165
os_obj_data * obj
Definition: pdftypes.h:246
unsigned int idx
Definition: pdftypes.h:250
unsigned int cur_objstm
Definition: pdftypes.h:249
strbuf_s * buf[3]
Definition: pdftypes.h:247
unsigned int o_ctr
Definition: pdftypes.h:252
buffer_e curbuf
Definition: pdftypes.h:248
unsigned int ostm_ctr
Definition: pdftypes.h:251
Definition: pdfobj.c:63
struct pdf_object_list_ * link
Definition: pdftypes.h:130
struct avl_table * resources_tree
Definition: pdftypes.h:228
scaledpos pos
Definition: pdftypes.h:102
Definition: pdfgen.c:757
int obj_type
Definition: pdfgen.c:758
pdf_object_list * list
Definition: pdfgen.c:759
int64_t v
Definition: pdftypes.h:92
int64_t h
Definition: pdftypes.h:91
Definition: dvips.h:235
Definition: strexpr.c:21
pointer location
Definition: t1imager.h:35
int j
Definition: t4ht.c:1589
static char job_name[255]
Definition: t4ht.c:484
char * ext
Definition: t4ht.c:938
*job_name strlen((char *) job_name) - 4)
#define key
Definition: tex2xindy.c:753
char fmt[256]
Definition: tex4ht.c:3925
m
Definition: tex4ht.c:3990
static FILE * log_file
Definition: tex4ht.c:1100
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)
boolean lua_b_open_out(alpha_file *f, char *fn)
Definition: texfileio.c:374
boolean log_opened_global
Definition: texfileio.c:862
int max_font_id(void)
Definition: texfont.c:92
int pk_dpi
Definition: texfont.c:1758
#define pdf_font_num(a)
Definition: texfont.h:377
#define pdf_font_attr(a)
Definition: texfont.h:380
#define font_used(a)
Definition: texfont.h:281
#define quick_char_exists(f, c)
Definition: texfont.h:467
#define font_ec(a)
Definition: texfont.h:278
#define font_bc(a)
Definition: texfont.h:275
#define set_pdf_font_attr(a, b)
Definition: texfont.h:381
void flush_node(halfword p)
Definition: texnodes.c:2321
#define pdf_ann_top(a)
Definition: texnodes.h:895
#define pdf_annot_data(a)
Definition: texnodes.h:903
#define pdf_link_attr(a)
Definition: texnodes.h:904
#define pdf_link_action(a)
Definition: texnodes.h:905
pdf_action_type
Definition: texnodes.h:936
@ pdf_action_user
Definition: texnodes.h:940
#define pdf_ann_right(a)
Definition: texnodes.h:896
#define pdf_ann_left(a)
Definition: texnodes.h:894
@ pdf_link_data_node
Definition: texnodes.h:732
#define pdf_ann_bottom(a)
Definition: texnodes.h:897
char * tokenlist_to_cstring(int pp, int inhibit_par, int *siz)
Definition: textoken.c:3636
@ L
Definition: ubidiimp.h:45
#define va_start(pvar)
Definition: varargs.h:30
#define va_end(pvar)
Definition: varargs.h:38
char * va_list
Definition: varargs.h:22
long long scaled
Definition: vf_ng.c:93
#define limit(x)
Definition: yuvsplittoppm.c:26
#define return(val)