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)  

writecff.c
Go to the documentation of this file.
1 /*
2 
3 Copyright 2006-2010 Taco Hoekwater <taco@luatex.org>
4 
5 This file is part of LuaTeX.
6 
7 LuaTeX is free software; you can redistribute it and/or modify it under
8 the terms of the GNU General Public License as published by the Free
9 Software Foundation; either version 2 of the License, or (at your
10 option) any later version.
11 
12 LuaTeX is distributed in the hope that it will be useful, but WITHOUT
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
15 License for more details.
16 
17 You should have received a copy of the GNU General Public License along
18 with LuaTeX; if not, see <http://www.gnu.org/licenses/>.
19 
20 */
21 
22 #include "ptexlib.h"
23 #include "lua/luatex-api.h"
24 #include "font/writecff.h"
25 
26 extern int cidset;
27 
28 #define get_offset(s,n) get_unsigned(s, (n))
29 #define get_card8(a) (card8)(a->stream[a->offset++])
30 #define get_card16(a) (card16)(get_unsigned(a,2))
31 #define get_card32(a) (get_unsigned(a,4))
32 
33 #undef b0
34 #undef b1
35 #undef b2
36 #undef b3
37 
38 #define WORK_BUFFER_SIZE 1024
39 
41 
42 static unsigned long get_unsigned(cff_font * cff, int n)
43 {
44  unsigned long v = 0;
45  while (n-- > 0)
46  v = v * 256 + get_card8(cff);
47  return v;
48 }
49 
50 const char *const cff_stdstr[CFF_STDSTR_MAX] = {
51  ".notdef", "space", "exclam", "quotedbl", "numbersign",
52  "dollar", "percent", "ampersand", "quoteright", "parenleft",
53  "parenright", "asterisk", "plus", "comma", "hyphen",
54  "period", "slash", "zero", "one", "two",
55  "three", "four", "five", "six", "seven",
56  "eight", "nine", "colon", "semicolon", "less",
57  "equal", "greater", "question", "at", "A",
58  "B", "C", "D", "E", "F",
59  "G", "H", "I", "J", "K",
60  "L", "M", "N", "O", "P",
61  "Q", "R", "S", "T", "U",
62  "V", "W", "X", "Y", "Z",
63  "bracketleft", "backslash", "bracketright", "asciicircum", "underscore",
64  "quoteleft", "a", "b", "c", "d",
65  "e", "f", "g", "h", "i",
66  "j", "k", "l", "m", "n",
67  "o", "p", "q", "r", "s",
68  "t", "u", "v", "w", "x",
69  "y", "z", "braceleft", "bar", "braceright",
70  "asciitilde", "exclamdown", "cent", "sterling", "fraction",
71  "yen", "florin", "section", "currency", "quotesingle",
72  "quotedblleft", "guillemotleft", "guilsinglleft", "guilsinglright", "fi",
73  "fl", "endash", "dagger", "daggerdbl", "periodcentered",
74  "paragraph", "bullet", "quotesinglbase", "quotedblbase", "quotedblright",
75  "guillemotright", "ellipsis", "perthousand", "questiondown", "grave",
76  "acute", "circumflex", "tilde", "macron", "breve",
77  "dotaccent", "dieresis", "ring", "cedilla", "hungarumlaut",
78  "ogonek", "caron", "emdash", "AE", "ordfeminine",
79  "Lslash", "Oslash", "OE", "ordmasculine", "ae",
80  "dotlessi", "lslash", "oslash", "oe", "germandbls",
81  "onesuperior", "logicalnot", "mu", "trademark", "Eth",
82  "onehalf", "plusminus", "Thorn", "onequarter", "divide",
83  "brokenbar", "degree", "thorn", "threequarters", "twosuperior",
84  "registered", "minus", "eth", "multiply", "threesuperior",
85  "copyright", "Aacute", "Acircumflex", "Adieresis", "Agrave",
86  "Aring", "Atilde", "Ccedilla", "Eacute", "Ecircumflex",
87  "Edieresis", "Egrave", "Iacute", "Icircumflex", "Idieresis",
88  "Igrave", "Ntilde", "Oacute", "Ocircumflex", "Odieresis",
89  "Ograve", "Otilde", "Scaron", "Uacute", "Ucircumflex",
90  "Udieresis", "Ugrave", "Yacute", "Ydieresis", "Zcaron",
91  "aacute", "acircumflex", "adieresis", "agrave", "aring",
92  "atilde", "ccedilla", "eacute", "ecircumflex", "edieresis",
93  "egrave", "iacute", "icircumflex", "idieresis", "igrave",
94  "ntilde", "oacute", "ocircumflex", "odieresis", "ograve",
95  "otilde", "scaron", "uacute", "ucircumflex", "udieresis",
96  "ugrave", "yacute", "ydieresis", "zcaron", "exclamsmall",
97  "Hungarumlautsmall", "dollaroldstyle", "dollarsuperior", "ampersandsmall",
98  "Acutesmall",
99  "parenleftsuperior", "parenrightsuperior", "twodotenleader",
100  "onedotenleader", "zerooldstyle",
101  "oneoldstyle", "twooldstyle", "threeoldstyle", "fouroldstyle",
102  "fiveoldstyle",
103  "sixoldstyle", "sevenoldstyle", "eightoldstyle", "nineoldstyle",
104  "commasuperior",
105  "threequartersemdash", "periodsuperior", "questionsmall", "asuperior",
106  "bsuperior",
107  "centsuperior", "dsuperior", "esuperior", "isuperior", "lsuperior",
108  "msuperior", "nsuperior", "osuperior", "rsuperior", "ssuperior",
109  "tsuperior", "ff", "ffi", "ffl", "parenleftinferior",
110  "parenrightinferior", "Circumflexsmall", "hyphensuperior", "Gravesmall",
111  "Asmall",
112  "Bsmall", "Csmall", "Dsmall", "Esmall", "Fsmall",
113  "Gsmall", "Hsmall", "Ismall", "Jsmall", "Ksmall",
114  "Lsmall", "Msmall", "Nsmall", "Osmall", "Psmall",
115  "Qsmall", "Rsmall", "Ssmall", "Tsmall", "Usmall",
116  "Vsmall", "Wsmall", "Xsmall", "Ysmall", "Zsmall",
117  "colonmonetary", "onefitted", "rupiah", "Tildesmall", "exclamdownsmall",
118  "centoldstyle", "Lslashsmall", "Scaronsmall", "Zcaronsmall",
119  "Dieresissmall",
120  "Brevesmall", "Caronsmall", "Dotaccentsmall", "Macronsmall", "figuredash",
121  "hypheninferior", "Ogoneksmall", "Ringsmall", "Cedillasmall",
122  "questiondownsmall",
123  "oneeighth", "threeeighths", "fiveeighths", "seveneighths", "onethird",
124  "twothirds", "zerosuperior", "foursuperior", "fivesuperior", "sixsuperior",
125  "sevensuperior", "eightsuperior", "ninesuperior", "zeroinferior",
126  "oneinferior",
127  "twoinferior", "threeinferior", "fourinferior", "fiveinferior",
128  "sixinferior",
129  "seveninferior", "eightinferior", "nineinferior", "centinferior",
130  "dollarinferior",
131  "periodinferior", "commainferior", "Agravesmall", "Aacutesmall",
132  "Acircumflexsmall",
133  "Atildesmall", "Adieresissmall", "Aringsmall", "AEsmall", "Ccedillasmall",
134  "Egravesmall", "Eacutesmall", "Ecircumflexsmall", "Edieresissmall",
135  "Igravesmall",
136  "Iacutesmall", "Icircumflexsmall", "Idieresissmall", "Ethsmall",
137  "Ntildesmall",
138  "Ogravesmall", "Oacutesmall", "Ocircumflexsmall", "Otildesmall",
139  "Odieresissmall",
140  "OEsmall", "Oslashsmall", "Ugravesmall", "Uacutesmall", "Ucircumflexsmall",
141  "Udieresissmall", "Yacutesmall", "Thornsmall", "Ydieresissmall",
142  "001.000", "001.001", "001.002", "001.003",
143  "Black", "Bold", "Book", "Light", "Medium", "Regular", "Roman", "Semibold"
144 };
145 
146 /*tex Only read the header part and forget about the body */
147 
149 {
150  cff_index *idx;
151  card16 i, count;
152  idx = xcalloc(1, sizeof(cff_index));
153  if (cff->header_major == 2) {
154  idx->count = count = get_card32(cff);
155  } else {
156  idx->count = count = get_card16(cff);
157  }
158  if (count > 0) {
159  idx->offsize = get_card8(cff);
160  if (idx->offsize < 1 || idx->offsize > 4)
161  normal_error("cff","invalid offsize data (1)");
162  idx->offset = xmalloc((unsigned) (((unsigned) count + 1) * sizeof(l_offset)));
163  for (i = 0; i <count + 1 ; i++) {
164  (idx->offset)[i] = get_offset(cff, idx->offsize);
165  if (i == USHRT_MAX)
166  break;
167  }
168  if (idx->offset[0] != 1)
169  normal_error("cff","invalid index data");
170  idx->data = NULL;
171  } else {
172  idx->offsize = 0;
173  idx->offset = NULL;
174  idx->data = NULL;
175  }
176  return idx;
177 }
178 
180 {
181  cff_index *idx;
182  card16 i, count;
183  size_t length;
184  idx = xcalloc(1, sizeof(cff_index));
185  idx->count = count = get_card16(cff);
186  if (count > 0) {
187  idx->offsize = get_card8(cff);
188  if (idx->offsize < 1 || idx->offsize > 4)
189  normal_error("cff","invalid offsize data (2)");
190  idx->offset = xmalloc((unsigned) (((unsigned) count + 1) * sizeof(l_offset)));
191  for (i = 0; i < count + 1; i++) {
192  idx->offset[i] = get_offset(cff, idx->offsize);
193  }
194  if (idx->offset[0] != 1)
195  normal_error("cff","invalid index offset data");
196  length = (size_t) (idx->offset[count] - idx->offset[0]);
197  idx->data = xmalloc((unsigned) length * sizeof(card8));
198  memcpy(idx->data, &cff->stream[cff->offset], length);
199  cff->offset += length;
200  } else {
201  idx->offsize = 0;
202  idx->offset = NULL;
203  idx->data = NULL;
204  }
205  return idx;
206 }
207 
209 {
210  cff_index *idx;
211  idx = xcalloc(1, sizeof(cff_index));
212  idx->count = 0;
213  idx->offsize = 0;
214  idx->offset = NULL;
215  idx->data = NULL;
216  return idx;
217 }
218 
220 {
221  /*tex We fake a dict array. */
222  cff_index *idx;
223  size_t length;
224  idx = xcalloc(1, sizeof(cff_index));
225  length = (size_t) cff->header_offsize;
226  idx->offsize = 2;
227  idx->count = 1;
228  idx->offset = xmalloc((unsigned) (((unsigned) 2) * sizeof(l_offset)));
229  idx->offset[0] = 1;
230  idx->offset[1] = length + 1;
231  idx->data = xmalloc((unsigned) length * sizeof(card8));
232  memcpy(idx->data, &cff->stream[cff->offset], length );
233  cff->offset += length ;
234  return idx;
235 }
236 
237 long cff_pack_index(cff_index * idx, card8 * dest, long destlen)
238 {
239  long len = 0;
240  unsigned long datalen;
241  card16 i;
242  if (idx->count < 1) {
243  if (destlen < 2)
244  normal_error("cff","not enough space available");
245  memset(dest, 0, 2);
246  return 2;
247  }
249  datalen = idx->offset[idx->count] - 1;
250  if (destlen < len)
251  normal_error("cff","not enough space available");
252  *(dest++) = (card8) ((idx->count >> 8) & 0xff);
253  *(dest++) = (card8) (idx->count & 0xff);
254  if (datalen < 0xffUL) {
255  idx->offsize = 1;
256  *(dest++) = 1;
257  for (i = 0; i <= idx->count; i++) {
258  *(dest++) = (card8) (idx->offset[i] & 0xff);
259  }
260  } else if (datalen < 0xffffUL) {
261  idx->offsize = 2;
262  *(dest++) = 2;
263  for (i = 0; i <= idx->count; i++) {
264  *(dest++) = (card8) ((idx->offset[i] >> 8) & 0xff);
265  *(dest++) = (card8) (idx->offset[i] & 0xff);
266  }
267  } else if (datalen < 0xffffffUL) {
268  idx->offsize = 3;
269  *(dest++) = 3;
270  for (i = 0; i <= idx->count; i++) {
271  *(dest++) = (card8) ((idx->offset[i] >> 16) & 0xff);
272  *(dest++) = (card8) ((idx->offset[i] >> 8) & 0xff);
273  *(dest++) = (card8) (idx->offset[i] & 0xff);
274  }
275  } else {
276  idx->offsize = 4;
277  *(dest++) = 4;
278  for (i = 0; i <= idx->count; i++) {
279  *(dest++) = (card8) ((idx->offset[i] >> 24) & 0xff);
280  *(dest++) = (card8) ((idx->offset[i] >> 16) & 0xff);
281  *(dest++) = (card8) ((idx->offset[i] >> 8) & 0xff);
282  *(dest++) = (card8) (idx->offset[i] & 0xff);
283  }
284  }
285  memmove(dest, idx->data, idx->offset[idx->count] - 1);
286  return len;
287 }
288 
290 {
291  if (idx->count > 0) {
292  l_offset datalen;
293  datalen = idx->offset[idx->count] - 1;
294  if (datalen < 0xffUL) {
295  idx->offsize = 1;
296  } else if (datalen < 0xffffUL) {
297  idx->offsize = 2;
298  } else if (datalen < 0xffffffUL) {
299  idx->offsize = 3;
300  } else {
301  idx->offsize = 4;
302  }
303  return (3 + (idx->offsize) * (idx->count + 1) + (long) datalen);
304  } else {
305  return 2;
306  }
307 }
308 
310 {
311  cff_index *idx;
312  idx = xcalloc(1, sizeof(cff_index));
313  idx->count = count;
314  idx->offsize = 0;
315  if (count > 0) {
316  idx->offset = xcalloc((unsigned) (count + 1), sizeof(l_offset));
317  (idx->offset)[0] = 1;
318  } else {
319  idx->offset = NULL;
320  }
321  idx->data = NULL;
322  return idx;
323 }
324 
326 {
327  if (idx) {
328  xfree(idx->data);
329  xfree(idx->offset);
330  xfree(idx);
331  }
332 }
333 
335 {
336  if (dict) {
337  if (dict->entries) {
338  int i;
339  for (i = 0; i < dict->count; i++) {
340  xfree((dict->entries)[i].values);
341  }
342  xfree(dict->entries);
343  }
344  xfree(dict);
345  }
346 }
347 
349 {
350  if (encoding) {
351  switch (encoding->format & (~0x80)) {
352  case 0:
353  xfree(encoding->data.codes);
354  break;
355  case 1:
356  xfree(encoding->data.range1);
357  break;
358  default:
359  normal_error("cff","unknown encoding format");
360  }
361  if (encoding->format & 0x80)
362  xfree(encoding->supp);
363  xfree(encoding);
364  }
365 }
366 
368 {
369  if (charset) {
370  switch (charset->format) {
371  case 0:
372  xfree(charset->data.glyphs);
373  break;
374  case 1:
375  xfree(charset->data.range1);
376  break;
377  case 2:
378  xfree(charset->data.range2);
379  break;
380  default:
381  break;
382  }
383  xfree(charset);
384  }
385 }
386 
388 {
389  if (fdselect) {
390  if (fdselect->format == 0) {
391  xfree(fdselect->data.fds);
392  } else if (fdselect->format == 3) {
393  xfree(fdselect->data.ranges);
394  }
395  xfree(fdselect);
396  }
397 }
398 
400 {
401  card16 i;
402  if (cff) {
403  xfree(cff->fontname);
404  if (cff->name)
405  cff_release_index(cff->name);
406  if (cff->topdict)
407  cff_release_dict(cff->topdict);
408  if (cff->string)
409  cff_release_index(cff->string);
410  if (cff->gsubr)
411  cff_release_index(cff->gsubr);
412  if (cff->encoding)
414  if (cff->charsets)
415  cff_release_charsets(cff->charsets);
416  if (cff->fdselect)
417  cff_release_fdselect(cff->fdselect);
418  if (cff->cstrings)
419  cff_release_index(cff->cstrings);
420  if (cff->fdarray) {
421  for (i = 0; i < cff->num_fds; i++) {
422  if (cff->fdarray[i])
423  cff_release_dict(cff->fdarray[i]);
424  }
425  xfree(cff->fdarray);
426  }
427  if (cff->private) {
428  for (i = 0; i < cff->num_fds; i++) {
429  if (cff->private[i])
430  cff_release_dict(cff->private[i]);
431  }
432  xfree(cff->private);
433  }
434  if (cff->subrs) {
435  for (i = 0; i < cff->num_fds; i++) {
436  if (cff->subrs[i])
437  cff_release_index(cff->subrs[i]);
438  }
439  xfree(cff->subrs);
440  }
441  if (cff->_string)
442  cff_release_index(cff->_string);
443  xfree(cff);
444  }
445  return;
446 }
447 
449 {
450  char *fontname;
451  l_offset len;
452  cff_index *idx;
453  idx = cff->name;
454  len = idx->offset[cff->index + 1] - idx->offset[cff->index];
455  fontname = xmalloc((unsigned) (len + 1) * sizeof(char));
456  memcpy(fontname, idx->data + idx->offset[cff->index] - 1, len);
457  fontname[len] = '\0';
458  return fontname;
459 }
460 
462 {
463  cff_index *idx;
464  if (strlen(name) > 127)
465  normal_error("cff","FontName string length too large");
466  if (cff->name)
467  cff_release_index(cff->name);
468  cff->name = idx = xcalloc(1, sizeof(cff_index));
469  idx->count = 1;
470  idx->offsize = 1;
471  idx->offset = xmalloc(2 * sizeof(l_offset));
472  (idx->offset)[0] = 1;
473  (idx->offset)[1] = strlen(name) + 1;
474  idx->data = xmalloc((unsigned) strlen(name) * sizeof(card8));
475  /*tex No trailing |\0| */
476  memmove(idx->data, name, strlen(name));
477  return (long) (5 + strlen(name));
478 }
479 
480 long cff_put_header(cff_font * cff, card8 * dest, long destlen)
481 {
482  if (destlen < 4)
483  normal_error("cff","not enough space available");
484  /*tex cff->header_major */
485  *(dest++) = 1;
486  *(dest++) = cff->header_minor;
487  *(dest++) = 4;
488  /*tex
489  Additional data in between header and Name INDEX is ignored. We will set
490  all offset (0) to a four-byte integer.
491  */
492  *(dest++) = 4;
493  cff->header_offsize = 4;
494  return 4;
495 }
496 
497 #define CFF_PARSE_OK 0
498 #define CFF_CFF_ERROR_PARSE_CFF_ERROR -1
499 #define CFF_CFF_ERROR_STACK_OVERFLOW -2
500 #define CFF_CFF_ERROR_STACK_UNDERFLOW -3
501 #define CFF_CFF_ERROR_STACK_RANGECHECK -4
502 
503 #define DICT_ENTRY_MAX 16
504 
506 {
507  cff_dict *dict;
508  dict = xcalloc(1, sizeof(cff_dict));
509  dict->max = DICT_ENTRY_MAX;
510  dict->count = 0;
511  dict->entries = xcalloc((unsigned) dict->max, sizeof(cff_dict_entry));
512  return dict;
513 }
514 
515 /*tex
516 
517  Operand stack: only numbers are stored (as double). Operand types are:
518 
519  \startitemize
520  \startitem number: double (integer or real) \stopitem
521  \startitem boolean: stored as a number \stopitem
522  \startitem SID: stored as a number \stopitem
523  \startitem array: array of numbers \stopitem
524  \startitem delta: array of numbers \stopitem
525  \stopitemize
526 
527 */
528 
529 #define CFF_DICT_STACK_LIMIT 64
530 static int stack_top = 0;
532 
533 /* The CFF DICT encoding: */
534 
535 #define CFF_LAST_DICT_OP1 26
536 #define CFF_LAST_DICT_OP2 39
537 #define CFF_LAST_DICT_OP (CFF_LAST_DICT_OP1 + CFF_LAST_DICT_OP2)
538 
539 static struct {
540  const char *opname;
541  int argtype;
543  { "version", CFF_TYPE_SID },
544  { "Notice", CFF_TYPE_SID },
545  { "FullName", CFF_TYPE_SID },
546  { "FamilyName", CFF_TYPE_SID },
547  { "Weight", CFF_TYPE_SID },
548  { "FontBBox", CFF_TYPE_ARRAY },
549  { "BlueValues", CFF_TYPE_DELTA },
550  { "OtherBlues", CFF_TYPE_DELTA },
551  { "FamilyBlues", CFF_TYPE_DELTA },
552  { "FamilyOtherBlues", CFF_TYPE_DELTA },
553  { "StdHW", CFF_TYPE_NUMBER },
554  { "StdVW", CFF_TYPE_NUMBER },
555  { NULL, -1 },
556  { "UniqueID", CFF_TYPE_NUMBER },
557  { "XUID", CFF_TYPE_ARRAY },
558  { "charset", CFF_TYPE_OFFSET },
559  { "Encoding", CFF_TYPE_OFFSET },
560  { "CharStrings", CFF_TYPE_OFFSET },
561  { "Private", CFF_TYPE_SZOFF },
562  { "Subrs", CFF_TYPE_OFFSET },
563  { "defaultWidthX", CFF_TYPE_NUMBER },
564  { "nominalWidthX", CFF_TYPE_NUMBER },
565  { NULL, -1 },
566  { NULL, -1 },
567  /*tex two CFF2 instructions */
568  { "vstore", CFF_TYPE_OFFSET },
569  { "maxstack", CFF_TYPE_NUMBER },
570  /*tex Here we start with operator 2 of 12. */
571  { "Copyright", CFF_TYPE_SID },
572  { "IsFixedPitch", CFF_TYPE_BOOLEAN },
573  { "ItalicAngle", CFF_TYPE_NUMBER },
574  { "UnderlinePosition", CFF_TYPE_NUMBER },
575  { "UnderlineThickness", CFF_TYPE_NUMBER },
576  { "PaintType", CFF_TYPE_NUMBER },
577  { "CharstringType", CFF_TYPE_NUMBER },
578  { "FontMatrix", CFF_TYPE_ARRAY },
579  { "StrokeWidth", CFF_TYPE_NUMBER },
580  { "BlueScale", CFF_TYPE_NUMBER },
581  { "BlueShift", CFF_TYPE_NUMBER },
582  { "BlueFuzz", CFF_TYPE_NUMBER },
583  { "StemSnapH", CFF_TYPE_DELTA },
584  { "StemSnapV", CFF_TYPE_DELTA },
585  { "ForceBold", CFF_TYPE_BOOLEAN },
586  { NULL, -1 },
587  { NULL, -1 },
588  { "LanguageGroup", CFF_TYPE_NUMBER },
589  { "ExpansionFactor", CFF_TYPE_NUMBER },
590  { "InitialRandomSeed", CFF_TYPE_NUMBER },
591  { "SyntheticBase", CFF_TYPE_NUMBER },
592  { "PostScript", CFF_TYPE_SID },
593  { "BaseFontName", CFF_TYPE_SID },
594  { "BaseFontBlend", CFF_TYPE_DELTA },
595  { NULL, -1 },
596  { NULL, -1 },
597  { NULL, -1 },
598  { NULL, -1 },
599  { NULL, -1 },
600  { NULL, -1 },
601  { "ROS", CFF_TYPE_ROS },
602  { "CIDFontVersion", CFF_TYPE_NUMBER },
603  { "CIDFontRevision", CFF_TYPE_NUMBER },
604  { "CIDFontType", CFF_TYPE_NUMBER },
605  { "CIDCount", CFF_TYPE_NUMBER },
606  { "UIDBase", CFF_TYPE_NUMBER },
607  { "FDArray", CFF_TYPE_OFFSET },
608  { "FDSelect", CFF_TYPE_OFFSET },
609  { "FontName", CFF_TYPE_SID }
610 };
611 
612 /*tex Parse DICT data */
613 
614 static double get_integer(card8 ** data, card8 * endptr, int *status)
615 {
616  long result = 0;
617  card8 b0, b1, b2;
618 
619  b0 = *(*data)++;
620  if (b0 == 28 && *data < endptr - 2) {
621  /*tex shortint */
622  b1 = *(*data)++;
623  b2 = *(*data)++;
624  result = b1 * 256 + b2;
625  if (result > 0x7fffL)
626  result -= 0x10000L;
627  } else if (b0 == 29 && *data < endptr - 4) {
628  /*tex longint */
629  int i;
630  result = *(*data)++;
631  if (result > 0x7f)
632  result -= 0x100;
633  for (i = 0; i < 3; i++) {
634  result = result * 256 + (**data);
635  *data += 1;
636  }
637  } else if (b0 >= 32 && b0 <= 246) {
638  /*tex int (1) */
639  result = b0 - 139;
640  } else if (b0 >= 247 && b0 <= 250) {
641  /*tex int (2) */
642  b1 = *(*data)++;
643  result = (b0 - 247) * 256 + b1 + 108;
644  } else if (b0 >= 251 && b0 <= 254) {
645  b1 = *(*data)++;
646  result = -(b0 - 251) * 256 - b1 - 108;
647  } else {
649  }
650  return (double) result;
651 }
652 
653 /*tex Simply uses |strtod|: */
654 
655 static double get_real(card8 ** data, card8 * endptr, int *status)
656 {
657  double result = 0.0;
658  int nibble = 0, pos = 0;
659  int len = 0, fail = 0;
660 
661  if (**data != 30 || *data >= endptr - 1) {
663  return 0.0;
664  }
665  /*tex Skip the first byte (30): */
666  *data += 1;
667  pos = 0;
668  while ((!fail) && len < WORK_BUFFER_SIZE - 2 && *data < endptr) {
669  /*tex Get a nibble. */
670  if (pos % 2) {
671  nibble = **data & 0x0f;
672  *data += 1;
673  } else {
674  nibble = (**data >> 4) & 0x0f;
675  }
676  if (nibble >= 0x00 && nibble <= 0x09) {
677  work_buffer[len++] = (char) (nibble + '0');
678  } else if (nibble == 0x0a) { /* . */
679  work_buffer[len++] = '.';
680  } else if (nibble == 0x0b || nibble == 0x0c) {
681  /*tex E, E- */
682  work_buffer[len++] = 'e';
683  if (nibble == 0x0c)
684  work_buffer[len++] = '-';
685  } else if (nibble == 0x0e) {
686  /*tex the minus */
687  work_buffer[len++] = '-';
688  } else if (nibble == 0x0d) {
689  /*tex do nothing */
690  } else if (nibble == 0x0f) {
691  /*tex we're done */
692  work_buffer[len++] = '\0';
693  if (((pos % 2) == 0) && (**data != 0xff)) {
694  fail = 1;
695  }
696  break;
697  } else {
698  /*tex invalid */
699  fail = 1;
700  }
701  pos++;
702  }
703  /*tex the returned values */
704  if (fail || nibble != 0x0f) {
706  } else {
707  char *s;
708  errno=0;
709  result = strtod(work_buffer, &s);
710  if ((result==0.0 && work_buffer==s) || errno) {
711  /*tex Conversion is not possible. */
713  }
714  }
715  return result;
716 }
717 
718 /*tex Operators */
719 
720 static void add_dict(cff_dict * dict, card8 ** data, card8 * endptr, int *status)
721 {
722  int id, argtype, t;
723  id = **data;
724  if (id == 0x0c) {
725  *data += 1;
726  if (*data >= endptr ||
727  (id = **data + CFF_LAST_DICT_OP1) >= CFF_LAST_DICT_OP) {
729  return;
730  }
731  } else if (id >= CFF_LAST_DICT_OP1) {
733  return;
734  }
735  argtype = dict_operator[id].argtype;
736  if (dict_operator[id].opname == NULL || argtype < 0) {
738  return;
739  }
740  if (dict->count >= dict->max) {
741  dict->max += DICT_ENTRY_MAX;
742  /*tex Not zeroed! */
743  dict->entries = xrealloc(dict->entries, (unsigned) ((unsigned) dict->max * sizeof(cff_dict_entry)));
744  }
745  (dict->entries)[dict->count].id = id;
746  (dict->entries)[dict->count].key = dict_operator[id].opname;
747  if (argtype == CFF_TYPE_NUMBER ||
750  /*tex Check for underflow here, as exactly one operand is expected. */
751  if (stack_top < 1) {
753  return;
754  }
755  stack_top--;
756  (dict->entries)[dict->count].count = 1;
757  (dict->entries)[dict->count].values = xcalloc(1, sizeof(double));
758  (dict->entries)[dict->count].values[0] = arg_stack[stack_top];
759  dict->count += 1;
760  } else {
761  /*tex
762  Just ignore operator if there were no operands provided. Don't treat
763  this as underflow, e.g. |StemSnapV| in |TemporaLGCUni-Italic.otf|.
764  */
765  if ((t = stack_top) > 0) {
766  (dict->entries)[dict->count].count = stack_top;
767  (dict->entries)[dict->count].values =
768  xmalloc((unsigned) ((unsigned) stack_top * sizeof(double)));
769  while (stack_top > 0) {
770  stack_top--;
771  (dict->entries)[dict->count].values[stack_top] =
773  }
774  if (t > 3 && strcmp(dict_operator[id].opname, "FontMatrix") == 0) {
775  (dict->entries)[dict->count].values[0] = 0.001;
776  (dict->entries)[dict->count].values[3] = 0.001;
777  }
778  dict->count += 1;
779  }
780  }
781  *data += 1;
782  return;
783 }
784 
785 /*tex
786 
787  All operands are treated as number or array of numbers.
788 
789  \startitemize
790  \startitem |Private|: two numbers, size and offset \stopitem
791  \startitem |ROS|: hree numbers, SID, SID, and a number \stopitem
792  \stopitemize
793 
794 */
795 
797 {
798  cff_dict *dict;
799  int status = CFF_PARSE_OK;
800  stack_top = 0;
801  dict = cff_new_dict();
802  while (data < endptr && status == CFF_PARSE_OK) {
803  if (*data < CFF_LAST_DICT_OP1) {
804  /*tex Some operator. */
805  add_dict(dict, &data, endptr, &status);
806  } else if (*data == 30) {
807  /*tex First byte of a sequence (variable). */
809  arg_stack[stack_top] = get_real(&data, endptr, &status);
810  stack_top++;
811  } else {
813  }
814  } else if (*data == 255 || (*data >= CFF_LAST_DICT_OP1 && *data <= 27)) {
815  /*tex Reserved. */
816  data++;
817  } else {
818  /*tex Everything else is an integer. */
820  arg_stack[stack_top] = get_integer(&data, endptr, &status);
821  stack_top++;
822  } else {
824  }
825  }
826  }
827  if (status != CFF_PARSE_OK) {
828  formatted_error("cff","parsing DICT failed (error=%d)", status);
829  } else if (stack_top != 0) {
830  normal_warning("cff","garbage in DICT data");
831  stack_top = 0;
832  }
833  return dict;
834 }
835 
836 int cff_dict_known(cff_dict * dict, const char *key)
837 {
838  int i;
839  for (i = 0; i < dict->count; i++) {
840  if (key && strcmp(key, (dict->entries)[i].key) == 0
841  && (dict->entries)[i].count > 0)
842  return 1;
843  }
844  return 0;
845 }
846 
847 double cff_dict_get(cff_dict * dict, const char *key, int idx)
848 {
849  double value = 0.0;
850  int i;
851  assert(key && dict);
852  for (i = 0; i < dict->count; i++) {
853  if (strcmp(key, (dict->entries)[i].key) == 0) {
854  if ((dict->entries)[i].count > idx)
855  value = (dict->entries)[i].values[idx];
856  else
857  normal_error("cff","invalid index number");
858  break;
859  }
860  }
861  if (i == dict->count)
862  formatted_error("cff","DICT entry '%s' not found", key);
863  return value;
864 }
865 
867 {
868  card8 fd = 0xff;
869  cff_fdselect *fdsel;
870  if (cff->fdselect == NULL)
871  normal_error("cff","FDSelect not available");
872  fdsel = cff->fdselect;
873  if (gid >= cff->num_glyphs)
874  normal_error("cff","invalid glyph index");
875  switch (fdsel->format) {
876  case 0:
877  fd = fdsel->data.fds[gid];
878  break;
879  case 3:
880  {
881  if (gid == 0) {
882  fd = (fdsel->data).ranges[0].fd;
883  } else {
884  card16 i;
885  for (i = 1; i < (fdsel->num_entries); i++) {
886  if (gid < (fdsel->data).ranges[i].first)
887  break;
888  }
889  fd = (fdsel->data).ranges[i - 1].fd;
890  }
891  }
892  break;
893  default:
894  normal_error("cff","invalid FDSelect format");
895  break;
896  }
897  if (fd >= cff->num_fds)
898  normal_error("cff","invalid Font DICT index");
899  return fd;
900 }
901 
903 {
904  long len = 0;
905  long offset;
906  int i;
907  if ((cff->flag & FONTTYPE_CIDFONT) && cff->fdselect == NULL) {
909  }
910  if ((cff->flag & FONTTYPE_CIDFONT) && cff->fdarray == NULL) {
912  }
913  if (cff->private == NULL)
915  if (cff->gsubr == NULL) {
916  cff->offset = cff->gsubr_offset;
917  cff->gsubr = cff_get_index(cff);
918  }
919  cff->subrs = xcalloc(cff->num_fds, sizeof(cff_index *));
920  if (cff->flag & FONTTYPE_CIDFONT) {
921  for (i = 0; i < cff->num_fds; i++) {
922  if (cff->private[i] == NULL ||
923  !cff_dict_known(cff->private[i], "Subrs")) {
924  (cff->subrs)[i] = NULL;
925  } else {
926  offset = (long) cff_dict_get(cff->fdarray[i], "Private", 1);
927  offset += (long) cff_dict_get(cff->private[i], "Subrs", 0);
928  cff->offset = (l_offset) offset;
929  (cff->subrs)[i] = cff_get_index(cff);
930  len += cff_index_size((cff->subrs)[i]);
931  }
932  }
933  } else if (cff->private[0] == NULL || !cff_dict_known(cff->private[0], "Subrs")) {
934  (cff->subrs)[0] = NULL;
935  } else {
936  offset = (long) cff_dict_get(cff->topdict, "Private", 1);
937  offset += (long) cff_dict_get(cff->private[0], "Subrs", 0);
938  cff->offset = (l_offset) offset;
939  (cff->subrs)[0] = cff_get_index(cff);
940  len += cff_index_size((cff->subrs)[0]);
941  }
942  return len;
943 }
944 
946 {
947  long len = 0;
948  cff_index *idx;
949  long offset, size;
950  card16 i;
951  if (cff->topdict == NULL)
952  normal_error("cff","top DICT not found");
953  if (!(cff->flag & FONTTYPE_CIDFONT))
954  return 0;
955  offset = (long) cff_dict_get(cff->topdict, "FDArray", 0);
956  cff->offset = (l_offset) offset;
957  idx = cff_get_index(cff);
958  cff->num_fds = (card8) idx->count;
959  cff->fdarray = xmalloc((unsigned) (idx->count * sizeof(cff_dict *)));
960  for (i = 0; i < idx->count; i++) {
961  card8 *data = idx->data + (idx->offset)[i] - 1;
962  size = (long) ((idx->offset)[i + 1] - (idx->offset)[i]);
963  if (size > 0) {
964  (cff->fdarray)[i] = cff_dict_unpack(data, data + size);
965  } else {
966  (cff->fdarray)[i] = NULL;
967  }
968  }
971  return len;
972 }
973 
975 {
976  long len = 0;
977  card8 *data;
978  long offset, size;
979  if (cff->flag & FONTTYPE_CIDFONT) {
980  int i;
981  if (cff->fdarray == NULL)
983  cff->private = xmalloc((unsigned) (cff->num_fds * sizeof(cff_dict *)));
984  for (i = 0; i < cff->num_fds; i++) {
985  if (cff->fdarray[i] != NULL &&
986  cff_dict_known(cff->fdarray[i], "Private") &&
987  (size = (long) cff_dict_get(cff->fdarray[i], "Private", 0)) > 0) {
988  offset = (long) cff_dict_get(cff->fdarray[i], "Private", 1);
989  cff->offset = (l_offset) offset;
990  data = xmalloc((unsigned) size * sizeof(card8));
991  memcpy(data, &cff->stream[cff->offset], (size_t) size);
992  cff->offset = (l_offset) size;
993  (cff->private)[i] = cff_dict_unpack(data, data + size);
994  xfree(data);
995  len += size;
996  } else {
997  (cff->private)[i] = NULL;
998  }
999  }
1000  } else {
1001  cff->num_fds = 1;
1002  cff->private = xmalloc(sizeof(cff_dict *));
1003  if (cff_dict_known(cff->topdict, "Private") &&
1004  (size = (long) cff_dict_get(cff->topdict, "Private", 0)) > 0) {
1005  offset = (long) cff_dict_get(cff->topdict, "Private", 1);
1006  cff->offset = (l_offset) offset;
1007  data = xmalloc((unsigned) size * sizeof(card8));
1008  memcpy(data, &cff->stream[cff->offset], (size_t) size);
1009  cff->offset = (l_offset) size;
1010  cff->private[0] = cff_dict_unpack(data, data + size);
1011  xfree(data);
1012  len += size;
1013  } else {
1014  (cff->private)[0] = NULL;
1015  len = 0;
1016  }
1017  }
1018  return len;
1019 }
1020 
1021 cff_font *read_cff(unsigned char *buf, long buflength, int n)
1022 {
1023  cff_font *cff;
1024  cff_index *idx;
1025  long offset;
1026  cff = xcalloc(1, sizeof(cff_font));
1027  cff->stream = buf;
1028  cff->stream_size = (l_offset) buflength;
1029  cff->index = n;
1030  cff->header_major = get_card8(cff);
1031  cff->header_minor = get_card8(cff);
1032  cff->header_hdr_size = get_card8(cff);
1033  if (cff->header_major == 2) {
1034  /*tex We have only one top dictionary. */
1035  cff->header_offsize = get_card16(cff);
1036  } else {
1037  cff->header_offsize = get_card8(cff);
1038  if (cff->header_offsize < 1 || cff->header_offsize > 4) {
1039  normal_warning("cff","invalid offsize data (4)");
1040  cff_close(cff);
1041  return NULL;
1042  }
1043  }
1044  if (cff->header_major > 2) {
1045  formatted_warning("cff","major version %u not supported", cff->header_major);
1046  cff_close(cff);
1047  return NULL;
1048  }
1049  cff->offset = cff->header_hdr_size;
1050  /*tex The name index. */
1051  if (cff->header_major == 2) {
1052  cff->name = cff_empty_index(cff);
1053  } else {
1054  idx = cff_get_index(cff);
1055  if (n > idx->count - 1) {
1056  normal_warning("cff","invalid fontset index number");
1057  cff_close(cff);
1058  return NULL;
1059  }
1060  cff->name = idx;
1061  cff->fontname = cff_get_name(cff);
1062  }
1063  /*tex The top dict index. */
1064  if (cff->header_major == 2) {
1065  /*tex we fake an index (just one entry) */
1066  idx = cff_get_index2(cff);
1067  } else {
1068  idx = cff_get_index(cff);
1069  }
1070  if (n > idx->count - 1) {
1071  normal_warning("cff","top DICT not exist");
1072  cff_close(cff);
1073  return NULL;
1074  }
1075  cff->topdict = cff_dict_unpack(idx->data + idx->offset[n] - 1, idx->data + idx->offset[n + 1] - 1);
1076  if (!cff->topdict) {
1077  normal_warning("cff","parsing top DICT data failed");
1078  cff_close(cff);
1079  return NULL;
1080  }
1082  if (cff_dict_known(cff->topdict, "CharstringType") &&
1083  cff_dict_get(cff->topdict, "CharstringType", 0) != 2) {
1084  normal_warning("cff","only type 2 charstrings supported");
1085  cff_close(cff);
1086  return NULL;
1087  }
1088  if (cff_dict_known(cff->topdict, "SyntheticBase")) {
1089  normal_warning("cff","synthetic font not supported");
1090  cff_close(cff);
1091  return NULL;
1092  }
1093  /*tex The string index. */
1094  if (cff->header_major == 2) {
1095  /*tex do nothing */
1096  } else {
1097  cff->string = cff_get_index(cff);
1098  }
1099  /*tex The offset to subroutines. */
1100  cff->gsubr_offset = cff->offset;
1101  /*tex The number of glyphs. */
1102  offset = (long) cff_dict_get(cff->topdict, "CharStrings", 0);
1103  cff->offset = (l_offset) offset;
1105  /*tex Check for font type. */
1106  if (cff_dict_known(cff->topdict, "ROS")) {
1107  cff->flag |= FONTTYPE_CIDFONT;
1108  } else {
1109  cff->flag |= FONTTYPE_FONT;
1110  }
1111  /*tex Check for the encoding. */
1112  if (cff_dict_known(cff->topdict, "Encoding")) {
1113  offset = (long) cff_dict_get(cff->topdict, "Encoding", 0);
1114  if (offset == 0) { /* predefined */
1115  cff->flag |= ENCODING_STANDARD;
1116  } else if (offset == 1) {
1117  cff->flag |= ENCODING_EXPERT;
1118  }
1119  } else {
1120  cff->flag |= ENCODING_STANDARD;
1121  }
1122  cff->offset = cff->gsubr_offset;
1123  return cff;
1124 }
1125 
1126 /*tex Write CFF data for an \OPENTYPE\ font. We need to pack dictionary data. */
1127 
1128 static long pack_integer(card8 * dest, long destlen, long value)
1129 {
1130  long len = 0;
1131  if (value >= -107 && value <= 107) {
1132  if (destlen < 1)
1133  normal_error("cff","buffer overflow (1)");
1134  dest[0] = (card8) ((value + 139) & 0xff);
1135  len = 1;
1136  } else if (value >= 108 && value <= 1131) {
1137  if (destlen < 2)
1138  normal_error("cff","buffer overflow (2)");
1139  value = (long) 0xf700u + value - 108;
1140  dest[0] = (card8) ((value >> 8) & 0xff);
1141  dest[1] = (card8) (value & 0xff);
1142  len = 2;
1143  } else if (value >= -1131 && value <= -108) {
1144  if (destlen < 2)
1145  normal_error("cff","buffer overflow (3)");
1146  value = (long) 0xfb00u - value - 108;
1147  dest[0] = (card8) ((value >> 8) & 0xff);
1148  dest[1] = (card8) (value & 0xff);
1149  len = 2;
1150  } else if (value >= -32768 && value <= 32767) {
1151  /*tex shortint */
1152  if (destlen < 3)
1153  normal_error("cff","buffer overflow (4)");
1154  dest[0] = 28;
1155  dest[1] = (card8) ((value >> 8) & 0xff);
1156  dest[2] = (card8) (value & 0xff);
1157  len = 3;
1158  } else {
1159  /*tex longint */
1160  if (destlen < 5)
1161  normal_error("cff","buffer overflow (5)");
1162  dest[0] = 29;
1163  dest[1] = (card8) ((value >> 24) & 0xff);
1164  dest[2] = (card8) ((value >> 16) & 0xff);
1165  dest[3] = (card8) ((value >> 8) & 0xff);
1166  dest[4] = (card8) (value & 0xff);
1167  len = 5;
1168  }
1169  return len;
1170 }
1171 
1172 static long pack_real(card8 * dest, long destlen, double value)
1173 {
1174  long e;
1175  int i = 0, pos = 2;
1176  int res;
1177  char local_work_buffer[WORK_BUFFER_SIZE];
1178 #define CFF_REAL_MAX_LEN 17
1179  if (destlen < 2)
1180  normal_error("cff","buffer overflow (6)");
1181  dest[0] = 30;
1182  if (value == 0.0) {
1183  dest[1] = 0x0f;
1184  return 2;
1185  }
1186  if (value < 0.0) {
1187  dest[1] = 0xe0;
1188  value *= -1.0;
1189  pos++;
1190  }
1191  e = 0;
1192  if (value >= 10.0) {
1193  while (value >= 10.0) {
1194  value /= 10.0;
1195  e++;
1196  }
1197  } else if (value < 1.0) {
1198  while (value < 1.0) {
1199  value *= 10.0;
1200  e--;
1201  }
1202  }
1203  res = sprintf(local_work_buffer, "%1.14g", value);
1204  if ( (dest>((card8*)(work_buffer))) && (dest-((card8*)work_buffer))<(res+1)) {
1205  normal_warning("cff","invalid real value to pack. Continuing, but the font looks wrong.");
1206  }
1207  if (res<0)
1208  normal_error("cff","invalid conversion");
1209  if (res>CFF_REAL_MAX_LEN)
1211  for (i = 0; i < res; i++) {
1212  unsigned char ch = 0;
1213  if (local_work_buffer[i] == '\0') {
1214  /*tex In fact |res| should prevent this. */
1215  break;
1216  } else if (local_work_buffer[i] == '.') {
1217  ch = 0x0a;
1218  } else if (local_work_buffer[i] >= '0' && local_work_buffer[i] <= '9') {
1219  ch = (unsigned char) (local_work_buffer[i] - '0');
1220  } else {
1221  normal_error("cff","invalid character");
1222  }
1223  if (destlen < pos / 2 + 1)
1224  normal_error("cff","buffer overflow (7)");
1225 
1226  if (pos % 2) {
1227  dest[pos / 2] = (card8) (dest[pos / 2] + ch);
1228  } else {
1229  dest[pos / 2] = (card8) (ch << 4);
1230  }
1231  pos++;
1232  }
1233  if (e > 0) {
1234  if (pos % 2) {
1235  dest[pos / 2] = (card8) (dest[pos / 2] + 0x0b);
1236  } else {
1237  if (destlen < pos / 2 + 1)
1238  normal_error("cff","buffer overflow (8)");
1239  dest[pos / 2] = (card8) (0xb0);
1240  }
1241  pos++;
1242  } else if (e < 0) {
1243  if (pos % 2) {
1244  dest[pos / 2] = (card8) (dest[pos / 2] + 0x0c);
1245  } else {
1246  if (destlen < pos / 2 + 1)
1247  normal_error("cff","buffer overflow (9)");
1248  dest[pos / 2] = (card8) (0xc0);
1249  }
1250  e *= -1;
1251  pos++;
1252  }
1253  if (e != 0) {
1254  sprintf(local_work_buffer, "%ld", e);
1255  for (i = 0; i < CFF_REAL_MAX_LEN; i++) {
1256  unsigned char ch = 0;
1257  if (local_work_buffer[i] == '\0') {
1258  break;
1259  } else if (local_work_buffer[i] == '.') {
1260  ch = 0x0a;
1261  } else if (local_work_buffer[i] >= '0' && local_work_buffer[i] <= '9') {
1262  ch = (unsigned char) (local_work_buffer[i] - '0');
1263  } else {
1264  normal_error("cff","invalid character");
1265  }
1266  if (destlen < pos / 2 + 1)
1267  normal_error("cff","buffer overflow (10)");
1268  if (pos % 2) {
1269  dest[pos / 2] = (card8) (dest[pos / 2] + ch);
1270  } else {
1271  dest[pos / 2] = (card8) (ch << 4);
1272  }
1273  pos++;
1274  }
1275  }
1276  if (pos % 2) {
1277  dest[pos / 2] = (card8) (dest[pos / 2] + 0x0f);
1278  pos++;
1279  } else {
1280  if (destlen < pos / 2 + 1)
1281  normal_error("cff","buffer overflow (11)");
1282  dest[pos / 2] = (card8) (0xff);
1283  pos += 2;
1284  }
1285  return pos / 2;
1286 }
1287 
1288 static long cff_dict_put_number(double value, card8 * dest, long destlen, int type)
1289 {
1290  long len = 0;
1291  double nearint;
1292  nearint = floor(value + 0.5);
1293  if (type == CFF_TYPE_OFFSET) {
1294  long lvalue;
1295  lvalue = (long) value;
1296  if (destlen < 5)
1297  normal_error("cff","buffer overflow (12)");
1298  dest[0] = 29;
1299  dest[1] = (card8) ((lvalue >> 24) & 0xff);
1300  dest[2] = (card8) ((lvalue >> 16) & 0xff);
1301  dest[3] = (card8) ((lvalue >> 8) & 0xff);
1302  dest[4] = (card8) (lvalue & 0xff);
1303  len = 5;
1304  } else if (value > CFF_INT_MAX || value < CFF_INT_MIN || (fabs(value - nearint) > 1.0e-5)) {
1305  /*tex A real */
1306  len = pack_real(dest, destlen, value);
1307  } else {
1308  /*tex An integer */
1309  len = pack_integer(dest, destlen, (long) nearint);
1310  }
1311  return len;
1312 }
1313 
1314 static long put_dict_entry(cff_dict_entry * de, card8 * dest, long destlen)
1315 {
1316  long len = 0;
1317  int i, type, id;
1318  if (de->count > 0) {
1319  id = de->id;
1320  if (dict_operator[id].argtype == CFF_TYPE_OFFSET ||
1323  } else {
1325  }
1326  for (i = 0; i < de->count; i++) {
1327  len += cff_dict_put_number(de->values[i], dest + len, destlen - len, type);
1328  }
1329  if (id >= 0 && id < CFF_LAST_DICT_OP1) {
1330  if (len + 1 > destlen)
1331  normal_error("cff","buffer overflow (13)");
1332  dest[len++] = (card8) id;
1333  } else if (id >= 0 && id < CFF_LAST_DICT_OP) {
1334  if (len + 2 > destlen)
1335  normal_error("cff","buffer overflow (14)");
1336  dest[len++] = 12;
1337  dest[len++] = (card8) (id - CFF_LAST_DICT_OP1);
1338  } else {
1339  normal_error("cff","invalid DICT operator ID");
1340  }
1341  }
1342  return len;
1343 }
1344 
1345 long cff_dict_pack(cff_dict * dict, card8 * dest, long destlen)
1346 {
1347  long len = 0;
1348  int i;
1349  for (i = 0; i < dict->count; i++) {
1350  if (!strcmp(dict->entries[i].key, "ROS")) {
1351  len += put_dict_entry(&dict->entries[i], dest, destlen);
1352  break;
1353  }
1354  }
1355  for (i = 0; i < dict->count; i++) {
1356  if (strcmp(dict->entries[i].key, "ROS")) {
1357  len += put_dict_entry(&dict->entries[i], dest + len, destlen - len);
1358  }
1359  }
1360  return len;
1361 }
1362 
1363 void cff_dict_add(cff_dict * dict, const char *key, int count)
1364 {
1365  int id, i;
1366  for (id = 0; id < CFF_LAST_DICT_OP; id++) {
1367  if (key && dict_operator[id].opname &&
1368  strcmp(dict_operator[id].opname, key) == 0)
1369  break;
1370  }
1371  if (id == CFF_LAST_DICT_OP)
1372  normal_error("cff","unknown DICT operator");
1373  for (i = 0; i < dict->count; i++) {
1374  if ((dict->entries)[i].id == id) {
1375  if ((dict->entries)[i].count != count)
1376  normal_error("cff","inconsistent DICT argument number");
1377  return;
1378  }
1379  }
1380  if (dict->count + 1 >= dict->max) {
1381  dict->max += 8;
1382  dict->entries =
1383  xrealloc(dict->entries, (unsigned) ((unsigned) dict->max * sizeof(cff_dict_entry)));
1384  }
1385  (dict->entries)[dict->count].id = id;
1386  (dict->entries)[dict->count].key = dict_operator[id].opname;
1387  (dict->entries)[dict->count].count = count;
1388  if (count > 0) {
1389  (dict->entries)[dict->count].values = xcalloc((unsigned) count, sizeof(double));
1390  } else {
1391  (dict->entries)[dict->count].values = NULL;
1392  }
1393  dict->count += 1;
1394  return;
1395 }
1396 
1397 void cff_dict_remove(cff_dict * dict, const char *key)
1398 {
1399  int i;
1400  for (i = 0; i < dict->count; i++) {
1401  if (key && strcmp(key, (dict->entries)[i].key) == 0) {
1402  (dict->entries)[i].count = 0;
1403  xfree((dict->entries)[i].values);
1404  }
1405  }
1406 }
1407 
1408 void cff_dict_set(cff_dict * dict, const char *key, int idx, double value)
1409 {
1410  int i;
1411  for (i = 0; i < dict->count; i++) {
1412  if (strcmp(key, (dict->entries)[i].key) == 0) {
1413  if ((dict->entries)[i].count > idx)
1414  (dict->entries)[i].values[idx] = value;
1415  else
1416  normal_error("cff","invalid index number");
1417  break;
1418  }
1419  }
1420  if (i == dict->count)
1421  formatted_error("cff","DICT entry '%s' not found", key);
1422 }
1423 
1424 
1425 /*tex Strings */
1426 
1428 {
1429  char *result = NULL;
1430  size_t len;
1431  if (id < CFF_STDSTR_MAX) {
1432  len = strlen(cff_stdstr[id]);
1433  result = xmalloc((unsigned) (len + 1) * sizeof(char));
1434  memcpy(result, cff_stdstr[id], len);
1435  result[len] = '\0';
1436  } else if (cff && cff->string) {
1437  cff_index *strings = cff->string;
1438  id = (s_SID) (id - CFF_STDSTR_MAX);
1439  if (id < strings->count) {
1440  len = (strings->offset)[id + 1] - (strings->offset)[id];
1441  result = xmalloc((unsigned) (len + 1) * sizeof(char));
1442  memmove(result, strings->data + (strings->offset)[id] - 1, len);
1443  result[len] = '\0';
1444  }
1445  }
1446  return result;
1447 }
1448 
1449 long cff_get_sid(cff_font * cff, const char *str)
1450 {
1451  card16 i;
1452  if (!cff || !str)
1453  return -1;
1454  /*tex We search the string index first. */
1455  if (cff && cff->string) {
1456  cff_index *idx = cff->string;
1457  for (i = 0; i < idx->count; i++) {
1458  if (strlen(str) == (idx->offset)[i + 1] - (idx->offset)[i] &&
1459  !memcmp(str, (idx->data) + (idx->offset)[i] - 1, strlen(str)))
1460  return (i + CFF_STDSTR_MAX);
1461  }
1462  }
1463  for (i = 0; i < CFF_STDSTR_MAX; i++) {
1464  if (!strcmp(str, cff_stdstr[i]))
1465  return i;
1466  }
1467  return -1;
1468 }
1469 
1471 {
1472  if (cff == NULL)
1473  normal_error("cff","CFF font not opened");
1474  if (cff->string)
1475  cff_release_index(cff->string);
1476  cff->string = cff->_string;
1477  cff->_string = NULL;
1478 }
1479 
1481 {
1482  card16 idx;
1483  cff_index *strings;
1484  l_offset offset, size;
1485  if (cff == NULL) {
1486  normal_error("cff","CFF font not opened");
1487  }
1488  if (cff->_string == NULL) {
1489  cff->_string = cff_new_index(0);
1490  }
1491  strings = cff->_string;
1492  for (idx = 0; idx < strings->count; idx++) {
1493  size = strings->offset[idx + 1] - strings->offset[idx];
1494  offset = strings->offset[idx];
1495  if (size == strlen(str) && !memcmp(strings->data + offset - 1, str, strlen(str))) {
1496  return (s_SID) (idx + CFF_STDSTR_MAX);
1497  }
1498  }
1499  for (idx = 0; idx < CFF_STDSTR_MAX; idx++) {
1500  if (cff_stdstr[idx] && !strcmp(cff_stdstr[idx], str)) {
1501  return idx;
1502  }
1503  }
1504  offset = (strings->count > 0) ? strings->offset[strings->count] : 1;
1505  strings->offset = xrealloc(strings->offset, (unsigned) (((unsigned) strings->count + 2) * sizeof(l_offset)));
1506  if (strings->count == 0)
1507  strings->offset[0] = 1;
1508  idx = strings->count;
1509  strings->count = (card16) (strings->count + 1);
1510  strings->offset[strings->count] = offset + strlen(str);
1511  strings->data = xrealloc(strings->data, (unsigned) ((offset + strlen(str) - 1) * sizeof(card8)));
1512  memcpy(strings->data + offset - 1, str, strlen(str));
1513  return (s_SID) (idx + CFF_STDSTR_MAX);
1514 }
1515 
1517 {
1518  int i;
1519  for (i = 0; i < dict->count; i++) {
1520  if ((dict->entries)[i].count > 0) {
1521  char *str;
1522  int id;
1523  id = (dict->entries)[i].id;
1524  if (dict_operator[id].argtype == CFF_TYPE_SID) {
1525  str = cff_get_string(cff, (s_SID) (dict->entries)[i].values[0]);
1526  if (str != NULL) {
1527  (dict->entries)[i].values[0] = cff_add_string(cff, str);
1528  xfree(str);
1529  }
1530  } else if (dict_operator[id].argtype == CFF_TYPE_ROS) {
1531  str = cff_get_string(cff, (s_SID) (dict->entries)[i].values[0]);
1532  if (str != NULL) {
1533  (dict->entries)[i].values[0] = cff_add_string(cff, str);
1534  xfree(str);
1535  }
1536  str = cff_get_string(cff, (s_SID) (dict->entries)[i].values[1]);
1537  if (str != NULL) {
1538  (dict->entries)[i].values[1] = cff_add_string(cff, str);
1539  xfree(str);
1540  }
1541  }
1542  }
1543  }
1544 }
1545 
1546 /*tex The charsets. */
1547 
1549 {
1551  long offset, length;
1552  card16 count, i;
1553  if (cff->topdict == NULL)
1554  normal_error("cff","top DICT not available");
1555  if (!cff_dict_known(cff->topdict, "charset")) {
1556  cff->flag |= CHARSETS_ISOADOBE;
1557  cff->charsets = NULL;
1558  return 0;
1559  }
1560  offset = (long) cff_dict_get(cff->topdict, "charset", 0);
1561  if (offset == 0) {
1562  /*tex predefined */
1563  cff->flag |= CHARSETS_ISOADOBE;
1564  cff->charsets = NULL;
1565  return 0;
1566  } else if (offset == 1) {
1567  cff->flag |= CHARSETS_EXPERT;
1568  cff->charsets = NULL;
1569  return 0;
1570  } else if (offset == 2) {
1571  cff->flag |= CHARSETS_EXPSUB;
1572  cff->charsets = NULL;
1573  return 0;
1574  }
1575  cff->offset = (l_offset) offset;
1576  cff->charsets = charset = xcalloc(1, sizeof(cff_charsets));
1577  charset->format = get_card8(cff);
1578  charset->num_entries = 0;
1579  count = (card16) (cff->num_glyphs - 1);
1580  length = 1;
1581  /*tex Not well documented. */
1582  switch (charset->format) {
1583  case 0:
1584  charset->num_entries = (card16) (cff->num_glyphs - 1); /* no .notdef */
1585  charset->data.glyphs =
1586  xmalloc((unsigned) (charset->num_entries * sizeof(s_SID)));
1587  length += (charset->num_entries) * 2;
1588  for (i = 0; i < (charset->num_entries); i++) {
1589  charset->data.glyphs[i] = get_card16(cff);
1590  }
1591  count = 0;
1592  break;
1593  case 1:
1594  {
1595  cff_range1 *ranges = NULL;
1596  while (count > 0 && charset->num_entries < cff->num_glyphs) {
1597  ranges =
1598  xrealloc(ranges,
1599  (unsigned) (((unsigned) charset->num_entries +
1600  1) * sizeof(cff_range1)));
1601  ranges[charset->num_entries].first = get_card16(cff);
1602  ranges[charset->num_entries].n_left = get_card8(cff);
1603  count = (card16) (count - ranges[charset->num_entries].n_left + 1); /* no-overrap */
1604  charset->num_entries++;
1605  charset->data.range1 = ranges;
1606  }
1607  length += (charset->num_entries) * 3;
1608  }
1609  break;
1610  case 2:
1611  {
1612  cff_range2 *ranges = NULL;
1613  while (count > 0 && charset->num_entries < cff->num_glyphs) {
1614  ranges =
1615  xrealloc(ranges,
1616  (unsigned) (((unsigned) charset->num_entries +
1617  1) * sizeof(cff_range2)));
1618  ranges[charset->num_entries].first = get_card16(cff);
1619  ranges[charset->num_entries].n_left = get_card16(cff);
1620  count = (card16) (count - (ranges[charset->num_entries].n_left + 1)); /* non-overrapping */
1621  charset->num_entries++;
1622  }
1623  charset->data.range2 = ranges;
1624  length += (charset->num_entries) * 4;
1625  }
1626  break;
1627  default:
1628  xfree(charset);
1629  normal_error("cff","unknown charset format");
1630  break;
1631  }
1632  if (count > 0) {
1633  normal_warning("cff","charset data possibly broken (too many glyphs)");
1634  }
1635  return length;
1636 }
1637 
1638 long cff_pack_charsets(cff_font * cff, card8 * dest, long destlen)
1639 {
1640  long len = 0;
1641  card16 i;
1643  if (cff->flag & HAVE_STANDARD_CHARSETS || cff->charsets == NULL)
1644  return 0;
1645  if (destlen < 1)
1646  normal_error("cff","buffer overflow (15)");
1647  charset = cff->charsets;
1648  dest[len++] = charset->format;
1649  switch (charset->format) {
1650  case 0:
1651  if (destlen < len + (charset->num_entries) * 2)
1652  normal_error("cff","buffer overflow (16)");
1653  for (i = 0; i < (charset->num_entries); i++) {
1654  s_SID sid = (charset->data).glyphs[i]; /* or CID */
1655  dest[len++] = (card8) ((sid >> 8) & 0xff);
1656  dest[len++] = (card8) (sid & 0xff);
1657  }
1658  break;
1659  case 1:
1660  {
1661  if (destlen < len + (charset->num_entries) * 3)
1662  normal_error("cff","buffer overflow (17)");
1663  for (i = 0; i < (charset->num_entries); i++) {
1664  dest[len++] = (card8) (((charset->data).range1[i].first >> 8) & 0xff);
1665  dest[len++] = (card8) ((charset->data).range1[i].first & 0xff);
1666  dest[len++] = (card8) ((charset->data).range1[i].n_left);
1667  }
1668  }
1669  break;
1670  case 2:
1671  {
1672  if (destlen < len + (charset->num_entries) * 4)
1673  normal_error("cff","buffer overflow (18)");
1674  for (i = 0; i < (charset->num_entries); i++) {
1675  dest[len++] = (card8) (((charset->data).range2[i].first >> 8) & 0xff);
1676  dest[len++] = (card8) ((charset->data).range2[i].first & 0xff);
1677  dest[len++] = (card8) (((charset->data).range2[i].n_left >> 8) & 0xff);
1678  dest[len++] = (card8) ((charset->data).range2[i].n_left & 0xff);
1679  }
1680  }
1681  break;
1682  default:
1683  normal_error("cff","unknown charset format");
1684  break;
1685  }
1686  return len;
1687 }
1688 
1689 /*tex
1690 
1691  Here we decode and encode Type 2 charstring. All local/global subroutine
1692  calls in a given charstring is replace by the content of subroutine
1693  charstrings. We do this because some PostScript RIP may have problems with
1694  sparse subroutine array. Workaround for this is to re-order subroutine array
1695  so that no gap appears in the subroutine array, or put dummy charstrings that
1696  contains only `return' in the gap. However, re-ordering of subroutine is
1697  rather difficult for Type 2 charstrings due to the bias which depends on the
1698  total number of subroutines. Replacing callgsubr/callsubr calls with the
1699  content of the corresponding subroutine charstring may be more efficient than
1700  putting dummy subroutines in the case of subsetted font. Adobe distiller
1701  seems doing same thing.
1702 
1703  And also note that subroutine numbers within subroutines can depend on the
1704  content of operand stack as follows:
1705 
1706  \startyping
1707  \.{ ... l m callsubr << subr \#(m+bias): n add callsubr >> ...}
1708  \stoptyping
1709 
1710  I've not implemented the `random' operator which generates a pseudo-random
1711  number in the range (0, 1] and push them into argument stack. How
1712  pseudo-random sequences are generated is not documented in the Type 2
1713  charstring spec.
1714 
1715 */
1716 
1717 #define CS_TYPE2_DEBUG_STR "Type2 Charstring Parser"
1718 #define CS_TYPE2_DEBUG 5
1719 
1720 #define CS_BUFFER_CFF_ERROR -3
1721 #define CS_STACK_CFF_ERROR -2
1722 #define CS_PARSE_CFF_ERROR -1
1723 #define CS_PARSE_OK 0
1724 #define CS_PARSE_END 1
1725 #define CS_SUBR_RETURN 2
1726 #define CS_CHAR_END 3
1727 
1729 
1730 #define DST_NEED(a,b) {if ((a) < (b)) { status = CS_BUFFER_CFF_ERROR ; return ; }}
1731 #define SRC_NEED(a,b) {if ((a) < (b)) { status = CS_PARSE_CFF_ERROR ; return ; }}
1732 #define NEED(a,b) {if ((a) < (b)) { status = CS_STACK_CFF_ERROR ; return ; }}
1733 
1734 /*tex The hintmask and cntrmask need the number of stem zones. */
1735 
1736 static int num_stems = 0;
1737 static int phase = 0;
1738 
1739 /*tex Subroutine nesting.
1740 */
1741 static int cs2_nest = 0;
1742 
1743 /*tex The advance width. */
1744 
1745 static int have_width = 0;
1746 static double width = 0.0;
1747 
1748 /*tex
1749 
1750  Standard Encoding Accented Characters: Optional four arguments for endchar.
1751  See, CFF spec., p.35. This is obsolete feature and is no longer supported.
1752 
1753  \starttyping
1754  static double seac[4] = { 0.0, 0.0, 0.0, 0.0 }; // gone
1755  \stoptyping
1756 
1757 */
1758 
1759 /*tex Operand stack and Transient array */
1760 
1761 static int cs2_stack_top = 0;
1764 
1765 /*tex
1766 
1767  Type 2 CharString encoding, first the 1 byte operators:
1768 
1769 */
1770 
1771 /* RESERVED 0 */
1772 #define cs_hstem 1
1773 /* RESERVED 2 */
1774 #define cs_vstem 3
1775 #define cs_vmoveto 4
1776 #define cs_rlineto 5
1777 #define cs_hlineto 6
1778 #define cs_vlineto 7
1779 #define cs_rrcurveto 8
1780 /* cs_closepath 9 */
1781 #define cs_callsubr 10
1782 #define cs_return 11
1783 #define cs_escape 12
1784 /* cs_hsbw 13 */
1785 #define cs_endchar 14
1786 #define cs_setvsindex 15
1787 #define cs_blend 16
1788 /* RESERVED 17 */
1789 #define cs_hstemhm 18
1790 #define cs_hintmask 19
1791 #define cs_cntrmask 20
1792 #define cs_rmoveto 21
1793 #define cs_hmoveto 22
1794 #define cs_vstemhm 23
1795 #define cs_rcurveline 24
1796 #define cs_rlinecurve 25
1797 #define cs_vvcurveto 26
1798 #define cs_hhcurveto 27
1799 /* SHORTINT 28 */
1800 #define cs_callgsubr 29
1801 #define cs_vhcurveto 30
1802 #define cs_hvcurveto 31
1803 
1804 /*tex
1805 
1806  Next the two byte CharString operators:
1807 
1808 */
1809 
1810 #define cs_dotsection 0
1811 /* cs_vstem3 1 */
1812 /* cs_hstem3 2 */
1813 #define cs_and 3
1814 #define cs_or 4
1815 #define cs_not 5
1816 /* cs_seac 6 */
1817 /* cs_sbw 7 */
1818 /* RESERVED 8 */
1819 #define cs_abs 9
1820 #define cs_add 10
1821 #define cs_sub 11
1822 #define cs_div 12
1823 /* RESERVED 13 */
1824 #define cs_neg 14
1825 #define cs_eq 15
1826 /* cs_callothersubr 16 */
1827 /* cs_pop| 17 */
1828 #define cs_drop 18
1829 /* RESERVED 19 */
1830 #define cs_put 20
1831 #define cs_get 21
1832 #define cs_ifelse 22
1833 #define cs_random 23
1834 #define cs_mul 24
1835 /* RESERVED 25 */
1836 #define cs_sqrt 26
1837 #define cs_dup 27
1838 #define cs_exch 28
1839 #define cs_index 29
1840 #define cs_roll 30
1841 /* cs_setcurrentpoint 31 */
1842 /* RESERVED 32 */
1843 /* RESERVED 33 */
1844 #define cs_hflex 34
1845 #define cs_flex 35
1846 #define cs_hflex1 36
1847 #define cs_flex1 37
1848 
1849 /*tex |clear_stack| put all operands sotred in operand stack to dest. */
1850 
1851 static void clear_stack(card8 ** dest, card8 * limit)
1852 {
1853  int i;
1854  for (i = 0; i < cs2_stack_top; i++) {
1855  double value;
1856  long ivalue;
1857  value = cs2_arg_stack[i];
1858  /*tex The nearest integer value. */
1859  ivalue = (long) floor(value + 0.5);
1860  if (value >= 0x8000L || value <= (-0x8000L - 1)) {
1861  /*tex
1862  This number cannot be represented as a single operand. We must
1863  use |a b mul ...| or |a c div| to represent large values.
1864  */
1865  normal_error("cff","argument value too large (this is bug)");
1866  } else if (fabs(value - (double) ivalue) > 3.0e-5) {
1867  /*tex A 16.16-bit signed fixed value */
1868  DST_NEED(limit, *dest + 5);
1869  *(*dest)++ = 255;
1870  /*tex The mantissa. */
1871  ivalue = (long) floor(value);
1872  *(*dest)++ = (card8) ((ivalue >> 8) & 0xff);
1873  *(*dest)++ = (card8) (ivalue & 0xff);
1874  /*tex The fraction. */
1875  ivalue = (long) ((value - (double) ivalue) * 0x10000l);
1876  *(*dest)++ = (card8) ((ivalue >> 8) & 0xff);
1877  *(*dest)++ = (card8) (ivalue & 0xff);
1878  /*tex Everything else is integer. */
1879  } else if (ivalue >= -107 && ivalue <= 107) {
1880  DST_NEED(limit, *dest + 1);
1881  *(*dest)++ = (card8) (ivalue + 139);
1882  } else if (ivalue >= 108 && ivalue <= 1131) {
1883  DST_NEED(limit, *dest + 2);
1884  ivalue = (long) 0xf700u + ivalue - 108;
1885  *(*dest)++ = (card8) ((ivalue >> 8) & 0xff);
1886  *(*dest)++ = (card8) (ivalue & 0xff);
1887  } else if (ivalue >= -1131 && ivalue <= -108) {
1888  DST_NEED(limit, *dest + 2);
1889  ivalue = (long) 0xfb00u - ivalue - 108;
1890  *(*dest)++ = (card8) ((ivalue >> 8) & 0xff);
1891  *(*dest)++ = (card8) (ivalue & 0xff);
1892  } else if (ivalue >= -32768 && ivalue <= 32767) {
1893  /*tex A shortint. */
1894  DST_NEED(limit, *dest + 3);
1895  *(*dest)++ = 28;
1896  *(*dest)++ = (card8) ((ivalue >> 8) & 0xff);
1897  *(*dest)++ = (card8) ((ivalue) & 0xff);
1898  } else {
1899  normal_error("cff","unexpected error");
1900  }
1901  }
1902  /*tex Clear the stack. */
1903  cs2_stack_top = 0;
1904  return;
1905 }
1906 
1907 /*tex
1908  Single byte operators: Path construction, Operator for finishing a path, Hint
1909  operators. Phases:
1910 
1911  \starttabulate
1912  \NC \type{0} \NC inital state \NC \NR
1913  \NC \type{1} \NC hint declaration, first stack-clearing operator appeared \NC \NR
1914  \NC \type{2} \NC in path construction \NC \NR
1915  \stoptabulate
1916 
1917 */
1918 
1919 static void do_operator1(card8 ** dest, card8 * limit, card8 ** data, card8 * endptr)
1920 {
1921  card8 op = **data;
1922 
1923  *data += 1;
1924 
1925  switch (op) {
1926  case cs_hstemhm:
1927  case cs_vstemhm:
1928  /*tex A charstring may have a hintmask if the above operator has been seen. */
1929  case cs_hstem:
1930  case cs_vstem:
1931  if (phase == 0 && (cs2_stack_top % 2)) {
1932  have_width = 1;
1933  width = cs2_arg_stack[0];
1934  }
1935  num_stems += cs2_stack_top / 2;
1937  DST_NEED(limit, *dest + 1);
1938  *(*dest)++ = op;
1939  phase = 1;
1940  break;
1941  case cs_hintmask:
1942  case cs_cntrmask:
1943  if (phase < 2) {
1944  if (phase == 0 && (cs2_stack_top % 2)) {
1945  have_width = 1;
1946  width = cs2_arg_stack[0];
1947  }
1948  num_stems += cs2_stack_top / 2;
1949  }
1951  DST_NEED(limit, *dest + 1);
1952  *(*dest)++ = op;
1953  if (num_stems > 0) {
1954  int masklen = (num_stems + 7) / 8;
1955  DST_NEED(limit, *dest + masklen);
1956  SRC_NEED(endptr, *data + masklen);
1957  memmove(*dest, *data, (size_t) masklen);
1958  *data += masklen;
1959  *dest += masklen;
1960  }
1961  phase = 2;
1962  break;
1963  case cs_rmoveto:
1964  if (phase == 0 && (cs2_stack_top % 2)) {
1965  have_width = 1;
1966  width = cs2_arg_stack[0];
1967  }
1969  DST_NEED(limit, *dest + 1);
1970  *(*dest)++ = op;
1971  phase = 2;
1972  break;
1973  case cs_hmoveto:
1974  case cs_vmoveto:
1975  if (phase == 0 && (cs2_stack_top % 2) == 0) {
1976  have_width = 1;
1977  width = cs2_arg_stack[0];
1978  }
1980  DST_NEED(limit, *dest + 1);
1981  *(*dest)++ = op;
1982  phase = 2;
1983  break;
1984  case cs_endchar:
1985  if (cs2_stack_top == 1) {
1986  have_width = 1;
1987  width = cs2_arg_stack[0];
1989  } else if (cs2_stack_top == 4 || cs2_stack_top == 5) {
1990  normal_warning("cff","'seac' character deprecated in type 2 charstring");
1992  return;
1993  } else if (cs2_stack_top > 0) {
1994  normal_warning("cff","operand stack not empty");
1995  }
1996  DST_NEED(limit, *dest + 1);
1997  *(*dest)++ = op;
1998  status = CS_CHAR_END;
1999  break;
2000  /*tex The above operators are candidate for first stack clearing operator. */
2001  case cs_setvsindex:
2002  /*
2003  vsindex = cs2_arg_stack[cs2_stack_top-1];
2004  cs2_stack_top -= 1;
2005  */
2006  normal_warning("cff2","unsupported setvindex operator");
2008  break;
2009  case cs_blend:
2010  /*
2011  blends = cs2_arg_stack[cs2_stack_top-1];
2012  cs2_stack_top -= 1;
2013  cs2_stack_top -= blends * regions ;
2014  */
2015  normal_warning("cff2","unsupported blend operator");
2017  break;
2018  case cs_rlineto:
2019  case cs_hlineto:
2020  case cs_vlineto:
2021  case cs_rrcurveto:
2022  case cs_rcurveline:
2023  case cs_rlinecurve:
2024  case cs_vvcurveto:
2025  case cs_hhcurveto:
2026  case cs_vhcurveto:
2027  case cs_hvcurveto:
2028  if (phase < 2) {
2029  normal_warning("cff","broken type 2 charstring");
2031  return;
2032  }
2034  DST_NEED(limit, *dest + 1);
2035  *(*dest)++ = op;
2036  break;
2037  /*tex All the operotors above are stack clearing. */
2038  case cs_return:
2039  normal_error("cff","unexpected return");
2040  case cs_callgsubr:
2041  normal_error("cff","unexpected callgsubr");
2042  case cs_callsubr:
2043  normal_error("cff","unexpected callsubr");
2044  break;
2045  default:
2046  formatted_warning("cff","%s: unknown charstring operator: 0x%02x", CS_TYPE2_DEBUG_STR, op);
2048  break;
2049  }
2050  return;
2051 }
2052 
2053 /*tex
2054 
2055  Double byte operators: Flex, arithmetic, conditional, and storage operators.
2056  The following operators are not supported: random but How random ?
2057 
2058 */
2059 
2060 static void do_operator2(card8 ** dest, card8 * limit, card8 ** data, card8 * endptr)
2061 {
2062  card8 op;
2063  *data += 1;
2064  SRC_NEED(endptr, *data + 1);
2065  op = **data;
2066  *data += 1;
2067  switch (op) {
2068  case cs_dotsection:
2069  normal_warning("cff","Operator 'dotsection' deprecated in type 2 charstring");
2071  return;
2072  break;
2073  case cs_hflex:
2074  case cs_flex:
2075  case cs_hflex1:
2076  case cs_flex1:
2077  if (phase < 2) {
2078  formatted_warning("cff","%s: broken type 2 charstring", CS_TYPE2_DEBUG_STR);
2080  return;
2081  }
2083  DST_NEED(limit, *dest + 2);
2084  *(*dest)++ = cs_escape;
2085  *(*dest)++ = op;
2086  break;
2087  /*tex All operators above are stack clearing. */
2088  case cs_and:
2089  NEED(cs2_stack_top, 2);
2090  cs2_stack_top--;
2092  cs2_arg_stack[cs2_stack_top - 1] = 1.0;
2093  } else {
2094  cs2_arg_stack[cs2_stack_top - 1] = 0.0;
2095  }
2096  break;
2097  case cs_or:
2098  NEED(cs2_stack_top, 2);
2099  cs2_stack_top--;
2101  cs2_arg_stack[cs2_stack_top - 1] = 1.0;
2102  } else {
2103  cs2_arg_stack[cs2_stack_top - 1] = 0.0;
2104  }
2105  break;
2106  case cs_not:
2107  NEED(cs2_stack_top, 1);
2108  if (cs2_arg_stack[cs2_stack_top - 1]) {
2109  cs2_arg_stack[cs2_stack_top - 1] = 0.0;
2110  } else {
2111  cs2_arg_stack[cs2_stack_top - 1] = 1.0;
2112  }
2113  break;
2114  case cs_abs:
2115  NEED(cs2_stack_top, 1);
2118  break;
2119  case cs_add:
2120  NEED(cs2_stack_top, 2);
2122  cs2_stack_top--;
2123  break;
2124  case cs_sub:
2125  NEED(cs2_stack_top, 2);
2127  cs2_stack_top--;
2128  break;
2129  case cs_div:
2130  NEED(cs2_stack_top, 2);
2132  cs2_stack_top--;
2133  break;
2134  case cs_neg:
2135  NEED(cs2_stack_top, 1);
2136  cs2_arg_stack[cs2_stack_top - 1] *= -1.0;
2137  break;
2138  case cs_eq:
2139  NEED(cs2_stack_top, 2);
2140  cs2_stack_top--;
2142  cs2_arg_stack[cs2_stack_top - 1] = 1.0;
2143  } else {
2144  cs2_arg_stack[cs2_stack_top - 1] = 0.0;
2145  }
2146  break;
2147  case cs_drop:
2148  NEED(cs2_stack_top, 1);
2149  cs2_stack_top--;
2150  break;
2151  case cs_put:
2152  NEED(cs2_stack_top, 2);
2153  {
2154  int idx = (int) cs2_arg_stack[--cs2_stack_top];
2157  }
2158  break;
2159  case cs_get:
2160  NEED(cs2_stack_top, 1);
2161  {
2162  int idx = (int) cs2_arg_stack[cs2_stack_top - 1];
2165  }
2166  break;
2167  case cs_ifelse:
2168  NEED(cs2_stack_top, 4);
2169  cs2_stack_top -= 3;
2172  }
2173  break;
2174  case cs_mul:
2175  NEED(cs2_stack_top, 2);
2178  cs2_stack_top--;
2179  break;
2180  case cs_sqrt:
2181  NEED(cs2_stack_top, 1);
2184  break;
2185  case cs_dup:
2186  NEED(cs2_stack_top, 1);
2189  cs2_stack_top++;
2190  break;
2191  case cs_exch:
2192  NEED(cs2_stack_top, 2);
2193  {
2194  double save = cs2_arg_stack[cs2_stack_top - 2];
2197  }
2198  break;
2199  case cs_index:
2200  NEED(cs2_stack_top, 2);
2201  {
2202  int idx = (int) cs2_arg_stack[cs2_stack_top - 1];
2203  if (idx < 0) {
2206  } else {
2207  NEED(cs2_stack_top, idx + 2);
2210  }
2211  }
2212  break;
2213  case cs_roll:
2214  NEED(cs2_stack_top, 2);
2215  {
2216  int N, J;
2219  NEED(cs2_stack_top, N);
2220  if (J > 0) {
2221  J = J % N;
2222  while (J-- > 0) {
2223  double save = cs2_arg_stack[cs2_stack_top - 1];
2224  int i = cs2_stack_top - 1;
2225  while (i > cs2_stack_top - N) {
2226  cs2_arg_stack[i] = cs2_arg_stack[i - 1];
2227  i--;
2228  }
2229  cs2_arg_stack[i] = save;
2230  }
2231  } else {
2232  J = (-J) % N;
2233  while (J-- > 0) {
2234  double save = cs2_arg_stack[cs2_stack_top - N];
2235  int i = cs2_stack_top - N;
2236  while (i < cs2_stack_top - 1) {
2237  cs2_arg_stack[i] = cs2_arg_stack[i + 1];
2238  i++;
2239  }
2240  cs2_arg_stack[i] = save;
2241  }
2242  }
2243  }
2244  break;
2245  case cs_random:
2246  formatted_warning("cff","%s: Charstring operator 'random' found.", CS_TYPE2_DEBUG_STR);
2248  cs2_arg_stack[cs2_stack_top++] = 1.0;
2249  break;
2250  default:
2251  formatted_warning("cff","%s: unknown charstring operator: 0x0c%02x", CS_TYPE2_DEBUG_STR, op);
2253  break;
2254  }
2255  return;
2256 }
2257 
2258 /*tex integer: exactly the same as the DICT encoding (except 29) */
2259 
2260 static void cs2_get_integer(card8 ** data, card8 * endptr)
2261 {
2262  long result = 0;
2263  card8 b0 = **data, b1, b2;
2264  *data += 1;
2265  if (b0 == 28) {
2266  /*tex shortint */
2267  SRC_NEED(endptr, *data + 2);
2268  b1 = **data;
2269  b2 = *(*data + 1);
2270  result = b1 * 256 + b2;
2271  if (result > 0x7fff)
2272  result -= 0x10000L;
2273  *data += 2;
2274  } else if (b0 >= 32 && b0 <= 246) {
2275  /*tex int (1) */
2276  result = b0 - 139;
2277  } else if (b0 >= 247 && b0 <= 250) {
2278  /*tex int (2) */
2279  SRC_NEED(endptr, *data + 1);
2280  b1 = **data;
2281  result = (b0 - 247) * 256 + b1 + 108;
2282  *data += 1;
2283  } else if (b0 >= 251 && b0 <= 254) {
2284  SRC_NEED(endptr, *data + 1);
2285  b1 = **data;
2286  result = -(b0 - 251) * 256 - b1 - 108;
2287  *data += 1;
2288  } else {
2290  return;
2291  }
2293  cs2_arg_stack[cs2_stack_top++] = (double) result;
2294  return;
2295 }
2296 
2297 /*tex Signed 16.16-bits fixed number for Type 2 charstring encoding. */
2298 
2299 static void get_fixed(card8 ** data, card8 * endptr)
2300 {
2301  long ivalue;
2302  double rvalue;
2303  *data += 1;
2304  SRC_NEED(endptr, *data + 4);
2305  ivalue = *(*data) * 0x100 + *(*data + 1);
2306  rvalue = (double) ((ivalue > 0x7fffL) ? (ivalue - 0x10000L) : ivalue);
2307  ivalue = *(*data + 2) * 0x100 + *(*data + 3);
2308  rvalue += ((double) ivalue) / 0x10000L;
2310  cs2_arg_stack[cs2_stack_top++] = rvalue;
2311  *data += 4;
2312  return;
2313 }
2314 
2315 /*tex
2316 
2317 Subroutines: the bias for subroutine number is introduced in type 2
2318 charstrings.
2319 
2320 \starttabulate
2321 \NC \type {subr} \NC set to a pointer to the subroutine charstring \NC \NR
2322 \NC \type {len} \NC set to the length of subroutine charstring \NC \NR
2323 \NC \type {subr_idx} \NC CFF INDEX data that contains subroutines \NC \NR
2324 \NC \type {id} \NC biased subroutine number \NC \NR
2325 \stoptabulate
2326 
2327 */
2328 
2329 static void get_subr(card8 ** subr, long *len, cff_index * subr_idx, long id)
2330 {
2331  card16 count;
2332  if (subr_idx == NULL)
2333  formatted_error("cff","%s: subroutine called but no subroutine found",CS_TYPE2_DEBUG_STR);
2334  count = subr_idx->count;
2335  /*tex addi the bias number */
2336  if (count < 1240) {
2337  id += 107;
2338  } else if (count < 33900) {
2339  id += 1131;
2340  } else {
2341  id += 32768;
2342  }
2343  if (id > count)
2344  formatted_error("cff","%s: invalid subroutine index: %ld (max=%u)", CS_TYPE2_DEBUG_STR, id, count);
2345  *len = (long) ((subr_idx->offset)[id + 1] - (subr_idx->offset)[id]);
2346  *subr = subr_idx->data + (subr_idx->offset)[id] - 1;
2347  return;
2348 }
2349 
2350 /*tex
2351 
2352  The Type 2 interpretation of a number encoded in five-bytes (those with an
2353  initial byte value of 255) differs from how it is interpreted in the Type 1
2354  format.
2355 
2356 */
2357 
2358 static void do_charstring(card8 ** dest, card8 * limit, card8 ** data, card8 * endptr,
2359  cff_index * gsubr_idx, cff_index * subr_idx, int cff2)
2360 {
2361  card8 b0 = 0, *subr;
2362  long len;
2363  if (cs2_nest > CS_SUBR_NEST_MAX)
2364  formatted_error("cff","%s: subroutine nested too deeply", CS_TYPE2_DEBUG_STR);
2365  cs2_nest++;
2366  while (*data < endptr && status == CS_PARSE_OK) {
2367  b0 = **data;
2368  if (b0 == 255) {
2369  /*tex A 16-bit.16-bit fixed signed number. */
2370  get_fixed(data, endptr);
2371  } else if (b0 == cs_return) {
2373  } else if (b0 == cs_callgsubr) {
2374  if (cs2_stack_top < 1) {
2376  } else {
2377  cs2_stack_top--;
2378  get_subr(&subr, &len, gsubr_idx, (long) cs2_arg_stack[cs2_stack_top]);
2379  if (*dest + len > limit)
2380  formatted_error("cff","%s: possible buffer overflow (1)", CS_TYPE2_DEBUG_STR);
2381  do_charstring(dest, limit, &subr, subr + len, gsubr_idx, subr_idx, cff2);
2382  *data += 1;
2383  }
2384  } else if (b0 == cs_callsubr) {
2385  if (cs2_stack_top < 1) {
2387  } else {
2388  cs2_stack_top--;
2389  get_subr(&subr, &len, subr_idx, (long) cs2_arg_stack[cs2_stack_top]);
2390  if (limit < *dest + len)
2391  formatted_error("cff","%s: possible buffer overflow (2)", CS_TYPE2_DEBUG_STR);
2392  do_charstring(dest, limit, &subr, subr + len, gsubr_idx, subr_idx, cff2);
2393  *data += 1;
2394  }
2395  } else if (b0 == cs_escape) {
2396  do_operator2(dest, limit, data, endptr);
2397  } else if (b0 < 32 && b0 != 28) {
2398  do_operator1(dest, limit, data, endptr);
2399  } else if ((b0 <= 22 && b0 >= 27) || b0 == 31) {
2401  } else {
2402  cs2_get_integer(data, endptr);
2403  }
2404  }
2405  if (cff2) {
2406  DST_NEED(limit, *dest + 1);
2407  ++endptr;
2408  *(*dest)++ = cs_endchar;
2409  } else if (status == CS_SUBR_RETURN) {
2410  status = CS_PARSE_OK;
2411  } else if (status == CS_CHAR_END && *data < endptr) {
2412  formatted_warning("cff","%s: garbage after endchar", CS_TYPE2_DEBUG_STR);
2413  } else if (status < CS_PARSE_OK) {
2414  formatted_error("cff","%s: parsing charstring failed: (status=%d, stack=%d)", CS_TYPE2_DEBUG_STR, status, cs2_stack_top);
2415  }
2416  cs2_nest--;
2417  return;
2418 }
2419 
2420 static void cs_parse_init(void)
2421 {
2422  status = CS_PARSE_OK;
2423  cs2_nest = 0;
2424  phase = 0;
2425  num_stems = 0;
2426  cs2_stack_top = 0;
2427 }
2428 
2429 /*tex Not just copying \unknown */
2430 
2431 static long cs_copy_charstring(card8 * dst, long dstlen, card8 * src, long srclen, cff_index * gsubr,
2432  cff_index * subr, double default_width, double nominal_width, cs_ginfo * ginfo, int cff2)
2433 {
2434  card8 *save = dst;
2435 
2436  cs_parse_init();
2437 
2438  width = 0.0;
2439  have_width = 0;
2440 
2441  /* expand call(g)subrs */
2442  do_charstring(&dst, dst + dstlen, &src, src + srclen, gsubr, subr, cff2);
2443 
2444  if (ginfo) {
2445  ginfo->flags = 0; /* not used */
2446  if (have_width) {
2447  ginfo->wx = nominal_width + width;
2448  } else {
2449  ginfo->wx = default_width;
2450  }
2451  }
2452 
2453  return (long) (dst - save);
2454 }
2455 
2456 /*tex CID-Keyed font specific. */
2457 
2459 {
2460  cff_fdselect *fdsel;
2461  long offset, length;
2462  card16 i;
2463  if (cff->topdict == NULL)
2464  normal_error("cff","top DICT not available");
2465  if (!(cff->flag & FONTTYPE_CIDFONT))
2466  return 0;
2467  offset = (long) cff_dict_get(cff->topdict, "FDSelect", 0);
2468  cff->offset = (l_offset) offset;
2469  cff->fdselect = fdsel = xcalloc(1, sizeof(cff_fdselect));
2470  fdsel->format = get_card8(cff);
2471  length = 1;
2472  switch (fdsel->format) {
2473  case 0:
2474  fdsel->num_entries = cff->num_glyphs;
2475  (fdsel->data).fds = xmalloc(fdsel->num_entries * sizeof(card8));
2476  for (i = 0; i < (fdsel->num_entries); i++) {
2477  (fdsel->data).fds[i] = get_card8(cff);
2478  }
2479  length += fdsel->num_entries;
2480  break;
2481  case 3:
2482  {
2483  cff_range3 *ranges;
2484  fdsel->num_entries = get_card16(cff);
2485  fdsel->data.ranges = ranges =
2486  xcalloc(fdsel->num_entries, sizeof(cff_range3));
2487  for (i = 0; i < (fdsel->num_entries); i++) {
2488  ranges[i].first = get_card16(cff);
2489  ranges[i].fd = get_card8(cff);
2490  }
2491  if (ranges[0].first != 0)
2492  normal_error("cff","range not starting with 0");
2493  if (cff->num_glyphs != get_card16(cff))
2494  normal_error("cff","sentinel value mismatched with number of glyphs");
2495  length += (fdsel->num_entries) * 3 + 4;
2496  }
2497  break;
2498  default:
2499  xfree(fdsel);
2500  normal_error("cff","unknown FDSelect format");
2501  break;
2502  }
2503  return length;
2504 }
2505 
2506 long cff_pack_fdselect(cff_font * cff, card8 * dest, long destlen)
2507 {
2508  cff_fdselect *fdsel;
2509  long len = 0;
2510  card16 i;
2511  if (cff->fdselect == NULL)
2512  return 0;
2513  if (destlen < 1)
2514  normal_error("cff","buffer overflow (23)");
2515  fdsel = cff->fdselect;
2516  dest[len++] = fdsel->format;
2517  switch (fdsel->format) {
2518  case 0:
2519  if (fdsel->num_entries != cff->num_glyphs)
2520  normal_error("cff","invalid data");
2521  if (destlen < len + fdsel->num_entries)
2522  normal_error("cff","buffer overflow (24)");
2523  for (i = 0; i < fdsel->num_entries; i++) {
2524  dest[len++] = (fdsel->data).fds[i];
2525  }
2526  break;
2527  case 3:
2528  {
2529  if (destlen < len + 2)
2530  normal_error("cff","buffer overflow (25)");
2531  len += 2;
2532  for (i = 0; i < (fdsel->num_entries); i++) {
2533  if (destlen < len + 3)
2534  normal_error("cff","buffer overflow (26)");
2535  dest[len++] =
2536  (card8) (((fdsel->data).ranges[i].first >> 8) & 0xff);
2537  dest[len++] = (card8) ((fdsel->data).ranges[i].first & 0xff);
2538  dest[len++] = (card8) ((fdsel->data).ranges[i].fd);
2539  }
2540  if (destlen < len + 2)
2541  normal_error("cff","buffer overflow (27)");
2542  dest[len++] = (card8) ((cff->num_glyphs >> 8) & 0xff);
2543  dest[len++] = (card8) (cff->num_glyphs & 0xff);
2544  dest[1] = (card8) (((len / 3 - 1) >> 8) & 0xff);
2545  dest[2] = (card8) ((len / 3 - 1) & 0xff);
2546  }
2547  break;
2548  default:
2549  normal_error("cff","unknown FDSelect format");
2550  break;
2551  }
2552  return len;
2553 }
2554 
2555 /*tex Create an instance of embeddable font. */
2556 
2557 static void write_fontfile(PDF pdf, cff_font * cffont, char *fullname)
2558 {
2559  cff_index *topdict, *fdarray, *private;
2560  unsigned char *dest;
2561  long destlen = 0, i, size;
2562  long offset, topdict_offset, fdarray_offset;
2563  topdict = cff_new_index(1);
2564  fdarray = cff_new_index(cffont->num_fds);
2565  private = cff_new_index(cffont->num_fds);
2566  cff_dict_remove(cffont->topdict, "UniqueID");
2567  cff_dict_remove(cffont->topdict, "XUID");
2568  /*tex A bad font may have this: */
2569  cff_dict_remove(cffont->topdict, "Private");
2570  /*tex A bad font may have this: */
2571  cff_dict_remove(cffont->topdict, "Encoding");
2572  /*tex This is CFF2 specific: */
2573  cff_dict_remove(cffont->topdict, "vstore");
2574  /*tex This is CFF2 specific: */
2575  cff_dict_remove(cffont->topdict, "maxstack");
2576  topdict->offset[1] = (l_offset) cff_dict_pack(cffont->topdict, (card8 *) work_buffer, WORK_BUFFER_SIZE) + 1;
2577  for (i = 0; i < cffont->num_fds; i++) {
2578  size = 0;
2579  if (cffont->private && cffont->private[i]) {
2581  if (size < 1) {
2582  /*tex |Private| contains only |Subr|: */
2583  cff_dict_remove(cffont->fdarray[i], "Private");
2584  }
2585  }
2586  (private->offset)[i + 1] = (unsigned long) ((private->offset)[i] + (unsigned) size);
2587  (fdarray->offset)[i + 1] = (unsigned long) ((fdarray->offset)[i]
2588  + (unsigned) cff_dict_pack(cffont->fdarray[i], (card8 *) work_buffer, WORK_BUFFER_SIZE));
2589  }
2590  /*tex The header size: */
2591  destlen = 4;
2592  destlen += cff_set_name(cffont, fullname);
2593  destlen += cff_index_size(topdict);
2594  destlen += cff_index_size(cffont->string);
2595  destlen += cff_index_size(cffont->gsubr);
2596  /*tex |charset| format 0 */
2597  destlen += (cffont->charsets->num_entries) * 2 + 1;
2598  /*tex |fdselect| format 3 */
2599  destlen += (cffont->fdselect->num_entries) * 3 + 5;
2600  destlen += cff_index_size(cffont->cstrings);
2601  destlen += cff_index_size(fdarray);
2602  /* |Private| is not indexed */
2603  destlen = (long) (destlen + (long) private->offset[private->count] - 1);
2604  dest = xcalloc((unsigned) destlen, sizeof(card8));
2605  offset = 0;
2606  /*tex |Header| */
2607  offset += cff_put_header(cffont, dest + offset, destlen - offset);
2608  /*tex |Name| */
2609  offset += cff_pack_index(cffont->name, dest + offset, destlen - offset);
2610  /*tex |Top DICT| */
2611  topdict_offset = offset;
2612  offset += cff_index_size(topdict);
2613  /*tex |Strings| */
2614  offset += cff_pack_index(cffont->string, dest + offset, destlen - offset);
2615  /*tex |Global Subrs| */
2616  offset += cff_pack_index(cffont->gsubr, dest + offset, destlen - offset);
2617  /*tex |charset| */
2618  cff_dict_set(cffont->topdict, "charset", 0, (double) offset);
2619  offset += cff_pack_charsets(cffont, dest + offset, destlen - offset);
2620  /*tex |FDSelect| */
2621  cff_dict_set(cffont->topdict, "FDSelect", 0, (double) offset);
2622  offset += cff_pack_fdselect(cffont, dest + offset, destlen - offset);
2623  /*tex |CharStrings| */
2624  cff_dict_set(cffont->topdict, "CharStrings", 0, (double) offset);
2625  offset += cff_pack_index(cffont->cstrings, dest + offset, cff_index_size(cffont->cstrings));
2626  cff_release_index(cffont->cstrings);
2627  /*tex |Charstring|s can consume a lot of memory. */
2628  cffont->cstrings = NULL;
2629  /*tex |FDArray| and |Private| */
2630  cff_dict_set(cffont->topdict, "FDArray", 0, (double) offset);
2631  fdarray_offset = offset;
2632  offset += cff_index_size(fdarray);
2633  fdarray->data = xcalloc((unsigned) (fdarray->offset[fdarray->count] - 1), sizeof(card8));
2634  for (i = 0; i < cffont->num_fds; i++) {
2635  size = (long) (private->offset[i + 1] - private->offset[i]);
2636  if (cffont->private[i] && size > 0) {
2637  cff_dict_pack(cffont->private[i], dest + offset, size);
2638  cff_dict_set(cffont->fdarray[i], "Private", 0, (double) size);
2639  cff_dict_set(cffont->fdarray[i], "Private", 1, (double) offset);
2640  }
2641  cff_dict_pack(cffont->fdarray[i], fdarray->data + (fdarray->offset)[i] - 1, (long) (fdarray->offset[fdarray->count] - 1));
2642  offset += size;
2643  }
2644  cff_pack_index(fdarray, dest + fdarray_offset, cff_index_size(fdarray));
2645  cff_release_index(fdarray);
2646  cff_release_index(private);
2647  /*tex Finally the |Top DICT| */
2648  topdict->data = xcalloc((unsigned) (topdict->offset[topdict->count] - 1), sizeof(card8));
2649  cff_dict_pack(cffont->topdict, topdict->data, (long) (topdict->offset[topdict->count] - 1));
2650  cff_pack_index(topdict, dest + topdict_offset, cff_index_size(topdict));
2651  cff_release_index(topdict);
2652  for (i = 0; i < offset; i++) {
2653  strbuf_putchar(pdf->fb, dest[i]);
2654  }
2655  xfree(dest);
2656  return;
2657 }
2658 
2659 void write_cff(PDF pdf, cff_font * cffont, fd_entry * fd)
2660 {
2661  cff_index *charstrings, *cs_idx;
2662  long charstring_len, max_len;
2663  long size, offset = 0;
2664  card8 *data;
2665  card16 num_glyphs, cs_count1, code, gid, last_cid;
2666  double nominal_width, default_width;
2667  char *fontname;
2668  char *fullname;
2669  glw_entry *glyph, *found;
2670  struct avl_traverser t;
2671  cffont->_string = NULL;
2672  fontname = xcalloc((unsigned) (1 + strlen(fd->fontname)), 1);
2673  sprintf(fontname, "%s", fd->fontname);
2674  fullname = xcalloc((unsigned) (8 + strlen(fd->fontname)), 1);
2675  sprintf(fullname, "%s+%s", fd->subset_tag, fd->fontname);
2676  /*tex Finish parsing the CFF. */
2677  cff_read_private(cffont);
2678  cff_read_subrs(cffont);
2679  /*tex The |Width|s. */
2680  if (cffont->private[0] && cff_dict_known(cffont->private[0], "defaultWidthX")) {
2681  default_width = (double) cff_dict_get(cffont->private[0], "defaultWidthX", 0);
2682  } else {
2683  default_width = CFF_DEFAULTWIDTHX_DEFAULT;
2684  }
2685  if (cffont->private[0] && cff_dict_known(cffont->private[0], "nominalWidthX")) {
2686  nominal_width = (double) cff_dict_get(cffont->private[0], "nominalWidthX", 0);
2687  } else {
2688  nominal_width = CFF_NOMINALWIDTHX_DEFAULT;
2689  }
2690  num_glyphs = 0;
2691  last_cid = 0;
2692  glyph = xtalloc(1, glw_entry);
2693  /*tex insert |notdef| */
2694  glyph->id = 0;
2695  if (avl_find(fd->gl_tree, glyph) == NULL) {
2696  avl_insert(fd->gl_tree, glyph);
2697  glyph = xtalloc(1, glw_entry);
2698  }
2699  avl_t_init(&t, fd->gl_tree);
2700  for (found = (glw_entry *) avl_t_first(&t, fd->gl_tree);
2701  found != NULL; found = (glw_entry *) avl_t_next(&t)) {
2702  if (found->id > last_cid)
2703  last_cid = (card16) found->id;
2704  num_glyphs++;
2705  }
2706  {
2707  cff_fdselect *fdselect;
2708  fdselect = xcalloc(1, sizeof(cff_fdselect));
2709  fdselect->format = 3;
2710  fdselect->num_entries = 1;
2711  fdselect->data.ranges = xcalloc(1, sizeof(cff_range3));
2712  fdselect->data.ranges[0].first = 0;
2713  fdselect->data.ranges[0].fd = 0;
2714  cffont->fdselect = fdselect;
2715  }
2716  {
2718  charset = xcalloc(1, sizeof(cff_charsets));
2719  charset->format = 0;
2720  charset->num_entries = (card16) (num_glyphs - 1);
2721  charset->data.glyphs = xcalloc(num_glyphs, sizeof(s_SID));
2722  gid = 0;
2723  avl_t_init(&t, fd->gl_tree);
2724  for (found = (glw_entry *) avl_t_first(&t, fd->gl_tree);
2725  found != NULL; found = (glw_entry *) avl_t_next(&t)) {
2726  if (found->id != 0) {
2727  charset->data.glyphs[gid] = (s_SID) found->id;
2728  gid++;
2729  }
2730  }
2731  cffont->charsets = charset;
2732  if (cffont->header_major == 2) {
2733  cff_dict_add(cffont->topdict, "charset", 1);
2734  }
2735  }
2736  cff_dict_add(cffont->topdict, "CIDCount", 1);
2737  cff_dict_set(cffont->topdict, "CIDCount", 0, last_cid + 1);
2738  if (cffont->header_major == 2) {
2739  cff_dict_add(cffont->topdict, "FullName", 1);
2740  cff_dict_set(cffont->topdict, "FullName", 0, (double) cff_add_string(cffont, fontname));
2741  cff_dict_add(cffont->topdict, "FontBBox", 4);
2742  cff_dict_set(cffont->topdict, "FontBBox", 0, fd->font_dim[FONTBBOX1_CODE].val);
2743  cff_dict_set(cffont->topdict, "FontBBox", 1, fd->font_dim[FONTBBOX2_CODE].val);
2744  cff_dict_set(cffont->topdict, "FontBBox", 2, fd->font_dim[FONTBBOX3_CODE].val);
2745  cff_dict_set(cffont->topdict, "FontBBox", 3, fd->font_dim[FONTBBOX4_CODE].val);
2746  }
2747  cffont->fdarray = xcalloc(1, sizeof(cff_dict *));
2748  cffont->fdarray[0] = cff_new_dict();
2749  cff_dict_add(cffont->fdarray[0], "FontName", 1);
2750  /*tex fix: skip XXXXXX+ */
2751  cff_dict_set(cffont->fdarray[0], "FontName", 0, (double) cff_add_string(cffont, fullname));
2752  cff_dict_add(cffont->fdarray[0], "Private", 2);
2753  cff_dict_set(cffont->fdarray[0], "Private", 0, 0.0);
2754  cff_dict_set(cffont->fdarray[0], "Private", 0, 0.0);
2755  /*tex |FDArray| index offset, not known yet */
2756  cff_dict_add(cffont->topdict, "FDArray", 1);
2757  cff_dict_set(cffont->topdict, "FDArray", 0, 0.0);
2758  /*tex |FDSelect| offset, not known yet */
2759  cff_dict_add(cffont->topdict, "FDSelect", 1);
2760  cff_dict_set(cffont->topdict, "FDSelect", 0, 0.0);
2761  cff_dict_remove(cffont->topdict, "UniqueID");
2762  cff_dict_remove(cffont->topdict, "XUID");
2763  cff_dict_remove(cffont->topdict, "Private");
2764  cff_dict_remove(cffont->topdict, "Encoding");
2765  cffont->offset = (l_offset) cff_dict_get(cffont->topdict, "CharStrings", 0);
2766  cs_idx = cff_get_index_header(cffont);
2767  offset = (long) cffont->offset;
2768  cs_count1 = cs_idx->count;
2769  if (cs_count1 < 2) {
2770  normal_error("cff","no valid charstring data found");
2771  }
2772  /*tex Build the new charstrings entry. */
2773  charstrings = cff_new_index((card16) (cs_count1==USHRT_MAX?cs_count1: cs_count1 + 1));
2774  max_len = 2 * CS_STR_LEN_MAX;
2775  charstrings->data = xcalloc((unsigned) max_len, sizeof(card8));
2776  charstring_len = 0;
2777  gid = 0;
2778  data = xcalloc(CS_STR_LEN_MAX, sizeof(card8));
2779  {
2780  int i;
2781  int tex_font = fd->tex_font;
2782  int streamprovider = 0;
2783  int callback_id = 0 ;
2784  if ((tex_font > 0) && (font_streamprovider(tex_font) == 1)) {
2785  streamprovider = font_streamprovider(tex_font);
2787  }
2788  for (i = 0; i < cs_count1; i++) {
2789  code = (card16) i;
2790  glyph->id = code;
2791  if ((avl_find(fd->gl_tree,glyph) != NULL)) {
2792  /*tex This code is the same as below, apart from small details */
2793  if (callback_id > 0) {
2794  lstring * result;
2795  run_callback(callback_id, "ddd->L", tex_font, i, streamprovider, &result); /* this call can be sped up */
2796  size = (size_t) result->l ;
2797  if (size > 0) {
2798  if (charstring_len + CS_STR_LEN_MAX >= max_len) {
2799  max_len = (long)(charstring_len + 2 * CS_STR_LEN_MAX);
2800  charstrings->data = xrealloc(charstrings->data, (unsigned)((unsigned)max_len*sizeof(card8)));
2801  }
2802  (charstrings->offset)[gid] = (unsigned)(charstring_len + 1);
2803  cffont->offset = (l_offset)((unsigned)offset + (cs_idx->offset)[code] - 1);
2804  memcpy(charstrings->data+charstring_len,(const char *) result->s,(size_t) size);
2805  charstring_len += size;
2806  xfree(result);
2807  }
2808  } else {
2809  size = (long)(cs_idx->offset[code+1] - cs_idx->offset[code]);
2810  if (size > CS_STR_LEN_MAX) {
2811  formatted_error("cff","charstring too long: gid=%u, %ld bytes", code, size);
2812  }
2813  if (charstring_len + CS_STR_LEN_MAX >= max_len) {
2814  max_len = (long)(charstring_len + 2 * CS_STR_LEN_MAX);
2815  charstrings->data = xrealloc(charstrings->data, (unsigned)((unsigned)max_len*sizeof(card8)));
2816  }
2817  (charstrings->offset)[gid] = (unsigned)(charstring_len + 1);
2818  cffont->offset = (l_offset)((unsigned)offset + (cs_idx->offset)[code] - 1);
2819  memcpy(data,&cffont->stream[cffont->offset],(size_t)size);
2820  charstring_len += cs_copy_charstring(
2821  charstrings->data + charstring_len,
2822  max_len - charstring_len,
2823  data, size,
2824  cffont->gsubr, (cffont->subrs)[0],
2825  default_width, nominal_width, NULL,
2826  cffont->header_major == 2
2827  );
2828  }
2829  gid++;
2830  }
2831  }
2832  }
2833  /*tex
2834  The |CIDSet| is a table of bits indexed by cid, bytes with high order bit
2835  first, each (set) bit is a (present) CID.
2836  */
2837  if ((! pdf->omit_cidset) && (pdf->major_version == 1)) {
2838  int cid;
2840  if (cidset != 0) {
2841  size_t l = (last_cid/8)+1;
2842  char *stream = xmalloc(l);
2843  memset(stream, 0, l);
2844  for (cid = 1; cid <= (long) last_cid; cid++) {
2845  glyph->id = cid;
2846  if (avl_find(fd->gl_tree,glyph) != NULL) {
2847  stream[(cid / 8)] |= (1 << (7 - (cid % 8)));
2848  }
2849  }
2853  pdf_end_dict(pdf);
2857  pdf_end_obj(pdf);
2858  }
2859  }
2860  /*tex
2861  This happens if the internal metrics do not agree with the actual disk
2862  font.
2863  */
2864  if (gid < num_glyphs) {
2865  formatted_warning("cff","embedded subset is smaller than expected: %d instead of %d glyphs", gid, num_glyphs);
2866  num_glyphs = gid;
2867  }
2868  xfree(data);
2869  cff_release_index(cs_idx);
2870  (charstrings->offset)[num_glyphs] = (l_offset) (charstring_len + 1);
2871  charstrings->count = num_glyphs;
2872  cffont->num_glyphs = num_glyphs;
2873  cffont->cstrings = charstrings;
2874  /*tex
2875  We don't use subroutines at all.
2876  */
2877  if (cffont->gsubr)
2878  cff_release_index(cffont->gsubr);
2879  cffont->gsubr = cff_new_index(0);
2880  if (cffont->subrs && cffont->subrs[0])
2881  cff_release_index(cffont->subrs[0]);
2882  cffont->subrs[0] = NULL;
2883  if (cffont->private && (cffont->private)[0]) {
2884  cff_dict_remove((cffont->private)[0], "Subrs"); /* no Subrs */
2885  }
2886  cff_dict_update(cffont->topdict, cffont);
2887  cff_add_string(cffont, "Adobe");
2888  cff_add_string(cffont, "Identity");
2889  if (cffont->header_major == 2) {
2890  /*tex A crash. */
2891  } else if (cffont->private && (cffont->private)[0]) {
2892  cff_dict_update(cffont->private[0], cffont);
2893  }
2894  cff_update_string(cffont);
2895  /* CFF code need to be rewritten */
2896  cff_dict_add(cffont->topdict, "ROS", 3);
2897  cff_dict_set(cffont->topdict, "ROS", 0, (double) cff_get_sid(cffont, "Adobe"));
2898  cff_dict_set(cffont->topdict, "ROS", 1, (double) cff_get_sid(cffont, "Identity"));
2899  cff_dict_set(cffont->topdict, "ROS", 2, 0.0);
2900  write_fontfile(pdf, cffont, fullname);
2901  xfree(fontname);
2902  xfree(fullname);
2903  cff_close(cffont);
2904 }
2905 
2906 #define is_cidfont(a) ((a)->flag & FONTTYPE_CIDFONT)
2907 #define CID_MAX 65535
2908 
2909 void write_cid_cff(PDF pdf, cff_font * cffont, fd_entry * fd)
2910 {
2911  cff_index *charstrings, *cs_idx;
2912  long charstring_len, max_len;
2913  long size, offset = 0;
2914  int tex_font = fd->tex_font;
2915  int streamprovider = 0;
2916  int callback_id = 0 ;
2917  card8 *data;
2918  card16 num_glyphs, cs_count1, gid, last_cid;
2919  int fdsel, prev_fd, cid_count, cid ;
2920  char *fullname;
2921  glw_entry *glyph;
2922  unsigned char *CIDToGIDMap = NULL;
2923  cff_fdselect *fdselect = NULL;
2925  if (!is_cidfont(cffont)) {
2926  normal_error("cff","invalid CIDfont");
2927  return;
2928  }
2929  if ((tex_font > 0) && (font_streamprovider(tex_font) == 1)) {
2930  streamprovider = font_streamprovider(tex_font);
2932  }
2933  fullname = xcalloc((unsigned) (8 + strlen(fd->fontname)), 1);
2934  sprintf(fullname, "%s+%s", fd->subset_tag, fd->fontname);
2935  /*tex Finish parsing the CFF. */
2936  if (cff_dict_known(cffont->topdict, "CIDCount")) {
2937  cid_count = (card16) cff_dict_get(cffont->topdict, "CIDCount", 0);
2938  } else {
2939  cid_count = CFF_CIDCOUNT_DEFAULT;
2940  }
2941  if (cffont->header_major == 2) {
2942  /*tex hm */
2943  } else {
2944  cff_read_charsets(cffont);
2945  }
2946  CIDToGIDMap = xmalloc((unsigned) ((2 * (unsigned) cid_count) * sizeof(unsigned char)));
2947  memset(CIDToGIDMap, 0, (size_t) (2 * cid_count));
2948  glyph = xtalloc(1, glw_entry);
2949  /*tex insert |notdef| */
2950  glyph->id = 0;
2951  if (avl_find(fd->gl_tree, glyph) == NULL) {
2952  avl_insert(fd->gl_tree, glyph);
2953  glyph = xtalloc(1, glw_entry);
2954  }
2955  last_cid = 0;
2956  num_glyphs = 0;
2957  for (cid = 0; cid <= CID_MAX; cid++) {
2958  glyph->id = (unsigned) cid;
2959  if (avl_find(fd->gl_tree, glyph) != NULL) {
2960  gid = (card16) cid;
2961  CIDToGIDMap[2 * cid] = (unsigned char) ((gid >> 8) & 0xff);
2962  CIDToGIDMap[2 * cid + 1] = (unsigned char) (gid & 0xff);
2963  last_cid = (card16) cid;
2964  num_glyphs++;
2965  }
2966  }
2967  if (cffont->header_major == 2) {
2968  /*tex hm */
2969  } else if (last_cid >= cffont->num_glyphs) {
2970  formatted_error("cff font","bad glyph index %i",last_cid);
2971  }
2972  /*tex
2973  The |CIDSet| table is a table of bits indexed by cid, bytes with high
2974  order bit first, each (set) bit is a (present) CID.
2975  */
2976  if ((! pdf->omit_cidset) && (pdf->major_version == 1)) {
2978  if (cidset != 0) {
2979  size_t l = (last_cid / 8) + 1;
2980  char *stream = xmalloc(l);
2981  memset(stream, 0, l);
2982  stream[0] |= 1 << 7; /*tex Force |.notdef| into the map. */
2983  for (cid = 1; cid <= (long) last_cid; cid++) {
2984  if (CIDToGIDMap[2 * cid] || CIDToGIDMap[2 * cid + 1]) {
2985  stream[(cid / 8)] |= (1 << (7 - (cid % 8)));
2986  }
2987  }
2991  pdf_end_dict(pdf);
2995  pdf_end_obj(pdf);
2996  xfree(stream);
2997  }
2998  }
2999  cff_read_fdselect(cffont);
3000  cff_read_fdarray(cffont);
3001  cff_read_private(cffont);
3002  cff_read_subrs(cffont);
3003  cffont->offset = (l_offset) cff_dict_get(cffont->topdict, "CharStrings", 0);
3004  cs_idx = cff_get_index_header(cffont);
3005  offset = (long) cffont->offset;
3006  cs_count1 = cs_idx->count;
3007  if (cs_count1 < 2) {
3008  normal_error("cff","no valid charstring data found");
3009  }
3010  charset = xcalloc(1, sizeof(cff_charsets));
3011  charset->format = 0;
3012  charset->num_entries = 0;
3013  charset->data.glyphs = xcalloc(num_glyphs, sizeof(s_SID));
3014  fdselect = xcalloc(1, sizeof(cff_fdselect));
3015  fdselect->format = 3;
3016  fdselect->num_entries = 0;
3017  fdselect->data.ranges = xcalloc(num_glyphs, sizeof(cff_range3));
3018  charstrings = cff_new_index((card16) (cs_count1==USHRT_MAX?cs_count1: cs_count1 + 1));
3019  max_len = 2 * CS_STR_LEN_MAX;
3020  charstrings->data = xcalloc((unsigned) max_len, sizeof(card8));
3021  charstring_len = 0;
3022  prev_fd = -1;
3023  gid = 0;
3024  data = xcalloc(CS_STR_LEN_MAX, sizeof(card8));
3025  for (cid = 0; cid <= last_cid; cid++) {
3026  unsigned short gid_org;
3027  glyph->id = (unsigned) cid;
3028  if (avl_find(fd->gl_tree, glyph) == NULL)
3029  continue;
3030  gid_org = (short unsigned) ((CIDToGIDMap[2 * cid] << 8) | (CIDToGIDMap[2 * cid + 1]));
3031  fdsel = cff_fdselect_lookup(cffont, gid_org);
3032  if (callback_id > 0) {
3033  /*tex The next blob is not yet tested \unknown\ I need a font. */
3034  lstring * result;
3035  run_callback(callback_id, "ddd->L", tex_font, gid_org, streamprovider, &result);
3036  size = (size_t) result->l ;
3037  if (size > 0) {
3038  if (charstring_len + CS_STR_LEN_MAX >= max_len) {
3039  max_len = (long)(charstring_len + 2 * CS_STR_LEN_MAX);
3040  charstrings->data = xrealloc(charstrings->data, (unsigned)((unsigned)max_len*sizeof(card8)));
3041  }
3042  (charstrings->offset)[gid] = (unsigned)(charstring_len + 1);
3043  cffont->offset = (l_offset)((unsigned)offset + (cs_idx->offset)[gid_org] - 1);
3044  memcpy(charstrings->data+charstring_len,(const char *) result->s,(size_t)size);
3045  charstring_len += size;
3046  xfree(result);
3047  }
3048  } else {
3049  size = (long) (cs_idx->offset[gid_org + 1] - cs_idx->offset[gid_org]);
3050  if (size > CS_STR_LEN_MAX) {
3051  formatted_error("cff","charstring too long: gid=%u, %ld bytes", cid, size);
3052  }
3053  if (charstring_len + CS_STR_LEN_MAX >= max_len) {
3054  max_len = charstring_len + 2 * CS_STR_LEN_MAX;
3055  charstrings->data = xrealloc(charstrings->data, (unsigned) ((unsigned) max_len * sizeof(card8)));
3056  }
3057  (charstrings->offset)[gid] = (l_offset) (charstring_len + 1);
3058  cffont->offset = (l_offset) ((unsigned) offset + (cs_idx->offset)[gid_org] - 1);
3059  memcpy(data, &cffont->stream[cffont->offset], (size_t) size);
3060  charstring_len += cs_copy_charstring(
3061  charstrings->data + charstring_len,
3062  max_len - charstring_len,
3063  data, size,
3064  cffont->gsubr, (cffont->subrs)[fdsel],
3065  0, 0, NULL,
3066  cffont->header_major == 2
3067  );
3068  }
3069  if (cid > 0 && gid_org > 0) {
3070  charset->data.glyphs[charset->num_entries] = (s_SID) cid;
3071  charset->num_entries++;
3072  }
3073  if (fdsel != prev_fd) {
3074  fdselect->data.ranges[fdselect->num_entries].first = gid;
3075  fdselect->data.ranges[fdselect->num_entries].fd = (card8) fdsel;
3076  fdselect->num_entries++;
3077  prev_fd = fdsel;
3078  }
3079  gid++;
3080  }
3081  if (gid != num_glyphs)
3082  formatted_error("cff","unexpected error: %i != %i", gid, num_glyphs);
3083  xfree(data);
3084  cff_release_index(cs_idx);
3085  xfree(CIDToGIDMap);
3086  (charstrings->offset)[num_glyphs] = (l_offset) (charstring_len + 1);
3087  charstrings->count = num_glyphs;
3088  cffont->num_glyphs = num_glyphs;
3089  cffont->cstrings = charstrings;
3090  cff_release_charsets(cffont->charsets);
3091  cffont->charsets = charset;
3092  cff_release_fdselect(cffont->fdselect);
3093  cffont->fdselect = fdselect;
3094  /*tex
3095  We don't use subroutines at all.
3096  */
3097  if (cffont->gsubr)
3098  cff_release_index(cffont->gsubr);
3099  cffont->gsubr = cff_new_index(0);
3100  for (fdsel = 0; fdsel < cffont->num_fds; fdsel++) {
3101  if (cffont->subrs && cffont->subrs[fdsel]) {
3102  cff_release_index(cffont->subrs[fdsel]);
3103  cffont->subrs[fdsel] = NULL;
3104  }
3105  if (cffont->private && (cffont->private)[fdsel]) {
3106  cff_dict_remove((cffont->private)[fdsel], "Subrs"); /* no Subrs */
3107  }
3108  }
3109  write_fontfile(pdf, cffont, fullname);
3110  xfree(fullname);
3111  cff_close(cffont);
3112 }
3113 
3114 /*tex
3115 
3116  Here is a sneaky trick: fontforge knows how to convert Type1 to CFF, so I
3117  have defined a utility function in luafflib.c that does exactly that. If it
3118  works out ok, I will clean up this code.
3119 
3120 */
3121 
3123 {
3124  cff_font *cff;
3125  int i;
3126  FILE *fp;
3127  ff_entry *ff;
3128  unsigned char *tfm_buffer = NULL;
3129  int tfm_size = 0;
3130  ff = check_ff_exist(fd->fm->ff_name, 0);
3131  fp = fopen(ff->ff_path, "rb");
3132  cur_file_name = ff->ff_path;
3133  if (!fp) {
3134  formatted_error("cff","could not open Type1 font: %s", cur_file_name);
3135  }
3136  fclose(fp);
3137  if (is_subsetted(fd->fm)) {
3139  } else {
3141  }
3142  (void) ff_createcff(ff->ff_path, &tfm_buffer, &tfm_size);
3143  if (tfm_size > 0) {
3144  cff = read_cff(tfm_buffer, tfm_size, 0);
3145  if (cff != NULL) {
3146  write_cff(pdf, cff, fd);
3147  } else {
3148  for (i = 0; i < tfm_size; i++)
3149  strbuf_putchar(pdf->fb, tfm_buffer[i]);
3150  }
3151  fd->ff_found = 1;
3152  } else {
3153  formatted_error("cff","could not understand Type1 font: %s",cur_file_name);
3154  }
3155  if (is_subsetted(fd->fm)) {
3157  } else {
3159  }
3160  cur_file_name = NULL;
3161 }
double __cdecl strtod(char const *_String, char **_EndPtr)
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
const char * fontname
Definition: afm2pl.c:186
int code
Definition: aftopl.c:52
#define type(a)
Definition: aptex-macros.h:171
#define count(a)
Definition: aptex-macros.h:781
#define name
#define n
Definition: t4ht.c:1290
void glyphs(int opcode)
Definition: disdvi.c:775
static int id
Definition: bifont.c:66
int v
Definition: dviconv.c:10
#define fopen
Definition: xxstdio.h:21
double sqrt()
#define FONTBBOX1_CODE
Definition: ptexmac.h:97
#define xfree(p)
Definition: ptexmac.h:85
#define FONTBBOX2_CODE
Definition: ptexmac.h:98
#define is_subsetted(fm)
Definition: ptexmac.h:126
#define xtalloc
Definition: ptexmac.h:87
#define FONTBBOX3_CODE
Definition: ptexmac.h:99
#define FONTBBOX4_CODE
Definition: ptexmac.h:100
int strcmp()
Definition: coll.cpp:143
char * strings
Definition: dvidvi.c:141
struct rect data
Definition: dvipdfm.c:64
static void
Definition: fpif.c:118
#define s
Definition: afcover.h:80
#define t
Definition: afcover.h:96
static void * xrealloc(char *oldp, unsigned size)
Definition: gsftopk.c:643
#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
assert(pcxLoadImage24((char *)((void *) 0), fp, pinfo, hdr))
#define NULL
Definition: ftobjs.h:61
small capitals from c petite p scientific i
Definition: afcover.h:80
FT_UInt sid
Definition: cffcmap.c:138
FT_UInt idx
Definition: cffcmap.c:135
CFF_Font cff
Definition: cffdrivr.c:701
int errno
#define xmalloc(size)
Definition: writet1.c:33
#define CHARSETS_EXPSUB
Definition: cff.h:37
#define ENCODING_EXPERT
Definition: cff.h:33
#define CHARSETS_ISOADOBE
Definition: cff.h:35
#define HAVE_STANDARD_CHARSETS
Definition: cff.h:40
#define CHARSETS_EXPERT
Definition: cff.h:36
#define ENCODING_STANDARD
Definition: cff.h:32
#define FONTTYPE_CIDFONT
Definition: cff.h:28
#define FONTTYPE_FONT
Definition: cff.h:29
#define CFF_NOMINALWIDTHX_DEFAULT
Definition: cff_dict.h:27
#define CFF_DEFAULTWIDTHX_DEFAULT
Definition: cff_dict.h:28
#define CS_SUBR_NEST_MAX
Definition: cff_limits.h:42
#define CS_STR_LEN_MAX
Definition: cff_limits.h:38
#define CFF_INT_MAX
Definition: cff_limits.h:26
#define CFF_STDSTR_MAX
Definition: cff_limits.h:34
#define CS_TRANS_ARRAY_MAX
Definition: cff_limits.h:41
#define CS_ARG_STACK_MAX
Definition: cff_limits.h:40
#define CFF_INT_MIN
Definition: cff_limits.h:27
#define CFF_TYPE_SID
Definition: cff_types.h:31
unsigned char card8
Definition: cff_types.h:42
uint32_t l_offset
Definition: cff_types.h:46
#define CFF_TYPE_ROS
Definition: cff_types.h:36
#define CFF_TYPE_DELTA
Definition: cff_types.h:33
unsigned short s_SID
Definition: cff_types.h:47
unsigned short card16
Definition: cff_types.h:43
#define CFF_TYPE_ARRAY
Definition: cff_types.h:32
#define CFF_TYPE_SZOFF
Definition: cff_types.h:40
#define CFF_TYPE_BOOLEAN
Definition: cff_types.h:30
#define CFF_TYPE_OFFSET
Definition: cff_types.h:38
#define CFF_TYPE_NUMBER
Definition: cff_types.h:29
#define buf
#define USHRT_MAX
Definition: c-minmax.h:46
#define fclose
Definition: debug.h:100
KPSEDLL address xcalloc(size_t nelem, size_t elsize)
Definition: xcalloc.c:23
#define fabs(x)
Definition: cpascal.h:211
#define floor(x)
Definition: cpascal.h:52
#define cur_file_name
Definition: ctangleboot.c:60
#define length(c)
Definition: ctangleboot.c:65
#define b0
Definition: texmfmem.h:168
#define b1
Definition: texmfmem.h:169
#define b2
Definition: texmfmem.h:170
void * avl_t_next(struct avl_traverser *trav)
Definition: avl.c:524
void * avl_t_first(struct avl_traverser *trav, struct avl_table *tree)
Definition: avl.c:393
void avl_t_init(struct avl_traverser *trav, struct avl_table *tree)
Definition: avl.c:382
void * avl_insert(struct avl_table *table, void *item)
Definition: avl.c:185
ff_entry * check_ff_exist(char *ff_name, boolean is_tt)
Definition: mapfile.c:863
#define dest
#define sprintf
Definition: snprintf.c:44
int run_callback(int i, const char *values,...)
Definition: lcallbacklib.c:259
void normal_error(const char *t, const char *p)
Definition: errors.c:951
void formatted_error(const char *t, const char *fmt,...)
Definition: errors.c:1038
int ff_createcff(char *file, unsigned char **buf, int *bufsiz)
Definition: luafflib.c:3265
const int * pos
Definition: combiners.h:905
void formatted_warning(const char *t, const char *fmt,...)
Definition: errors.c:1048
@ glyph_stream_provider_callback
#define callback_defined(a)
#define report_stop_file(right)
#define filetype_font
#define report_start_file(left, name)
#define filetype_subset
#define size_t
Definition: glob.c:257
void normal_warning(const char *t, const char *p)
Definition: errors.c:981
Definition: pdf.py:1
union value value
Definition: obx.h:44
void strbuf_putchar(strbuf_s *b, unsigned char c)
Definition: pdfgen.c:124
#define OBJSTM_NEVER
Definition: pdftypes.h:51
@ obj_type_others
Definition: pdftypes.h:221
#define res(length)
Definition: picttoppm.c:287
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
#define fp
static int32_t first
Definition: ppagelist.c:29
static int size
Definition: ppmlabel.c:24
static int offset
Definition: ppmtogif.c:642
bstring c int memset(void *s, int c, int length)
struct stream_s stream
Definition: pts_fax.h:93
charset
Definition: charset.h:51
#define ivalue(o)
Definition: lobject.h:163
#define avl_find
Definition: avl.h:18
int pdf_create_obj(PDF pdf, int t, int i)
Definition: pdftables.c:121
void pdf_end_obj(PDF)
Definition: pdfgen.c:1277
void pdf_end_stream(PDF)
Definition: pdfgen.c:631
void pdf_end_dict(PDF)
Definition: pdfgen.c:1125
void pdf_begin_obj(PDF, int, int)
Definition: pdfgen.c:1256
void pdf_begin_dict(PDF)
Definition: pdfgen.c:1118
void pdf_out_block(PDF pdf, char *s, size_t n)
void pdf_dict_add_streaminfo(PDF)
Definition: pdfgen.c:1227
void pdf_begin_stream(PDF)
Definition: pdfgen.c:618
#define str(s)
Definition: sh6.c:399
ShellFileEnvironment e
Definition: sh6.c:388
FT_Stream stream
Definition: cfftypes.h:340
CFF_EncodingRec encoding
Definition: cfftypes.h:358
FT_UInt num_glyphs
Definition: cfftypes.h:344
card16 num_entries
Definition: cff_types.h:112
Definition: cff_types.h:65
const char * key
Definition: cff_types.h:67
int count
Definition: cff_types.h:68
double * values
Definition: cff_types.h:69
int id
Definition: cff_types.h:66
int max
Definition: cff_types.h:73
cff_dict_entry * entries
Definition: cff_types.h:75
int count
Definition: cff_types.h:74
card8 * fds
Definition: cff_types.h:132
card8 format
Definition: cff_types.h:129
card16 num_entries
Definition: cff_types.h:130
cff_range3 * ranges
Definition: cff_types.h:133
union cff_fdselect::@117 data
Definition: cff.h:46
card16 num_glyphs
Definition: cff.h:66
cff_index * _string
Definition: cff.h:72
cff_charsets * charsets
Definition: cff.h:56
card8 header_major
Definition: writecff.h:191
cff_dict ** private
Definition: cff.h:60
cff_dict * topdict
Definition: cff.h:52
card8 num_fds
Definition: cff.h:67
cff_index * cstrings
Definition: cff.h:58
cff_index * gsubr
Definition: cff.h:54
cff_index ** subrs
Definition: cff.h:61
cff_index * string
Definition: cff.h:53
cff_index * name
Definition: cff.h:51
FILE * stream
Definition: cff.h:74
cff_dict ** fdarray
Definition: cff.h:59
cff_fdselect * fdselect
Definition: cff.h:57
l_offset offset
Definition: cff.h:64
card16 count
Definition: cff_types.h:50
l_offset * offset
Definition: cff_types.h:52
card8 * data
Definition: cff_types.h:53
card8 fd
Definition: cff_types.h:124
card16 first
Definition: cff_types.h:123
Definition: inftrees.h:24
Definition: ptexlib.h:116
char * fontname
Definition: ptexlib.h:118
struct avl_table * gl_tree
Definition: ptexlib.h:130
fm_entry * fm
Definition: ptexlib.h:128
intparm font_dim[(10+1)]
Definition: ptexlib.h:125
char * subset_tag
Definition: ptexlib.h:119
internal_font_number tex_font
Definition: luatexfont.h:85
boolean ff_found
Definition: ptexlib.h:120
Definition: ptexlib.h:152
char * ff_path
Definition: ptexlib.h:154
char * ff_name
Definition: ptexlib.h:99
Definition: luatexfont.h:107
Definition: pbmfont.h:4
Definition: utils.c:99
int val
Definition: ptexlib.h:112
Definition: sh.h:1226
Definition: psfont.h:67
Definition: sh2.c:920
Definition: dvips.h:235
static unsigned char * save
Definition: t1disasm.c:278
#define FILE
Definition: t1stdio.h:34
ch
Definition: t4ht.c:1443
*job_name strlen((char *) job_name) - 4)
#define key
Definition: tex2xindy.c:753
long unsigned N
Definition: tex4ht.c:2765
found
Definition: tex4ht.c:5000
op
Definition: tex4ht.c:3129
return() int(((double) *(font_tbl[cur_fnt].wtbl+(int)(*(font_tbl[cur_fnt].char_wi+(int)(ch - font_tbl[cur_fnt].char_f)% 256)))/(double)(1L<< 20)) *(double) font_tbl[cur_fnt].scale)
#define font_streamprovider(a)
Definition: texfont.h:329
TT_Glyph glyph
Definition: ttf2pfb.c:162
Definition: obx.h:51
#define cs_abs
Definition: writecff.c:1819
void cff_release_encoding(cff_encoding *encoding)
Definition: writecff.c:348
#define cs_rcurveline
Definition: writecff.c:1795
static long cff_dict_put_number(double value, card8 *dest, long destlen, int type)
Definition: writecff.c:1288
long cff_set_name(cff_font *cff, char *name)
Definition: writecff.c:461
static double trn_array[32]
Definition: writecff.c:1763
#define is_cidfont(a)
Definition: writecff.c:2906
long cff_put_header(cff_font *cff, card8 *dest, long destlen)
Definition: writecff.c:480
#define get_card32(a)
Definition: writecff.c:31
#define cs_vhcurveto
Definition: writecff.c:1801
void cff_dict_set(cff_dict *dict, const char *key, int idx, double value)
Definition: writecff.c:1408
char * cff_get_string(cff_font *cff, s_SID id)
Definition: writecff.c:1427
#define cs_drop
Definition: writecff.c:1828
#define CFF_DICT_STACK_LIMIT
Definition: writecff.c:529
#define cs_mul
Definition: writecff.c:1834
#define cs_blend
Definition: writecff.c:1787
static void cs_parse_init(void)
Definition: writecff.c:2420
#define cs_dotsection
Definition: writecff.c:1810
#define DICT_ENTRY_MAX
Definition: writecff.c:503
#define get_card16(a)
Definition: writecff.c:30
#define cs_rlinecurve
Definition: writecff.c:1796
long cff_get_sid(cff_font *cff, const char *str)
Definition: writecff.c:1449
static cff_index * cff_get_index2(cff_font *cff)
Definition: writecff.c:219
cff_index * cff_get_index(cff_font *cff)
Definition: writecff.c:179
#define cs_hstem
Definition: writecff.c:1772
#define CID_MAX
Definition: writecff.c:2907
#define cs_get
Definition: writecff.c:1831
long cff_read_fdarray(cff_font *cff)
Definition: writecff.c:945
#define cs_div
Definition: writecff.c:1822
static unsigned long get_unsigned(cff_font *cff, int n)
Definition: writecff.c:42
static int cs2_nest
Definition: writecff.c:1741
#define CS_CHAR_END
Definition: writecff.c:1726
void cff_release_charsets(cff_charsets *charset)
Definition: writecff.c:367
#define cs_sub
Definition: writecff.c:1821
long cff_read_fdselect(cff_font *cff)
Definition: writecff.c:2458
#define cs_hlineto
Definition: writecff.c:1777
#define CS_STACK_CFF_ERROR
Definition: writecff.c:1721
long cff_pack_fdselect(cff_font *cff, card8 *dest, long destlen)
Definition: writecff.c:2506
static double get_integer(card8 **data, card8 *endptr, int *status)
Definition: writecff.c:614
void writetype1w(PDF pdf, fd_entry *fd)
Definition: writecff.c:3122
#define CFF_LAST_DICT_OP
Definition: writecff.c:537
#define cs_cntrmask
Definition: writecff.c:1791
static int cs2_stack_top
Definition: writecff.c:1761
static void do_charstring(card8 **dest, card8 *limit, card8 **data, card8 *endptr, cff_index *gsubr_idx, cff_index *subr_idx, int cff2)
Definition: writecff.c:2358
static long cs_copy_charstring(card8 *dst, long dstlen, card8 *src, long srclen, cff_index *gsubr, cff_index *subr, double default_width, double nominal_width, cs_ginfo *ginfo, int cff2)
Definition: writecff.c:2431
#define cs_vstem
Definition: writecff.c:1774
long cff_read_charsets(cff_font *cff)
Definition: writecff.c:1548
void cff_dict_update(cff_dict *dict, cff_font *cff)
Definition: