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)  

utiliof.c
Go to the documentation of this file.
1 /* input/output stream */
2 
3 #include <stdlib.h>
4 #include <string.h>
5 #include <stdarg.h>
6 
7 #include "utilmem.h"
8 #include "utillog.h"
9 #include "utiliof.h"
10 
11 #ifdef _WIN32 /* --ak */
12 FILE *ppu8open(const char *filename, const char *mode);
13 #define fopen ppu8open
14 #endif /* _WIN32 --ak */
15 
16 /* commons */
17 
18 void * iof_copy_data (const void *data, size_t size)
19 {
20  return memcpy(util_malloc(size), data, size);
21 }
22 
23 uint8_t * iof_copy_file_data (const char *filename, size_t *psize)
24 {
25  FILE *file;
26  size_t size;
27  uint8_t *data;
28  if ((file = fopen(filename, "rb")) == NULL)
29  return NULL;
30  fseek(file, 0, SEEK_END);
31  size = (size_t)ftell(file);
33  fseek(file, 0, SEEK_SET);
34  if ((*psize = fread(data, 1, size, file)) != size)
35  {
36  util_free(data);
37  data = NULL;
38  }
39  fclose(file);
40  return data;
41 }
42 
44 {
45  size_t size;
46  uint8_t *data;
47  //long offset = ftell(file); // keep offset intact?
48  fseek(file, 0, SEEK_END);
49  size = (size_t)ftell(file);
51  fseek(file, 0, SEEK_SET);
52  if ((*psize = fread(data, 1, size, file)) != size)
53  {
54  util_free(data);
55  data = NULL;
56  }
57  //fseek(file, offset, SEEK_SET)
58  return data;
59 }
60 
62 {
63  if (F->flags & IOF_FILE)
64  return iof_file_get_file(F->iofile);
65  if (F->flags & IOF_FILE_HANDLE)
66  return F->file;
67  return NULL;
68 }
69 
71 {
72  switch (status)
73  {
74  case IOFEOF:
75  return "IOFEOF";
76  case IOFERR:
77  return "IOFERR";
78  case IOFEMPTY:
79  return "IOFEMPTY";
80  case IOFFULL:
81  return "IOFFULL";
82  default:
83  break;
84  }
85  return "(unknown)";
86 }
87 
88 /* shared pseudofile */
89 
90 #define IOF_FILE_DEFAULTS 0
91 
93 {
94  iof_file *iofile = (iof_file *)util_malloc(sizeof(iof_file));
95  iof_file_set_fh(iofile, file);
96  iofile->offset = NULL;
97  iofile->size = 0;
98  iofile->name = NULL;
99  iofile->refcount = 0;
101  return iofile;
102 }
103 
105 {
106  iof_file_set_fh(iofile, file);
107  iofile->offset = NULL;
108  iofile->size = 0;
109  iofile->name = NULL;
110  iofile->refcount = 0;
111  iofile->flags = IOF_FILE_DEFAULTS;
112  return iofile;
113 }
114 
115 iof_file * iof_file_rdata (const void *data, size_t size)
116 {
117  iof_file *iofile = (iof_file *)util_malloc(sizeof(iof_file));
118  iofile->rbuf = iofile->rpos = (const uint8_t *)data;
119  iofile->rend = iofile->rbuf + size;
120  iofile->offset = NULL;
121  iofile->size = 0;
122  iofile->name = NULL;
123  iofile->refcount = 0;
125  return iofile;
126 }
127 
128 iof_file * iof_file_rdata_init (iof_file *iofile, const void *data, size_t size)
129 {
130  iofile->rbuf = iofile->rpos = (const uint8_t *)data;
131  iofile->rend = iofile->rbuf + size;
132  iofile->offset = NULL;
133  iofile->size = 0; // lets keep it consequently set to zero (only for user disposition)
134  iofile->name = NULL;
135  iofile->refcount = 0;
136  iofile->flags = IOF_FILE_DEFAULTS|IOF_DATA;
137  return iofile;
138 }
139 
140 iof_file * iof_file_wdata (void *data, size_t size)
141 {
142  return iof_file_rdata((const void *)data, size);
143 }
144 
145 iof_file * iof_file_wdata_init (iof_file *iofile, void *data, size_t size)
146 {
147  return iof_file_rdata_init(iofile, (const void *)data, size);
148 }
149 
150 /* typical uses so far */
151 
152 iof_file * iof_file_reader_from_file_handle (iof_file *iofile, const char *filename, FILE *file, int preload, int closefile)
153 {
154  uint8_t *data;
155  size_t size;
156 
157  if (preload)
158  {
160  {
161  if (closefile) // callers expect close also on failure
162  fclose(file);
163  return NULL;
164  }
165  if (iofile == NULL)
166  iofile = iof_file_rdata(data, size);
167  else
168  iof_file_rdata_init(iofile, data, size);
169  iofile->flags |= IOF_BUFFER_ALLOC;
170  if (closefile)
171  fclose(file);
172  }
173  else
174  {
175  if (iofile == NULL)
176  iofile = iof_file_new(file);
177  else
178  iof_file_init(iofile, file);
179  if (closefile)
180  iofile->flags |= IOF_CLOSE_FILE;
181  }
182  if (filename != NULL)
183  iof_file_set_name(iofile, filename);
184  return iofile;
185 }
186 
188 {
189  FILE *file;
190  if ((file = fopen(filename, "rb")) == NULL)
191  return NULL;
192  return iof_file_reader_from_file_handle(iofile, filename, file, preload, 1); // takes care to fclose() on failure
193 }
194 
195 iof_file * iof_file_reader_from_data (iof_file *iofile, const void *data, size_t size, int preload, int freedata)
196 {
197  void *newdata;
198  if (data == NULL)
199  return NULL;
200  if (preload)
201  {
202  newdata = iof_copy_data(data, size);
203  if (iofile == NULL)
204  iofile = iof_file_rdata(newdata, size);
205  else
206  iof_file_rdata_init(iofile, newdata, size);
207  iofile->flags |= IOF_BUFFER_ALLOC;
208  //if (freedata) // hardly makes sense... we can't free const void *
209  // util_free((void *)data);
210  }
211  else
212  {
213  if (iofile == NULL)
214  iofile = iof_file_rdata(data, size);
215  else
216  iof_file_rdata_init(iofile, data, size);
217  if (freedata)
218  iofile->flags |= IOF_BUFFER_ALLOC;
219  }
220  return iofile;
221 }
222 
223 /*
224 iof_file * iof_file_writer_from_file (iof_file *iofile, const char *filename)
225 {
226  FILE *file;
227  if ((file = fopen(filename, "wb")) == NULL)
228  return NULL;
229  if (iofile == NULL)
230  iofile = iof_file_new(file);
231  else
232  iof_file_init(iofile, file);
233  iofile->flags |= IOF_CLOSE_FILE;
234  iof_file_set_name(iofile, filename);
235  return iofile;
236 }
237 */
238 
239 /*
240 Because of limited number of FILE* handles available, we may need to close/reopen a file handle
241 when accessing it. In applications so far (fonts, images) we typically need the entire source
242 to parse the file on object creation and to rewrite or reload the data on dump. All iof_file API
243 functions assume that iofile has FILE* opened. Reopening it on every access (ftell, fseek, read/write)
244 makes no sense. So if the caller invalidates iofile by closing and NULLing its file handle,
245 it is also responsible to reopen when necessary.
246 */
247 
249 {
250  FILE *file;
251  if (iofile->flags & IOF_DATA)
252  return 0;
253  if ((file = iof_file_get_fh(iofile)) == NULL)
254  return 0;
255  fclose(file);
256  iof_file_set_fh(iofile, NULL);
257  iofile->flags &= ~~IOF_RECLOSE_FILE;
258  iofile->flags |= IOF_REOPEN_FILE;
259  return 1;
260 }
261 
263 { // returns true if iofile readable
264  FILE *file;
265  const char *filename;
266  if (iofile->flags & IOF_DATA)
267  return 1;
268  if ((file = iof_file_get_fh(iofile)) != NULL)
269  return 1; // if present, assumed readable
270  if ((filename = iofile->name) == NULL || (file = fopen(filename, "rb")) == NULL)
271  return 0;
272  iof_file_set_fh(iofile, file);
273  iofile->flags &= ~~IOF_REOPEN_FILE;
274  iofile->flags |= IOF_RECLOSE_FILE;
275  return 1;
276 }
277 
278 /* freeing iof_file */
279 
280 void iof_file_free (iof_file *iofile)
281 {
282  FILE *file;
283  if (iofile->flags & IOF_DATA)
284  {
285  if (iofile->flags & IOF_BUFFER_ALLOC)
286  {
287  iofile->flags &= ~~IOF_BUFFER_ALLOC;
288  if (iofile->buf != NULL)
289  {
290  util_free(iofile->buf);
291  iofile->buf = iofile->pos = iofile->end = NULL;
292  }
293  }
294  }
295  else if ((file = iof_file_get_fh(iofile)) != NULL)
296  {
297  if (iofile->flags & IOF_CLOSE_FILE)
298  fclose(file);
299  iof_file_set_fh(iofile, NULL);
300  }
301  iof_file_set_name(iofile, NULL);
302  if (iofile->flags & IOF_ALLOC)
303  util_free(iofile);
304 }
305 
306 /*
307 An attempt to close iofile input keeping things safe. In bindings we sometimes we need to force
308 closing the file handle, otherwise it is closed when garbage collector graciously calls destroyer.
309 Eg. we are done with an object representing pdf/image/font, but we can't move/replace it, as the
310 host language keeps the garbage that keeps a file handle. When we call fclose(), we also have to
311 set the handle to NULL. In many places we assume, that if the iofile wraps FILE *, than the handle
312 is operable (no NULL checks). To close the handle keeping iofile alive safe, we can silently convert
313 it dummy IOF_DATA buffer.
314 */
315 
317 {
318  FILE *file;
319  if (iofile->flags & IOF_DATA)
320  {
321  if (iofile->flags & IOF_BUFFER_ALLOC)
322  {
323  iofile->flags &= ~~IOF_BUFFER_ALLOC;
324  if (iofile->buf != NULL)
325  {
326  util_free(iofile->buf);
327  //iofile->buf = iofile->pos = iofile->end = NULL;
328  }
329  }
330  }
331  else if ((file = iof_file_get_fh(iofile)) != NULL)
332  {
333  iof_file_set_fh(iofile, NULL);
334  fclose(file);
335  }
336  iof_file_set_name(iofile, NULL);
337  /* now make it a dummy string iofile */
338  iofile->buf = iofile->pos = iofile->end = NULL;
339  iofile->flags |= IOF_DATA;
340 }
341 
342 /* set filename for reopen */
343 
344 void iof_file_set_name (iof_file *iofile, const char *name)
345 {
346  if (iofile->name != NULL)
347  util_free(iofile->name);
348  if (name != NULL)
349  iofile->name = iof_copy_data(name, strlen(name) + 1);
350  else
351  iofile->name = NULL;
352 }
353 
354 /* seek */
355 
356 int iof_file_seek (iof_file *iofile, long offset, int whence)
357 {
358  if (iofile->flags & IOF_DATA)
359  {
360  switch (whence)
361  {
362  case SEEK_SET:
363  if (offset >= 0 && iofile->buf + offset <= iofile->end)
364  {
365  iofile->pos = iofile->buf + offset;
366  return 0;
367  }
368  return -1;
369  case SEEK_CUR:
370  if ((offset >= 0 && iofile->pos + offset <= iofile->end) || (offset < 0 && iofile->pos + offset >= iofile->buf))
371  {
372  iofile->pos += offset;
373  return 0;
374  }
375  return -1;
376  case SEEK_END:
377  if (offset <= 0 && iofile->end + offset >= iofile->buf)
378  {
379  iofile->pos = iofile->end + offset;
380  return 0;
381  }
382  return -1;
383  }
384  return -1;
385  }
386  return fseek(iof_file_get_fh(iofile), offset, whence);
387 }
388 
389 /* */
390 
391 long iof_file_tell (iof_file *iofile)
392 {
393  return (iofile->flags & IOF_DATA) ? (long)(iofile->pos - iofile->buf) : ftell(iof_file_get_fh(iofile));
394 }
395 
396 size_t iof_file_size (iof_file *iofile)
397 {
398  long pos, size;
399  FILE *file;
400  if (iofile->flags & IOF_DATA)
401  return (size_t)iof_space(iofile);
402  file = iof_file_get_fh(iofile);
403  pos = ftell(file);
404  fseek(file, 0, SEEK_END);
405  size = ftell(file);
406  fseek(file, pos, SEEK_SET);
407  return size;
408 }
409 
410 int iof_file_eof (iof_file *iofile)
411 {
412  if (iofile->flags & IOF_DATA)
413  return iofile->pos == iofile->end ? -1 : 0;
414  return feof(iof_file_get_fh(iofile));
415 }
416 
418 {
419  if (iofile->flags & IOF_DATA)
420  return 0;
421  return fflush(iof_file_get_fh(iofile));
422 }
423 
424 size_t iof_file_read (void *ptr, size_t size, size_t items, iof_file *iofile)
425 {
426  if (iofile->flags & IOF_DATA)
427  {
428  size_t bytes = size * items;
429  if (bytes > (size_t)iof_left(iofile))
430  bytes = (size_t)iof_left(iofile);
431  memcpy(ptr, iofile->pos, bytes);
432  iofile->pos += bytes;
433  return bytes / size; // number of elements read
434  }
435  return fread(ptr, size, items, iof_file_get_fh(iofile));
436 }
437 
438 static size_t iof_file_data_resizeto (iof_file *iofile, size_t space)
439 {
440  uint8_t *newbuf;
441  size_t size;
442  size = iof_size(iofile);
443  if (iofile->flags & IOF_BUFFER_ALLOC)
444  {
445  newbuf = (uint8_t *)util_realloc(iofile->buf, space);
446  }
447  else
448  {
449  newbuf = (uint8_t *)util_malloc(space);
450  if (size > 0)
451  memcpy(newbuf, iofile->buf, size);
452  iofile->flags |= IOF_BUFFER_ALLOC;
453  }
454  iofile->buf = newbuf;
455  iofile->pos = newbuf + size;
456  iofile->end = newbuf + space;
457  return space - size;
458 }
459 
460 #define iof_file_data_resize(iofile) iof_file_data_resizeto(iofile, iof_space(iofile) << 1)
461 
462 size_t iof_file_write (const void *ptr, size_t size, size_t items, iof_file *iofile)
463 {
464  if (iofile->flags & IOF_DATA)
465  {
466  size_t space, sizesofar, bytes;
467  bytes = size * items;
468  if (bytes > (size_t)iof_left(iofile))
469  {
470  if ((space = iof_space(iofile)) == 0) // allow iofile->buf/end initially NULL
471  space = BUFSIZ;
472  for (sizesofar = iof_size(iofile), space <<= 1; sizesofar + bytes > space; space <<= 1)
473  ;
474  if (iof_file_data_resizeto(iofile, space) == 0)
475  return 0;
476  }
477  memcpy(iofile->pos, ptr, bytes);
478  iofile->pos += bytes;
479  return bytes / size;
480  }
481  return fwrite(ptr, size, items, iof_file_get_fh(iofile));
482 }
483 
484 size_t iof_file_ensure (iof_file *iofile, size_t bytes)
485 {
486  if (iofile->flags & IOF_DATA)
487  {
488  size_t space, sizesofar, left;
489  left = (size_t)iof_left(iofile);
490  if (bytes > left)
491  {
492  if ((space = iof_space(iofile)) == 0) // allow iofile->buf/end initially NULL
493  space = BUFSIZ;
494  for (sizesofar = iof_size(iofile), space <<= 1; sizesofar + bytes > space; space <<= 1);
495  return iof_file_data_resizeto(iofile, space);
496  }
497  return left;
498  }
499  return 0;
500 }
501 
502 int iof_file_getc (iof_file *iofile)
503 {
504  if (iofile->flags & IOF_DATA)
505  return iofile->pos < iofile->end ? *iofile->pos++ : IOFEOF;
506  return fgetc(iof_file_get_fh(iofile));
507 }
508 
509 int iof_file_putc (iof_file *iofile, int c)
510 {
511  if (iofile->flags & IOF_DATA)
512  {
513  if (iofile->pos >= iofile->end)
514  if (iof_file_data_resize(iofile) == 0)
515  return IOFEOF;
516  *iofile->pos++ = (uint8_t)c;
517  return c;
518  }
519  return fputc(c, iof_file_get_fh(iofile));
520 }
521 
522 static int iof_file_sync (iof_file *iofile, size_t *offset)
523 {
524  if (iofile->offset != offset)
525  {
526  if (iofile->offset != NULL)
527  *iofile->offset = iof_file_tell(iofile);
528  iofile->offset = offset;
529  if (offset) // let offset be NULL
530  return iof_file_seek(iofile, (long)*offset, SEEK_SET);
531  }
532  return 0;
533 }
534 
535 //#define iof_file_unsync(iofile, poffset) (void)((iofile)->offset == poffset && (((iofile)->offset = NULL), 0))
536 #define iof_file_unsync(iofile, poffset) ((void)poffset, (iofile)->offset = NULL)
537 
538 /* iof seek */
539 
540 #define iof_reader_reset(I) ((I)->pos = (I)->end = (I)->buf)
541 #define iof_reader_reseek_file(I, offset, whence) (fseek((I)->file, offset, whence) == 0 ? (iof_reader_reset(I), 0) : -1)
542 #define iof_reader_reseek_iofile(I, offset, whence) (iof_file_seek((I)->iofile, offset, whence) == 0 ? (iof_reader_reset(I), 0) : -1)
543 
544 #define iof_writer_reset(O) ((O)->pos = (O)->buf)
545 #define iof_writer_reseek_file(O, offset, whence) (iof_flush(O), (fseek((O)->file, offset, whence) == 0 ? (iof_writer_reset(O), 0) : -1))
546 #define iof_writer_reseek_iofile(O, offset, whence) (iof_flush(O), (iof_file_seek((O)->iofile, offset, whence) == 0 ? (iof_writer_reset(O), 0) : -1))
547 
548 static int iof_reader_seek_data (iof *I, long offset, int whence)
549 {
550  switch (whence)
551  {
552  case SEEK_SET:
553  if (offset >= 0 && I->buf + offset <= I->end)
554  {
555  I->pos = I->buf + offset;
556  return 0;
557  }
558  return -1;
559  case SEEK_CUR:
560  if ((offset >= 0 && I->pos + offset <= I->end) || (offset < 0 && I->pos + offset >= I->buf))
561  {
562  I->pos += offset;
563  return 0;
564  }
565  return -1;
566  case SEEK_END:
567  if (offset <= 0 && I->end + offset >= I->buf)
568  {
569  I->pos = I->end + offset;
570  return 0;
571  }
572  return -1;
573  }
574  return -1;
575 }
576 
577 static int iof_reader_seek_iofile (iof *I, long offset, int whence)
578 {
579  long fileoffset;
580  switch (whence)
581  {
582  case SEEK_SET:
583  fileoffset = iof_file_tell(I->iofile);
584  if (offset <= fileoffset && offset >= fileoffset - iof_space(I))
585  {
586  I->pos = I->end - (fileoffset - offset);
587  return 0;
588  }
590  case SEEK_CUR:
591  if ((offset >= 0 && I->pos + offset <= I->end) || (offset < 0 && I->pos + offset >= I->buf))
592  {
593  I->pos += offset;
594  return 0;
595  }
597  case SEEK_END:
598  return iof_reader_reseek_iofile(I, offset, SEEK_END); // can we do better?
599  }
600  return -1;
601 }
602 
603 static int iof_reader_seek_file (iof *I, long offset, int whence)
604 {
605  long fileoffset;
606  switch (whence)
607  {
608  case SEEK_SET:
609  fileoffset = ftell(I->file);
610  if (offset <= fileoffset && offset >= fileoffset - iof_space(I))
611  {
612  I->pos = I->end - (fileoffset - offset);
613  return 0;
614  }
616  case SEEK_CUR:
617  if ((offset >= 0 && I->pos + offset <= I->end) || (offset < 0 && I->pos + offset >= I->buf))
618  {
619  I->pos += offset;
620  return 0;
621  }
623  case SEEK_END:
624  return iof_reader_reseek_file(I, offset, SEEK_END); // can we do better?
625  }
626  return -1;
627 }
628 
629 int iof_reader_seek (iof *I, long offset, int whence)
630 {
631  I->flags &= ~~IOF_STOPPED;
632  if (I->flags & IOF_FILE)
633  return iof_reader_seek_iofile(I, offset, whence);
634  if (I->flags & IOF_FILE_HANDLE)
635  return iof_reader_seek_file(I, offset, whence);
636  if (I->flags & IOF_DATA)
637  return iof_reader_seek_data(I, offset, whence);
638  return -1;
639 }
640 
641 int iof_reader_reseek (iof *I, long offset, int whence)
642 {
643  I->flags &= ~~IOF_STOPPED;
644  if (I->flags & IOF_FILE)
645  return iof_reader_reseek_iofile(I, offset, whence);
646  if (I->flags & IOF_FILE_HANDLE)
647  return iof_reader_reseek_file(I, offset, whence);
648  if (I->flags & IOF_DATA)
649  return iof_reader_seek_data(I, offset, whence);
650  return -1;
651 }
652 
653 static int iof_writer_seek_data (iof *O, long offset, int whence)
654 {
655  /*
656  fseek() allows to seek after the end of file. Seeking does not increase the output file.
657  No byte is written before fwirte(). It seems to fill the gap with zeros. Until we really need that,
658  no seeking out of bounds for writers.
659  */
660  O->flags &= ~~IOF_STOPPED;
661  return iof_reader_seek_data(O, offset, whence);
662 }
663 
664 static int iof_writer_seek_iofile (iof *O, long offset, int whence)
665 {
666  long fileoffset;
667  switch (whence)
668  {
669  case SEEK_SET:
670  fileoffset = iof_file_tell(O->iofile);
671  if (offset >= fileoffset && offset <= fileoffset + iof_space(O))
672  {
673  O->pos = O->buf + (offset - fileoffset);
674  return 0;
675  }
677  case SEEK_CUR:
678  if ((offset >=0 && O->pos + offset <= O->end) || (offset < 0 && O->pos + offset >= O->buf))
679  {
680  O->pos += offset;
681  return 0;
682  }
684  case SEEK_END:
686  }
687  return -1;
688 }
689 
690 static int iof_writer_seek_file (iof *O, long offset, int whence)
691 {
692  long fileoffset;
693  switch (whence)
694  {
695  case SEEK_SET:
696  fileoffset = ftell(O->file);
697  if (offset >= fileoffset && offset <= fileoffset + iof_space(O))
698  {
699  O->pos = O->buf + (offset - fileoffset);
700  return 0;
701  }
703  case SEEK_CUR:
704  if ((offset >=0 && O->pos + offset <= O->end) || (offset < 0 && O->pos + offset >= O->buf))
705  {
706  O->pos += offset;
707  return 0;
708  }
710  case SEEK_END:
712  }
713  return -1;
714 }
715 
716 int iof_writer_seek (iof *I, long offset, int whence)
717 {
718  I->flags &= ~~IOF_STOPPED;
719  if (I->flags & IOF_FILE)
720  return iof_writer_seek_iofile(I, offset, whence);
721  if (I->flags & IOF_FILE_HANDLE)
722  return iof_writer_seek_file(I, offset, whence);
723  if (I->flags & IOF_DATA)
724  return iof_writer_seek_data(I, offset, whence);
725  return -1;
726 }
727 
728 int iof_writer_reseek (iof *I, long offset, int whence)
729 {
730  I->flags &= ~~IOF_STOPPED;
731  if (I->flags & IOF_FILE)
732  return iof_writer_reseek_iofile(I, offset, whence);
733  if (I->flags & IOF_FILE_HANDLE)
734  return iof_writer_reseek_file(I, offset, whence);
735  if (I->flags & IOF_DATA)
736  return iof_writer_seek_data(I, offset, whence);
737  return -1;
738 }
739 
740 int iof_seek (iof *F, long offset, int whence)
741 {
742  return (F->flags & IOF_WRITER) ? iof_writer_seek(F, offset, whence) : iof_reader_seek(F, offset, whence);
743 }
744 
745 int iof_reseek (iof *F, long offset, int whence)
746 {
747  return (F->flags & IOF_WRITER) ? iof_writer_reseek(F, offset, whence) : iof_reader_reseek(F, offset, whence);
748 }
749 
750 /* tell */
751 
753 {
754  if (I->flags & IOF_FILE)
755  return iof_file_tell(I->iofile) - (long)iof_left(I);
756  if (I->flags & IOF_FILE_HANDLE)
757  return ftell(I->file) - (long)iof_left(I);
758  //if (I->flags & IOF_DATA)
759  return (long)iof_size(I);
760 }
761 
763 {
764  if (O->flags & IOF_FILE)
765  return iof_file_tell(O->iofile) + (long)iof_size(O);
766  if (O->flags & IOF_FILE_HANDLE)
767  return ftell(O->file) + (long)iof_size(O);
768  //if (I->flags & IOF_DATA)
769  return (long)iof_size(O);
770 }
771 
772 long iof_tell (iof *I)
773 {
774  return (I->flags & IOF_WRITER) ? iof_writer_tell(I) : iof_reader_tell(I);
775 }
776 
777 size_t iof_fsize (iof *I)
778 {
779  size_t pos, size;
780  if (I->flags & IOF_FILE)
781  return iof_file_size(I->iofile);
782  if (I->flags & IOF_FILE_HANDLE)
783  {
784  pos = (size_t)ftell(I->file);
785  fseek(I->file, 0, SEEK_END);
786  size = (size_t)ftell(I->file);
787  fseek(I->file, (long)pos, SEEK_SET);
788  return size;
789  }
790  //if (I->flags & IOF_DATA)
791  return (size_t)iof_space(I);
792 }
793 
794 /* save reader tail */
795 
796 size_t iof_save_tail (iof *I)
797 {
798  size_t size, left;
799  size = iof_size(I);
800  left = iof_left(I);
801  if (size >= left)
802  memcpy(I->buf, I->pos, left);
803  else
804  memmove(I->buf, I->pos, left);
805  return left;
806 }
807 
808 size_t iof_input_save_tail (iof *I, size_t back)
809 {
810  size_t size;
811  I->flags |= IOF_TAIL;
812  I->pos -= back;
813  size = iof_input(I);
814  I->pos += back;
815  I->flags &= ~~IOF_TAIL;
816  return size; // + back - back
817 }
818 
819 /* read from file */
820 
821 /* iof free*/
822 
823 static size_t file_read (iof *I);
824 static size_t file_load (iof *I);
825 
826 static size_t file_reader (iof *I, iof_mode mode)
827 {
828  switch (mode)
829  {
830  case IOFREAD:
831  return file_read(I);
832  case IOFLOAD:
833  return file_load(I);
834  case IOFCLOSE:
835  iof_free(I);
836  return 0;
837  default:
838  return 0;
839  }
840 }
841 
843 {
845  iof_setup_file(I, f);
846  I->more = file_reader;
847  return I;
848 }
849 
850 iof * iof_setup_file_reader (iof *I, void *buffer, size_t space, const char *filename)
851 {
852  FILE *f;
853  if ((f = fopen(filename, "rb")) == NULL)
854  return NULL;
856  iof_setup_file(I, f);
857  I->flags |= IOF_CLOSE_FILE;
858  I->more = file_reader;
859  return I;
860 }
861 
862 /* write to file */
863 
864 static size_t file_write (iof *O, int flush);
865 
866 static size_t file_writer (iof *O, iof_mode mode)
867 {
868  switch (mode)
869  {
870  case IOFWRITE:
871  return file_write(O, 0);
872  case IOFFLUSH:
873  return file_write(O, 1);
874  case IOFCLOSE:
875  file_write(O, 1);
876  iof_free(O);
877  return 0;
878  default:
879  return 0;
880  }
881 }
882 
884 {
886  iof_setup_file(O, f);
887  O->more = file_writer;
888  return O;
889 }
890 
891 iof * iof_setup_file_writer (iof *O, void *buffer, size_t space, const char *filename)
892 {
893  FILE *f;
894  if ((f = fopen(filename, "wb")) == NULL)
895  return NULL;
897  iof_setup_file(O, f);
898  O->flags |= IOF_CLOSE_FILE;
899  O->more = file_writer;
900  return O;
901 }
902 
903 /* a dedicated handler for stdout/stderr */
904 
905 static size_t stdout_writer (iof *O, iof_mode mode)
906 {
907  switch(mode)
908  {
909  case IOFWRITE:
910  {
911  fwrite(O->buf, sizeof(uint8_t), iof_size(O), stdout);
912  O->pos = O->buf;
913  return O->space;
914  }
915  case IOFCLOSE:
916  case IOFFLUSH:
917  {
918  fwrite(O->buf, sizeof(uint8_t), iof_size(O), stdout);
919  fflush(stdout);
920  O->pos = O->buf;
921  return 0;
922  }
923  default:
924  break;
925  }
926  return 0;
927 }
928 
929 static size_t stderr_writer (iof *O, iof_mode mode)
930 {
931  switch(mode)
932  {
933  case IOFWRITE:
934  {
935  fwrite(O->buf, sizeof(uint8_t), iof_size(O), stderr);
936  O->pos = O->buf;
937  return O->space;
938  }
939  case IOFCLOSE:
940  case IOFFLUSH:
941  {
942  fwrite(O->buf, sizeof(uint8_t), iof_size(O), stderr);
943  fflush(stderr);
944  O->pos = O->buf;
945  return 0;
946  }
947  default:
948  break;
949  }
950  return 0;
951 }
952 
955 
958 
959 /* read from somewhere */
960 
961 iof * iof_reader (iof *I, void *link, iof_handler reader, const void *m, size_t bytes)
962 {
963  I->space = 0;
964  I->link = link;
965  I->more = reader;
966  I->flags = 0;
967  I->refcount = 0;
968  if (m != NULL)
969  {
970  I->rbuf = I->rpos = (const uint8_t *)m;
971  I->rend = (const uint8_t *)m + bytes;
972  return I;
973  }
974  return NULL;
975 }
976 
977 iof * iof_string_reader (iof *I, const void *s, size_t bytes)
978 {
979  I->space = 0;
980  I->link = NULL;
981  I->more = NULL;
982  I->flags = 0; // iof_string() sets IOF_DATA
983  I->refcount = 0;
984  if (s != NULL)
985  return iof_string(I, s, bytes);
986  return NULL;
987 }
988 
989 /* write somewhere */
990 
991 iof * iof_writer (iof *O, void *link, iof_handler writer, void *m, size_t bytes)
992 {
993  O->space = 0;
994  O->link = link;
995  O->more = writer;
996  O->flags = 0;
997  O->refcount = 0;
998  if (m != NULL && bytes > 0)
999  {
1000  O->buf = O->pos = (uint8_t *)m;
1001  O->end = (uint8_t *)m + bytes;
1002  return O;
1003  }
1004  // return iof_null(O);
1005  return NULL;
1006 }
1007 
1008 /* write to growing bytes buffer */
1009 
1010 static size_t iof_mem_handler (iof *O, iof_mode mode)
1011 {
1012  switch(mode)
1013  {
1014  case IOFWRITE:
1015  return iof_resize_buffer(O);
1016  case IOFCLOSE:
1017  iof_free(O);
1018  return 0;
1019  default:
1020  return 0;
1021  }
1022 }
1023 
1024 iof * iof_setup_buffer (iof *O, void *buffer, size_t space)
1025 {
1027  O->link = NULL;
1028  O->flags |= IOF_DATA;
1029  O->more = iof_mem_handler;
1030  return O;
1031 }
1032 
1033 iof * iof_setup_buffermin (iof *O, void *buffer, size_t space, size_t min)
1034 {
1036  if (space < min) // allocate min to avoid further rewriting
1037  {
1038  O->buf = O->pos = (uint8_t *)util_malloc(min);
1039  O->flags |= IOF_BUFFER_ALLOC;
1040  O->end = O->buf + min;
1041  }
1042  return O;
1043 }
1044 
1046 {
1047  uint8_t *buffer;
1048  iof *O;
1049  O = (iof *)util_malloc(space);
1050  buffer = (uint8_t *)(O + 1);
1052  O->flags |= IOF_ALLOC;
1053  return O;
1054 }
1055 
1056 /* set/get */
1057 
1059 {
1060  if (iof_readable(I))
1061  return *I->pos++;
1062  return IOFEOF;
1063 }
1064 
1065 int iof_putc (iof *O, int u)
1066 {
1067  if (iof_writable(O))
1068  {
1069  iof_set(O, u);
1070  return (uint8_t)u;
1071  }
1072  return IOFFULL;
1073 }
1074 
1075 size_t iof_skip (iof *I, size_t bytes)
1076 {
1077  while (bytes)
1078  {
1079  if (iof_readable(I))
1080  ++I->pos;
1081  else
1082  break;
1083  --bytes;
1084  }
1085  return bytes;
1086 }
1087 
1088 /* from iof to iof */
1089 
1091 {
1092  size_t leftin, leftout;
1093  if ((leftin = iof_left(I)) == 0)
1094  leftin = iof_input(I);
1095  while (leftin)
1096  {
1097  if ((leftout = iof_left(O)) == 0)
1098  if ((leftout = iof_output(O)) == 0)
1099  return IOFFULL;
1100  while (leftin > leftout)
1101  {
1102  memcpy(O->pos, I->pos, leftout);
1103  I->pos += leftout;
1104  O->pos = O->end; /* eq. += leftout */
1105  leftin -= leftout;
1106  if ((leftout = iof_output(O)) == 0)
1107  return IOFFULL;
1108  }
1109  if (leftin)
1110  {
1111  memcpy(O->pos, I->pos, leftin);
1112  I->pos = I->end; /* eq. += leftin */
1113  O->pos += leftin;
1114  }
1115  leftin = iof_input(I);
1116  }
1117  return IOFEOF;
1118 }
1119 
1120 /* read n-bytes */
1121 
1122 size_t iof_read (iof *I, void *to, size_t size)
1123 {
1124  size_t leftin, done = 0;
1125  char *s = (char *)to;
1126 
1127  if ((leftin = iof_left(I)) == 0)
1128  if ((leftin = iof_input(I)) == 0)
1129  return done;
1130  while (size > leftin)
1131  {
1132  memcpy(s, I->pos, leftin * sizeof(uint8_t));
1133  size -= leftin;
1134  done += leftin;
1135  s += leftin;
1136  I->pos = I->end;
1137  if ((leftin = iof_input(I)) == 0)
1138  return done;
1139  }
1140  if (size)
1141  {
1142  memcpy(s, I->pos, size * sizeof(uint8_t));
1143  I->pos += size;
1144  done += size;
1145  }
1146  return done;
1147 }
1148 
1149 /* rewrite FILE content (use fseek if needed) */
1150 
1152 {
1153  size_t leftout, size, readout;
1154  if ((leftout = iof_left(O)) == 0)
1155  if ((leftout = iof_output(O)) == 0)
1156  return 0;
1157  size = 0;
1158  do {
1159  readout = fread(O->pos, 1, leftout, file);
1160  O->pos += readout;
1161  size += readout;
1162  } while(readout == leftout && (leftout = iof_output(O)) > 0);
1163  return size;
1164 }
1165 
1166 size_t iof_write_file (iof *O, const char *filename)
1167 {
1168  FILE *file;
1169  size_t size;
1170  if ((file = fopen(filename, "rb")) == NULL)
1171  return 0;
1173  fclose(file);
1174  return size;
1175 }
1176 
1177 size_t iof_write_iofile (iof *O, iof_file *iofile, int savepos)
1178 {
1179  long offset;
1180  size_t size;
1181  FILE *file;
1182  if (iofile->flags & IOF_DATA)
1183  return iof_write(O, iofile->pos, (size_t)(iofile->end - iofile->pos));
1184  file = iof_file_get_fh(iofile);
1185  if (savepos)
1186  {
1187  offset = ftell(file);
1190  return size;
1191  }
1192  return iof_write_file_handle(O, file);
1193 }
1194 
1195 /* write n-bytes */
1196 
1197 size_t iof_write (iof *O, const void *data, size_t size)
1198 {
1199  size_t leftout, done = 0;
1200  const char *s = (const char *)data;
1201  if ((leftout = iof_left(O)) == 0)
1202  if ((leftout = iof_output(O)) == 0)
1203  return done;
1204  while (size > leftout)
1205  {
1206  memcpy(O->pos, s, leftout * sizeof(uint8_t));
1207  size -= leftout;
1208  done += leftout;
1209  s += leftout;
1210  O->pos = O->end;
1211  if ((leftout = iof_output(O)) == 0)
1212  return done;
1213  }
1214  if (size)
1215  {
1216  memcpy(O->pos, s, size * sizeof(uint8_t));
1217  O->pos += size;
1218  done += size;
1219  }
1220  return done;
1221 }
1222 
1223 /* write '\0'-terminated string */
1224 
1225 iof_status iof_puts (iof *O, const void *data)
1226 {
1227  const char *s = (const char *)data;
1228  while (*s)
1229  {
1230  if (iof_writable(O))
1231  iof_set(O, *s++);
1232  else
1233  return IOFFULL;
1234  }
1235  return IOFEOF; // ?
1236 }
1237 
1238 size_t iof_put_string (iof *O, const void *data)
1239 {
1240  const char *p, *s = (const char *)data;
1241  for (p = s; *p != '\0' && iof_writable(O); iof_set(O, *p++));
1242  return p - s;
1243 }
1244 
1245 /* write byte n-times */
1246 
1247 /*
1248 iof_status iof_repc (iof *O, char c, size_t bytes)
1249 {
1250  while (bytes)
1251  {
1252  if (iof_writable(O))
1253  iof_set(O, c);
1254  else
1255  return IOFFULL;
1256  --bytes;
1257  }
1258  return IOFEOF; // ?
1259 }
1260 */
1261 
1262 size_t iof_repc (iof *O, char c, size_t bytes)
1263 {
1264  size_t leftout, todo = bytes;
1265  if ((leftout = iof_left(O)) == 0)
1266  if ((leftout = iof_output(O)) == 0)
1267  return 0;
1268  while (bytes > leftout)
1269  {
1270  memset(O->pos, c, leftout);
1271  bytes -= leftout;
1272  O->pos = O->end;
1273  if ((leftout = iof_output(O)) == 0)
1274  return todo - bytes;
1275  }
1276  if (bytes)
1277  {
1278  memset(O->pos, c, bytes);
1279  O->pos += bytes;
1280  }
1281  return todo;
1282 }
1283 
1284 /* putfs */
1285 
1286 #define IOF_FMT_SIZE 1024
1287 
1288 size_t iof_putfs (iof *O, const char *format, ...)
1289 {
1290  static char buffer[IOF_FMT_SIZE];
1291  va_list args;
1292  va_start(args, format);
1293  if (vsnprintf(buffer, IOF_FMT_SIZE, format, args) > 0)
1294  {
1295  va_end(args);
1296  return iof_put_string(O, buffer);
1297  }
1298  else
1299  {
1300  va_end(args);
1301  return iof_write(O, buffer, IOF_FMT_SIZE);
1302  }
1303 }
1304 
1305 /* integer from iof; return 1 on success, 0 otherwise */
1306 
1308 {
1309  int sign, c = iof_char(I);
1310  iof_scan_sign(I, c, sign);
1311  if (!base10_digit(c)) return 0;
1312  iof_read_integer(I, c, *number);
1313  if (sign) *number = -*number;
1314  return 1;
1315 }
1316 
1317 int iof_get_slong (iof *I, long *number)
1318 {
1319  int sign, c = iof_char(I);
1320  iof_scan_sign(I, c, sign);
1321  if (!base10_digit(c)) return 0;
1322  iof_read_integer(I, c, *number);
1323  if (sign) *number = -*number;
1324  return 1;
1325 }
1326 
1328 {
1329  int sign, c = iof_char(I);
1330  iof_scan_sign(I, c, sign);
1331  if (!base10_digit(c)) return 0;
1332  iof_read_integer(I, c, *number);
1333  if (sign) *number = -*number;
1334  return 1;
1335 }
1336 
1338 {
1339  int c = iof_char(I);
1340  if (!base10_digit(c)) return 0;
1341  iof_read_integer(I, c, *number);
1342  return 1;
1343 }
1344 
1345 int iof_get_ulong (iof *I, unsigned long *number)
1346 {
1347  int c = iof_char(I);
1348  if (!base10_digit(c)) return 0;
1349  iof_read_integer(I, c, *number);
1350  return 1;
1351 }
1352 
1353 int iof_get_usize (iof *I, size_t *number)
1354 {
1355  int c = iof_char(I);
1356  if (!base10_digit(c)) return 0;
1357  iof_read_integer(I, c, *number);
1358  return 1;
1359 }
1360 
1362 {
1363  int c = iof_char(I);
1364  if (!base10_digit(c)) return 0;
1365  iof_read_integer(I, c, *number);
1366  return 1;
1367 }
1368 
1370 {
1371  int sign, c = iof_char(I);
1372  iof_scan_sign(I, c, sign);
1373  if (!base10_digit(c)) return 0;
1374  iof_read_radix(I, c, *number, radix);
1375  if (sign) *number = -*number;
1376  return 1;
1377 
1378 }
1379 
1381 {
1382  int sign, c = iof_char(I);
1383  iof_scan_sign(I, c, sign);
1384  if (!base10_digit(c)) return 0;
1385  iof_read_radix(I, c, *number, radix);
1386  if (sign) *number = -*number;
1387  return 1;
1388 }
1389 
1391 {
1392  int sign, c = iof_char(I);
1393  iof_scan_sign(I, c, sign);
1394  if (!base10_digit(c)) return 0;
1395  iof_read_radix(I, c, *number, radix);
1396  if (sign) *number = -*number;
1397  return 1;
1398 }
1399 
1401 {
1402  int c = iof_char(I);
1403  if (!base10_digit(c)) return 0;
1404  iof_read_radix(I, c, *number, radix);
1405  return 1;
1406 }
1407 
1408 int iof_get_ulong_radix (iof *I, unsigned long *number, int radix)
1409 {
1410  int c = iof_char(I);
1411  if (!base10_digit(c)) return 0;
1412  iof_read_radix(I, c, *number, radix);
1413  return 1;
1414 }
1415 
1416 int iof_get_usize_radix (iof *I, size_t *number, int radix)
1417 {
1418  int c = iof_char(I);
1419  if (!base10_digit(c)) return 0;
1420  iof_read_radix(I, c, *number, radix);
1421  return 1;
1422 }
1423 
1425 {
1426  int c = iof_char(I);
1427  if (!base10_digit(c)) return 0;
1428  iof_read_radix(I, c, *number, radix);
1429  return 1;
1430 }
1431 
1432 /* get roman to uint16_t, cf. roman_to_uint16() from utilnumber.c*/
1433 
1434 /* todo: some trick in place of this macro horror? */
1435 
1436 #define roman1000(c) (c == 'M' || c == 'm')
1437 #define roman500(c) (c == 'D' || c == 'd')
1438 #define roman100(c) (c == 'C' || c == 'c')
1439 #define roman50(c) (c == 'L' || c == 'l')
1440 #define roman10(c) (c == 'X' || c == 'x')
1441 #define roman5(c) (c == 'V' || c == 'v')
1442 #define roman1(c) (c == 'I' || c == 'i')
1443 
1444 #define roman100s(I, c) \
1445  (roman100(c) ? (100 + ((c = iof_next(I), roman100(c)) ? (100 + ((c = iof_next(I), roman100(c)) ? (c = iof_next(I), 100) : 0)) : 0)) : 0)
1446 #define roman10s(I, c) \
1447  (roman10(c) ? (10 + ((c = iof_next(I), roman10(c)) ? (10 + ((c = iof_next(I), roman10(c)) ? (c = iof_next(I), 10) : 0)) : 0)) : 0)
1448 #define roman1s(I, c) \
1449  (roman1(c) ? (1 + ((c = iof_next(I), roman1(c)) ? (1 + ((c = iof_next(I), roman1(c)) ? (c = iof_next(I), 1) : 0)) : 0)) : 0)
1450 
1452 {
1453  int c;
1454  /* M */
1455  for (*number = 0, c = iof_char(I); roman1000(c); *number += 1000, c = iof_next(I));
1456  /* D C */
1457  if (roman500(c))
1458  {
1459  c = iof_next(I);
1460  *number += 500 + roman100s(I, c);
1461  }
1462  else if (roman100(c))
1463  {
1464  c = iof_next(I);
1465  if (roman1000(c))
1466  {
1467  c = iof_next(I);
1468  *number += 900;
1469  }
1470  else if (roman500(c))
1471  {
1472  c = iof_next(I);
1473  *number += 400;
1474  }
1475  else
1476  *number += 100 + roman100s(I, c);
1477  }
1478  /* L X */
1479  if (roman50(c))
1480  {
1481  c = iof_next(I);
1482  *number += 50 + roman10s(I, c);
1483  }
1484  else if (roman10(c))
1485  {
1486  c = iof_next(I);
1487  if (roman100(c))
1488  {
1489  c = iof_next(I);
1490  *number += 90;
1491  }
1492  else if (roman50(c))
1493  {
1494  c = iof_next(I);
1495  *number += 40;
1496  }
1497  else
1498  *number += 10 + roman10s(I, c);
1499  }
1500  /* V I */
1501  if (roman5(c))
1502  {
1503  c = iof_next(I);
1504  *number += 5 + roman1s(I, c);
1505  }
1506  else if (roman1(c))
1507  {
1508  c = iof_next(I);
1509  if (roman10(c))
1510  {
1511  c = iof_next(I);
1512  *number += 9;
1513  }
1514  else if (roman5(c))
1515  {
1516  c = iof_next(I);
1517  *number += 4;
1518  }
1519  else
1520  *number += 1 + roman1s(I, c);
1521  }
1522  return 1;
1523 }
1524 
1525 /* double from iof; return 1 on success */
1526 
1527 int iof_get_double (iof *I, double *number) // cf. string_to_double()
1528 {
1529  int sign, exponent10, c = iof_char(I);
1530  iof_scan_sign(I, c, sign);
1531  iof_scan_decimal(I, c, *number);
1532  if (c == '.')
1533  {
1534  c = iof_next(I);
1535  iof_scan_fraction(I, c, *number, exponent10);
1536  }
1537  else
1538  exponent10 = 0;
1539  if (c == 'e' || c == 'E')
1540  {
1541  c = iof_next(I);
1542  iof_scan_exponent10(I, c, exponent10);
1543  }
1544  double_exp10(*number, exponent10);
1545  if (sign) *number = -*number;
1546  return 1;
1547 }
1548 
1549 int iof_get_float (iof *I, float *number) // cf. string_to_float()
1550 {
1551  int sign, exponent10, c = iof_char(I);
1552  iof_scan_sign(I, c, sign);
1553  iof_scan_decimal(I, c, *number);
1554  if (c == '.')
1555  {
1556  c = iof_next(I);
1557  iof_scan_fraction(I, c, *number, exponent10);
1558  }
1559  else
1560  exponent10 = 0;
1561  if (c == 'e' || c == 'E')
1562  {
1563  c = iof_next(I);
1564  iof_scan_exponent10(I, c, exponent10);
1565  }
1566  float_exp10(*number, exponent10);
1567  if (sign) *number = -*number;
1568  return 1;
1569 }
1570 
1571 int iof_conv_double (iof *I, double *number) // cf. convert_to_double()
1572 {
1573  int sign, exponent10, c = iof_char(I);
1574  iof_scan_sign(I, c, sign);
1575  iof_scan_decimal(I, c, *number);
1576  if (c == '.' || c == ',')
1577  {
1578  c = iof_next(I);
1579  iof_scan_fraction(I, c, *number, exponent10);
1580  if (exponent10 < 0)
1581  double_negative_exp10(*number, exponent10);
1582  }
1583  if (sign) *number = -*number;
1584  return 1;
1585 }
1586 
1587 int iof_conv_float (iof *I, float *number) // cf. convert_to_float()
1588 {
1589  int sign, exponent10, c = iof_char(I);
1590  iof_scan_sign(I, c, sign);
1591  iof_scan_decimal(I, c, *number);
1592  if (c == '.' || c == ',')
1593  {
1594  c = iof_next(I);
1595  iof_scan_fraction(I, c, *number, exponent10);
1596  if (exponent10 < 0)
1597  float_negative_exp10(*number, exponent10);
1598  }
1599  if (sign) *number = -*number;
1600  return 1;
1601 }
1602 
1603 /* integer to iof; return a number of written bytes */
1604 
1606 {
1607  const char *s;
1608  size_t size;
1610  return iof_write(O, s, size);
1611 }
1612 
1613 size_t iof_put_slong (iof *O, long number)
1614 {
1615  const char *s;
1616  size_t size;
1618  return iof_write(O, s, size);
1619 }
1620 
1622 {
1623  const char *s;
1624  size_t size;
1626  return iof_write(O, s, size);
1627 }
1628 
1630 {
1631  const char *s;
1632  size_t size;
1634  return iof_write(O, s, size);
1635 }
1636 
1637 size_t iof_put_ulong (iof *O, unsigned long number)
1638 {
1639  const char *s;
1640  size_t size;
1642  return iof_write(O, s, size);
1643 }
1644 
1645 size_t iof_put_usize (iof *O, size_t number)
1646 {
1647  const char *s;
1648  size_t size;
1650  return iof_write(O, s, size);
1651 }
1652 
1654 {
1655  const char *s;
1656  size_t size;
1658  return iof_write(O, s, size);
1659 }
1660 
1661 size_t iof_put_int32_radix (iof *O, int32_t number, int radix, int uc)
1662 {
1663  const char *s;
1664  size_t size;
1665  s = int32_to_radix(number, radix, uc, &size);
1666  return iof_write(O, s, size);
1667 }
1668 
1669 size_t iof_put_slong_radix (iof *O, long number, int radix, int uc)
1670 {
1671  const char *s;
1672  size_t size;
1673  s = slong_to_radix(number, radix, uc, &size);
1674  return iof_write(O, s, size);
1675 }
1676 
1677 size_t iof_put_int64_radix (iof *O, int64_t number, int radix, int uc)
1678 {
1679  const char *s;
1680  size_t size;
1681  s = int64_to_radix(number, radix, uc, &size);
1682  return iof_write(O, s, size);
1683 }
1684 
1686 {
1687  const char *s;
1688  size_t size;
1689  s = uint32_to_radix(number, radix, uc, &size);
1690  return iof_write(O, s, size);
1691 }
1692 
1693 size_t iof_put_ulong_radix (iof *O, unsigned long number, int radix, int uc)
1694 {
1695  const char *s;
1696  size_t size;
1697  s = ulong_to_radix(number, radix, uc, &size);
1698  return iof_write(O, s, size);
1699 }
1700 
1701 size_t iof_put_usize_radix (iof *O, size_t number, int radix, int uc)
1702 {
1703  const char *s;
1704  size_t size;
1705  s = usize_to_radix(number, radix, uc, &size);
1706  return iof_write(O, s, size);
1707 }
1708 
1710 {
1711  const char *s;
1712  size_t size;
1713  s = uint64_to_radix(number, radix, uc, &size);
1714  return iof_write(O, s, size);
1715 }
1716 
1717 /* roman numerals */
1718 
1719 size_t iof_put_roman (iof *O, uint16_t number, int uc)
1720 {
1721  const char *s;
1722  size_t size;
1723  s = uint16_to_roman(number, uc, &size);
1724  return iof_write(O, s, size);
1725 }
1726 
1727 /* double/float to iof; return the number of written bytes */
1728 
1729 size_t iof_put_double (iof *O, double number, int digits)
1730 {
1731  const char *s;
1732  size_t size;
1734  return iof_write(O, s, size);
1735 }
1736 
1737 size_t iof_put_float (iof *O, float number, int digits)
1738 {
1739  const char *s;
1740  size_t size;
1742  return iof_write(O, s, size);
1743 }
1744 
1745 /* iof to binary integer; pretty common */
1746 
1747 int iof_get_be_uint2 (iof *I, uint32_t *pnumber)
1748 {
1749  int c1, c2;
1750  if ((c1 = iof_get(I)) < 0 || (c2 = iof_get(I)) < 0)
1751  return 0;
1752  *pnumber = (c1<<8)|c2;
1753  return 1;
1754 }
1755 
1756 int iof_get_be_uint3 (iof *I, uint32_t *pnumber)
1757 {
1758  int c1, c2, c3;
1759  if ((c1 = iof_get(I)) < 0 || (c2 = iof_get(I)) < 0 || (c3 = iof_get(I)) < 0)
1760  return 0;
1761  *pnumber = (c1<<16)|(c2<<8)|c3;
1762  return 1;
1763 }
1764 
1765 int iof_get_be_uint4 (iof *I, uint32_t *pnumber)
1766 {
1767  int c1, c2, c3, c4;
1768  if ((c1 = iof_get(I)) < 0 || (c2 = iof_get(I)) < 0 || (c3 = iof_get(I)) < 0 || (c4 = iof_get(I)) < 0)
1769  return 0;
1770  *pnumber = (c1<<24)|(c2<<16)|(c3<<8)|c4;
1771  return 1;
1772 }
1773 
1774 int iof_get_le_uint2 (iof *I, uint32_t *pnumber)
1775 {
1776  int c1, c2;
1777  if ((c1 = iof_get(I)) < 0 || (c2 = iof_get(I)) < 0)
1778  return 0;
1779  *pnumber = (c2<<8)|c1;
1780  return 1;
1781 }
1782 
1783 int iof_get_le_uint3 (iof *I, uint32_t *pnumber)
1784 {
1785  int c1, c2, c3;
1786  if ((c1 = iof_get(I)) < 0 || (c2 = iof_get(I)) < 0 || (c3 = iof_get(I)) < 0)
1787  return 0;
1788  *pnumber = (c3<<16)|(c2<<8)|c1;
1789  return 1;
1790 }
1791 
1792 int iof_get_le_uint4 (iof *I, uint32_t *pnumber)
1793 {
1794  int c1, c2, c3, c4;
1795  if ((c1 = iof_get(I)) < 0 || (c2 = iof_get(I)) < 0 || (c3 = iof_get(I)) < 0 || (c4 = iof_get(I)) < 0)
1796  return 0;
1797  *pnumber = (c4<<24)|(c3<<16)|(c2<<8)|c1;
1798  return 1;
1799 }
1800 
1801 /* iof input data */
1802 
1803 uint8_t * iof_file_input_data (iof_file *iofile, size_t *psize, int *isnew)
1804 {
1805  uint8_t *data;
1806  if (iofile->flags & IOF_DATA)
1807  {
1808  data = iofile->buf;
1809  *psize = iofile->end - iofile->buf;
1810  *isnew = 0;
1811  return data;
1812  }
1813  if (iof_file_reopen(iofile))
1814  {
1816  *isnew = 1;
1817  iof_file_reclose(iofile);
1818  return data;
1819  }
1820  return NULL;
1821 }
1822 
1823 /*
1824 uint8_t * iof_file_reader_data (iof_file *iofile, size_t *size)
1825 {
1826  uint8_t *data;
1827  if (!(iofile->flags & IOF_DATA) || iofile->pos == NULL || (*size = (size_t)iof_left(iofile)) == 0)
1828  return NULL;
1829  if (iofile->flags & IOF_BUFFER_ALLOC)
1830  {
1831  data = iofile->buf; // iofile->pos; // returned must be freeable, makes sense when ->buf == ->pos
1832  iofile->flags &= ~IOF_BUFFER_ALLOC;
1833  iofile->buf = iofile->pos = iofile->end = NULL;
1834  return data;
1835  }
1836  data = (uint8_t *)util_malloc(*size);
1837  memcpy(data, iofile->buf, *size);
1838  return data;
1839 }
1840 
1841 uint8_t * iof_file_writer_data (iof_file *iofile, size_t *size)
1842 {
1843  uint8_t *data;
1844  if (!(iofile->flags & IOF_DATA) || iofile->buf == NULL || (*size = (size_t)iof_size(iofile)) == 0)
1845  return NULL;
1846  if (iofile->flags & IOF_BUFFER_ALLOC)
1847  {
1848  iofile->flags &= ~IOF_BUFFER_ALLOC;
1849  data = iofile->buf;
1850  iofile->buf = iofile->pos = iofile->end = NULL;
1851  return data;
1852  }
1853  data = (uint8_t *)util_malloc(*size);
1854  memcpy(data, iofile->buf, *size);
1855  return data;
1856 }
1857 */
1858 
1859 uint8_t * iof_reader_data (iof *I, size_t *psize)
1860 {
1861  uint8_t *data;
1862  *psize = (size_t)iof_left(I);
1863  if (I->flags & IOF_BUFFER_ALLOC)
1864  {
1865  data = I->buf; // actually I->pos, but we have to return something freeable
1866  I->flags &= ~~IOF_BUFFER_ALLOC;
1867  I->buf = NULL;
1868  }
1869  else
1870  {
1871  data = util_malloc(*psize);
1872  memcpy(data, I->pos, *psize);
1873  }
1874  iof_close(I);
1875  return data;
1876 }
1877 
1878 
1879 uint8_t * iof_writer_data (iof *O, size_t *psize)
1880 {
1881  uint8_t *data;
1882  *psize = (size_t)iof_size(O);
1883  if (O->flags & IOF_BUFFER_ALLOC)
1884  {
1885  data = O->buf;
1886  O->flags &= ~~IOF_BUFFER_ALLOC;
1887  O->buf = NULL;
1888  }
1889  else
1890  {
1891  data = util_malloc(*psize);
1892  memcpy(data, O->buf, *psize);
1893  }
1894  iof_close(O);
1895  return data;
1896 }
1897 
1899 {
1900  size_t size;
1901  for (size = 0; iof_readable(I); I->pos = I->end)
1902  size += fwrite(I->buf, sizeof(uint8_t), iof_left(I), file);
1903  return size;
1904 }
1905 
1906 size_t iof_reader_to_file (iof *I, const char *filename)
1907 {
1908  FILE *file;
1909  size_t size;
1910  if ((file = fopen(filename, "wb")) == NULL)
1911  return 0;
1912  for (size = 0; iof_readable(I); I->pos = I->end)
1913  size += fwrite(I->buf, sizeof(uint8_t), iof_left(I), file);
1914  fclose(file);
1915  return size;
1916 }
1917 
1918 /* debug */
1919 
1920 size_t iof_data_to_file (const void *data, size_t size, const char *filename)
1921 {
1922  FILE *fh;
1923  if ((fh = fopen(filename, "wb")) == NULL)
1924  return 0;
1925  // size = fwrite(data, size, sizeof(uint8_t), fh); // WRONG, this always returns 1, as fwrite returns the number of elements successfully written out
1926  size = fwrite(data, sizeof(uint8_t), size, fh);
1927  fclose(fh);
1928  return size;
1929 }
1930 
1932 {
1933  const void *data;
1934  size_t size;
1935  data = iof_result(F, size);
1937 }
1938 
1939 size_t iof_result_to_file (iof *F, const char *filename)
1940 {
1941  const void *data;
1942  size_t size;
1943  data = iof_result(F, size);
1944  return iof_data_to_file(data, size, filename);
1945 }
1946 
1947 void iof_debug (iof *I, const char *filename)
1948 {
1949  FILE *file = fopen(filename, "wb");
1950  if (file != NULL)
1951  {
1952  fprintf(file, ">>> buf %p <<<\n", I->buf);
1953  fwrite(I->buf, sizeof(uint8_t), iof_size(I), file);
1954  fprintf(file, "\n>>> pos %p (%ld) <<<\n", I->pos, (long)iof_size(I));
1955  fwrite(I->pos, sizeof(uint8_t), iof_left(I), file);
1956  fprintf(file, "\n>>> end %p (%ld) <<<\n", I->end, (long)iof_left(I));
1957  fwrite(I->end, sizeof(uint8_t), I->space - iof_space(I), file);
1958  fprintf(file, "\n>>> end of buffer %p (%ld) <<<\n", I->buf + I->space, (long)(I->buf + I->space - I->end));
1959  fclose(file);
1960  }
1961 }
1962 
1963 /* common filters api */
1964 
1965 /* sizes of filter states on x64
1966 size of iof_filter: 640 (no longer used; sizeof(iof) + sizeof larger state)
1967 size of file_state: 16
1968 size of stream_state: 16
1969 size of flate_state: 104
1970 size of lzw_state: 56
1971 size of predictor_state: 104
1972 size of basexx_state: 48
1973 size of basexx_state: 48
1974 size of basexx_state: 48
1975 size of eexec_state: 40
1976 size of runlength_state: 24
1977 size of rc4_state: 24
1978 size of aes_state: 72
1979 size of img_state: 576
1980 size of img: 496
1981 */
1982 
1983 typedef struct iof_heap iof_heap;
1984 
1985 typedef struct {
1986  iof_heap *heap;
1987 } iof_heap_ghost;
1988 
1989 
1990 struct iof_heap {
1991  union { uint8_t *data; iof_heap_ghost *gdata; }; // union instead of casts (ARM)
1992  union { uint8_t *pos; iof_heap_ghost *gpos; };
1993  size_t size, space;
1994  iof_heap *next, *prev;
1995  int refcount;
1996  uint8_t dummy[4]; // pad to 8N bytes
1997 };
1998 
1999 /*
2000 We use hidden heap pointer for every allocated buffer, so heap->data should be kept properly aligned.
2001 Dummy 4-bytes pad doesn't really matter (the pad is there anyway), but iof_heap_take() must pad the
2002 requested size.
2003 */
2004 
2007 
2008 #define IOF_HEAP_FILTERS_COUNT 4
2009 #define IOF_BUFFER_SIZE 262144 // (1<<18)
2010 #define IOF_FILTER_SIZE 1024
2011 // sizeof(iof_filter) on x64 is now 640, img_state 576, img 496, others 16-104
2012 #define IOF_BUFFER_HEAP_SIZE (IOF_HEAP_FILTERS_COUNT * (IOF_BUFFER_SIZE + sizeof(iof_heap_ghost)))
2013 #define IOF_FILTER_HEAP_SIZE (IOF_HEAP_FILTERS_COUNT * (IOF_FILTER_SIZE + sizeof(iof_heap_ghost)))
2014 
2015 static iof_heap * iof_heap_new (size_t space)
2016 {
2017  iof_heap *iofheap;
2018  iofheap = (iof_heap *)util_malloc(sizeof(iof_heap) + space);
2019  iofheap->gdata = iofheap->gpos = (iof_heap_ghost *)(iofheap + 1);
2020  iofheap->size = iofheap->space = space;
2021  iofheap->next = NULL;
2022  iofheap->prev = NULL;
2023  iofheap->refcount = 0;
2024  return iofheap;
2025 }
2026 
2027 #define iof_heap_free(iofheap) util_free(iofheap)
2028 
2029 void iof_filters_init (void)
2030 {
2031  if (iof_buffers_heap == NULL)
2033  if (iof_filters_heap == NULL)
2035 }
2036 
2037 void iof_filters_free (void)
2038 {
2039  iof_heap *heap, *next;
2040  for (heap = iof_buffers_heap; heap != NULL; heap = next)
2041  {
2042  next = heap->next;
2043  if (heap->refcount != 0)
2044  loggerf("not closed iof filters left (%d)", heap->refcount);
2045  if (next != NULL)
2046  loggerf("iof filters heap left");
2047  iof_heap_free(heap);
2048  }
2050  for (heap = iof_filters_heap; heap != NULL; heap = next)
2051  {
2052  next = heap->next;
2053  if (heap->refcount != 0)
2054  loggerf("not closed iof buffers left (%d)", heap->refcount);
2055  if (next != NULL)
2056  loggerf("iof buffers heap left");
2057  iof_heap_free(heap);
2058  }
2060 }
2061 
2062 #define iof_heap_get(hp, ghost, data, siz) \
2063  (ghost = (hp)->gpos, ghost->heap = (hp), data = (uint8_t *)(ghost + 1), (hp)->pos += siz, (hp)->size -= siz, ++(hp)->refcount)
2064 
2065 static void * iof_heap_take (iof_heap **pheap, size_t size)
2066 {
2067  uint8_t *data;
2068  iof_heap_ghost *ghost;
2069  iof_heap *heap, *newheap, *next;
2070 
2071  heap = *pheap;
2072  if (size & 7)
2073  size += 8 - (size & 7); // pad to 8N bytes so that (heap->pos + size) remains properly aligned
2074  size += sizeof(iof_heap_ghost);
2075  if (heap->size >= size)
2076  { /* take cheap mem from main heap */
2077  iof_heap_get(heap, ghost, data, size);
2078  return data;
2079  }
2080  if (size <= (heap->space >> 1))
2081  { /* make new cheap heap, make it front */
2082  *pheap = newheap = iof_heap_new(heap->space);
2083  newheap->next = heap;
2084  heap->prev = newheap;
2085  iof_heap_get(newheap, ghost, data, size);
2086  return data;
2087  }
2088  /* size much larger than expected? should not happen.
2089  make a single-item heap, keep the front heap intact. */
2090  newheap = iof_heap_new(size);
2091  if ((next = heap->next) != NULL)
2092  {
2093  newheap->next = next;
2094  next->prev = newheap;
2095  }
2096  heap->next = newheap;
2097  newheap->prev = heap;
2098  iof_heap_get(newheap, ghost, data, size);
2099  return data;
2100 }
2101 
2102 static void iof_heap_back (void *data)
2103 {
2104  iof_heap_ghost *ghost;
2105  iof_heap *heap, *next, *prev;
2106 
2107  ghost = ((iof_heap_ghost *)data) - 1;
2108  heap = ghost->heap;
2109  if (heap->refcount == 0)
2110  loggerf("invalid use of iof heap, refcount < 0");
2111  if (--heap->refcount <= 0)
2112  {
2113  if ((prev = heap->prev) != NULL)
2114  { /* free the heap */
2115  if ((next = heap->next) != NULL)
2116  prev->next = next, next->prev = prev;
2117  else
2118  prev->next = NULL;
2119  iof_heap_free(heap);
2120  }
2121  else
2122  { /* this is the front heap, just reset */
2123  heap->pos = heap->data;
2124  heap->size = heap->space;
2125  }
2126  }
2127 }
2128 
2129 /**/
2130 
2131 /*
2132 void * iof_filter_new (size_t size)
2133 {
2134  void *data;
2135  iof_filters_init();
2136  data = iof_heap_take(&iof_filters_heap, size);
2137  return memset(data, 0, size);
2138 }
2139 */
2140 
2141 iof * iof_filter_reader_new (iof_handler handler, size_t statesize, void **pstate)
2142 {
2143  iof *F;
2144  void *filter;
2145  uint8_t *buffer;
2146  size_t buffersize;
2147 
2148  iof_filters_init();
2149  filter = iof_heap_take(&iof_filters_heap, sizeof(iof) + statesize);
2150  F = (iof *)memset(filter, 0, sizeof(iof) + statesize);
2152  buffersize = IOF_BUFFER_SIZE;
2153  iof_setup_reader(F, buffer, buffersize);
2154  F->flags |= IOF_HEAP|IOF_BUFFER_HEAP;
2155  F->more = handler;
2156  *pstate = (F + 1);
2157  return F;
2158 }
2159 
2160 iof * iof_filter_reader_with_buffer_new (iof_handler handler, size_t statesize, void **pstate, void *buffer, size_t buffersize)
2161 { // for filters that has own buffer (string, some image filters)
2162  iof *F;
2163  void *filter;
2164 
2165  iof_filters_init();
2166  filter = iof_heap_take(&iof_filters_heap, sizeof(iof) + statesize);
2167  F = (iof *)memset(filter, 0, sizeof(iof) + statesize);
2168  iof_setup_reader(F, buffer, buffersize);
2169  F->flags |= IOF_HEAP;
2170  F->more = handler;
2171  *pstate = (F + 1);
2172  return F;
2173 }
2174 
2175 iof * iof_filter_writer_new (iof_handler handler, size_t statesize, void **pstate)
2176 {
2177  iof *F;
2178  void *filter;
2179  uint8_t *buffer;
2180  size_t buffersize;
2181 
2182  iof_filters_init();
2183  filter = iof_heap_take(&iof_filters_heap, sizeof(iof) + statesize);
2184  F = (iof *)memset(filter, 0, sizeof(iof) + statesize);
2186  buffersize = IOF_BUFFER_SIZE;
2187  iof_setup_writer(F, buffer, buffersize);
2188  F->flags |= IOF_HEAP|IOF_BUFFER_HEAP;
2189  F->more = handler;
2190  *pstate = (F + 1);
2191  return F;
2192 }
2193 
2194 iof * iof_filter_writer_with_buffer_new (iof_handler handler, size_t statesize, void **pstate, void *buffer, size_t buffersize)
2195 {
2196  iof *F;
2197  void *filter;
2198 
2199  iof_filters_init();
2200  filter = iof_heap_take(&iof_filters_heap, sizeof(iof) + statesize);
2201  F = (iof *)memset(filter, 0, sizeof(iof) + statesize);
2202  iof_setup_writer(F, buffer, buffersize);
2203  F->flags |= IOF_HEAP;
2204  F->more = handler;
2205  *pstate = (F + 1);
2206  return F;
2207 }
2208 
2209 /**/
2210 
2211 #define iof_filter_free(F) iof_heap_back(F)
2212 #define iof_filter_buffer_free(data) iof_heap_back(data)
2213 
2214 /* close */
2215 
2216 #define iof_close_next(F) ((void)(iof_decref((F)->next), (F)->next = NULL, 0))
2217 /* when filter creation fails, we should take care to destroy the filter but leave ->next intact */
2218 #define iof_clear_next(F) ((void)(iof_unref((F)->next), (F)->next = NULL, 0))
2219 
2220 #define iof_close_buffer(F) ((void)\
2221  ((F)->buf != NULL ? \
2222  ((F->flags & IOF_BUFFER_ALLOC) ? (util_free((F)->buf), (F)->buf = NULL, 0) : \
2223  ((F->flags & IOF_BUFFER_HEAP) ? (iof_filter_buffer_free((F)->buf), (F)->buf = NULL, 0) : ((F)->buf = NULL, 0))) : 0))
2224 
2225 /* closing underlying file handle */
2226 
2227 static void iof_close_file (iof *F)
2228 {
2229  FILE *file;
2230  //if (F->flags & IOF_FILE_HANDLE)
2231  //{
2232  if ((file = F->file) != NULL)
2233  {
2234  if (F->flags & IOF_CLOSE_FILE)
2235  fclose(F->file);
2236  F->file = NULL;
2237  }
2238  //}
2239 }
2240 
2241 /* a very special variant for reader filters initiated with iof_file_reopen(). It also calls
2242  iof_file_reclose(), which takes an effect only if previously reopened, but better to keep
2243  all this thin ice separated. Used in filters: iofile_reader, iofile_stream_reader, image
2244  decoders. */
2245 
2246 static void iof_close_iofile (iof *F)
2247 {
2248  iof_file *iofile;
2249  //if (F->flags & IOF_FILE)
2250  //{
2251  if ((iofile = F->iofile) != NULL)
2252  {
2253  iof_file_unsync(iofile, NULL);
2254  iof_file_reclose(iofile); // takes an effect iff prevoiusly reopened
2255  iof_file_decref(iofile);
2256  F->iofile = NULL;
2257  }
2258  //}
2259 }
2260 
2261 void iof_free (iof *F)
2262 {
2263  if (F->flags & IOF_FILE_HANDLE)
2264  iof_close_file(F);
2265  else if (F->flags & IOF_FILE)
2267  else if (F->flags & IOF_NEXT)
2268  iof_close_next(F);
2270  if (F->flags & IOF_HEAP)
2271  iof_filter_free(F);
2272  else if (F->flags & IOF_ALLOC)
2273  util_free(F);
2274 }
2275 
2277 { // so far used only on failed filters creation; as iof_free() but don't dare to release ->next
2278  if (F->flags & IOF_FILE_HANDLE)
2279  iof_close_file(F);
2280  else if (F->flags & IOF_FILE)
2282  //else if (F->flags & IOF_NEXT)
2283  // iof_close_next(F);
2285  if (F->flags & IOF_HEAP)
2286  iof_filter_free(F);
2287  else if (F->flags & IOF_ALLOC)
2288  util_free(F);
2289 }
2290 
2291 /* resizing buffer */
2292 
2293 size_t iof_resize_buffer_to (iof *O, size_t space)
2294 {
2295  uint8_t *buf;
2296 
2297  if (O->flags & IOF_BUFFER_ALLOC)
2298  {
2299  buf = (uint8_t *)util_realloc(O->buf, space);
2300  }
2301  else
2302  {
2303  buf = (uint8_t *)util_malloc(space);
2304  memcpy(buf, O->buf, iof_size(O));
2305  if (O->flags & IOF_BUFFER_HEAP)
2306  {
2307  iof_filter_buffer_free(O->buf);
2308  O->flags &= ~~IOF_BUFFER_HEAP;
2309  }
2310  O->flags |= IOF_BUFFER_ALLOC;
2311 
2312  }
2313  O->pos = buf + iof_size(O);
2314  O->end = buf + space;
2315  O->buf = buf;
2316  O->space = space;
2317  return iof_left(O);
2318 }
2319 
2320 /* */
2321 
2323 {
2324  switch (status)
2325  {
2326  case IOFERR:
2327  case IOFEMPTY: // should never happen as we set state.flush = 1 on decoders init
2328  loggerf("%s decoder error (%d, %s)", type, status, iof_status_kind(status));
2329  I->flags |= IOF_STOPPED;
2330  return 0;
2331  case IOFEOF: // this is the last chunk,
2332  I->flags |= IOF_STOPPED; // so stop it and fall
2333  FALLTHRU // fall through
2334  case IOFFULL: // prepare pointers to read from I->buf
2335  I->end = I->pos;
2336  I->pos = I->buf;
2337  return I->end - I->buf;
2338  }
2339  loggerf("%s decoder bug, invalid retval %d", type, status);
2340  return 0;
2341 }
2342 
2344 {
2345  switch (status)
2346  {
2347  case IOFERR:
2348  case IOFFULL:
2349  loggerf("%s encoder error (%d, %s)", type, status, iof_status_kind(status));
2350  return 0;
2351  case IOFEMPTY:
2352  O->pos = O->buf;
2353  O->end = O->buf + O->space;
2354  return O->space;
2355  case IOFEOF:
2356  return 0;
2357  }
2358  loggerf("%s encoder bug, invalid retval %d", type, status);
2359  return 0;
2360 }
2361 
2362 /* file/stream state */
2363 
2364 typedef struct {
2365  size_t length;
2366  size_t offset;
2367 } file_state;
2368 
2369 #define file_state_init(state, off, len) ((state)->offset = off, (state)->length = len)
2370 
2371 typedef struct {
2372  size_t length;
2373  size_t offset;
2374 } stream_state;
2375 
2376 #define stream_state_init(state, off, len) ((state)->offset = off, (state)->length = len)
2377 
2378 /* union type to avoid 'dereferencing type-punned .. ' warnings on (void **) case */
2379 
2380 typedef union { file_state *filestate; stream_state *streamstate; void *voidstate; } fs_state_pointer;
2381 
2382 /**/
2383 
2384 static size_t file_read (iof *I)
2385 {
2386  size_t bytes, tail;
2387  if (I->flags & IOF_STOPPED)
2388  return 0;
2389  tail = iof_tail(I);
2390  if ((bytes = tail + fread(I->buf + tail, sizeof(uint8_t), I->space - tail, I->file)) < I->space)
2391  I->flags |= IOF_STOPPED;
2392  I->pos = I->buf;
2393  I->end = I->buf + bytes;
2394  return bytes;
2395 }
2396 
2397 static size_t iofile_read (iof *I, size_t *poffset)
2398 {
2399  size_t bytes, tail;
2400  if (I->flags & IOF_STOPPED)
2401  return 0;
2402  iof_file_sync(I->iofile, poffset);
2403  tail = iof_tail(I);
2404  if ((bytes = tail + iof_file_read(I->buf + tail, sizeof(uint8_t), I->space - tail, I->iofile)) < I->space)
2405  {
2406  I->flags |= IOF_STOPPED;
2407  iof_file_unsync(I->iofile, poffset);
2408  }
2409  I->pos = I->buf;
2410  I->end = I->buf + bytes;
2411  return bytes;
2412 }
2413 
2414 static size_t file_load (iof *I)
2415 {
2416  size_t bytes, left, tail;
2417  if (I->flags & IOF_STOPPED)
2418  return 0;
2419  tail = iof_tail(I);
2420  I->pos = I->buf + tail;
2421  I->end = I->buf + I->space; /* don't assume its done when initializing the filter */
2422  left = I->space - tail;
2423  do {
2424  bytes = fread(I->pos, sizeof(uint8_t), left, I->file);
2425  I->pos += bytes;
2426  } while (bytes == left && (left = iof_resize_buffer(I)) > 0);
2427  I->flags |= IOF_STOPPED;
2428  return iof_loaded(I);
2429 }
2430 
2431 static size_t iofile_load (iof *I, size_t *poffset)
2432 {
2433  size_t bytes, left, tail;
2434  if (I->flags & IOF_STOPPED)
2435  return 0;
2436  tail = iof_tail(I);
2437  I->pos = I->buf + tail;
2438  I->end = I->buf + I->space; /* don't assume its done when initializing the filter */
2439  left = I->space - tail;
2440  iof_file_sync(I->iofile, poffset);
2441  do {
2442  bytes = iof_file_read(I->pos, sizeof(uint8_t), left, I->iofile);
2443  I->pos += bytes;
2444  } while (bytes == left && (left = iof_resize_buffer(I)) > 0);
2445  I->flags |= IOF_STOPPED;
2446  iof_file_unsync(I->iofile, poffset);
2447  return iof_loaded(I);
2448 }
2449 
2451 {
2452  switch (mode)
2453  {
2454  case IOFREAD:
2455  return file_read(I);
2456  case IOFLOAD:
2457  return file_load(I);
2458  case IOFCLOSE:
2459  iof_free(I);
2460  return 0;
2461  default:
2462  return 0;
2463  }
2464 }
2465 
2467 {
2468  file_state *state;
2470  switch (mode)
2471  {
2472  case IOFREAD:
2473  return iofile_read(I, &state->offset);
2474  case IOFLOAD:
2475  return iofile_load(I, &state->offset);
2476  case IOFCLOSE:
2477  iof_free(I);
2478  return 0;
2479  default:
2480  return 0;
2481  }
2482 }
2483 
2484 static size_t file_write (iof *O, int flush)
2485 {
2486  size_t bytes;
2487  if ((bytes = iof_size(O)) > 0)
2488  if (bytes != fwrite(O->buf, sizeof(uint8_t), bytes, O->file))
2489  return 0;
2490  if (flush)
2491  fflush(O->file);
2492  O->end = O->buf + O->space; // remains intact actually
2493  O->pos = O->buf;
2494  return O->space;
2495 }
2496 
2497 static size_t iofile_write (iof *O, size_t *poffset, int flush)
2498 {
2499  size_t bytes;
2500  iof_file_sync(O->iofile, poffset);
2501  if ((bytes = iof_size(O)) > 0)
2502  {
2503  if (bytes != iof_file_write(O->buf, sizeof(uint8_t), bytes, O->iofile))
2504  {
2505  iof_file_unsync(O->iofile, poffset);
2506  return 0;
2507  }
2508  }
2509  if (flush)
2510  iof_file_flush(O->iofile);
2511  O->end = O->buf + O->space; // remains intact actually
2512  O->pos = O->buf;
2513  return O->space;
2514 }
2515 
2517 {
2518  switch (mode)
2519  {
2520  case IOFWRITE:
2521  return file_write(O, 0);
2522  case IOFFLUSH:
2523  return file_write(O, 1);
2524  case IOFCLOSE:
2525  file_write(O, 1);
2526  iof_free(O);
2527  return 0;
2528  default:
2529  return 0;
2530  }
2531 }
2532 
2534 {
2535  file_state *state;
2537  switch (mode)
2538  {
2539  case IOFWRITE:
2540  return iofile_write(O, &state->offset, 0);
2541  case IOFFLUSH:
2542  return iofile_write(O, &state->offset, 1);
2543  case IOFCLOSE:
2544  iofile_write(O, &state->offset, 1);
2545  iof_free(O);
2546  return 0;
2547  default:
2548  return 0;
2549  }
2550 }
2551 
2552 /* filter from FILE* */
2553 
2555 {
2556  iof *I;
2558  if (file == NULL)
2559  return NULL;
2560  I = iof_filter_reader(filter_file_reader, sizeof(file_state), &P.voidstate);
2561  iof_setup_file(I, file);
2562  file_state_init(P.filestate, 0, 0);
2563  return I;
2564 }
2565 
2567 {
2568  iof *O;
2570  if (file == NULL)
2571  return NULL;
2572  O = iof_filter_writer(filter_file_writer, sizeof(file_state), &P.voidstate);
2573  iof_setup_file(O, file);
2574  file_state_init(P.filestate, 0, 0);
2575  return O;
2576 }
2577 
2578 /* filter from iof_file * */
2579 
2581 {
2582  iof *I;
2584  if (!iof_file_reopen(iofile))
2585  return NULL;
2586  I = iof_filter_reader(filter_iofile_reader, sizeof(file_state), &P.voidstate);
2587  iof_setup_iofile(I, iofile);
2588  file_state_init(P.filestate, offset, 0);
2589  return I;
2590 }
2591 
2593 {
2594  iof *O;
2596  O = iof_filter_writer(filter_iofile_writer, sizeof(file_state), &P.voidstate);
2597  iof_setup_iofile(O, iofile);
2598  file_state_init(P.filestate, offset, 0);
2599  return O;
2600 }
2601 
2602 /* filter from filename */
2603 
2605 {
2606  iof *I;
2608  FILE *file;
2609  if ((file = fopen(filename, "rb")) == NULL)
2610  return NULL;
2611  I = iof_filter_reader(filter_file_reader, sizeof(file_state), &P.voidstate);
2612  iof_setup_file(I, file);
2613  file_state_init(P.filestate, 0, 0);
2614  I->flags |= IOF_CLOSE_FILE;
2615  return I;
2616 }
2617 
2619 {
2620  iof *O;
2622  FILE *file;
2623  if ((file = fopen(filename, "wb")) == NULL)
2624  return NULL;
2625  O = iof_filter_writer(filter_file_writer, sizeof(file_state), &P.voidstate);
2626  iof_setup_file(O, file);
2627  file_state_init(P.filestate, 0, 0);
2628  O->flags |= IOF_CLOSE_FILE;
2629  return O;
2630 }
2631 
2632 /* from string */
2633 
2634 static size_t dummy_handler (iof *I, iof_mode mode)
2635 {
2636  switch (mode)
2637  {
2638  case IOFCLOSE:
2639  iof_free(I);
2640  return 0;
2641  default:
2642  return 0;
2643  }
2644 }
2645 
2646 iof * iof_filter_string_reader (const void *s, size_t length)
2647 {
2648  iof *I;
2649  void *dummy;
2651  I->rbuf = I->rpos = (const uint8_t *)s;
2652  I->rend = (const uint8_t *)s + length;
2653  // I->space = length;
2654  return I;
2655 }
2656 
2657 iof * iof_filter_string_writer (const void *s, size_t length)
2658 {
2659  iof *O;
2660  void *dummy;
2662  O->rbuf = O->rpos = (const uint8_t *)s;
2663  O->rend = (const uint8_t *)s + length;
2664  // O->space = length;
2665  return O;
2666 }
2667 
2669 { // cmp iof_buffer_create()
2670  iof *O;
2672  uint8_t *buffer;
2673  if (size > IOF_BUFFER_SIZE)
2674  {
2677  O->flags |= IOF_BUFFER_ALLOC;
2678  return O;
2679  }
2680  return iof_filter_writer(iof_mem_handler, 0, &dummy.voidstate);
2681 }
2682 
2683 /* stream */
2684 
2685 static size_t file_stream_read (iof *I, size_t *plength)
2686 {
2687  size_t bytes, tail;
2688  if (I->flags & IOF_STOPPED || *plength == 0)
2689  return 0;
2690  tail = iof_tail(I);
2691  if (I->space - tail >= *plength)
2692  {
2693  bytes = tail + fread(I->buf + tail, sizeof(uint8_t), *plength, I->file);
2694  I->flags |= IOF_STOPPED;
2695  *plength = 0;
2696  }
2697  else
2698  {
2699  bytes = tail + fread(I->buf + tail, sizeof(uint8_t), I->space - tail, I->file);
2700  *plength -= bytes - tail;
2701  }
2702  I->pos = I->buf;
2703  I->end = I->buf + bytes;
2704  return bytes;
2705 }
2706 
2707 static size_t iofile_stream_read (iof *I, size_t *plength, size_t *poffset)
2708 {
2709  size_t bytes, tail;
2710  if (I->flags & IOF_STOPPED || *plength == 0)
2711  return 0;
2712  tail = iof_tail(I);
2713  iof_file_sync(I->iofile, poffset);
2714  if (I->space - tail >= *plength)
2715  {
2716  bytes = tail + iof_file_read(I->buf + tail, sizeof(uint8_t), *plength, I->iofile);
2717  iof_file_unsync(I->iofile, poffset);
2718  I->flags |= IOF_STOPPED;
2719  *plength = 0;
2720  }
2721  else
2722  {
2723  bytes = tail + iof_file_read(I->buf + tail, sizeof(uint8_t), I->space - tail, I->iofile);
2724  *plength -= bytes - tail;
2725  }
2726  I->pos = I->buf;
2727  I->end = I->buf + bytes;
2728  return bytes;
2729 }
2730 
2731 static size_t file_stream_load (iof *I, size_t *plength)
2732 {
2733  size_t bytes, tail;
2734  if (I->flags & IOF_STOPPED || *plength == 0)
2735  return 0;
2736  tail = iof_tail(I);
2737  if (I->space - tail < *plength)
2738  if (iof_resize_buffer_to(I, tail + *plength) == 0)
2739  return 0;
2740  bytes = tail + fread(I->buf + tail, sizeof(uint8_t), *plength, I->file);
2741  I->flags |= IOF_STOPPED;
2742  *plength = 0;
2743  I->pos = I->buf;
2744  I->end = I->buf + bytes;
2745  return bytes;
2746 }
2747 
2748 static size_t iofile_stream_load (iof *I, size_t *plength, size_t *poffset)
2749 {
2750  size_t bytes, tail;
2751  if (I->flags & IOF_STOPPED || *plength == 0)
2752  return 0;
2753  iof_file_sync(I->iofile, poffset);
2754  tail = iof_tail(I);
2755  if (I->space - tail < *plength)
2756  if (iof_resize_buffer_to(I, tail + *plength) == 0)
2757  return 0;
2758  bytes = tail + iof_file_read(I->buf + tail, sizeof(uint8_t), *plength, I->iofile);
2759  iof_file_unsync(I->iofile, poffset);
2760  I->flags |= IOF_STOPPED;
2761  *plength = 0;
2762  I->pos = I->buf;
2763  I->end = I->buf + bytes;
2764  return bytes;
2765 }
2766 
2768 {
2771  switch(mode)
2772  {
2773  case IOFREAD:
2774  return file_stream_read(I, &state->length);
2775  case IOFLOAD:
2776  return file_stream_load(I, &state->length);
2777  case IOFCLOSE:
2778  iof_free(I);
2779  return 0;
2780  default:
2781  return 0;
2782  }
2783 }
2784 
2786 {
2789  switch(mode)
2790  {
2791  case IOFREAD:
2792  return iofile_stream_read(I, &state->length, &state->offset);
2793  case IOFLOAD:
2794  return iofile_stream_load(I, &state->length, &state->offset);
2795  case IOFCLOSE:
2796  iof_free(I);
2797  return 0;
2798  default:
2799  return 0;
2800  }
2801 }
2802 
2804 {
2805  iof *I;
2808  iof_setup_file(I, file);
2809  stream_state_init(P.streamstate, offset, length);
2810  fseek(file, (long)offset, SEEK_SET); // or perhaps it should be call in file_stream_read(), like iof_file_sync()?
2811  return I;
2812 }
2813 
2815 {
2816  iof *I;
2818  if (!iof_file_reopen(iofile))
2819  return NULL;
2821  iof_setup_iofile(I, iofile);
2822  stream_state_init(P.streamstate, offset, length);
2823  return I;
2824 }
2825 
2826 static size_t file_stream_write (iof *O, size_t *plength, int flush)
2827 {
2828  size_t bytes;
2829  if ((bytes = iof_size(O)) > 0)
2830  {
2831  if (bytes != fwrite(O->buf, sizeof(uint8_t), bytes, O->file))
2832  {
2833  *plength += bytes;
2834  return 0;
2835  }
2836  }
2837  if (flush)
2838  fflush(O->file);
2839  *plength += bytes;
2840  O->end = O->buf + O->space; // remains intact
2841  O->pos = O->buf;
2842  return O->space;
2843 }
2844 
2845 static size_t iofile_stream_write (iof *O, size_t *plength, size_t *poffset, int flush)
2846 {
2847  size_t bytes;
2848  if ((bytes = iof_size(O)) > 0)
2849  {
2850  iof_file_sync(O->iofile, poffset);
2851  if (bytes != iof_file_write(O->buf, sizeof(uint8_t), bytes, O->iofile))
2852  {
2853  *plength += bytes;
2854  iof_file_unsync(O->iofile, poffset);
2855  return 0;
2856  }
2857  }
2858  if (flush)
2859  iof_file_flush(O->iofile);
2860  *plength += bytes;
2861  O->end = O->buf + O->space; // remains intact
2862  O->pos = O->buf;
2863  return O->space;
2864 }
2865 
2867 {
2870  switch (mode)
2871  {
2872  case IOFWRITE:
2873  return file_stream_write(O, &state->length, 0);
2874  case IOFFLUSH:
2875  return file_stream_write(O, &state->length, 1);
2876  case IOFCLOSE:
2877  file_stream_write(O, &state->length, 1);
2878  iof_free(O);
2879  return 0;
2880  default:
2881  return 0;
2882  }
2883 }
2884 
2886 {
2889  switch (mode)
2890  {
2891  case IOFWRITE:
2892  return iofile_stream_write(O, &state->length, &state->offset, 0);
2893  case IOFFLUSH:
2894  return iofile_stream_write(O, &state->length, &state->offset, 1);
2895  case IOFCLOSE:
2896  iofile_stream_write(O, &state->length, &state->offset, 1);
2897  iof_free(O);
2898  return 0;
2899  default:
2900  return 0;
2901  }
2902 }
2903 
2905 {
2906  iof *O;
2909  iof_setup_file(O, file);
2910  stream_state_init(P.streamstate, 0, 0);
2911  return O;
2912 }
2913 
2915 {
2916  iof *O;
2919  iof_setup_iofile(O, iofile);
2920  stream_state_init(P.streamstate, offset, 0);
2921  return O;
2922 }
2923 
2924 /* very specific for images; get input from already created strem filter, exchange the filter but keep the buffer */
2925 
2926 FILE * iof_filter_file_reader_source (iof *I, size_t *poffset, size_t *plength)
2927 {
2929  if (I->more == filter_file_stream_reader) // I is the result of iof_filter_stream_reader()
2930  {
2931  P.streamstate = iof_filter_state(stream_state *, I);
2932  *poffset = P.streamstate->offset;
2933  *plength = P.streamstate->length; // might be 0 but it is ok for file readers
2934  return I->file;
2935  }
2936  if (I->more == filter_file_reader)
2937  {
2938  P.filestate = iof_filter_state(file_state *, I);
2939  *poffset = P.filestate->offset;
2940  *plength = P.filestate->length; // might be 0 but it is ok for file readers
2941  return I->file;
2942  }
2943  return NULL;
2944 }
2945 
2946 iof_file * iof_filter_file_coreader_source (iof *I, size_t *poffset, size_t *plength)
2947 {
2949  if (I->more == filter_iofile_stream_reader) // I is the result of iof_filter_stream_coreader()
2950  {
2951  P.streamstate = iof_filter_state(stream_state *, I);
2952  *poffset = P.streamstate->offset;
2953  *plength = P.streamstate->length;
2954  return I->iofile;
2955  }
2956  if (I->more == filter_iofile_reader)
2957  {
2958  P.filestate = iof_filter_state(file_state *, I);
2959  *poffset = P.filestate->offset;
2960  *plength = P.filestate->length;
2961  return I->iofile;
2962  }
2963  return NULL;
2964 }
2965 
2966 iof * iof_filter_reader_replacement (iof *P, iof_handler handler, size_t statesize, void **pstate)
2967 { // called after iof_filter_file_reader_source(), no need to check if F is filter from iof heap and if has buffer from iof heap
2968  iof *F;
2969  F = iof_filter_reader_with_buffer(handler, statesize, pstate, P->buf, P->space);
2970  F->flags |= IOF_BUFFER_HEAP;
2971  //iof_setup_reader(P, NULL, 0);
2972  //P->flags &= ~IOF_BUFFER_HEAP;
2973  iof_filter_free(P);
2974  return F;
2975 }
2976 
2977 #ifdef _WIN32 /* --ak */
2978 #include <malloc.h>
2979 #include <sys/stat.h>
2980 #include <wchar.h>
2981 #include <windows.h>
2982 /*
2983  Get wide string from multibyte string. (by T. Tanaka)
2984 */
2985 static wchar_t *
2986 get_wstring_from_mbstring(int cp, const char *mbstr, wchar_t *wstr)
2987 {
2988  int len;
2989 
2990  len = MultiByteToWideChar(cp, 0, mbstr, -1, wstr, 0);
2991  if (len==0) {
2992  return NULL;
2993  }
2994  if (wstr==NULL) {
2995  wstr = malloc(sizeof(wchar_t)*(len+1));
2996  }
2997  len = MultiByteToWideChar(cp, 0, mbstr, -1, wstr, len+1);
2998  if (len==0) {
2999  return NULL;
3000  }
3001  return wstr;
3002 }
3003 
3004 FILE *ppu8open(const char *filename, const char *mode)
3005 {
3006  wchar_t *wfilename, *wmode;
3007  FILE *ret;
3008  int cp;
3009  unsigned char *fnn;
3010  unsigned char *p;
3011  size_t len = strlen(filename);
3012 
3013  fnn = malloc(len + 10);
3014  p = strstr(filename, ".\\");
3015  if (!p) {
3016  p = strstr(filename, "./");
3017  }
3018  if (!p && len > 2) {
3019  p = strstr(filename + 2, "//");
3020  }
3021  if (!p && len > 2) {
3022  p = strstr(filename + 2, "\\\\");
3023  }
3024  if (!p && len > 2) {
3025  p = strstr(filename + 2, "\\/");
3026  }
3027  if (!p && len > 2) {
3028  p = strstr(filename + 2, "/\\");
3029  }
3030  if (!p && len > 2 && ((filename[0] == '/' && filename[1] == '/') ||
3031  (filename[0] == '\\' && filename[1] == '\\' &&
3032  filename[2] != '?'))) {
3033  filename += 2;
3034  strcpy (fnn, "\\\\?\\UNC\\");
3035  strcat (fnn, filename);
3036  } else if (!p && len > 2 && filename[1] == ':') {
3037  strcpy (fnn, "\\\\?\\");
3038  strcat (fnn, filename);
3039  } else {
3040  strcpy (fnn, filename);
3041  }
3042  for (p = fnn; *p; p++) {
3043  if (*p == '/')
3044  *p = '\\';
3045  }
3046 
3047  cp = CP_UTF8;
3048  wfilename = get_wstring_from_mbstring(cp, fnn, wfilename=NULL);
3049  free(fnn);
3050  if (wfilename == NULL)
3051  return NULL;
3052  wmode = get_wstring_from_mbstring(cp, mode, wmode=NULL);
3053  if (wmode == NULL)
3054  return NULL;
3055  ret = _wfopen((const wchar_t *)wfilename, (const wchar_t *)wmode);
3056  free(wfilename);
3057  free(wmode);
3058  return ret;
3059 }
3060 #endif /* _WIN32 --ak */
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
cp
Definition: action.c:1035
#define state
Definition: aptex-macros.h:996
#define type(a)
Definition: aptex-macros.h:171
#define name
#define next(a)
Definition: aptex-macros.h:924
#define tail
Definition: aptex-macros.h:514
#define mode
Definition: aptex-macros.h:510
static int radix
Definition: aptex.h:450
#define free(a)
Definition: decNumber.cpp:310
#define dummy
Definition: devnag.c:313
int dummy
Definition: dummy.c:29
#define fopen
Definition: xxstdio.h:21
#define fread
Definition: xxstdio.h:25
#define fflush
Definition: xxstdio.h:24
#define fseek
Definition: xxstdio.h:30
#define fgetc
Definition: xxstdio.h:26
#define ftell
Definition: xxstdio.h:31
char * strcpy()
struct rect data
Definition: dvipdfm.c:64
mpz_t * f
Definition: gen-fib.c:34
#define s
Definition: afcover.h:80
static FIELD_PTR prev
Definition: genind.c:36
paragraph P
#define c(n)
Definition: gpos-common.c:150
#define memmove(d, s, n)
Definition: gsftopk.c:65
#define memcpy(d, s, n)
Definition: gsftopk.c:64
#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
#define F(x, y, z)
Definition: md5.c:51
#define I(x, y, z)
Definition: md5.c:55
#define SEEK_CUR
Definition: ftzconf.h:250
#define SEEK_END
Definition: ftzconf.h:251
unsigned short uint16_t
Definition: stdint.h:79
signed __int64 int64_t
Definition: stdint.h:89
unsigned int uint32_t
Definition: stdint.h:80
signed int int32_t
Definition: stdint.h:77
unsigned char uint8_t
Definition: stdint.h:78
unsigned __int64 uint64_t
Definition: stdint.h:90
static GBool preload
Definition: pdftops.cc:54
#define buf
char * strstr()
#define fclose
Definition: debug.h:100
wchar_t * get_wstring_from_mbstring(int cp, const char *mbstr, wchar_t *wstr)
Definition: knj.c:38
#define link
Definition: win32lib.h:82
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
#define length(c)
Definition: ctangleboot.c:65
Code related to b fwrite(a, sizeof(char), b, stdout) @d C_printf(c
#define malloc
Definition: alloca.c:91
char args[100]
Definition: fixwrites.c:7
#define vsnprintf
Definition: snprintf.c:40
const int * pos
Definition: combiners.h:905
#define size_t
Definition: glob.c:257
#define O(_t, _a, _f)
Definition: makeint.h:501
unsigned digits[12]
Definition: out_routines.c:255
static int format
Definition: pbmclean.c:15
#define min(a, b)
Definition: pbmplus.h:223
char * filename[256]
Definition: pbmtopk.c:46
static int items
Definition: pgmtofs.c:86
#define sign(x)
set set set set set set set set set set set set set set set set set set set set *set set set macro pixldst op &r &cond WK op &r &cond WK op &r &cond WK else op &m &cond &ia op &r &cond WK else op &m &cond &ia elseif elseif else error unsupported base if elseif elseif else error unsupported unaligned pixldst unaligned endm macro pixst base base else pixldst base endif endm macro PF ptr
real to[600]
Definition: pmxab.c:87
static int filter
Definition: pnmtopng.c:113
static int size
Definition: ppmlabel.c:24
static int offset
Definition: ppmtogif.c:642
bstring c int memset(void *s, int c, int length)
static long bytes
Definition: psutil.c:35
struct stream_state_s stream_state
Definition: pts_fax.h:100
#define status
size_t iof_result_to_file_handle(iof *F, FILE *file)
Definition: utiliof.c:1931
int iof_get_usize(iof *I, size_t *number)
Definition: utiliof.c:1353
iof * iof_setup_file_reader(iof *I, void *buffer, size_t space, const char *filename)
Definition: utiliof.c:850
size_t iof_reader_to_file_handle(iof *I, FILE *file)
Definition: utiliof.c:1898
iof iof_stdout
Definition: utiliof.c:954
void iof_debug(iof *I, const char *filename)
Definition: utiliof.c:1947
int iof_file_reopen_input(iof_file *iofile)
Definition: utiliof.c:262
size_t iof_encoder_retval(iof *O, const char *type, iof_status status)
Definition: utiliof.c:2343
iof * iof_filter_iofile_writer(iof_file *iofile, size_t offset)
Definition: utiliof.c:2592
int iof_get_ulong_radix(iof *I, unsigned long *number, int radix)
Definition: utiliof.c:1408
int iof_get_uint32_radix(iof *I, uint32_t *number, int radix)
Definition: utiliof.c:1400
int iof_reader_reseek(iof *I, long offset, int whence)
Definition: utiliof.c:641
size_t iof_put_int32(iof *O, int32_t number)
Definition: utiliof.c:1605
int iof_reseek(iof *F, long offset, int whence)
Definition: utiliof.c:745
iof_file * iof_file_rdata(const void *data, size_t size)
Definition: utiliof.c:115
iof * iof_filter_string_reader(const void *s, size_t length)
Definition: utiliof.c:2646
iof * iof_reader(iof *I, void *link, iof_handler reader, const void *m, size_t bytes)
Definition: utiliof.c:961
iof * iof_filter_buffer_writer(size_t size)
Definition: utiliof.c:2668
int iof_get_ulong(iof *I, unsigned long *number)
Definition: utiliof.c:1345
size_t iof_put_int32_radix(iof *O, int32_t number, int radix, int uc)
Definition: utiliof.c:1661
size_t iof_data_to_file(const void *data, size_t size, const char *filename)
Definition: utiliof.c:1920
int iof_seek(iof *F, long offset, int whence)
Definition: utiliof.c:740
void iof_filters_free(void)
Definition: utiliof.c:2037
size_t iof_write(iof *O, const void *data, size_t size)
Definition: utiliof.c:1197
int iof_get_int64_radix(iof *I, int64_t *number, int radix)
Definition: utiliof.c:1390
int iof_file_flush(iof_file *iofile)
Definition: utiliof.c:417
void iof_file_close_input(iof_file *iofile)
Definition: utiliof.c:316
long iof_writer_tell(iof *O)
Definition: utiliof.c:762
int iof_get_le_uint3(iof *I, uint32_t *pnumber)
Definition: utiliof.c:1783
iof * iof_filter_stream_cowriter(iof_file *iofile, size_t offset)
Definition: utiliof.c:2914
int iof_getc(iof *I)
Definition: utiliof.c:1058
iof * iof_buffer_create(size_t space)
Definition: utiliof.c:1045
int iof_get_usize_radix(iof *I, size_t *number, int radix)
Definition: utiliof.c:1416
size_t iof_skip(iof *I, size_t bytes)
Definition: utiliof.c:1075
size_t iof_file_write(const void *ptr, size_t size, size_t items, iof_file *iofile)
Definition: utiliof.c:462
void iof_filters_init(void)
Definition: utiliof.c:2029
size_t iof_write_iofile(iof *O, iof_file *iofile, int savepos)
Definition: utiliof.c:1177
int iof_get_be_uint2(iof *I, uint32_t *pnumber)
Definition: utiliof.c:1747
size_t iof_write_file_handle(iof *O, FILE *file)
Definition: utiliof.c:1151
int iof_conv_float(iof *I, float *number)
Definition: utiliof.c:1587
iof * iof_filter_stream_coreader(iof_file *iofile, size_t offset, size_t length)
Definition: utiliof.c:2814
size_t iof_put_usize_radix(iof *O, size_t number, int radix, int uc)
Definition: utiliof.c:1701
iof * iof_writer(iof *O, void *link, iof_handler writer, void *m, size_t bytes)
Definition: utiliof.c:991
size_t iof_result_to_file(iof *F, const char *filename)
Definition: utiliof.c:1939
iof * iof_filter_file_handle_reader(FILE *file)
Definition: utiliof.c:2554
iof * iof_setup_file_handle_reader(iof *I, void *buffer, size_t space, FILE *f)
Definition: utiliof.c:842
iof * iof_filter_reader_with_buffer_new(iof_handler handler, size_t statesize, void **pstate, void *buffer, size_t buffersize)
Definition: utiliof.c:2160
iof * iof_string_reader(iof *I, const void *s, size_t bytes)
Definition: utiliof.c:977
iof_file * iof_file_wdata(void *data, size_t size)
Definition: utiliof.c:140
size_t iof_repc(iof *O, char c, size_t bytes)
Definition: utiliof.c:1262
int iof_get_le_uint4(iof *I, uint32_t *pnumber)
Definition: utiliof.c:1792
size_t iof_put_uint32_radix(iof *O, uint32_t number, int radix, int uc)
Definition: utiliof.c:1685
int iof_get_le_uint2(iof *I, uint32_t *pnumber)
Definition: utiliof.c:1774
iof * iof_filter_file_writer(const char *filename)
Definition: utiliof.c:2618
size_t iof_put_float(iof *O, float number, int digits)
Definition: utiliof.c:1737
size_t iof_put_uint32(iof *O, uint32_t number)
Definition: utiliof.c:1629
long iof_reader_tell(iof *I)
Definition: utiliof.c:752
iof * iof_filter_reader_new(iof_handler handler, size_t statesize, void **pstate)
Definition: utiliof.c:2141
int iof_get_float(iof *I, float *number)
Definition: utiliof.c:1549
int iof_get_double(iof *I, double *number)
Definition: utiliof.c:1527
void iof_file_free(iof_file *iofile)
Definition: utiliof.c:280
FILE * iof_filter_file_reader_source(iof *I, size_t *poffset, size_t *plength)
Definition: utiliof.c:2926
iof * iof_filter_file_handle_writer(FILE *file)
Definition: utiliof.c:2566
size_t iof_put_slong(iof *O, long number)
Definition: utiliof.c:1613
int iof_file_eof(iof_file *iofile)
Definition: utiliof.c:410
iof_file * iof_file_rdata_init(iof_file *iofile, const void *data, size_t size)
Definition: utiliof.c:128
int iof_get_slong_radix(iof *I, long *number, int radix)
Definition: utiliof.c:1380
size_t iof_decoder_retval(iof *I, const char *type, iof_status status)
Definition: utiliof.c:2322
iof_file * iof_file_reader_from_file_handle(iof_file *iofile, const char *filename, FILE *file, int preload, int closefile)
Definition: utiliof.c:152
size_t iof_fsize(iof *I)
Definition: utiliof.c:777
iof * iof_filter_writer_with_buffer_new(iof_handler handler, size_t statesize, void **pstate, void *buffer, size_t buffersize)
Definition: utiliof.c:2194
FILE * iof_get_file(iof *F)
Definition: utiliof.c:61
void iof_file_set_name(iof_file *iofile, const char *name)
Definition: utiliof.c:344
uint8_t * iof_reader_data(iof *I, size_t *psize)
Definition: utiliof.c:1859
int iof_get_roman(iof *I, uint16_t *number)
Definition: utiliof.c:1451
size_t iof_put_double(iof *O, double number, int digits)
Definition: utiliof.c:1729
int iof_file_reclose_input(iof_file *iofile)
Definition: utiliof.c:248
size_t iof_reader_to_file(iof *I, const char *filename)
Definition: utiliof.c:1906
size_t iof_resize_buffer_to(iof *O, size_t space)
Definition: utiliof.c:2293
size_t iof_read(iof *I, void *to, size_t size)
Definition: utiliof.c:1122
iof * iof_setup_buffer(iof *O, void *buffer, size_t space)
Definition: utiliof.c:1024
iof_file * iof_file_reader_from_file(iof_file *iofile, const char *filename, int preload)
Definition: utiliof.c:187
iof * iof_filter_string_writer(const void *s, size_t length)
Definition: utiliof.c:2657
int iof_get_uint64(iof *I, uint64_t *number)
Definition: utiliof.c:1361
void * iof_copy_data(const void *data, size_t size)
Definition: utiliof.c:18
size_t iof_write_file(iof *O, const char *filename)
Definition: utiliof.c:1166
int iof_get_uint32(iof *I, uint32_t *number)
Definition: utiliof.c:1337
int iof_file_getc(iof_file *iofile)
Definition: utiliof.c:502
size_t iof_save_tail(iof *I)
Definition: utiliof.c:796
int iof_get_slong(iof *I, long *number)
Definition: utiliof.c:1317
iof * iof_setup_file_writer(iof *O, void *buffer, size_t space, const char *filename)
Definition: utiliof.c:891
long iof_file_tell(iof_file *iofile)
Definition: utiliof.c:391
size_t iof_put_uint64_radix(iof *O, uint64_t number, int radix, int uc)
Definition: utiliof.c:1709
uint8_t * iof_copy_file_handle_data(FILE *file, size_t *psize)
Definition: utiliof.c:43
iof * iof_filter_stream_writer(FILE *file)
Definition: utiliof.c:2904
iof_file * iof_file_wdata_init(iof_file *iofile, void *data, size_t size)
Definition: utiliof.c:145
size_t iof_putfs(iof *O, const char *format,...)
Definition: utiliof.c:1288
size_t iof_file_read(void *ptr, size_t size, size_t items, iof_file *iofile)
Definition: utiliof.c:424
size_t iof_put_string(iof *O, const void *data)
Definition: utiliof.c:1238
void iof_discard(iof *F)
Definition: utiliof.c:2276
int iof_reader_seek(iof *I, long offset, int whence)
Definition: utiliof.c:629
size_t iof_file_size(iof_file *iofile)
Definition: utiliof.c:396
iof * iof_filter_iofile_reader(iof_file *iofile, size_t offset)
Definition: utiliof.c:2580
size_t iof_put_ulong(iof *O, unsigned long number)
Definition: utiliof.c:1637
size_t iof_put_usize(iof *O, size_t number)
Definition: utiliof.c:1645
int iof_get_be_uint3(iof *I, uint32_t *pnumber)
Definition: utiliof.c:1756
long iof_tell(iof *I)
Definition: utiliof.c:772
size_t iof_put_int64_radix(iof *O, int64_t number, int radix, int uc)
Definition: utiliof.c:1677
iof_status iof_puts(iof *O, const void *data)
Definition: utiliof.c:1225
size_t iof_put_uint64(iof *O, uint64_t number)
Definition: utiliof.c:1653
int iof_writer_seek(iof *I, long offset, int whence)
Definition: utiliof.c:716
uint8_t * iof_file_input_data(iof_file *iofile, size_t *psize, int *isnew)
Definition: utiliof.c:1803
int iof_get_uint64_radix(iof *I, uint64_t *number, int radix)
Definition: utiliof.c:1424
int iof_writer_reseek(iof *I, long offset, int whence)
Definition: utiliof.c:728
uint8_t * iof_copy_file_data(const char *filename, size_t *psize)
Definition: utiliof.c:23
void iof_free(iof *F)
Definition: utiliof.c:2261
int iof_file_putc(iof_file *iofile, int c)
Definition: utiliof.c:509
iof * iof_setup_file_handle_writer(iof *O, void *buffer, size_t space, FILE *f)
Definition: utiliof.c:883
size_t iof_put_roman(iof *O, uint16_t number, int uc)
Definition: utiliof.c:1719
int iof_file_seek(iof_file *iofile, long offset, int whence)
Definition: utiliof.c:356
iof_status iof_pass(iof *I, iof *O)
Definition: utiliof.c:1090
size_t iof_put_int64(iof *O, int64_t number)
Definition: utiliof.c:1621
size_t iof_put_slong_radix(iof *O, long number, int radix, int uc)
Definition: utiliof.c:1669
iof * iof_filter_writer_new(iof_handler handler, size_t statesize, void **pstate)
Definition: utiliof.c:2175
int iof_conv_double(iof *I, double *number)
Definition: utiliof.c:1571
iof * iof_filter_reader_replacement(iof *P, iof_handler handler, size_t statesize, void **pstate)
Definition: utiliof.c:2966
int iof_putc(iof *O, int u)
Definition: utiliof.c:1065
size_t iof_input_save_tail(iof *I, size_t back)
Definition: utiliof.c:808
iof_file * iof_file_init(iof_file *iofile, FILE *file)
Definition: utiliof.c:104
int iof_get_int32_radix(iof *I, int32_t *number, int radix)
Definition: utiliof.c:1369
iof_file * iof_file_reader_from_data(iof_file *iofile, const void *data, size_t size, int preload, int freedata)
Definition: utiliof.c:195
iof * iof_setup_buffermin(iof *O, void *buffer, size_t space, size_t min)
Definition: utiliof.c:1033
size_t iof_file_ensure(iof_file *iofile, size_t bytes)
Definition: utiliof.c:484
const char * iof_status_kind(iof_status status)
Definition: utiliof.c:70
iof_file * iof_filter_file_coreader_source(iof *I, size_t *poffset, size_t *plength)
Definition: utiliof.c:2946
int iof_get_be_uint4(iof *I, uint32_t *pnumber)
Definition: utiliof.c:1765
uint8_t * iof_writer_data(iof *O, size_t *psize)
Definition: utiliof.c:1879
int iof_get_int32(iof *I, int32_t *number)
Definition: utiliof.c:1307
int iof_get_int64(iof *I, int64_t *number)
Definition: utiliof.c:1327
iof * iof_filter_stream_reader(FILE *file, size_t offset, size_t length)
Definition: utiliof.c:2803
iof_file * iof_file_new(FILE *file)
Definition: utiliof.c:92
iof * iof_filter_file_reader(const char *filename)
Definition: utiliof.c:2604
iof iof_stderr
Definition: utiliof.c:957
size_t iof_put_ulong_radix(iof *O, unsigned long number, int radix, int uc)
Definition: utiliof.c:1693
#define iof_setup_file(I, fh)
Definition: utiliof.h:292
#define iof_char(I)
Definition: utiliof.h:389
#define iof_file_reclose(iofile)
Definition: utiliof.h:272
#define iof_setup_reader(I, buffer, size)
Definition: utiliof.h:157
#define iof_file_decref(iofile)
Definition: utiliof.h:253
#define IOF_HEAP
Definition: utiliof.h:92
#define IOF_TAIL
Definition: utiliof.h:99
#define iof_setup_iofile(I, f)
Definition: utiliof.h:291
#define iof_read_radix(I, c, number, radix)
Definition: utiliof.h:484
#define iof_filter_state(statetype, F)
Definition: utiliof.h:635
#define iof_filter_reader(handler, statesize, pstate)
Definition: utiliof.h:627
#define IOF_ALLOC
Definition: utiliof.h:91
iof_status
Definition: utiliof.h:25
@ IOFEOF
Definition: utiliof.h:26
@ IOFFULL
Definition: utiliof.h:28
@ IOFERR
Definition: utiliof.h:29
@ IOFEMPTY
Definition: utiliof.h:27
#define IOF_WRITER
Definition: utiliof.h:101
#define iof_readable(I)
Definition: utiliof.h:338
#define IOF_RECLOSE_FILE
Definition: utiliof.h:109
#define iof_file_get_fh(iofile)
Definition: utiliof.h:221
#define iof_result(I, size)
Definition: utiliof.h:601
#define iof_scan_exponent10(I, c, exponent10)
Definition: utiliof.h:488
#define iof_writable(O)
Definition: utiliof.h:339
#define iof_input(I)
Definition: utiliof.h:172
#define IOF_CLOSE_FILE
Definition: utiliof.h:107
#define iof_file_get_file(iofile)
Definition: utiliof.h:223
#define iof_set(O, c)
Definition: utiliof.h:453
#define IOF_FILE_HANDLE
Definition: utiliof.h:104
#define iof_output(O)
Definition: utiliof.h:175
#define IOF_DATA
Definition: utiliof.h:103
#define IOF_REOPEN_FILE
Definition: utiliof.h:108
#define IOF_BUFFER_ALLOC
Definition: utiliof.h:93
#define iof_space(I)
Definition: utiliof.h:168
#define iof_read_integer(I, c, number)
Definition: utiliof.h:483
#define iof_data_to_file_handle(data, size, file)
Definition: utiliof.h:614
#define iof_left(I)
Definition: utiliof.h:169
iof_mode
Definition: utiliof.h:15
@ IOFCLOSE
Definition: utiliof.h:20
@ IOFREAD
Definition: utiliof.h:16
@ IOFLOAD
Definition: utiliof.h:17
@ IOFFLUSH
Definition: utiliof.h:19
@ IOFWRITE
Definition: utiliof.h:18
#define iof_size(I)
Definition: utiliof.h:170
#define iof_scan_fraction(I, c, number, exponent10)
Definition: utiliof.h:487
#define IOF_NEXT
Definition: utiliof.h:106
#define iof_filter_writer_with_buffer(handler, statesize, pstate, buffer, buffersize)
Definition: utiliof.h:633
#define iof_file_reopen(iofile)
Definition: utiliof.h:271
#define iof_file_set_fh(iofile, fh)
Definition: utiliof.h:222
#define IOF_STOPPED
Definition: utiliof.h:111
#define iof_filter_writer(handler, statesize, pstate)
Definition: utiliof.h:631
#define IOF_FILE
Definition: utiliof.h:105
#define iof_resize_buffer(O)
Definition: utiliof.h:641
#define iof_next(I)
Definition: utiliof.h:393
#define iof_string(I, s, bytes)
Definition: utiliof.h:327
#define iof_scan_decimal(I, c, number)
Definition: utiliof.h:486
#define iof_close(O)
Definition: utiliof.h:179
size_t(* iof_handler)(iof *I, iof_mode mode)
Definition: utiliof.h:54
#define IOF_WRITER_INIT(handler, file, buffer, size, flags)
Definition: utiliof.h:141
#define iof_setup_writer(O, buffer, size)
Definition: utiliof.h:161
#define iof_filter_reader_with_buffer(handler, statesize, pstate, buffer, buffersize)
Definition: utiliof.h:629
#define iof_get(I)
Definition: utiliof.h:385
#define IOF_BUFFER_HEAP
Definition: utiliof.h:94
#define iof_scan_sign(I, c, sign)
Definition: utiliof.h:480
#define iof_tail(I)
Definition: utiliof.h:197
#define iof_loaded(I)
Definition: utiliof.h:612
void loggerf(const char *format,...)
Definition: utillog.c:20
void * util_malloc(size_t size)
Definition: utilmem.c:15
void * util_realloc(void *m, size_t size)
Definition: utilmem.c:31
#define util_free
Definition: utilmem.h:14
#define double_negative_exp10(number, exponent)
Definition: utilnumber.h:409
#define uint32_to_radix(number, radix, uc, psize)
Definition: utilnumber.h:171
#define usize_to_string(number, psize)
Definition: utilnumber.h:155
#define int64_to_string(number, psize)
Definition: utilnumber.h:146
#define uint64_to_string(number, psize)
Definition: utilnumber.h:156
#define double_exp10(number, exponent)
Definition: utilnumber.h:415
#define uint16_to_roman(number, uc, psize)
Definition: utilnumber.h:248
#define usize_to_radix(number, radix, uc, psize)
Definition: utilnumber.h:173
#define float_negative_exp10(number, exponent)
Definition: utilnumber.h:412
#define slong_to_string(number, psize)
Definition: utilnumber.h:145
#define int64_to_radix(number, radix, uc, psize)
Definition: utilnumber.h:164
#define int32_to_radix(number, radix, uc, psize)
Definition: utilnumber.h:162
#define ulong_to_string(number, psize)
Definition: utilnumber.h:154
#define double_to_string(number, digits, psize)
Definition: utilnumber.h:253
#define uint32_to_string(number, psize)
Definition: utilnumber.h:153
#define float_exp10(number, exponent)
Definition: utilnumber.h:416
#define uint64_to_radix(number, radix, uc, psize)
Definition: utilnumber.h:174
#define base10_digit(c)
Definition: utilnumber.h:96
#define float_to_string(number, digits, psize)
Definition: utilnumber.h:256
#define int32_to_string(number, psize)
Definition: utilnumber.h:144
#define slong_to_radix(number, radix, uc, psize)
Definition: utilnumber.h:163
#define ulong_to_radix(number, radix, uc, psize)
Definition: utilnumber.h:172
#define FALLTHRU
Definition: utilplat.h:28
static int writer(lua_State *L, const void *b, size_t size, void *B)
Definition: lstrlib.c:182
static const char * reader(lua_State *L, void *ud, size_t *size)
Definition: luac.c:122
static size_t iofile_stream_read(iof *I, size_t *plength, size_t *poffset)
Definition: utiliof.c:2707
static size_t file_stream_read(iof *I, size_t *plength)
Definition: utiliof.c:2685
#define roman500(c)
Definition: utiliof.c:1437
#define roman1(c)
Definition: utiliof.c:1442
static int iof_file_sync(iof_file *iofile, size_t *offset)
Definition: utiliof.c:522
#define IOF_FILTER_HEAP_SIZE
Definition: utiliof.c:2013
static iof_heap * iof_buffers_heap
Definition: utiliof.c:2005
static iof_heap * iof_heap_new(size_t space)
Definition: utiliof.c:2015
static size_t stderr_writer(iof *O, iof_mode mode)
Definition: utiliof.c:929
static void * iof_heap_take(iof_heap **pheap, size_t size)
Definition: utiliof.c:2065
static size_t file_writer(iof *O, iof_mode mode)
Definition: utiliof.c:866
static int iof_writer_seek_file(iof *O, long offset, int whence)
Definition: utiliof.c:690
#define IOF_BUFFER_SIZE
Definition: utiliof.c:2009
#define iof_filter_buffer_free(data)
Definition: utiliof.c:2212
static size_t filter_iofile_writer(iof *O, iof_mode mode)
Definition: utiliof.c:2533
#define roman100s(I, c)
Definition: utiliof.c:1444
#define iof_reader_reseek_file(I, offset, whence)
Definition: utiliof.c:541
static iof_heap * iof_filters_heap
Definition: utiliof.c:2006
#define iof_heap_free(iofheap)
Definition: utiliof.c:2027
#define iof_close_buffer(F)
Definition: utiliof.c:2220
#define file_state_init(state, off, len)
Definition: utiliof.c:2369
#define roman1s(I, c)
Definition: utiliof.c:1448
static size_t iofile_write(iof *O, size_t *poffset, int flush)
Definition: utiliof.c:2497
static size_t filter_file_stream_reader(iof *I, iof_mode mode)
Definition: utiliof.c:2767
static size_t filter_file_stream_writer(iof *O, iof_mode mode)
Definition: utiliof.c:2866
static size_t iof_file_data_resizeto(iof_file *iofile, size_t space)
Definition: utiliof.c:438
#define IOF_BUFFER_HEAP_SIZE
Definition: utiliof.c:2012
static void iof_close_iofile(iof *F)
Definition: utiliof.c:2246
#define roman50(c)
Definition: utiliof.c:1439
static size_t file_stream_write(iof *O, size_t *plength, int flush)
Definition: utiliof.c:2826
static size_t file_reader(iof *I, iof_mode mode)
Definition: utiliof.c:826
static int iof_writer_seek_iofile(iof *O, long offset, int whence)
Definition: utiliof.c:664
#define iof_filter_free(F)
Definition: utiliof.c:2211
static size_t file_write(iof *O, int flush)
Definition: utiliof.c:2484
static size_t dummy_handler(iof *I, iof_mode mode)
Definition: utiliof.c:2634
static size_t stdout_writer(iof *O, iof_mode mode)
Definition: utiliof.c:905
static int iof_reader_seek_file(iof *I, long offset, int whence)
Definition: utiliof.c:603
static size_t iofile_stream_write(iof *O, size_t *plength, size_t *poffset, int flush)
Definition: utiliof.c:2845
#define iof_heap_get(hp, ghost, data, siz)
Definition: utiliof.c:2062
static void iof_heap_back(void *data)
Definition: utiliof.c:2102
static uint8_t iof_stdout_buffer[BUFSIZ]
Definition: utiliof.c:953
#define iof_reader_reseek_iofile(I, offset, whence)
Definition: utiliof.c:542
#define roman10s(I, c)
Definition: utiliof.c:1446
#define iof_file_unsync(iofile, poffset)
Definition: utiliof.c:536
static int iof_reader_seek_iofile(iof *I, long offset, int whence)
Definition: utiliof.c:577
#define roman5(c)
Definition: utiliof.c:1441
#define iof_writer_reseek_iofile(O, offset, whence)
Definition: