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)  

encoder.cpp
Go to the documentation of this file.
1 /* encoder.cpp -- various PostScript and PDF encoding filter implementations
2  * by pts@fazekas.hu at Sun Mar 3 14:16:00 CET 2002
3  * --- Mon Mar 4 00:00:20 CET 2002
4  */
5 
6 /* Imp: make built-in FlateEncode DYNALLOC */
7 /* Imp: add lzw_codec */
8 /* Imp: add gzip */
9 /* Imp: add zlib */
10 
11 #ifdef __GNUC__
12 #ifndef __clang__
13 #pragma implementation
14 #endif
15 #endif
16 
17 
18 #include "encoder.hpp"
19 #include "error.hpp"
20 #include "gensio.hpp"
21 #include <stdlib.h> /* getenv() */
22 #include <string.h>
23 
24 /* --- */
25 
26 /** Does output EOD (end-of-data) marker `>' */
27 class ASCIIHexEncode: public PSEncoder {
28  public:
29  /** @param maxcpl_: maximum # hex digits per line, should be even */
30  ASCIIHexEncode(GenBuffer::Writable &out_, unsigned maxcpl_);
31  virtual void vi_write(char const*buf, slen_t len);
32  protected:
33  unsigned maxcpl;
34  /** Number of hex digits already printed. */
35  unsigned curcpl;
37 };
38 
39 /** Does output EOD (end-of-data) marker `~>' */
40 class ASCII85Encode: public PSEncoder {
41  public:
42  /** @param maxcpl_: maximum # hex digits per line, should be even */
43  ASCII85Encode(GenBuffer::Writable &out_, unsigned maxcpl_);
44  virtual void vi_write(char const*buf, slen_t len);
45 
46  protected:
47  void wencoded(char const *encoded);
48  void wout(unsigned PTS_INT32_T buf_);
49  unsigned maxcpl;
50  /** Number of digits available in this line */
52  unsigned ascii85breaklen;
53  unsigned ascii85left;
55  char *obuf, *obufend, *op;
56  char dscst; /* For converting `%%' to `% %' to avoid DSC parser errors */
57 };
58 
59 /** Doesn't output EOD (end-of-data) marker `>' */
60 class RunLengthEncode: public PSEncoder {
61  public:
62  /** @param maxcpl_: maximum # hex digits per line, should be even */
63  RunLengthEncode(GenBuffer::Writable &out_, slen_t RecordSize_);
64  virtual void vi_write(char const*buf, slen_t len);
65 
66  protected:
69  // char *obuf, *obufend, *op;
71  unsigned saved_c, saved_rep;
72  /** size == header+buffer+EOD */
73  char saved[130];
74 };
75 
76 static int gen_write(char *block, unsigned len, void *zfile);
77 
78 #if USE_BUILTIN_ZIP
79 #include "pts_defl.h" /* Imp: because pts_defl_interface :-( */
80 #if OBJDEP
81 # warning REQUIRES: pts_defl
82 #endif
83 class FlateEncode: public PSEncoder {
84 #if PTS_DEFL_RIPPED_ZLIB /* Dat: defined in pts_defl.h */
85  public:
86  /** @param level: 1..9: 9==highest compression */
87  FlateEncode(GenBuffer::Writable &out_, unsigned level_);
88  virtual ~FlateEncode() { zlib_deflateEnd(&zs); } /* Dat: ==Z_OK check (for unflushed buffers) omitted */
89  virtual void vi_write(char const*buf, slen_t len);
90  protected:
91  /** Formerly only one instance of FlateEncode was allowed.
92  * It exists <=> loced==true
93  */
94  // static bool locked;
95  /** Writable that this filter writes to */
97  char workspace[ZLIB_DEFLATE_WORKSPACESIZE_MIN]; /* big, about 270k */
98  char obuf[4096];
99  /*struct*/ z_stream zs;
100 #else /* old, ripped from Info-ZIP 2.2 */
101  public:
102  /** @param level: 1..9: 9==highest compression */
103  FlateEncode(GenBuffer::Writable &out_, unsigned level_);
104  virtual ~FlateEncode() { if (fs!=NULLP) fs->delete2(fs); }
105  virtual void vi_write(char const*buf, slen_t len);
106  static void *gen_malloc(unsigned n);
107  static void gen_free(void *p);
108  protected:
109  /** Formerly only one instance of FlateEncode was allowed.
110  * It exists <=> loced==true
111  */
112  // static bool locked;
113  /** Writable that this filter writes to */
115  #if SIZEOF_INT>2
116  typedef unsigned s_t;
117  #else
118  typedef unsigned short s_t;
119  #endif
120  /** Adler32 checksum */
121  s_t s1, s2;
122  bool had_header;
123  struct pts_defl_interface* fs;
124 #endif /* else PTS_DEFL_RIPPED_ZLIB */
125 };
126 #endif
127 
128 /** Just store the data in Flate (ZLIB) format, no real compression. Adds
129  * about 3 bytes of overhead per 65535 bytes (compression ratio:
130  * 100.004578%)
131  */
133  public:
134  /** @param level: 1..9: 9==highest compression */
136  inline virtual ~FlateStoreEncode() {}
137  virtual void vi_write(char const*buf, slen_t len);
138  protected:
140  #if SIZEOF_INT>2
141  typedef unsigned s_t;
142  #else
143  typedef unsigned short s_t;
144  #endif
145  /** Adler32 checksum */
148  /** Number of bytes already in buf */
149  unsigned abuflen;
150  /** Max: 65535 */
151  #if HAVE_STATIC_CONST
152  static const unsigned ABUFSIZE=65535;
153  #else
154  #define ABUFSIZE 65535
155  #endif
156  /** Should really not allocate a FlateStoreEncode on the stack. */
157  char abuf[ABUFSIZE+5];
158 };
159 
160 #if USE_BUILTIN_FAXE
161 
162 #include "pts_fax.h"
163 #if OBJDEP
164 # warning REQUIRES: pts_faxe
165 #endif
166 class CCITTFaxEncode: public PSEncoder {
167  public:
168  CCITTFaxEncode(GenBuffer::Writable &out_, slendiff_t K, slen_t Columns, bool EndOfLine, bool BlackIs1);
169  virtual void vi_write(char const*buf, slen_t len);
170  protected:
173  unsigned char rbuf[4096];
174  unsigned char wbuf[4096];
177  unsigned char *hard, *rlimit;
178 
179  static void*gen_xalloc(unsigned n);
180  static void gen_free(void *ptr);
181  static void gen_memset(void *s, int c, unsigned n);
182  static void gen_memcpy(void *dest, const void *src, unsigned n);
183 };
184 #endif
185 
186 #if USE_BUILTIN_LZW
187 #include "pts_lzw.h" /* Imp: because pts_lzw_state :-( */
188 #if OBJDEP
189 # warning REQUIRES: pts_lzw
190 #endif
191 class LZWEncode: public PSEncoder {
192  public:
194  virtual void vi_write(char const*buf, slen_t len);
195  protected:
197  struct pts_lzw_state fs;
198 };
199 #endif
200 
201 /**
202  * Reporting of GS errors is somewhat dump: the actual message isn't reported,
203  * only the fact that something went wrong.
204  * Imp: force a no-error trailer output by gs, and check that
205  */
206 class GSEncode: public PSEncoder {
207  public:
208  /** @param filter_psname is a full-featured PostScript *Encode filter
209  * specification string, for example: "<</Effort 5>>/FlateEncode" or
210  * "0/RunLengthEncode" or "72 pop/ASCIIHexEncode"; will be surrounded as
211  * `currentfile ... filter'
212  */
213  GSEncode(GenBuffer::Writable &out_, char const*filter_psname);
214  inline virtual ~GSEncode() {}
215  /* vvv Imp: correct these */
216  virtual void vi_write(char const*buf, slen_t len);
217  protected:
218  class P: public Filter::PipeE {
219  protected: virtual void vi_check();
220  public: P(GenBuffer::Writable &out_, char const*filter_psname);
221  };
222  /** We need this delegator because `delete ...' won't work with multiple
223  * inheritance. (?? )
224  */
225  P p;
226 };
227 
228 class CjpegEncode: public PSEncoder {
229  public:
230  /** @param filter_psname is a full-featured PostScript *Encode filter
231  * specification string, for example: "<</Effort 5>>/FlateEncode" or
232  * "0/RunLengthEncode" or "72 pop/ASCIIHexEncode"; will be surrounded as
233  * `currentfile ... filter'
234  */
235  CjpegEncode(GenBuffer::Writable &out_, char const*filter_psname, slen_t Columns, slen_t Rows, bool rgbp_, unsigned char quality);
236  inline virtual ~CjpegEncode() {}
237  virtual void vi_write(char const*buf, slen_t len);
238  protected:
239  class P: public Filter::PipeE { public:
240  // protected: virtual void vi_check();
241  P(GenBuffer::Writable &out_, slen_t Columns, slen_t Rows, bool rgbp_, unsigned char quality);
242  protected: /* Not needed: protected -> public: pacify VC6.0 */
243  virtual void vi_copy(FILE *f);
244  bool rgbp;
245  };
246  /** We need this delegator because `delete ...' won't work with multiple
247  * inheritance. (?? )
248  */
249  P p;
250 };
251 
252 #if !USE_BUILTIN_LZW
253 class Lzw_codecEncode: public PSEncoder {
254  public:
255  /** @param filter_psname is a full-featured PostScript *Encode filter
256  * specification string, for example: "<</Effort 5>>/FlateEncode" or
257  * "0/RunLengthEncode" or "72 pop/ASCIIHexEncode"; will be surrounded as
258  * `currentfile ... filter'
259  */
260  Lzw_codecEncode(GenBuffer::Writable &out_, char const*filter_psname);
261  inline virtual ~~Lzw_codecEncode() {}
262  virtual void vi_write(char const*buf, slen_t len);
263  protected:
264  class P: public Filter::PipeE { public:
265  // protected: virtual void vi_check();
266  P(GenBuffer::Writable &out_);
267  protected:
268  // virtual void vi_copy(FILE *f);
269  };
270  /** We need this delegator because `delete ...' won't work with multiple
271  * inheritance. (?? )
272  */
273  P p;
274 };
275 #endif
276 
277 class TIFFPredictor2: public Encoder {
278  public:
279  /** @param maxcpl_: maximum # hex digits per line, should be even */
280  TIFFPredictor2(GenBuffer::Writable &out_, unsigned char bpc_, slen_t columns_, unsigned char cpp_);
281  virtual void vi_write(char const*buf, slen_t len);
282  protected:
283  unsigned PTS_INT32_T h;
284  unsigned char *obuf, *op, bpc, cpp;
287 };
288 
289 class PNGPredictorNone: public Encoder {
290  public:
291  /** @param maxcpl_: maximum # hex digits per line, should be even */
292  PNGPredictorNone(GenBuffer::Writable &out_, unsigned char bpc_, slen_t columns_, unsigned char cpp_);
293  virtual void vi_write(char const*buf, slen_t len);
294  protected:
297 };
298 
299 class PNGPredictorSub: public Encoder {
300  public:
301  /** @param maxcpl_: maximum # hex digits per line, should be even */
302  PNGPredictorSub(GenBuffer::Writable &out_, unsigned char bpc_, slen_t columns_, unsigned char cpp_);
303  virtual void vi_write(char const*buf, slen_t len);
304  protected:
305  unsigned PTS_INT32_T h;
306  unsigned char *obuf, *op;
309  unsigned char bpccpp;
310 };
311 
312 class PNGPredictorUp: public Encoder {
313  public:
314  /** @param maxcpl_: maximum # hex digits per line, should be even */
315  PNGPredictorUp(GenBuffer::Writable &out_, unsigned char bpc_, slen_t columns_, unsigned char cpp_);
316  virtual void vi_write(char const*buf, slen_t len);
317  protected:
318  unsigned char *obuf, *op, *oq;
321 };
322 
324  public:
325  /** @param maxcpl_: maximum # hex digits per line, should be even */
326  PNGPredictorAverage(GenBuffer::Writable &out_, unsigned char bpc_, slen_t columns_, unsigned char cpp_);
327  virtual void vi_write(char const*buf, slen_t len);
328  protected:
329  unsigned PTS_INT32_T h/*, g*/;
330  unsigned char *obuf, *op, *oq;
333  unsigned char bpccpp;
334 };
335 
336 class PNGPredictorPaeth: public Encoder {
337  public:
338  /** @param maxcpl_: maximum # hex digits per line, should be even */
339  PNGPredictorPaeth(GenBuffer::Writable &out_, unsigned char bpc_, slen_t columns_, unsigned char cpp_);
340  virtual void vi_write(char const*buf, slen_t len);
341  protected:
342  unsigned PTS_INT32_T h, g;
343  unsigned char *obuf, *op, *oq;
346  unsigned char bpccpp;
347 };
348 
349 /** This class implements inferior predictor autoselection heuristics.
350  * Please use PNGPredictorAuto instead.
351  * Imp: code reuse with PNGPredictorAuto
352  */
354  public:
355  /** @param maxcpl_: maximum # hex digits per line, should be even */
356  PNGPredictorAutoBadSigned(GenBuffer::Writable &out_, unsigned char bpc_, slen_t columns_, unsigned char cpp_);
357  virtual void vi_write(char const*buf, slen_t len);
358  protected:
359  unsigned PTS_INT32_T h, g;
360  unsigned char *obuf, *o_prior, *o_0, *o_1, *o_2, *o_3, *o_4, *oo[5];
363  unsigned char bpccpp;
365 };
366 
367 /** This class implements inferior predictor autoselection heuristics.
368  * Please use PNGPredictorAuto instead.
369  * Imp: code reuse with PNGPredictorAuto
370  */
372  public:
373  /** @param maxcpl_: maximum # hex digits per line, should be even */
374  PNGPredictorAutoBadUnsigned(GenBuffer::Writable &out_, unsigned char bpc_, slen_t columns_, unsigned char cpp_);
375  virtual void vi_write(char const*buf, slen_t len);
376  protected:
377  unsigned PTS_INT32_T h, g;
378  unsigned char *obuf, *o_prior, *o_0, *o_1, *o_2, *o_3, *o_4, *oo[5];
381  unsigned char bpccpp;
383 };
384 
385 /** This class implements to so-called ``minimum sum of absolute differences''
386  * predictior autoselection heuristics, the same as what pngwutil.c
387  * contains in function png_write_find_filter() in libpng 1.2.20. (See that
388  * function for a discussion of other heuristics. A summary of this heuristics:
389  * we find which method provides the smallest value when summing the absolute
390  * values of the distances from zero, using anything >= 128 as negative
391  * numbers.
392  */
393 class PNGPredictorAuto: public Encoder {
394  public:
395  /** @param maxcpl_: maximum # hex digits per line, should be even */
396  PNGPredictorAuto(GenBuffer::Writable &out_, unsigned char bpc_, slen_t columns_, unsigned char cpp_);
397  virtual void vi_write(char const*buf, slen_t len);
398  protected:
399  unsigned PTS_INT32_T h, g;
400  unsigned char *obuf, *o_prior, *o_0, *o_1, *o_2, *o_3, *o_4, *oo[5];
403  unsigned char bpccpp;
405 };
406 
407 /* --- */
408 
410  :out(out_)
411  ,s1(1)
412  ,s2(0)
413  ,had_header(false)
414  ,abuflen(0)
415  {}
416 
417 #if 0
418 /** 0x7801: ZLIB header signaling fastest compression
419  * 0: 2 bits: DEFLATE block header signaling stored (uncompressed) block +
420  * 6 bits of padding.
421  */
422 char FlateStoreEncode::header[3]= { 0x78, 1, 0 };
423 #endif
424 
426  register s_t sold;
427  register char const*p=buf; char const*pend=p+len;
428  (void)sold;
429  if (len==0) { /* EOF: flush and send trailer */
430  /* Dat: Last block has to be written even if it's empty. */
431  if (!had_header) { out.vi_write("\x78\x01", 2); had_header=true; }
432  abuf[0]=(char)1; /* Last, stored block with padding */
433  abuf[1]=abuflen; abuf[2]=abuflen>>8;
434  abuf[3]=~(abuflen); abuf[4]=~(abuflen>>8);
435  out.vi_write(abuf, abuflen+5);
436  if (s1>=65521) s1-=65521;
437  if (s2>=65521) s2-=65521;
438  unsigned char trailer[4];
439  trailer[0]=s2>>8; trailer[1]=s2&255; trailer[2]=s1>>8; trailer[3]=s1&255;
440  out.vi_write((char const*)trailer,4);
441  out.vi_write(0,0); /* Signal EOF */
442  return;
443  }
444  /* From rfc1950.txt:
445  Adler-32 is composed of two sums accumulated per byte: s1 is
446  the sum of all bytes, s2 is the sum of all s1 values. Both sums
447  are done modulo 65521. s1 is initialized to 1, s2 to zero. The
448  Adler-32 checksum is stored as s2*65536 + s1 in most-
449  significant-byte first (network) order.
450  */
451  /* Update Adler-32 checksum */
452  while (p!=pend) {
453  #if SIZEOF_INT>2
454  if ((s1+=*(unsigned char const*)p)>=65521) s1-=65521;
455  if ((s2+=s1)>=65521) s2-=65521;
456  #elif SIZEOF_SHORT==2
457  sold=s1;
458  if ((s1+=*(unsigned char const*)p))<sold) s1+=15; /* 15==65536-21 */
459  sold=s2;
460  s2=(s2+s1)&0xffff;
461  if ((s2+=s1)<sold) s2+=15;
462  #else
463  /* vvv 0xffff is needed since unsigned short may be > 0..65535 */
464  sold=s1;
465  s1=(s1+*(unsigned char const*)p)&0xffff;
466  if (s1<sold) s1+=15; /* 15==65536-21 */
467  sold=s2;
468  s2=(s2+s1)&0xffff;
469  if (s2<sold) s2+=15;
470  #endif
471  p++;
472  }
473  // fprintf(stderr, "len=%u\n", len);
474  unsigned abufleft;
475  while ((abufleft=ABUFSIZE-abuflen)<len) {
476  // putchar('.');
477  // fprintf(stderr, "ABUFSIZE=%u abuflen=%u\n", ABUFSIZE, abuflen);
478  memcpy(abuf+abuflen+5, buf, abufleft);
479  abuf[0]=0; /* Stored block with padding */
480  abuf[1]=(char)ABUFSIZE; abuf[2]=(char)(ABUFSIZE>>8);
481  abuf[3]=(char)~(ABUFSIZE); abuf[4]=(char)~(ABUFSIZE>>8);
482  if (!had_header) { out.vi_write("\x78\x01", 2); had_header=true; }
483  /* fprintf(stderr,"%02x %02x", abuf[1], abuf[2]); */
484  out.vi_write(abuf, ABUFSIZE+5); /* emit next stored block with header */
485  abuflen=0;
486  len-=abufleft;
487  buf+=abufleft;
488  }
489  // putchar('X');
490  memcpy(abuf+abuflen+5, buf, len);
491  abuflen+=len;
492  /* Now abuf is possibly full. That is intentional, so we will be able to
493  * emit a full last block instead of an empty one.
494  */
495 }
496 
497 /* --- */
498 
500  :maxcpl(maxcpl_)
501  ,curcpl(0)
502  ,out(out_) {}
503 
505  /* Imp: buffering (1K etc.) */
506  static char const hextable []="0123456789abcdef";
507  char obuf[3];
508  obuf[0]='\n';
509  if (len==0) { out.vi_write(">",1); out.vi_write(0,0); }
510  else while (len--!=0) {
511  obuf[1]=hextable[(*(unsigned char const*)buf)>>4];
512  obuf[2]=hextable[(*(unsigned char const*)buf)&15];
513  if (curcpl>=maxcpl) { curcpl=2; out.vi_write(obuf, 3); }
514  else { curcpl+=2; out.vi_write(obuf+1, 2); }
515  buf++;
516  }
517 }
518 
519 /* --- */
520 
522  :maxcpl(maxcpl_)
523  ,out(out_)
524  ,ascii85breaklen(maxcpl_)
525  ,ascii85left(4)
526  ,dscst(1) {
527  obufend=(op=obuf=new char[4096])+4096;
528 }
529 
530 void ASCII85Encode::wencoded(char const *cp) {
531  for (; *cp!='\0'; ) {
533  // if (*cp<='!') { fprintf(stderr, "e=%d.\n", cp-encoded); }
534  assert(*cp>='!');
535  assert(*cp<='~');
536  if (dscst) {
537  if (dscst == 1) {
538  dscst = (*cp == '%') ? 2 : 0;
539  } else { /* if (dscst == 2) { */
540  if (*cp == '%') {
541  if (--ascii85breaklen == 0) {
542  *op++ = '\n';
544  } else {
545  /* Add space for `% %' instead of `%%' at BOL. */
546  *op++ = ' ';
547  }
549  }
550  dscst = 0;
551  }
552  }
553  *op++=*cp++;
554  if (--ascii85breaklen == 0) {
556  *op++='\n';
558  dscst = 1;
559  }
560  } /* NEXT */
561 }
562 
564  if (len==0) {
565  char encoded[6];
566  assert(ascii85left<=4);
567  if (ascii85left!=4) {
568  unsigned PTS_INT32_T buf_=ascii85buf<<8*ascii85left;
569  unsigned PTS_INT32_T q;
570  unsigned w1;
571 
572  q = buf_ / ((unsigned PTS_INT32_T)85*85*85*85); /* actually only a byte */
573  assert(q<=85);
574  encoded[0] = q + '!';
575 
576  buf_ -= q * ((unsigned PTS_INT32_T)85*85*85*85); q = buf_ / ((unsigned PTS_INT32_T)85*85*85);
577  encoded[1] = q + '!';
578 
579  buf_ -= q * ((unsigned PTS_INT32_T)85*85*85); q = buf_ / (85*85);
580  encoded[2] = q + '!';
581 
582  w1 = (unsigned) (buf_ - q*(unsigned PTS_INT32_T)(85*85));
583  assert(w1/85<85);
584  encoded[3] = (w1 / 85) + '!';
585  encoded[4] = (w1 % 85) + '!';
586  encoded[5-ascii85left] = '\0';
587  wencoded(encoded);
588  } /* IF */
589  if (op!=obuf) out.vi_write(obuf, op-obuf); /* flush buffer cache */
590  out.vi_write("~>",2); out.vi_write(0,0);
591  delete [] obuf;
592  obuf=(char*)NULLP;
593  } else {
594  assert(obuf!=NULLP);
595  register unsigned PTS_INT32_T abuf=ascii85buf;
596  register unsigned aleft=ascii85left;
597  assert(aleft>=1 && aleft<=4);
598  do {
599  while (len!=0 && aleft!=0) {
600  abuf=(abuf<<8)+*(unsigned char const*)buf++; len--; aleft--;
601  }
602  if (aleft!=0) break;
603  wout(abuf);
604  aleft=4;
605  } while (len!=0);
606  ascii85buf=abuf; ascii85left=aleft;
607  }
608 }
609 
610 void ASCII85Encode::wout(unsigned PTS_INT32_T buf_) {
611  char encoded[6];
612  if (buf_ != (unsigned PTS_INT32_T)0) {
613  unsigned PTS_INT32_T q;
614  unsigned w1;
615 
616  q = buf_ / ((unsigned PTS_INT32_T)85*85*85*85); /* actually only a byte */
617  encoded[0] = q + '!';
618 
619  buf_ -= q * ((unsigned PTS_INT32_T)85*85*85*85); q = buf_ / ((unsigned PTS_INT32_T)85*85*85);
620  encoded[1] = q + '!';
621 
622  buf_ -= q * ((unsigned PTS_INT32_T)85*85*85); q = buf_ / (85*85);
623  encoded[2] = q + '!';
624 
625  w1 = (unsigned) (buf_ - q*(unsigned PTS_INT32_T)(85*85));
626  encoded[3] = (w1 / 85) + '!';
627  encoded[4] = (w1 % 85) + '!';
628  encoded[5] = '\0';
629  } else {
630  encoded[0] = 'z', encoded[1] = '\0';
631  }
632  wencoded(encoded);
633 }
634 
635 /* --- */
636 
638  :recordsize(RecordSize_==0?(slen_t)-1:RecordSize_)
639  ,out(out_) {
641  // obufend=(op=obuf=new char[4096])+4096; /* Imp: implement write buffering */
642  saved_c=saved_rep=0;
643 }
644 
646  unsigned j, umax;
647  char b;
648  if (len==0) { /* handle EOF */
649  if (saved_rep!=0) {
650  assert(saved_rep>=2);
651  (saved+1)[-1]=257-saved_rep;
652  (saved+1)[1]=(char)128; /* EOD */
653  out.vi_write((saved+1)-1,3);
654  // fprintf(stderr,"rd=%u\n",saved_rep);
655  } else if (saved_c!=0) {
656  (saved+1)[-1]=saved_c-1;
657  (saved+1)[saved_c]=(char)128; /* EOD */
658  out.vi_write((saved+1)-1, saved_c+2);
659  // fprintf(stderr,"re=%u\n",saved_c);
660  } else {
661  (saved+1)[-1]=(char)128;
662  out.vi_write((saved+1)-1, 1);
663  }
664  out.vi_write(0,0); /* propagate EOF */
665  record_left=0; /* signal that no further data will be accepted */
666  return;
667  }
668  again:
669  assert(record_left>=1);
670  assert(len>=1);
671  /* Imp: locally cache vars saved* */
672  j=0;
673  if (saved_c==0) {
674  saved_rep=0; saved_c=1; b=(saved+1)[0]=*buf++; len--;
675  if (0==--record_left) goto put_norep;
676  if (0==len) return;
677  goto yes;
678  }
679  if (saved_c==1 && saved_rep==0) { yes:
680  if (*buf++==(saved+1)[0]) {
681  saved_rep=2; len--;
682  if (0==--record_left) goto put_rep;
683  } else {
684  (saved+1)[1]=buf[-1]; saved_c=2; len--;
685  if (0==--record_left) goto put_norep;
686  }
687  if (0==len) return;
688  }
689  assert(record_left>=1);
690  assert(len>=1);
691  assert((saved_rep==0 && saved_c>=2) || (saved_rep>=2 && saved_c==1));
692  if (saved_rep!=0) { /* Try to increase the repeating sequence */
693  assert(saved_rep>=2);
694  assert(saved_c==1);
695  assert(len>=1);
696  b=(saved+1)[0];
697  umax=len>128?128:len; if (umax>record_left) umax=record_left;
698  /* fprintf(stderr,"um1=%u\n", umax); */
699  if (umax>128-saved_rep) umax=128-saved_rep;
700  assert(umax>=1);
701  j=0; while (j!=umax && buf[j]==b) { j++; saved_rep++; }
702  if (j!=len || saved_rep==128) {
703  put_rep: /* Found a maximal repeat width */
704  (saved+1)[-1]=257-saved_rep;
705  out.vi_write((saved+1)-1,2);
706  /* fprintf(stderr,"ra=%u\n",saved_rep); */
707  if ((record_left-=j)==0) record_left=recordsize;
708  buf+=j;
709  saved_c=saved_rep=0;
710  if (0==(len-=j)) return;
711  goto again;
712  } /* Current repeat width can be further increased */
713  } else { /* Try to increase the non-repeating sequence */
714  assert(saved_c>=2);
715  if (buf[0]==(saved+1)[saved_c-1]) { /* this decision might be sub-optimal */
716  saved_c--;
717  /* Now: saved_c: non-repeat length, >=1 */
718  (saved+1)[-1]=saved_c-1;
719  out.vi_write((saved+1)-1, saved_c+1);
720  /* fprintf(stderr,"rb=%u\n",saved_c); */
721  // record_left++; /* because of saved_c--; but we would increase it later anyway */
722  // buf+=saved_c;
723  (saved+1)[0]=buf[0]; /* first matching char-pair data */
724  saved_c=1; saved_rep=2; /* make the new block a >=2 repeat */
725  record_left--; buf++;
726  if (0==--len) return;
727  goto again;
728  }
729  (saved+1)[saved_c++]=buf[0];
730  //record_left--;
731  //buf++;
732  //len--;
733  //if (saved_c==128) goto put_norep;
734  //if (0==len) return;
735  umax=len>128?128:len; if (umax>record_left) umax=record_left;
736  if (umax>128-saved_c) umax=128-saved_c;
737  /* fprintf(stderr,"um2=%u\n", umax); */
738  assert(umax>=1);
739  j=1; while (j!=umax && buf[j]!=buf[j-1]) (saved+1)[saved_c++]=buf[j++];
740  if (j!=len || saved_c==128) {
741  put_norep: /* Found a maximal non-repeat width */
742  (saved+1)[-1]=saved_c-1;
743  out.vi_write((saved+1)-1, saved_c+1);
744  /* fprintf(stderr,"rc=%u\n",saved_c); */
745  if ((record_left-=j)==0) record_left=recordsize;
746  buf+=j;
747  saved_c=saved_rep=0;
748  if (0==(len-=j)) return;
749  goto again;
750  } /* Current non-repeat width can be further increased */
751  }
752  assert(j==len);
753  record_left-=j;
754  assert(saved_rep<128);
755  assert(saved_c<128);
756 }
757 
758 /* --- */
759 
760 #if USE_BUILTIN_ZIP
761 // bool FlateEncode::locked=false;
762 
763 #if PTS_DEFL_RIPPED_ZLIB
765  :out(out_) {
766  // assert(!locked); locked /* locking is not necessary anymore */
767  // pts_deflate_init(&fs); /* obsolete */
768  zs.total_in=0;
769  zs.total_out=0;
771  zs.msg=(char*)0;
772  zs.state=(struct zlib_internal_state*)0;
773  zs.data_type=Z_UNKNOWN; /* Imp: do we have to initialize it? */
774  assert(zlib_deflate_workspacesize()+(unsigned)0<sizeof(workspace) && "Flate workspace too small");
775  if (Z_OK!=zlib_deflateInit(&zs, level_))
776  Error::sev(Error::EERROR) << "Flate init error (out of memory?)" << (Error*)0;
777 }
778 
779 void FlateEncode::vi_write(char const*buf, slen_t len) {
780  slen_t got, zgot;
781  /* fprintf(stderr,"wcall\n"); */
782  zs.next_in=(unsigned char*)const_cast<char*>(buf); zs.avail_in=len;
783  if (len==0) { /* flush all output */
784  do { /* SUXX: C compiler should emit a warning: while (1) { ... } while(...); */
785  zs.next_out=(unsigned char*)obuf; zs.avail_out=sizeof(obuf);
786  /* fprintf(stderr,"wdone zai=%d zao=%d\n", zs.avail_in, zs.avail_out); */
787  if (Z_STREAM_END!=(zgot=zlib_deflate(&zs, Z_FINISH)) && Z_OK!=zgot)
788  Error::sev(Error::EERROR) << "Flate close error: " << zs.msg << (Error*)0;
789  got=sizeof(obuf)-zs.avail_out;
790  /* fprintf(stderr, "got=%u zgot=%d Z_OK=%d\n", got, zgot, Z_OK); */
791  if (got>0) out.vi_write(obuf, got);
792  } while (zgot==Z_OK);
793  /* Dat: zlib_deflateEnd() will be called in the destructur */
794  out.vi_write(0,0); /* Signal EOF */
795  /* Dat: zlib_deflate() adds RFC 1950 header and adler32 checksum automatically */
796  } else {
797  do {
798  /* fprintf(stderr,"writ\n"); */
799  zs.next_out=(unsigned char*)obuf; zs.avail_out=sizeof(obuf);
800  if (Z_OK!=zlib_deflate(&zs, 0))
801  Error::sev(Error::EERROR) << "Flate write error: " << zs.msg << (Error*)0;
802  if (0<(got=sizeof(obuf)-zs.avail_out)) out.vi_write(obuf, got);
803  } while (0!=zs.avail_in);
804  }
805 }
806 #else
807 FlateEncode::FlateEncode(GenBuffer::Writable &out_, unsigned level_)
808  :out(out_)
809  ,s1(1)
810  ,s2(0)
811  ,had_header(false) {
812  // assert(!locked); locked /* locking is not necessary anymore */
813  // pts_deflate_init(&fs); /* obsolete */
814  fs=pts_defl_new(
815  /*zpfwrite=*/ gen_write,
816  /*zpfmalloc=*/ gen_malloc,
817  /*zpffree=*/ gen_free,
818  /*pack_level=*/ level_,
819  /*zfile=*/ (void*)&out_
820  );
821  if (fs==NULL) Error::sev(Error::EERROR) << "Flate init error (out of memory?)" << (Error*)0;
822 }
823 void *FlateEncode::gen_malloc(unsigned n) {
824  return operator new(n);
825  // return new char[n];
826 }
827 void FlateEncode::gen_free(void *p) {
828  /*return*/ operator delete(p);
829  // delete [] (char*)p;
830 }
831 
832 void FlateEncode::vi_write(char const*buf, slen_t len) {
833  register s_t sold;
834  register char const*p=buf; char const*pend=p+len;
835  (void)sold;
836  if (!had_header) {
837  out.vi_write("\x78\xda",2); /* ZLIB (RFC 1950): max compression header */
838  had_header=true;
839  }
840  if (len==0) { /* EOF: send trailer */
841  fs->deflate2(0,0,fs); /* Let the compressor flush its buffers. */
842  if (fs->err!=0) Error::sev(Error::EERROR) << "Flate compression error" << (Error*)0;
843  fs->delete2(fs);
844  fs=(struct pts_defl_interface*)NULL;
845  if (s1>=65521) s1-=65521;
846  if (s2>=65521) s2-=65521;
847  unsigned char trailer[4];
848  trailer[0]=s2>>8; trailer[1]=s2&255; trailer[2]=s1>>8; trailer[3]=s1&255;
849  out.vi_write((char const*)trailer,4);
850  out.vi_write(0,0); /* Signal EOF */
851  return;
852  }
853  assert(fs!=NULL);
854 
855  /* From rfc1950.txt:
856  Adler-32 is composed of two sums accumulated per byte: s1 is
857  the sum of all bytes, s2 is the sum of all s1 values. Both sums
858  are done modulo 65521. s1 is initialized to 1, s2 to zero. The
859  Adler-32 checksum is stored as s2*65536 + s1 in most-
860  significant-byte first (network) order.
861  */
862  /* Update Adler-32 checksum */
863  while (p!=pend) {
864  #if SIZEOF_INT>2
865  if ((s1+=*(unsigned char const*)p)>=65521) s1-=65521;
866  if ((s2+=s1)>=65521) s2-=65521;
867  #elif SIZEOF_SHORT==2
868  sold=s1;
869  if ((s1+=*(unsigned char const*)p))<sold) s1+=15; /* 15==65536-21 */
870  sold=s2;
871  s2=(s2+s1)&0xffff;
872  if ((s2+=s1)<sold) s2+=15;
873  #else
874  /* vvv 0xffff is needed since unsigned short may be > 0..65535 */
875  sold=s1;
876  s1=(s1+*(unsigned char const*)p)&0xffff;
877  if (s1<sold) s1+=15; /* 15==65536-21 */
878  sold=s2;
879  s2=(s2+s1)&0xffff;
880  if (s2<sold) s2+=15;
881  #endif
882  p++;
883  }
884  while (len>=0x8000) { fs->deflate2(const_cast<char*>(buf),0x8000, fs); len-=0x8000; buf+=0x8000; }
885  if (len!=0) fs->deflate2(const_cast<char*>(buf),len, fs);
886 }
887 #endif /* PTS_DEFL_RIPPED_ZLIB */
888 #endif /* USE_BUILTIN_ZIP */
889 
890 int /*FlateEncode::*/gen_write(char *block, unsigned len, void *zfile) {
891  static_cast<GenBuffer::Writable*>(zfile)->vi_write(block, len);
892  return 0;
893 }
894 
895 
896 /* --- */
897 
898 #if USE_BUILTIN_FAXE
899 void* CCITTFaxEncode::gen_xalloc(unsigned n) {
900  return operator new(n);
901  // void *ret; if ((ret=malloc(n))==0) abort(); return ret;
902 }
904  /*return*/ operator delete(ptr);
905  // free(ptr);
906 }
907 void CCITTFaxEncode::gen_memset(void *s, int c, unsigned n) {
908  /*return*/ memset(s,c,n);
909 }
910 void CCITTFaxEncode::gen_memcpy(void *dest, const void *src, unsigned n) {
911  /*return*/ memcpy(dest, src, n);
912 }
913 CCITTFaxEncode::CCITTFaxEncode(GenBuffer::Writable &out_, slendiff_t K, slen_t Columns, bool EndOfLine, bool BlackIs1): out(out_) {
919  sCFEs.K=K;
920  sCFEs.Columns=Columns;
921  sCFEs.EndOfLine=EndOfLine;
922  sCFEs.BlackIs1=BlackIs1;
923  const int cf_max_height=(unsigned)-1/2-100; /* Dat: was slen_t */
924  if (sCFEs.K < -cf_max_height || sCFEs.K > cf_max_height /* Dat: .K is an int */
925  || sCFEs.Columns < 0 || sCFEs.Columns > cfe_max_width /* Dat: .Columns is an int */
926  || sCFEs.Rows < 0 || sCFEs.Rows > cf_max_height /* Dat: .Rows is an int */
928  || sCFEs.DamagedRowsBeforeError > cf_max_height /* Dat: .DamagedRowsBeforeError is an int */
930  || (sCFEs.DecodedByteAlign & (sCFEs.DecodedByteAlign - 1)) != 0
931  ) Error::sev(Error::EERROR) << "pts_fax: invalid params" << (Error*)0;
933  Error::sev(Error::EERROR) << "pts_fax: init failed" << (Error*)0;
934  #if __CHECKER__
935  memset(&r, 0, sizeof(r));
936  memset(&w, 0, sizeof(w));
937  #endif
938  r.ptr=rlimit=rbuf-1;
939  hard=rbuf+sizeof(rbuf)-1;
941 }
942 
944  int pog;
945  // unsigned char *save_wptr;
946  if (len==0) {
947  r.limit=rlimit;
948  do {
949  w.ptr=wbuf-1;
950  w.limit=wbuf+sizeof(wbuf)-1;
952  pog=s_CFE_template.process((stream_state*)&sCFEs, &r, &w, /*last:*/ true);
953  // fprintf(stderr, "pog=%d write=%d last=%d\n", pog, w.ptr-(wbuf-1), true);
954  assert(pog!=PTSFAX_ERRC); /* /CCITTFaxEncode filter must accept any input */
955  assert(pog!=PTSFAX_EOFC); /* /CCITTFaxEncode filter doesn't have EOD markers */
956  if (w.ptr!=wbuf-1) out.vi_write((char const*)wbuf, w.ptr-(wbuf-1));
957  } while (pog==1);
959  out.vi_write(0,0); /* propagate EOF */
960  return;
961  }
962 
963  while (len!=0) {
964  assert(r.ptr==rbuf-1);
965  assert(hard>rlimit);
966  unsigned clen=hard-rlimit;
967  if (clen>len) clen=len;
968  assert(clen>0);
969  // fprintf(stderr, "clen=%u\n", clen);
970  memcpy(rlimit+1, buf, clen);
971  rlimit+=clen;
972  buf+=clen;
973  len-=clen;
974  /* if (r.ptr==rlimit) break; */
975  r.limit=rlimit;
976  do {
977  w.ptr=wbuf-1;
978  w.limit=wbuf+sizeof(wbuf)-1;
980  pog=s_CFE_template.process((stream_state*)&sCFEs, &r, &w, /*last:*/ false);
981  // fprintf(stderr, "len=%d pog=%d write=%d last=%d\n", len, pog, w.ptr-(wbuf-1), false);
982  assert(pog!=PTSFAX_ERRC); /* /CCITTFaxEncode filter must accept any input */
983  assert(pog!=PTSFAX_EOFC); /* /CCITTFaxEncode filter doesn't have EOD markers */
984  if (w.ptr!=wbuf-1) out.vi_write((char const*)wbuf, w.ptr-(wbuf-1));
985  } while (pog==1);
986  // assert(pog!=1); /* not true: output space is enough (sizeof(wbuf)>min_out_size) */
987  assert(pog==0); /* more input is needed */
988  if (r.ptr!=rbuf-1) {
989  // fprintf(stderr, "limit=%d\n", rlimit-r.ptr);
990  memmove(rbuf, r.ptr+1, rlimit-r.ptr);
991  rlimit=rbuf-1+(rlimit-r.ptr);
992  r.ptr=rbuf-1;
993  }
994  }
995  // fprintf(stderr, "done\n");
996 }
997 #endif /* USE_BUILTIN_FAXE */
998 
999 /* --- */
1000 
1001 #if USE_BUILTIN_LZW
1003  fs.tif_writer=/*FlateEncode::*/gen_write;
1004  fs.tif_sout=(void*)&out_;
1005  if (0==pts_lzw_init(&fs)) Error::sev(Error::EERROR) << "LZW init error" << (Error*)0;
1006 }
1007 
1008 void LZWEncode::vi_write(char const*buf, slen_t len) {
1009  /* Imp: report real error _reason_ (if appropriate?? ) */
1010  if (len==0) {
1011  if (0==fs.tif_feeder(0,0,&fs)) goto we;
1012  out.vi_write(0,0); /* propagate EOF */
1013  return;
1014  }
1015  while (len>=0x8000) {
1016  if (0==fs.tif_feeder(const_cast<char*>(buf),0x8000,&fs)) we:
1017  Error::sev(Error::EERROR) << "LZW write error" << (Error*)0;
1018  len-=0x8000; buf+=0x8000;
1019  }
1020  if (len!=0 && 0==fs.tif_feeder(const_cast<char*>(buf),len,&fs)) goto we;
1021 }
1022 #endif /* USE_BUILTIN_LZW */
1023 
1024 /* --- */
1025 
1026 #if !USE_BUILTIN_LZW
1027 Lzw_codecEncode::Lzw_codecEncode(GenBuffer::Writable &out_, char const*filter_psname)
1028  :p(out_) {
1029  (void)filter_psname;
1030 }
1031 void Lzw_codecEncode::vi_write(char const*buf, slen_t len) { p.vi_write(buf,len); }
1032 
1033 /* Imp: figure out path-to-gs: gs or gswin32c */
1035  // :PipeEncoder(out_, ">/tmp/t cat - cjpeg quality %i", quality), rgbp(rgbp_) {
1036  // :Filter::PipeE(out_, "cjpeg -quality %i >%D", quality), rgbp(rgbp_) {
1037  :Filter::PipeE(out_, "lzw_codec encode >%D") {}
1038 #endif
1039 
1040 /* --- */
1041 
1042 CjpegEncode::CjpegEncode(GenBuffer::Writable &out_, char const*filter_psname, slen_t Columns, slen_t Rows, bool rgbp_, unsigned char quality)
1043  :p(out_, Columns, Rows, rgbp_, quality) {
1044  (void)filter_psname;
1045 }
1047 
1048 /* Imp: figure out path-to-gs: gs or gswin32c */
1049 CjpegEncode::P::P(GenBuffer::Writable &out_, slen_t Columns, slen_t Rows, bool rgbp_, unsigned char quality)
1050  // :PipeEncoder(out_, ">/tmp/t cat - cjpeg quality %i", quality), rgbp(rgbp_) {
1051  :Filter::PipeE(out_, "cjpeg -quality %i >%D", quality), rgbp(rgbp_) {
1052  /* Dat: we're extremely lucky that cjpeg can read PGM or PPM files from stdin */
1053  // operator<<("P5 width height 255\n"); /* RAWBITS PGM */
1054  // operator<<("P6 width height 255\n"); /* RAWBITS PPM */
1055  *this << (rgbp_?"P6 ":"P5 ") << Columns << ' ' << Rows << " 255\n";
1056 }
1058  char r[10];
1059  static char jfif[9]="\377\340\000\020JFIF";
1060  static unsigned char adobe[16]= {
1061  0xff, /* marker */
1062  0xee, /* APP14 */
1063  0, /* length-hi */
1064  14, /* length-lo */
1065  'A', 'd', 'o', 'b', 'e', /* ID */
1066  1, /* version-hi */
1067  0, /* version-lo */
1068  0, 0, /* flags0 */
1069  0, 0, /* flags1 */
1070  0, /* ColorTransform */
1071  };
1072  if (MACRO_GETC(f)!=0xff || MACRO_GETC(f)!=0xd8 || fread(r, 1, 8, f)!=8) {
1073  bad: Error::sev(Error::EERROR) << "CjpegEncode: cjpeg created bad JPEG" << (Error*)0;
1074  }
1075  out.vi_putcc((char)0xff);
1076  out.vi_putcc((char)0xd8);
1077  r[9]=r[3]; r[3]='\020';
1078  if ((unsigned char)r[9]>=6 && 0==memcmp(r, jfif, 8)) { /* JFIF marker */
1079  r[3]=r[9]; unsigned skip=r[9]-6;
1080  out.vi_write(r, 8);
1081  while (skip--!=0) out.vi_putcc(MACRO_GETC(f));
1082  }
1083  if (ferror(f) || feof(f)) goto bad;
1084  /* Now we can emit the Adobe marker. */
1085  adobe[sizeof(adobe)-1]=rgbp==true; /* ColorTransform value 0 for Gray, 1 for RGB->YCbCr */
1086  out.vi_write((char*)adobe, sizeof(adobe));
1087  /* vvv Dat: pacify VC6.0: Filter::PipeE::vi_copy(f); doesn't work */
1088  PipeE::vi_copy(f);
1089  /* ^^^ copy rest of file verbatim */
1090  // ((Filter::PipeE)*this).vi_copy(f);
1091 }
1092 
1093 /* --- */
1094 
1095 GSEncode::GSEncode(GenBuffer::Writable &out_, char const*filter_psname)
1096  :p(out_, filter_psname) {}
1098 
1099 /* Imp: figure out path-to-gs: gs or gswin32c */
1100 GSEncode::P::P(GenBuffer::Writable &out_, char const*filter_psname)
1101  :Filter::PipeE(out_, "rungs -s_OFN=%D -dNODISPLAY -q - >%E")
1102  {
1103  operator<<("{/o _OFN(w)file ");
1104  operator<<(filter_psname);
1105  operator<<(" filter def/s 4096 string def"
1106  "{currentfile s readstring exch o exch writestring not{exit}if}loop "
1107  "o closefile quit}bind exec\n");
1108 }
1110  /* If STDOUT of gs is not empty, then it is very probably an error message. */
1111  // tmpename.term0(); /* already is */
1112  assert(tmpename.end_()[0]=='\0');
1113  if (0!=Files::statSize(tmpename())) Error::sev(Error::EERROR) << "GSEncode: GS runtime error" << (Error*)0;
1114  /* Imp: display a meaningful error message */
1115 }
1116 
1117 /* --- */
1118 
1120  // SimBuffer::B fp; (fp << maxcpl_ << " pop/ASCIIHexEncode").term0();
1121  // PSEncoder *ret=new GSEncode(out_, fp());
1122  PSEncoder *ret=new ASCIIHexEncode(out_,maxcpl_);
1123  // ret->shortname="AHx"; ret->longname="ASCIIHex";
1124  // ret->filter_psname << fp;
1125  return ret;
1126 }
1128  // SimBuffer::B fp; (fp << maxcpl_ << " pop/ASCII85Encode").term0();
1129  PSEncoder *ret=new ASCII85Encode(out_,maxcpl_);
1130  // PSEncoder *ret=new GSEncode(out_, fp());
1131  // ret->shortname="A85"; ret->longname="ASCII85";
1132  // ret->filter_psname << fp;
1133  return ret;
1134 }
1135 PSEncoder* PSEncoder::newCCITTFaxEncode(GenBuffer::Writable &out_,slendiff_t K, slen_t Columns, bool EndOfLine, bool BlackIs1) {
1136  #if USE_BUILTIN_FAXE
1137  return new CCITTFaxEncode(out_, K, Columns, EndOfLine, BlackIs1);
1138  #else
1139  // (void)out_; (void)K; (void)Columns;
1140  // assert(0 && "unimplemented");
1141  SimBuffer::B fp("<< /K ");
1142  fp << K << "/Columns " << Columns;
1143  if (EndOfLine) fp << "/EndOfLine true"; /* PS default: false */
1144  if (BlackIs1) fp << "/BlackIs1 true";
1145  (fp << ">>/CCITTFaxEncode").term0();
1146  // fprintf(stderr, "fp=(%s)\n", fp());
1147  PSEncoder *ret=new GSEncode(out_, fp());
1148  // ret->shortname="CCF"; ret->longname="CCITTFax";
1149  // ret->filter_psname << fp; /* Dat: this could be made faster */
1150  return ret;
1151  #endif
1152 }
1154 #if USE_BUILTIN_LZW
1155  SimBuffer::B fp("/LZWEncode");
1156  PSEncoder *ret=new LZWEncode(out_);
1157  // PSEncoder *ret=new GSEncode(out_, fp());
1158  // ret->shortname="LZW"; ret->longname="LZW";
1159  // ret->filter_psname << fp;
1160  return ret;
1161 #else
1162  (void)out_;
1163  #if 0
1164  Error::sev(Error::EERROR) << "LZW not supported in this compilation of sam2p" << (Error*)0;
1165  #endif
1166  Error::sev(Error::WARNING) << "LZW: please `configure --enable-lzw' for builtin /Compression/LZW support" << (Error*)0;
1167  #if 0
1168  /* This is useless, because gs 5.50--7.04 have dummy LZW compressor:
1169  * it emits a correct LZW stream, but does no real compression, and
1170  * the file size is often increased.
1171  */
1172  PSEncoder *ret=new GSEncode(out_, "/LZWEncode");
1173  // ret->shortname="LZW"; ret->longname="LZW";
1174  // ret->filter_psname << "/LZWEncode";
1175  return ret;
1176  #endif
1177  #if 1 /* ask lzw_codec from the author of sam2p */
1178  return new Lzw_codecEncode(out_, "/LZWEncode");
1179  #endif
1180  return 0;
1181 #endif
1182 }
1184  // (void)out_; (void)K; (void)Columns;
1185  // assert(0 && "unimplemented");
1186  if (Effort==0) {
1187  PSEncoder *ret=new FlateStoreEncode(out_);
1188  // ret->shortname="Fla"; ret->longname="Flate";
1189  // ret->filter_psname << fp;
1190  return ret;
1191  }
1192  if (Effort<1 || Effort>9) Effort=5;
1193  #if USE_BUILTIN_ZIP
1194  PSEncoder *ret=new FlateEncode(out_, Effort);
1195  #else
1196  SimBuffer::B fp("<</Effort "); (fp << Effort << ">>/FlateEncode").term0();
1197  PSEncoder *ret=new GSEncode(out_, fp());
1198  #endif
1199  // ret->shortname="Fla"; ret->longname="Flate";
1200  // ret->filter_psname << fp;
1201  return ret;
1202 }
1204  SimBuffer::B fp; (fp << RecordSize << "/RunLengthEncode").term0();
1205  PSEncoder *ret=new RunLengthEncode(out_, RecordSize);
1206  // PSEncoder *ret=new GSEncode(out_, fp());
1207  // ret->shortname="RL"; ret->longname="RunLength";
1208  // ret->filter_psname << fp;
1209  return ret;
1210 }
1211 
1213  slen_t Columns,
1214  slen_t Rows,
1215  unsigned char Colors, /*1..4*/
1216  unsigned char quality /*libJPEG quality: 0..100 */
1217 ) {
1218  /* Dat: this supports only the Gray and RGB color spaces of JPEG */
1219  param_assert(Colors==1 || Colors==3);
1220  param_assert(/* quality>=0 && */ quality <=100);
1221  SimBuffer::B fp("<<IJG ");
1222  (fp<< "/Columns " << Columns
1223  << "/Rows " << Rows
1224  << "/Colors " << (unsigned)Colors
1225  << ">>/DCTEncode").term0();
1226  /* Dat: the default of /ColorTransform (defined in DCTEncode in
1227  subsubsection 3.13.3 in PLRM.pdf) is just perfect. */
1228  PSEncoder *ret=new CjpegEncode(out_, fp(), Columns, Rows, Colors==3, quality);
1229  // ret->longname=ret->shortname="DCT"; ret->filter_psname << fp;
1230  return ret;
1231 }
1232 
1234  slen_t Columns,
1235  slen_t Rows,
1236  unsigned char Colors, /*1..4*/
1237  unsigned char quality, /*libJPEG quality: 0..100 */
1238  unsigned char const*HSamples, /*all 1..4, NULLP OK*/
1239  unsigned char const*VSamples, /*all 1..4, NULLP OK*/
1240  unsigned char (*QuantTables)[64], /*NULLP OK*/
1241  double QFactor, /*0..1000000*/
1242  unsigned numHuffTables,
1243  unsigned char **HuffTables, /*NULLP OK*/
1244  unsigned char ColorTransform /*0,1,2 3=default*/
1245 ) {
1246  (void)quality;
1247  (void)QuantTables;
1248  (void)QFactor;
1249  (void)numHuffTables;
1250  (void)HuffTables;
1251  SimBuffer::B tmp;
1252  /* Imp: respect quality */
1253  /* Imp: respect QFactor (double) */
1254  /* Imp: respect QuantTables */
1255  /* Imp: respect numHuffTables, HuffTables */
1256 
1257  SimBuffer::B fp("<<");
1258  fp << "/Columns " << Columns
1259  << "/Rows " << Rows
1260  << "/Colors " << (unsigned)Colors;
1261  if (HSamples!=(unsigned char const*)NULLP) {
1262  tmp.clear(); tmp.vi_write((char const*)HSamples, (unsigned)Colors);
1263  fp << "/HSamples "; fp.appendDumpPS(tmp,true);
1264  }
1265  if (VSamples!=(unsigned char const*)NULLP) {
1266  tmp.clear(); tmp.vi_write((char const*)VSamples, (unsigned)Colors);
1267  fp << "/VSamples "; fp.appendDumpPS(tmp,true);
1268  }
1269  if (ColorTransform!=3) fp << "/ColorTransform " << (unsigned)ColorTransform;
1270  (fp << ">>/DCTEncode").term0();
1271 
1272  // PSEncoder *ret=new DCTEncode(out_,? ? ?);
1273  PSEncoder *ret=new GSEncode(out_, fp());
1274  // ret->shortname="DCT"; ret->longname="DCT";
1275  // ret->filter_psname << fp;
1276  return ret;
1277 }
1278 
1280  slen_t Columns,
1281  slen_t Rows,
1282  unsigned char Colors, /*1..4*/
1283  unsigned char ColorTransform, /*0,1,2 3=default*/
1284  SimBuffer::Flat const& other_parameters
1285 ) {
1286  SimBuffer::B fp("<<");
1287  fp << "/Columns " << Columns
1288  << "/Rows " << Rows
1289  << "/Colors " << (unsigned)Colors;
1290  if (ColorTransform!=3) fp << "/ColorTransform " << (unsigned)ColorTransform;
1291  (fp << other_parameters << ">>/DCTEncode").term0();
1292  PSEncoder *ret=new GSEncode(out_, fp());
1293  // ret->shortname="DCT"; ret->longname="DCT";
1294  // ret->filter_psname << fp;
1295  return ret;
1296 }
1297 
1298 /* --- */
1299 
1300 TIFFPredictor2::TIFFPredictor2(GenBuffer::Writable &out_, unsigned char bpc_, slen_t columns_, unsigned char cpp_)
1301  : h(0), bpc(bpc_), cpp(cpp_), out(out_) {
1302  param_assert(cpp_*bpc_<=32);
1303  rlen=(columns_*cpp_*bpc_+7)>>3; /* BUGFIX at Tue Mar 12 12:09:51 CET 2002 */
1304  op=obuf=new unsigned char[rlen];
1305 }
1306 
1308  unsigned char const *p=(unsigned char const*)buf, *pend0=p+len;
1309  slen_t opleft=rlen-(op-obuf);
1310  register unsigned int i, d, o, bpccpp;
1311  if (len==0) {
1312  assert(opleft==rlen); /* unflushed (half-ready) row disallowed */
1313  assert(obuf!=NULLP);
1314  delete [] obuf;
1315  obuf=(unsigned char*)NULLP;
1316  out.vi_write(0,0);
1317  return;
1318  }
1319  bpccpp=(cpp-1)*bpc;
1320  if (bpc==1) {
1321  while (p!=pend0) {
1322  i=*p++;
1323  d=(i>>7); o =((d-((h>>bpccpp)))&1)<<7; h=(h<<1)|d;
1324  d=(i>>6); o|=((d-((h>>bpccpp)))&1)<<6; h=(h<<1)|d;
1325  d=(i>>5); o|=((d-((h>>bpccpp)))&1)<<5; h=(h<<1)|d;
1326  d=(i>>4); o|=((d-((h>>bpccpp)))&1)<<4; h=(h<<1)|d;
1327  d=(i>>3); o|=((d-((h>>bpccpp)))&1)<<3; h=(h<<1)|d;
1328  d=(i>>2); o|=((d-((h>>bpccpp)))&1)<<2; h=(h<<1)|d;
1329  d=(i>>1); o|=((d-((h>>bpccpp)))&1)<<1; h=(h<<1)|d;
1330  d=(i ); o|=((d-((h>>bpccpp)))&1) ; h=(h<<1)|d;
1331  *op++=o;
1332  if (--opleft==0) { h=0; out.vi_write((char*)obuf,rlen); op=obuf; opleft=rlen; }
1333  }
1334  } else if (bpc==2) {
1335  while (p!=pend0) {
1336  i=*p++;
1337  d=(i>>6); o =((d-((h>>bpccpp)))&3)<<6; h=(h<<2)|d; // fprintf(stderr,"d=%#x\n", d);
1338  d=(i>>4); o|=((d-((h>>bpccpp)))&3)<<4; h=(h<<2)|d;
1339  d=(i>>2); o|=((d-((h>>bpccpp)))&3)<<2; h=(h<<2)|d;
1340  d=(i ); o|=((d-((h>>bpccpp)))&3) ; h=(h<<2)|d;
1341  *op++=o;
1342  if (--opleft==0) { h=0; out.vi_write((char*)obuf,rlen); op=obuf; opleft=rlen; }
1343  }
1344  } else if (bpc==4) {
1345  while (p!=pend0) {
1346  i=*p++;
1347  d=(i>>4); o =((d-((h>>bpccpp)))&15)<<4; h=(h<<4)|d;
1348  d=(i ); o|=((d-((h>>bpccpp)))&15) ; h=(h<<4)|d;
1349  *op++=o;
1350  if (--opleft==0) { h=0; out.vi_write((char*)obuf,rlen); op=obuf; opleft=rlen; }
1351  }
1352  } else if (bpc==8) {
1353  while (p!=pend0) {
1354  i=*p++; *op++=((i-((h>>bpccpp)))/*&255*/); h=(h<<8)|i;
1355  if (--opleft==0) { h=0; out.vi_write((char*)obuf,rlen); op=obuf; opleft=rlen; }
1356  }
1357  } else assert(0);
1358 }
1359 
1360 /* --- */
1361 
1362 PNGPredictorNone::PNGPredictorNone(GenBuffer::Writable &out_, unsigned char bpc_, slen_t columns_, unsigned char cpp_)
1363  : opleft(0), out(out_) {
1364  rlen=(columns_*cpp_*bpc_+7)>>3;
1365 }
1366 
1368  if (len==0) {
1369  assert(opleft==0); /* unflushed (half-ready) row disallowed */
1370  out.vi_write(0,0);
1371  return;
1372  }
1373  /* The following code just inserts a '\0' in front of each scanline */
1374  /* Imp: make it faster by collapsing vi_writes */
1375  if (opleft==0) { opleft=rlen; out.vi_write("\0",1); } /* Scanline (row) header: describes predictor used */
1376  while (len>opleft) {
1378  buf+=opleft; len-=opleft;
1379  opleft=rlen; out.vi_write("\0",1); /* Scanline (row) header: describes predictor used */
1380  }
1381  if (len!=0) out.vi_write(buf,len);
1382  opleft-=len;
1383 }
1384 
1385 /* --- */
1386 
1387 PNGPredictorSub::PNGPredictorSub(GenBuffer::Writable &out_, unsigned char bpc_, slen_t columns_, unsigned char cpp_)
1388  : h(0), out(out_) {
1389  param_assert(cpp_*bpc_<=32);
1390  rlen=(columns_*cpp_*bpc_+7)>>3;
1391  op=obuf=1+new unsigned char[rlen+1];
1392  obuf[-1]='\1'; /* Scanline (row) header: describes predictor used */
1393  bpccpp=((cpp_*bpc_+7)&~7)-8;
1394 }
1395 
1397  unsigned char const *p=(unsigned char const*)buf, *pend0=p+len;
1398  slen_t opleft=rlen-(op-obuf);
1399  register unsigned int i;
1400  if (len==0) {
1401  assert(opleft==rlen); /* unflushed (half-ready) row disallowed */
1402  assert(obuf!=NULLP);
1403  delete [] (obuf-1);
1404  obuf=(unsigned char*)NULLP;
1405  out.vi_write(0,0);
1406  return;
1407  }
1408  while (p!=pend0) {
1409  i=*p++; *op++=((i-((h>>bpccpp)))/*&255*/); h=(h<<8)|i;
1410  if (--opleft==0) { h=0;
1411  out.vi_write((char*)obuf-1,rlen+1); op=obuf; opleft=rlen;
1412  }
1413  }
1414 }
1415 
1416 /* --- */
1417 
1418 PNGPredictorUp::PNGPredictorUp(GenBuffer::Writable &out_, unsigned char bpc_, slen_t columns_, unsigned char cpp_)
1419  : out(out_) {
1420  rlen=(columns_*cpp_*bpc_+7)>>3;
1421  // fprintf(stderr, "rUp.rlen=%u cpp=%u bpc=%u\n", rlen, cpp_, bpc_);
1422  op=obuf=1+new unsigned char[2*rlen+1];
1423  oq=op+rlen; /* prev scanline */
1424  memset(oq, '\0', rlen);
1425  obuf[-1]='\2'; /* Scanline (row) header: describes predictor used */
1426 }
1427 
1429  unsigned char const *p=(unsigned char const*)buf, *pend0=p+len;
1430  slen_t opleft=rlen-(op-obuf);
1431  if (len==0) {
1432  assert(opleft==rlen); /* unflushed (half-ready) row disallowed */
1433  assert(obuf!=NULLP);
1434  delete [] (obuf-1);
1435  obuf=(unsigned char*)NULLP;
1436  out.vi_write(0,0);
1437  return;
1438  }
1439  while (p!=pend0) {
1440  *op++=((*p-*oq)/*&255*/); *oq++=*p++;
1441  if (--opleft==0) {
1442  out.vi_write((char*)obuf-1,rlen+1); opleft=rlen;
1443  op=obuf; oq=obuf+rlen;
1444  }
1445  }
1446 }
1447 
1448 /* --- */
1449 
1450 PNGPredictorAverage::PNGPredictorAverage(GenBuffer::Writable &out_, unsigned char bpc_, slen_t columns_, unsigned char cpp_)
1451  : h(0), /*g(0),*/ out(out_) {
1452  param_assert(cpp_*bpc_<=32);
1453  rlen=(columns_*cpp_*bpc_+7)>>3;
1454  op=obuf=1+new unsigned char[2*rlen+1];
1455  oq=op+rlen; /* prev scanline */
1456  memset(oq, '\0', rlen);
1457  obuf[-1]='\3'; /* Scanline (row) header: describes predictor used */
1458  bpccpp=((cpp_*bpc_+7)&~7)-8;
1459 }
1460 
1462  unsigned char const *p=(unsigned char const*)buf, *pend0=p+len;
1463  slen_t opleft=rlen-(op-obuf);
1464  register unsigned int i;
1465  if (len==0) {
1466  assert(opleft==rlen); /* unflushed (half-ready) row disallowed */
1467  assert(obuf!=NULLP);
1468  delete [] (obuf-1);
1469  obuf=(unsigned char*)NULLP;
1470  out.vi_write(0,0);
1471  return;
1472  }
1473  while (p!=pend0) {
1474  /* vvv Data: *og+h can be 0..510 */
1475  i=*p; *op++=i-((((h>>bpccpp)&255)+*oq)>>1); h=(h<<8)|i; *oq++=*p++;
1476  // i=*p; *op++=(*p-((*oq+h)>>1)/*&255*/); h=i; *oq++=*p++;
1477  if (--opleft==0) {
1478  out.vi_write((char*)obuf-1,rlen+1); opleft=rlen;
1479  op=obuf; oq=obuf+rlen; h=0;
1480  }
1481  }
1482 }
1483 
1484 /* --- */
1485 
1486 /* Dat: egcs-2.91.60 is buggy */
1487 // static inline unsigned abs_(unsigned i) { return ((signed)i)<0 ? -i : i; }
1488 static inline unsigned abs_(unsigned i) { return ((signed)i)<0 ? (i*-1) : i; }
1489 
1490 static inline unsigned paeth_predictor(unsigned a, unsigned b, unsigned c) {
1491  /* Code ripped from RFC 2083 (PNG specification), which also says:
1492  * The calculations within the PaethPredictor function must be
1493  * performed exactly, without overflow. Arithmetic modulo 256 is to
1494  * be used only for the final step of subtracting the function result
1495  * from the target byte value.
1496  */
1497  /* a = left, b = above, c = upper left */
1498  unsigned p = a + b - c; /* initial estimate */
1499  unsigned pa = abs_(p - a); /* distances to a, b, c */
1500  unsigned pb = abs_(p - b);
1501  unsigned pc = abs_(p - c);
1502  // assert(abs_(3*(-1))==3);
1503  // fprintf(stderr, "b=%u c=%u %d %d\n", b, c, p-b, ((signed)(p-b))<0 ? (b-p) : (p-b) );
1504  // fprintf(stderr, "pa=%u pb=%u pc=%u\n", pa, pb, pc);
1505  assert(pa<=255);
1506  assert(pb<=255);
1507  assert(pc<=255*2);
1508  /* return nearest of a,b,c, breaking ties in order a,b,c. */
1509  return (pa <= pb && pa <= pc) ? a
1510  : pb <= pc ? b
1511  : c;
1512 }
1513 
1514 PNGPredictorPaeth::PNGPredictorPaeth(GenBuffer::Writable &out_, unsigned char bpc_, slen_t columns_, unsigned char cpp_)
1515  : h(0), g(0), out(out_) {
1516  param_assert(cpp_*bpc_<=32);
1517  rlen=(columns_*cpp_*bpc_+7)>>3;
1518  op=obuf=1+new unsigned char[2*rlen+2];
1519  oq=obuf+rlen+1; /* prev scanline */
1520  memset(obuf+rlen, '\0', rlen+1);
1521  obuf[-1]='\4'; /* Scanline (row) header: describes predictor used */
1522  bpccpp=((cpp_*bpc_+7)&~7)-8;
1523 }
1524 
1526  unsigned char const *p=(unsigned char const*)buf, *pend0=p+len;
1527  slen_t opleft=rlen-(op-obuf);
1528  register unsigned int i;
1529  if (len==0) {
1530  assert(opleft==rlen); /* unflushed (half-ready) row disallowed */
1531  assert(obuf!=NULLP);
1532  delete [] (obuf-1);
1533  obuf=(unsigned char*)NULLP;
1534  out.vi_write(0,0);
1535  return;
1536  }
1537  while (p!=pend0) {
1538  // assert(0==obuf[rlen] && 4==obuf[-1]);
1539  i=*p; *op++=i-paeth_predictor((h>>bpccpp)&255, *oq, (g>>bpccpp)&255);
1540  h=(h<<8)|i; g=(g<<8)|*oq; *oq++=*p++;
1541  // i=*p; *op++=i-h; h=i; *oq++=*p++;
1542  if (--opleft==0) {
1543  out.vi_write((char*)obuf-1,rlen+1); opleft=rlen;
1544  op=obuf; oq=obuf+rlen+1; h=0; g=0;
1545  }
1546  }
1547 }
1548 
1549 /* --- */
1550 
1551 #if SIZEOF_INT >= 4
1552 typedef int weight_t;
1553 #else
1554 typedef long weight_t;
1555 #endif
1556 
1557 PNGPredictorAutoBadSigned::PNGPredictorAutoBadSigned(GenBuffer::Writable &out_, unsigned char bpc_, slen_t columns_, unsigned char cpp_)
1558  : h(0), g(0), out(out_) {
1559  param_assert(cpp_*bpc_<=32);
1560  opleft=rlen=(columns_*cpp_*bpc_+7)>>3;
1561  obuf=new unsigned char[6*rlen+6];
1562  o_prior=obuf+rlen+1; /* Prior(x): ooprior[-opleft] */
1563  obuf[rlen*1+1]='\0'; o_0=obuf+2*rlen+2;
1564  obuf[rlen*2+2]='\1'; o_1=obuf+3*rlen+3;
1565  obuf[rlen*3+3]='\2'; o_2=obuf+4*rlen+4;
1566  obuf[rlen*4+4]='\3'; o_3=obuf+5*rlen+5;
1567  obuf[rlen*5+5]='\4'; o_4=obuf+6*rlen+6;
1568  oo[0]=o_0; oo[1]=o_1; oo[2]=o_2; oo[3]=o_3; oo[4]=o_4;
1569  memset(obuf, '\0', rlen+1);
1570  bpccpp=((cpp_*bpc_+7)&~7)-8;
1571 }
1572 
1574  unsigned char const *p=(unsigned char const*)buf, *pend0=p+len;
1575  register unsigned int i;
1576  register unsigned raw_x_bpp, prior_x, prior_x_bpp;
1577  if (len==0) {
1578  assert(opleft==rlen); /* unflushed (half-ready) row disallowed */
1579  assert(obuf!=NULLP);
1580  delete [] obuf;
1581  obuf=(unsigned char*)NULLP;
1582  out.vi_write(0,0);
1583  return;
1584  }
1585  while (p!=pend0) {
1586  raw_x_bpp=(h>>bpccpp) &255;
1587  prior_x=*(o_prior-opleft);
1588  prior_x_bpp=(g>>bpccpp) &255;
1589  i=*p;
1590  *(o_0-opleft)=i;
1591  *(o_1-opleft)=i-raw_x_bpp;
1592  *(o_2-opleft)=i-prior_x;
1593  *(o_3-opleft)=i-((raw_x_bpp+prior_x)>>1);
1594  *(o_4-opleft)=i-paeth_predictor(raw_x_bpp, prior_x, prior_x_bpp);
1595  h=(h<<8)|i; g=(g<<8)|*(o_prior-opleft); *(o_prior-opleft)=*p++;
1596  if (--opleft==0) {
1597  /* Select the predictor having the smallest signed sum of values. */
1598  weight_t min_weight, cur_weight;
1599  unsigned min_pred=0, cur_pred;
1600  register signed char *beg, *end;
1601  min_weight=0; beg=(end=(signed char*)o_0)-rlen; while (beg!=end) min_weight+=*beg++;
1602  if (min_weight<0) min_weight*=-1;
1603  for (cur_pred=1; cur_pred<=4; cur_pred++) {
1604  cur_weight=0; beg=(end=(signed char*)oo[cur_pred])-rlen; while (beg!=end) cur_weight+=*beg++;
1605  if (cur_weight<0) cur_weight*=-1;
1606  if (cur_weight<min_weight) { min_weight=cur_weight; min_pred=cur_pred; }
1607  }
1608  // fprintf(stderr, "cp=%u\n", min_pred);
1609 
1610  out.vi_write((char*)(oo[min_pred]-rlen-1),rlen+1);
1611  opleft=rlen; h=0; g=0;
1612  }
1613  }
1614 }
1615 
1616 /* --- */
1617 
1618 PNGPredictorAutoBadUnsigned::PNGPredictorAutoBadUnsigned(GenBuffer::Writable &out_, unsigned char bpc_, slen_t columns_, unsigned char cpp_)
1619  : h(0), g(0), out(out_) {
1620  param_assert(cpp_*bpc_<=32);
1621  opleft=rlen=(columns_*cpp_*bpc_+7)>>3;
1622  obuf=new unsigned char[6*rlen+6];
1623  o_prior=obuf+rlen+1; /* Prior(x): ooprior[-opleft] */
1624  obuf[rlen*1+1]='\0'; o_0=obuf+2*rlen+2;
1625  obuf[rlen*2+2]='\1'; o_1=obuf+3*rlen+3;
1626  obuf[rlen*3+3]='\2'; o_2=obuf+4*rlen+4;
1627  obuf[rlen*4+4]='\3'; o_3=obuf+5*rlen+5;
1628  obuf[rlen*5+5]='\4'; o_4=obuf+6*rlen+6;
1629  oo[0]=o_0; oo[1]=o_1; oo[2]=o_2; oo[3]=o_3; oo[4]=o_4;
1630  memset(obuf, '\0', rlen+1);
1631  bpccpp=((cpp_*bpc_+7)&~7)-8;
1632 }
1633 
1635  unsigned char const *p=(unsigned char const*)buf, *pend0=p+len;
1636  register unsigned int i;
1637  register unsigned raw_x_bpp, prior_x, prior_x_bpp;
1638  // unsigned lines=0;
1639  if (len==0) {
1640  assert(opleft==rlen); /* unflushed (half-ready) row disallowed */
1641  assert(obuf!=NULLP);
1642  delete [] obuf;
1643  obuf=(unsigned char*)NULLP;
1644  out.vi_write(0,0);
1645  return;
1646  }
1647  // fprintf(stderr, "rlen=%u len=%u opleft=%u\n", rlen, len, opleft);
1648  while (p!=pend0) {
1649  raw_x_bpp=(h>>bpccpp) &255;
1650  prior_x=*(o_prior-opleft);
1651  prior_x_bpp=(g>>bpccpp) &255;
1652  i=*p;
1653  *(o_0-opleft)=i;
1654  *(o_1-opleft)=i-raw_x_bpp;
1655  *(o_2-opleft)=i-prior_x;
1656  *(o_3-opleft)=i-((raw_x_bpp+prior_x)>>1);
1657  *(o_4-opleft)=i-paeth_predictor(raw_x_bpp, prior_x, prior_x_bpp);
1658  h=(h<<8)|i; g=(g<<8)|*(o_prior-opleft); *(o_prior-opleft)=*p++;
1659  if (--opleft==0) {
1660  /* Select the predictor having the smallest unsigned sum of values. */
1661  weight_t min_weight, cur_weight;
1662  unsigned min_pred=0, cur_pred;
1663  register unsigned char *beg, *end;
1664  min_weight=0; beg=(end=(unsigned char*)o_0)-rlen; while (beg!=end) min_weight+=*beg++;
1665  for (cur_pred=1; cur_pred<=4; cur_pred++) {
1666  cur_weight=0; beg=(end=(unsigned char*)oo[cur_pred])-rlen; while (beg!=end) cur_weight+=*beg++;
1667  if (cur_weight<min_weight) { min_weight=cur_weight; min_pred=cur_pred; }
1668  }
1669  // fprintf(stderr, "cp=%u\n", min_pred);
1670 
1671  out.vi_write((char*)(oo[min_pred]-rlen-1),rlen+1);
1672  opleft=rlen; h=0; g=0;
1673  // lines++;
1674  }
1675  }
1676  // fprintf(stderr, "oen=%u opleft=%u lines=%u\n", len, opleft, lines);
1677 }
1678 
1679 /* --- */
1680 
1681 PNGPredictorAuto::PNGPredictorAuto(GenBuffer::Writable &out_, unsigned char bpc_, slen_t columns_, unsigned char cpp_)
1682  : h(0), g(0), out(out_) {
1683  param_assert(cpp_*bpc_<=32);
1684  opleft=rlen=(columns_*cpp_*bpc_+7)>>3;
1685  obuf=new unsigned char[6*rlen+6];
1686  o_prior=obuf+rlen+1; /* Prior(x): ooprior[-opleft] */
1687  obuf[rlen*1+1]='\0'; o_0=obuf+2*rlen+2;
1688  obuf[rlen*2+2]='\1'; o_1=obuf+3*rlen+3;
1689  obuf[rlen*3+3]='\2'; o_2=obuf+4*rlen+4;
1690  obuf[rlen*4+4]='\3'; o_3=obuf+5*rlen+5;
1691  obuf[rlen*5+5]='\4'; o_4=obuf+6*rlen+6;
1692  oo[0]=o_0; oo[1]=o_1; oo[2]=o_2; oo[3]=o_3; oo[4]=o_4;
1693  memset(obuf, '\0', rlen+1);
1694  bpccpp=((cpp_*bpc_+7)&~7)-8;
1695 }
1696 
1698  unsigned char const *p=(unsigned char const*)buf, *pend0=p+len;
1699  register unsigned int i;
1700  register unsigned raw_x_bpp, prior_x, prior_x_bpp;
1701  // unsigned lines=0;
1702  if (len==0) {
1703  assert(opleft==rlen); /* unflushed (half-ready) row disallowed */
1704  assert(obuf!=NULLP);
1705  delete [] obuf;
1706  obuf=(unsigned char*)NULLP;
1707  out.vi_write(0,0);
1708  return;
1709  }
1710  // fprintf(stderr, "rlen=%u len=%u opleft=%u\n", rlen, len, opleft);
1711  while (p!=pend0) {
1712  raw_x_bpp=(h>>bpccpp) &255;
1713  prior_x=*(o_prior-opleft);
1714  prior_x_bpp=(g>>bpccpp) &255;
1715  i=*p;
1716  *(o_0-opleft)=i;
1717  *(o_1-opleft)=i-raw_x_bpp;
1718  *(o_2-opleft)=i-prior_x;
1719  *(o_3-opleft)=i-((raw_x_bpp+prior_x)>>1);
1720  *(o_4-opleft)=i-paeth_predictor(raw_x_bpp, prior_x, prior_x_bpp);
1721  h=(h<<8)|i; g=(g<<8)|*(o_prior-opleft); *(o_prior-opleft)=*p++;
1722  if (--opleft==0) {
1723  /* Select the predictor having the smallest unsigned sum of values. */
1724  weight_t min_weight, cur_weight;
1725  unsigned min_pred=0, cur_pred;
1726  register signed char *beg, *end;
1727  /* abs_(...) here converts '\xFF' to 1. Good. */
1728  min_weight=0; beg=(end=(signed char*)o_0)-rlen; while (beg!=end) min_weight+=abs_(*beg++);
1729  for (cur_pred=1; cur_pred<=4; cur_pred++) {
1730  cur_weight=0; beg=(end=(signed char*)oo[cur_pred])-rlen; while (beg!=end) cur_weight+=abs_(*beg++);
1731  if (cur_weight<min_weight) { min_weight=cur_weight; min_pred=cur_pred; }
1732  }
1733  // fprintf(stderr, "cp=%u\n", min_pred);
1734 
1735  out.vi_write((char*)(oo[min_pred]-rlen-1),rlen+1);
1736  opleft=rlen; h=0; g=0;
1737  // lines++;
1738  }
1739  }
1740  // fprintf(stderr, "oen=%u opleft=%u lines=%u\n", len, opleft, lines);
1741 }
1742 
1743 /* --- */
1744 
1745 Encoder* PSEncoder::newPredictor(GenBuffer::Writable &out_, unsigned char type, unsigned char bpc_, slen_t columns_, unsigned char cpp_) {
1746  switch ((unsigned)type) {
1747  /* Imp: make these faster with `register int' etc. tricks */
1748  /* See also better_predictor in rule.cpp for the list of predictor numbers */
1749  case 1: return new Filter::VerbatimE(out_);
1750  case 2: return new TIFFPredictor2(out_, bpc_, columns_, cpp_);
1751  case 10: return new PNGPredictorNone(out_, bpc_, columns_, cpp_);
1752  case 11: return new PNGPredictorSub(out_, bpc_, columns_, cpp_);
1753  case 12: return new PNGPredictorUp(out_, bpc_, columns_, cpp_);
1754  case 13: return new PNGPredictorAverage(out_, bpc_, columns_, cpp_);
1755  case 14: return new PNGPredictorPaeth(out_, bpc_, columns_, cpp_);
1756  case 15: return new PNGPredictorAuto(out_, bpc_, columns_, cpp_);
1757  case 45: return new PNGPredictorAutoBadUnsigned(out_, bpc_, columns_, cpp_); /* pts' extension */
1758  case 55: return new PNGPredictorAutoBadSigned(out_, bpc_, columns_, cpp_); /* pts' extension */
1759  }
1760  // fprintf(stderr, "pred=%d\n", type);
1761  param_assert(0 && "invalid predictor requested");
1762  return (Encoder*)0; /*notreached*/
1763 }
1764 
1765 /* __END__ */
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
q
Definition: afm2pl.c:2287
#define type(a)
Definition: aptex-macros.h:171
#define w1
char * obufend
Definition: encoder.cpp:55
GenBuffer::Writable & out
Definition: encoder.cpp:51
char * op
Definition: encoder.cpp:55
char * obuf
Definition: encoder.cpp:55
void wencoded(char const *encoded)
Definition: encoder.cpp:530
ASCII85Encode(GenBuffer::Writable &out_, unsigned maxcpl_)
Definition: encoder.cpp:521
virtual void vi_write(char const *buf, slen_t len)
Definition: encoder.cpp:563
unsigned ascii85left
Definition: encoder.cpp:53
unsigned maxcpl
Definition: encoder.cpp:49
void wout(unsigned int buf_)
Definition: encoder.cpp:610
unsigned ascii85breaklen
Definition: encoder.cpp:52
unsigned int ascii85buf
Definition: encoder.cpp:54
ASCIIHexEncode(GenBuffer::Writable &out_, unsigned maxcpl_)
Definition: encoder.cpp:499
unsigned curcpl
Definition: encoder.cpp:35
GenBuffer::Writable & out
Definition: encoder.cpp:36
unsigned maxcpl
Definition: encoder.cpp:33
virtual void vi_write(char const *buf, slen_t len)
Definition: encoder.cpp:504
virtual void vi_write(char const *buf, slen_t len)
Definition: encoder.cpp:943
stream_cursor_write w
Definition: encoder.cpp:176
unsigned char wbuf[4096]
Definition: encoder.cpp:174
static void * gen_xalloc(unsigned n)
Definition: encoder.cpp:899
static void gen_free(void *ptr)
Definition: encoder.cpp:903
stream_cursor_read r
Definition: encoder.cpp:175
unsigned char rbuf[4096]
Definition: encoder.cpp:173
stream_CFE_state sCFEs
Definition: encoder.cpp:172
CCITTFaxEncode(GenBuffer::Writable &out_, slendiff_t K, slen_t Columns, bool EndOfLine, bool BlackIs1)
Definition: encoder.cpp:913
unsigned char * rlimit
Definition: encoder.cpp:177
static void gen_memset(void *s, int c, unsigned n)
Definition: encoder.cpp:907
static void gen_memcpy(void *dest, const void *src, unsigned n)
Definition: encoder.cpp:910
unsigned char * hard
Definition: encoder.cpp:177
GenBuffer::Writable & out
Definition: encoder.cpp:171
P(GenBuffer::Writable &out_, slen_t Columns, slen_t Rows, bool rgbp_, unsigned char quality)
Definition: encoder.cpp:1049
virtual void vi_copy(FILE *f)
Definition: encoder.cpp:1057
virtual ~CjpegEncode()
Definition: encoder.cpp:236
virtual void vi_write(char const *buf, slen_t len)
Definition: encoder.cpp:1046
CjpegEncode(GenBuffer::Writable &out_, char const *filter_psname, slen_t Columns, slen_t Rows, bool rgbp_, unsigned char quality)
Definition: encoder.cpp:1042
virtual void vi_write(char const *buf, slen_t len)=0
Definition: error.hpp:20
static GenBuffer::Writable & sev(level_t level)
Definition: error.cpp:58
@ EERROR
Definition: error.hpp:29
@ WARNING
Definition: error.hpp:31
static slen_t statSize(char const *filename)
Definition: gensio.cpp:861
virtual void vi_write(char const *buf, slen_t len)
Definition: gensio.cpp:532
char obuf[4096]
Definition: encoder.cpp:98
char workspace[270000]
Definition: encoder.cpp:97
z_stream zs
Definition: encoder.cpp:99
virtual void vi_write(char const *buf, slen_t len)
Definition: encoder.cpp:779
GenBuffer::Writable & out
Definition: encoder.cpp:96
virtual ~FlateEncode()
Definition: encoder.cpp:88
FlateEncode(GenBuffer::Writable &out_, unsigned level_)
Definition: encoder.cpp:764
unsigned s_t
Definition: encoder.cpp:141
unsigned abuflen
Definition: encoder.cpp:149
FlateStoreEncode(GenBuffer::Writable &out_)
Definition: encoder.cpp:409
GenBuffer::Writable & out
Definition: encoder.cpp:139
virtual void vi_write(char const *buf, slen_t len)
Definition: encoder.cpp:425
virtual ~FlateStoreEncode()
Definition: encoder.cpp:136
char abuf[65535+5]
Definition: encoder.cpp:157
virtual void vi_check()
Definition: encoder.cpp:1109
P(GenBuffer::Writable &out_, char const *filter_psname)
Definition: encoder.cpp:1100
GSEncode(GenBuffer::Writable &out_, char const *filter_psname)
Definition: encoder.cpp:1095
virtual ~GSEncode()
Definition: encoder.cpp:214
virtual void vi_write(char const *buf, slen_t len)
Definition: encoder.cpp:1097
Writable & operator<<(GenBuffer const &b)
Definition: gensi.hpp:144
virtual void vi_write(char const *, slen_t)=0
GenBuffer::Writable & out
Definition: encoder.cpp:196
LZWEncode(GenBuffer::Writable &out_)
Definition: encoder.cpp:1002
struct pts_lzw_state fs
Definition: encoder.cpp:197
virtual void vi_write(char const *buf, slen_t len)
Definition: encoder.cpp:1008
unsigned char * o_2
Definition: encoder.cpp:360
PNGPredictorAutoBadSigned(GenBuffer::Writable &out_, unsigned char bpc_, slen_t columns_, unsigned char cpp_)
Definition: encoder.cpp:1557
unsigned char bpccpp
Definition: encoder.cpp:363
unsigned char * oo[5]
Definition: encoder.cpp:360
unsigned char * o_3
Definition: encoder.cpp:360
unsigned char * obuf
Definition: encoder.cpp:360
unsigned char * o_prior
Definition: encoder.cpp:360
GenBuffer::Writable & out
Definition: encoder.cpp:362
unsigned char * o_4
Definition: encoder.cpp:360
virtual void vi_write(char const *buf, slen_t len)
Definition: encoder.cpp:1573
unsigned char * o_1
Definition: encoder.cpp:360
unsigned char * o_0
Definition: encoder.cpp:360
unsigned char * obuf
Definition: encoder.cpp:378
unsigned char * oo[5]
Definition: encoder.cpp:378
unsigned char * o_prior
Definition: encoder.cpp:378
virtual void vi_write(char const *buf, slen_t len)
Definition: encoder.cpp:1634
GenBuffer::Writable & out
Definition: encoder.cpp:380
PNGPredictorAutoBadUnsigned(GenBuffer::Writable &out_, unsigned char bpc_, slen_t columns_, unsigned char cpp_)
Definition: encoder.cpp:1618
unsigned char * o_prior
Definition: encoder.cpp:400
unsigned int g
Definition: encoder.cpp:399
GenBuffer::Writable & out
Definition: encoder.cpp:402
unsigned char * o_3
Definition: encoder.cpp:400
virtual void vi_write(char const *buf, slen_t len)
Definition: encoder.cpp:1697
unsigned char * o_2
Definition: encoder.cpp:400
unsigned char * o_0
Definition: encoder.cpp:400
unsigned char * o_4
Definition: encoder.cpp:400
unsigned char * o_1
Definition: encoder.cpp:400
PNGPredictorAuto(GenBuffer::Writable &out_, unsigned char bpc_, slen_t columns_, unsigned char cpp_)
Definition: encoder.cpp:1681
unsigned char * oo[5]
Definition: encoder.cpp:400
unsigned char bpccpp
Definition: encoder.cpp:403
unsigned char * obuf
Definition: encoder.cpp:400
unsigned int h
Definition: encoder.cpp:399
unsigned int h
Definition: encoder.cpp:329
unsigned char bpccpp
Definition: encoder.cpp:333
virtual void vi_write(char const *buf, slen_t len)
Definition: encoder.cpp:1461
PNGPredictorAverage(GenBuffer::Writable &out_, unsigned char bpc_, slen_t columns_, unsigned char cpp_)
Definition: encoder.cpp:1450
GenBuffer::Writable & out
Definition: encoder.cpp:332
unsigned char * op
Definition: encoder.cpp:330
unsigned char * obuf
Definition: encoder.cpp:330
unsigned char * oq
Definition: encoder.cpp:330
GenBuffer::Writable & out
Definition: encoder.cpp:296
PNGPredictorNone(GenBuffer::Writable &out_, unsigned char bpc_, slen_t columns_, unsigned char cpp_)
Definition: encoder.cpp:1362
virtual void vi_write(char const *buf, slen_t len)
Definition: encoder.cpp:1367
unsigned char * obuf
Definition: encoder.cpp:343
unsigned char * op
Definition: encoder.cpp:343
GenBuffer::Writable & out
Definition: encoder.cpp:345
unsigned int g
Definition: encoder.cpp:342
unsigned char * oq
Definition: encoder.cpp:343
unsigned int h
Definition: encoder.cpp:342
unsigned char bpccpp
Definition: encoder.cpp:346
virtual void vi_write(char const *buf, slen_t len)
Definition: encoder.cpp:1525
PNGPredictorPaeth(GenBuffer::Writable &out_, unsigned char bpc_, slen_t columns_, unsigned char cpp_)
Definition: encoder.cpp:1514
GenBuffer::Writable & out
Definition: encoder.cpp:308
unsigned char bpccpp
Definition: encoder.cpp:309
PNGPredictorSub(GenBuffer::Writable &out_, unsigned char bpc_, slen_t columns_, unsigned char cpp_)
Definition: encoder.cpp:1387
virtual void vi_write(char const *buf, slen_t len)
Definition: encoder.cpp:1396
unsigned char * obuf
Definition: encoder.cpp:306
unsigned char * op
Definition: encoder.cpp:306
unsigned int h
Definition: encoder.cpp:305
unsigned char * obuf
Definition: encoder.cpp:318
GenBuffer::Writable & out
Definition: encoder.cpp:320
PNGPredictorUp(GenBuffer::Writable &out_, unsigned char bpc_, slen_t columns_, unsigned char cpp_)
Definition: encoder.cpp:1418
virtual void vi_write(char const *buf, slen_t len)
Definition: encoder.cpp:1428
unsigned char * op
Definition: encoder.cpp:318
unsigned char * oq
Definition: encoder.cpp:318
static PSEncoder * newFlateEncode(GenBuffer::Writable &out_, signed Effort=-1)
Definition: encoder.cpp:1183
static Encoder * newPredictor(GenBuffer::Writable &out_, unsigned char type, unsigned char bpc_, slen_t columns_, unsigned char cpp_)
Definition: encoder.cpp:1745
static PSEncoder * newASCII85Encode(GenBuffer::Writable &out_, unsigned maxcpl_)
Definition: encoder.cpp:1127
static PSEncoder * newRunLengthEncode(GenBuffer::Writable &out_, slen_t RecordSize=0)
Definition: encoder.cpp:1203
static PSEncoder * newASCIIHexEncode(GenBuffer::Writable &out_, unsigned maxcpl_)
Definition: encoder.cpp:1119
static PSEncoder * newCCITTFaxEncode(GenBuffer::Writable &out_, slendiff_t K, slen_t Columns, bool EndOfLine=((bool) 0), bool BlackIs1=((bool) 0))
Definition: encoder.cpp:1135
static PSEncoder * newLZWEncode(GenBuffer::Writable &out_)
Definition: encoder.cpp:1153
static PSEncoder * newDCTEncode(GenBuffer::Writable &out_, slen_t Columns, slen_t Rows, unsigned char Colors, unsigned char ColorTransform, SimBuffer::Flat const &other_parameters)
Definition: encoder.cpp:1279
static PSEncoder * newDCTIJGEncode(GenBuffer::Writable &out_, slen_t Columns, slen_t Rows, unsigned char Colors, unsigned char quality)
Definition: encoder.cpp:1212
unsigned saved_rep
Definition: encoder.cpp:71
GenBuffer::Writable & out
Definition: encoder.cpp:68
slen_t recordsize
Definition: encoder.cpp:67
unsigned saved_c
Definition: encoder.cpp:71
char saved[130]
Definition: encoder.cpp:73
slen_t record_left
Definition: encoder.cpp:70
RunLengthEncode(GenBuffer::Writable &out_, slen_t RecordSize_)
Definition: encoder.cpp:637
virtual void vi_write(char const *buf, slen_t len)
Definition: encoder.cpp:645
void clear()
Definition: gensi.hpp:515
virtual void vi_write(char const *, slen_t)
Definition: gensi.cpp:866
virtual void vi_write(char const *buf, slen_t len)
Definition: encoder.cpp:1307
unsigned int h
Definition: encoder.cpp:283
GenBuffer::Writable & out
Definition: encoder.cpp:286
TIFFPredictor2(GenBuffer::Writable &out_, unsigned char bpc_, slen_t columns_, unsigned char cpp_)
Definition: encoder.cpp:1300
unsigned char * op
Definition: encoder.cpp:284
unsigned char cpp
Definition: encoder.cpp:284
unsigned char bpc
Definition: encoder.cpp:284
unsigned char * obuf
Definition: encoder.cpp:284
#define n
Definition: t4ht.c:1290
#define PTS_INT32_T
Definition: config-vc6.h:49
signed int slendiff_t
Definition: config2.h:38
unsigned int slen_t
Definition: config2.h:37
#define NULLP
Definition: config2.h:66
#define MACRO_GETC
Definition: config2.h:333
#define param_assert
Definition: config2.h:96
#define b
Definition: jpegint.h:372
long pc
Definition: disdvi.c:114
int h
Definition: dviconv.c:9
#define fread
Definition: xxstdio.h:25
#define skip(p, c)
Definition: ptexmac.h:70
static unsigned abs_(unsigned i)
Definition: encoder.cpp:1488
int weight_t
Definition: encoder.cpp:1552
static int gen_write(char *block, unsigned len, void *zfile)
Definition: encoder.cpp:890
static unsigned paeth_predictor(unsigned a, unsigned b, unsigned c)
Definition: encoder.cpp:1490
#define ABUFSIZE
Definition: encoder.cpp:154
cmd_t K[128]
Definition: fmtutil.c:72
static void
Definition: fpif.c:118
Integer_T bad
StrNumber_T s_t
mpz_t * f
Definition: gen-fib.c:34
#define s
Definition: afcover.h:80
paragraph P
#define c(n)
Definition: gpos-common.c:150
#define a(n)
Definition: gpos-common.c:148
#define d(n)
Definition: gpos-common.c:151
#define memcmp(s1, s2, n)
Definition: gsftopk.c:66
#define memmove(d, s, n)
Definition: gsftopk.c:65
#define memcpy(d, s, n)
Definition: gsftopk.c:64
FILE * out
Definition: hbf2gf.c:286
assert(pcxLoadImage24((char *)((void *) 0), fp, pinfo, hdr))
#define NULL
Definition: ftobjs.h:61
small capitals from c petite p
Definition: afcover.h:72
small capitals from c petite p scientific i
Definition: afcover.h:80
#define Z_UNKNOWN
Definition: zlib.h:158
#define Z_STREAM_END
Definition: zlib.h:133
#define Z_FINISH
Definition: zlib.h:129
#define Z_OK
Definition: zlib.h:132
#define false
Definition: ftrandom.c:52
#define buf
static int ret
Definition: convert.c:72
union hdr header
Definition: pbmtomacp.c:291
#define dest
cpp
Definition: cutout.py:14
set set set set set set set macro pixldst1 abits if abits op else op endif endm macro pixldst2 abits if abits op else op endif endm macro pixldst4 abits if abits op else op endif endm macro pixldst0 abits op endm macro pixldst3 mem_operand op endm macro pixldst30 mem_operand op endm macro pixldst abits if abits elseif abits elseif abits elseif abits elseif abits pixldst0 abits else pixldst0 abits pixldst0 abits pixldst0 abits pixldst0 abits endif elseif abits else pixldst0 abits pixldst0 abits endif elseif abits else error unsupported bpp *numpix else pixst endif endm macro pixld1_s mem_operand if asr adds SRC_WIDTH_FIXED bpl add asl mov asr adds SRC_WIDTH_FIXED bpl add asl mov asr adds SRC_WIDTH_FIXED bpl add asl mov asr adds SRC_WIDTH_FIXED bpl add asl elseif asr adds SRC_WIDTH_FIXED bpl add asl mov asr adds SRC_WIDTH_FIXED bpl add asl else error unsupported endif endm macro pixld2_s mem_operand if mov asr add asl add asl mov asr sub UNIT_X add asl mov asr add asl add asl mov asr add UNIT_X add asl else pixld1_s mem_operand pixld1_s mem_operand endif endm macro pixld0_s mem_operand if asr adds SRC_WIDTH_FIXED bpl add asl elseif asr adds SRC_WIDTH_FIXED bpl add asl endif endm macro pixld_s_internal mem_operand if mem_operand pixld2_s mem_operand pixdeinterleave basereg elseif mem_operand elseif mem_operand elseif mem_operand elseif mem_operand pixld0_s mem_operand else pixld0_s mem_operand pixld0_s mem_operand pixld0_s mem_operand pixld0_s mem_operand endif elseif mem_operand else pixld0_s mem_operand pixld0_s mem_operand endif elseif mem_operand else error unsupported mem_operand if bpp mem_operand endif endm macro vuzp8 reg2 vuzp d d &reg2 endm macro vzip8 reg2 vzip d d &reg2 endm macro pixdeinterleave basereg basereg basereg basereg basereg endif endm macro pixinterleave basereg basereg basereg basereg basereg endif endm macro PF boost_increment endif if endif PF tst PF addne PF subne PF cmp ORIG_W if endif if endif if endif PF subge ORIG_W PF subges if endif if endif if endif endif endm macro cache_preload_simple endif if dst_r_bpp pld[DST_R, #(PREFETCH_DISTANCE_SIMPLE *dst_r_bpp/8)] endif if mask_bpp pld if[MASK, #(PREFETCH_DISTANCE_SIMPLE *mask_bpp/8)] endif endif endm macro fetch_mask_pixblock pixld mask_basereg pixblock_size MASK endm macro ensure_destination_ptr_alignment process_pixblock_tail_head if beq irp skip1(dst_w_bpp<=(lowbit *8)) &&((lowbit *8)<(pixblock_size *dst_w_bpp)) .if lowbit< 16 tst DST_R
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
#define fp
int g
Definition: ppmqvga.c:68
int r
Definition: ppmqvga.c:68
static int quality
Definition: ppmtopjxl.c:45
bstring c int memset(void *s, int c, int length)
int zlib_deflateEnd(z_streamp strm)
Definition: pts_defl.c:1774
int zlib_deflate_workspacesize(void)
Definition: pts_defl.c:2490
int zlib_deflate(z_streamp strm, int flush)
Definition: pts_defl.c:1636
#define ZLIB_DEFLATE_WORKSPACESIZE_MIN
Definition: pts_defl.h:21
#define zlib_deflateInit(strm, level)
Definition: pts_defl.h:95
const stream_template s_CFE_template
Definition: pts_fax.c:1098
#define cfe_max_width
Definition: pts_fax.c:421
#define PTSFAX_EOFC
Definition: pts_fax.h:121
#define PTSFAX_ERRC
Definition: pts_fax.h:123
int pts_lzw_init(TIFF *tif)
Definition: pts_lzw.c:1426
static int LZWEncode(TIFF *tif, tidataval_t *bp, tsize_t cc)
Definition: pts_lzw.c:929
static uint8_t obuf[8192]
Definition: buildvm_lib.c:13
Definition: sh.h:1226
tiwriter_t tif_writer
Definition: pts_lzw.h:36
int(* tif_feeder)(char *readbuf, unsigned readlen, struct pts_lzw_state *tif)
Definition: pts_lzw.h:37
void * tif_sout
Definition: pts_lzw.h:35
gssss_memset_t memset_
Definition: pts_fax.h:447
gssss_xalloc_t xalloc_
Definition: pts_fax.h:447
gssss_free_t free_
Definition: pts_fax.h:447
gssss_memcpy_t memcpy_
Definition: pts_fax.h:447
int DamagedRowsBeforeError
Definition: pts_fax.h:447
const unsigned char * ptr
Definition: pts_fax.h:139
const unsigned char * limit
Definition: pts_fax.h:140
unsigned char * ptr
Definition: pts_fax.h:145
unsigned char * limit
Definition: pts_fax.h:146
unsigned int min_out_size
Definition: pts_fax.h:347
int(* process)()
Definition: pts_fax.h:343
int(* init)()
Definition: pts_fax.h:339
unsigned int min_in_size
Definition: pts_fax.h:346
void(* set_defaults)()
Definition: pts_fax.h:354
void(* release)()
Definition: pts_fax.h:350
Definition: exec.h:58
uInt avail_in
Definition: zlib.h:70
Bytef * next_in
Definition: zlib.h:69
uInt avail_out
Definition: zlib.h:74
void * workspace
Definition: pts_defl.h:71
char * msg
Definition: zlib.h:77
Bytef * next_out
Definition: zlib.h:73
int data_type
Definition: zlib.h:84
struct internal_state * state
Definition: zlib.h:78
uLong total_in
Definition: zlib.h:71
uLong total_out
Definition: zlib.h:75
#define FILE
Definition: t1stdio.h:34
#define feof(f)
Definition: t1stdio.h:109
#define ferror(f)
Definition: t1stdio.h:110
int j
Definition: t4ht.c:1589
s1
Definition: t4ht.c:1059
char * s2
Definition: t4ht.c:1062
#define end(cp)
Definition: zic.c:71