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)  

otfopen.c
Go to the documentation of this file.
1 /* otfopen.c -- OpenType font reader.
2 
3 Copyright (C) 2003, 2004, 2005, 2006, 2008, 2009, 2010
4  National Institute of Advanced Industrial Science and Technology (AIST)
5  Registration Number H15PRO167
6 
7 This file is part of libotf.
8 
9 Libotf is free software; you can redistribute it and/or modify it
10 under the terms of the GNU Lesser General Public License as published
11 by the Free Software Foundation; either version 2.1 of the License, or
12 (at your option) any later version.
13 
14 Libotf is distributed in the hope that it will be useful, but WITHOUT
15 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
16 FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
17 License for more details.
18 
19 You should have received a copy of the GNU Lesser General Public
20 License along with this library, in a file named COPYING; if not,
21 write to the Free Software Foundation, Inc., 59 Temple Place, Suite
22 330, Boston, MA 02111-1307, USA. */
23 
24 #include <stdio.h>
25 #include <stdlib.h>
26 #include <string.h>
27 #include <config.h>
28 
29 #include "otf.h"
30 #include "internal.h"
31 
32 #include FT_TRUETYPE_TABLES_H
33 
34 /***
35  Table of contents (almost parallel to otf.h):
36 
37  (0) Stream handler
38 
39  (1) Readers for OTF Layout tables and OTF itself
40  (1-1) Basic types and functions
41  (1-2) "head" table
42  (1-3) "name" table
43  (1-4) "cmap" table
44  (1-5) Structures common to GDEF, GSUB, and GPOS
45  (1-6) "GDEF" table
46  (1-7) Structures for ScriptList, FeatureList, and LookupList
47  (1-8) Structures common to GSUB and GPOS
48  (1-9) "GSUB" table
49  (1-10) "GPOS" table
50  (1-11) Structure for OTF
51 
52  (2) API for reading OTF
53  (2-1) OTF_open()
54  (2-2) OTF_close()
55  (2-3) OTF_get_table()
56  (2-4) OTF_check_table()
57 
58  (5) API miscellaneous
59 */
60 
61 int debug_flag = -1;
62 
63 static void
65 {
66  debug_flag = getenv ("LIBOTF_DEBUG") != NULL;
67 }
68 
69 ␌
70 /* (0) Stream handler
71 
72  Example of typical usage of OTF_Stream.
73 
74  {
75  OTF_Stream *stream;
76  OTF_StreamState state;
77  int offset, nbytes;
78 
79  OPEN_STREAM (_FILE_NAME_, stream);
80  if (! stream)
81  _ERROR_;
82  SETUP_STREAM (stream, fp, 0, 256, _NAME_);
83  offset = READ_OFFSET (stream);
84  nbytes = READ_ULONG (stream);
85  SETUP_STREAM (stream, fp, offset, nbytes, _NAME2_);
86  ...;
87  CLOSE_STREAM (stream);
88  }
89 
90 */
91 
92 typedef struct
93 {
94  const char *name;
95  long pos;
96  long bufsize;
97  long allocated;
98  unsigned char *buf;
99 } OTF_Stream;
100 
101 typedef long OTF_StreamState;
102 
103 static OTF_Stream *
104 make_stream (const char *name)
105 {
107  char *errfmt = "stream creation%s";
108  void *errret = NULL;
109 
110  stream = calloc (1, sizeof (OTF_Stream));
111  if (! stream)
113  stream->name = name;
114  return stream;
115 }
116 
117 static int
119 {
120  char *errfmt = "stream setup for %s";
121  int errret = -1;
122 
123  stream->pos = 0;
124  if (stream->allocated < nbytes)
125  {
126  unsigned char *buf = malloc (nbytes);
127 
128  if (! buf)
130  if (stream->buf)
131  free (stream->buf);
132  stream->buf = buf;
133  stream->allocated = nbytes;
134  }
135  stream->bufsize = nbytes;
136  if (fseek (fp, offset, SEEK_SET) < 0)
138  if (fread (stream->buf, 1, nbytes, fp) != nbytes)
140  return 0;
141 }
142 
143 static OTF_Stream *
145 {
146  char *errfmt = "FT_Face stream creation for %s";
147  void *errret = NULL;
148  FT_ULong nbytes = 0;
149  unsigned char *buf;
151  FT_ULong tag = FT_MAKE_TAG (name[0], name[1], name[2], name[3]);
152 
153  if (FT_Load_Sfnt_Table (face, tag, 0, NULL, &nbytes))
154  return NULL;
155  buf = malloc (nbytes);
156  if (! buf)
158  if (FT_Load_Sfnt_Table (face, tag, 0, buf, &nbytes))
159  {
160  free (buf);
162  }
163  stream = make_stream (name);
164  if (! stream)
165  return NULL;
166  stream->pos = 0;
167  stream->buf = buf;
168  stream->allocated = nbytes;
169  stream->bufsize = nbytes;
170  return stream;
171 }
172 
173 static void
175 {
176  if (stream->buf)
177  free (stream->buf);
178  free (stream);
179 }
180 
181 #define SAVE_STREAM(stream, state) ((state) = (stream)->pos)
182 #define RESTORE_STREAM(stream, state) ((stream)->pos = (state))
183 #define SEEK_STREAM(stream, offset) ((stream)->pos = (offset))
184 
185 #define STREAM_CHECK_SIZE(stream, size) \
186  if ((stream)->pos + (size) > (stream)->bufsize) \
187  { \
188  char *errfmt = "buffer overrun in %s"; \
189  \
190  OTF_ERROR (OTF_ERROR_TABLE, (stream)->name); \
191  return errret; \
192  } \
193  else
194 
195 
196 #define READ_USHORT(stream, var) \
197  do { \
198  STREAM_CHECK_SIZE ((stream), 2); \
199  (var) = (((stream)->buf[(stream)->pos] << 8) \
200  | (stream)->buf[(stream)->pos + 1]); \
201  (stream)->pos += 2; \
202  } while (0)
203 
204 #define READ_SHORT(stream, var) \
205  do { \
206  STREAM_CHECK_SIZE ((stream), 2); \
207  (var) = (short) (((stream)->buf[(stream)->pos] << 8) \
208  | (stream)->buf[(stream)->pos + 1]); \
209  (stream)->pos += 2; \
210  } while (0)
211 
212 #define READ_UINT24(stream, var) \
213  do { \
214  STREAM_CHECK_SIZE ((stream), 3); \
215  (var) = (((stream)->buf[(stream)->pos ] << 16) \
216  | ((stream)->buf[(stream)->pos + 1] << 8) \
217  | (stream)->buf[(stream)->pos + 2]); \
218  (stream)->pos += 3; \
219  } while (0)
220 
221 #define READ_ULONG(stream, var) \
222  do { \
223  STREAM_CHECK_SIZE ((stream), 4); \
224  (var) = (((stream)->buf[(stream)->pos] << 24) \
225  | ((stream)->buf[(stream)->pos + 1] << 16) \
226  | ((stream)->buf[(stream)->pos + 2] << 8) \
227  | (stream)->buf[(stream)->pos + 3]); \
228  (stream)->pos += 4; \
229  } while (0)
230 
231 #define READ_LONG(stream, var) \
232  do { \
233  STREAM_CHECK_SIZE ((stream), 4); \
234  (var) = (int) (((stream)->buf[(stream)->pos] << 24) \
235  | ((stream)->buf[(stream)->pos + 1] << 16) \
236  | ((stream)->buf[(stream)->pos + 2] << 8) \
237  | (stream)->buf[(stream)->pos + 3]); \
238  (stream)->pos += 4; \
239  } while (0)
240 
241 
242 #define READ_FIXED(stream, fixed) \
243  do { \
244  READ_USHORT ((stream), (fixed).high); \
245  READ_USHORT ((stream), (fixed).low); \
246  } while (0)
247 
248 
249 #define READ_BYTES(stream, p, nbytes) \
250  do { \
251  STREAM_CHECK_SIZE ((stream), (nbytes)); \
252  memcpy ((p), (stream)->buf + (stream)->pos, (nbytes)); \
253  (stream)->pos += (nbytes); \
254  } while (0)
255 
256 
257 #define READ_TAG READ_ULONG
258 #define READ_OFFSET READ_USHORT
259 #define READ_UINT16 READ_USHORT
260 #define READ_INT16 READ_SHORT
261 #define READ_GLYPHID READ_USHORT
262 
263 ␌
264 /*** (1) Structures for OTF Layout tables and OTF itself */
265 
266 /*** (1-1) Basic types and functions */
267 
269  {
277  };
278 
279 #define OTF_MEMORY_RECORD_SIZE 1024
280 
282 {
283  int used;
286 };
287 
288 typedef struct OTF_MemoryRecord OTF_MemoryRecord;
289 
291  {
296  };
297 
298 struct _OTF_TableInfo;
299 typedef struct _OTF_TableInfo OTF_TableInfo;
300 
302 {
303  /* Points to one of OTF->head, OTF->name, etc. */
304  void **address;
305  /* Function to read one of OTF tables. */
306  void *(*reader) (OTF *otf, OTF_TableInfo *table, enum OTF_ReaderFlag flag);
307  /* Stream given to <reader>. */
309 };
310 
312 {
313  char *id;
314  void *data;
315  void (*freer) (void *data);
317 };
318 
320 
322 {
323  /* Information about each OTF table. */
325 
326  /* Stream used to read the header part of OTF. */
328 
329  /* Records of allocated memories. */
331 
332  /* Root of application data chain. */
334 };
335 
336 static OTF_MemoryRecord *
338 {
339  OTF_InternalData *internal_data = (OTF_InternalData *) otf->internal_data;
340  OTF_MemoryRecord *memrec = malloc (sizeof (OTF_MemoryRecord));
341 
342  if (! memrec)
343  return NULL;
344  memrec->used = 0;
345  memrec->next = internal_data->memory_record;
346  internal_data->memory_record = memrec;
347  return memrec;
348 }
349 
350 /* Memory allocation macros. */
351 
352 #define OTF_MALLOC(p, size, arg) \
353  do { \
354  if (size == 0) \
355  (p) = NULL; \
356  else \
357  { \
358  OTF_MemoryRecord *memrec \
359  = ((OTF_InternalData *) otf->internal_data)->memory_record; \
360  (p) = malloc (sizeof (*(p)) * (size)); \
361  if (! (p) \
362  || (memrec->used >= OTF_MEMORY_RECORD_SIZE \
363  && ! (memrec = allocate_memory_record (otf)))) \
364  OTF_ERROR (OTF_ERROR_MEMORY, (arg)); \
365  memrec->memory[memrec->used++] = (p); \
366  } \
367  } while (0)
368 
369 
370 #define OTF_CALLOC(p, size, arg) \
371  do { \
372  if (size == 0) \
373  (p) = NULL; \
374  else \
375  { \
376  OTF_MemoryRecord *memrec \
377  = ((OTF_InternalData *) otf->internal_data)->memory_record; \
378  (p) = calloc ((size), sizeof (*(p))); \
379  if (! (p) \
380  || (memrec->used >= OTF_MEMORY_RECORD_SIZE \
381  && ! (memrec = allocate_memory_record (otf)))) \
382  OTF_ERROR (OTF_ERROR_MEMORY, (arg)); \
383  memrec->memory[memrec->used++] = (p); \
384  } \
385  } while (0)
386 
387 ␌
388 /*** (1-2) "head" table */
389 
390 static void *
392 {
393  OTF_Stream *stream = table->stream;
394  char *errfmt = "head%s";
395  void *errret = NULL;
396  OTF_head *head;
397 
398  OTF_CALLOC (head, 1, "");
399  READ_FIXED (stream, head->TableVersionNumber);
400  READ_FIXED (stream, head->fontRevision);
401  READ_ULONG (stream, head->checkSumAdjustment);
402  READ_ULONG (stream, head->magicNumber);
404  READ_USHORT (stream, head->unitsPerEm);
405 
406  *table->address = head;
407  return head;
408 }
409 
410 ␌
411 /*** (1-3) "name" table */
412 
413 static int
415 {
416  char errfmt[256];
417  int errret = -1;
419  int ucs = 0;
420  int ascii = 0;
421  int i;
422 
423  sprintf (errfmt, "nameID (%d)%%s", rec->nameID);
424  if (rec->platformID == 0)
425  ucs = (rec->encodingID <= 3) ? 2 : 4;
426  else if (rec->platformID == 1 && rec->encodingID == 0)
427  ascii = 1;
428  else if (rec->platformID == 3)
429  ucs = (rec->encodingID == 1 ? 2
430  : rec->encodingID == 10 ? 4
431  : 0);
432 
433  OTF_MALLOC (rec->name, rec->length + 1, "");
435  SEEK_STREAM (stream, stream->pos + rec->offset);
436  READ_BYTES (stream, rec->name, rec->length);
438  rec->name[rec->length] = 0;
439 
440  if (ascii)
441  {
442  rec->ascii = 1;
443  }
444  else if (ucs == 2)
445  {
446  rec->ascii = 1;
447  for (i = 0; i < rec->length / 2; i++)
448  {
449  if (rec->name[i * 2] > 0
450  || rec->name[i * 2 + 1] >= 128)
451  {
452  rec->ascii = 0;
453  break;
454  }
455  }
456  if (rec->ascii)
457  for (i = 0; i < rec->length / 2; i++)
458  rec->name[i] = rec->name[i * 2 + 1];
459  rec->name[i] = 0;
460  }
461  else if (ucs == 4)
462  {
463  rec->ascii = 1;
464  for (i = 0; i < rec->length / 4; i++)
465  {
466  if (rec->name[i * 4] > 0
467  || rec->name[i * 4 + 1] > 0
468  || rec->name[i * 4 + 2] > 0
469  || rec->name[i * 2 + 3] >= 128)
470  {
471  rec->ascii = 0;
472  break;
473  }
474  }
475  if (rec->ascii)
476  for (i = 0; i < rec->length / 4; i++)
477  rec->name[i] = rec->name[i * 4 + 3];
478  rec->name[i] = 0;
479  }
480 
481  return 0;
482 }
483 
484 static void *
486 {
487  OTF_Stream *stream = table->stream;
488  char *errfmt = "name%s";
489  void *errret = NULL;
490  OTF_name *name;
491  int i;
492 
493  OTF_CALLOC (name, 1, "");
494  READ_USHORT (stream, name->format);
495  READ_USHORT (stream, name->count);
496  READ_USHORT (stream, name->stringOffset);
497  OTF_MALLOC (name->nameRecord, name->count, "");
498  for (i = 0; i < name->count; i++)
499  {
500  OTF_NameRecord *rec = name->nameRecord + i;
501 
502  READ_USHORT (stream, rec->platformID);
503  READ_USHORT (stream, rec->encodingID);
504  READ_USHORT (stream, rec->languageID);
505  READ_USHORT (stream, rec->nameID);
506  READ_USHORT (stream, rec->length);
507  READ_USHORT (stream, rec->offset);
508  }
509  for (i = 0; i < name->count; i++)
510  {
511  OTF_NameRecord *rec = name->nameRecord + i;
512  int nameID = rec->nameID;
513 
514  read_name (otf, stream, rec);
515 
516  if (nameID >= OTF_max_nameID)
517  continue;
518  if (! name->name[nameID]
519  && rec->ascii)
520  name->name[nameID] = (char *) rec->name;
521  }
522 
523  *table->address = name;
524  return name;
525 }
526 
527 ␌
528 /*** (1-4) "cmap" table */
529 
530 static OTF_EncodingSubtable14 *
532 {
533  OTF_EncodingSubtable14 *sub14;
534  char *errfmt = "cmap-uvs%s";
535  void *errret = NULL;
536  unsigned nRecords;
537  unsigned i,j;
538 
539  OTF_MALLOC (sub14, 1, " (EncodingSubtable14)");
540  READ_ULONG (stream, nRecords);
541  sub14->nRecords = nRecords;
542  OTF_MALLOC (sub14->Records, nRecords, "(EncodingSubtable14-Records)");
543  for (i = 0; i < sub14->nRecords; i++)
544  {
545  unsigned varSelector=0, defaultUVSOffset, nonDefaultUVSOffset;
546 
547  READ_UINT24 (stream, varSelector);
548  sub14->Records[i].varSelector = varSelector;
549  READ_ULONG (stream, defaultUVSOffset);
550  sub14->Records[i].defaultUVSOffset = defaultUVSOffset;
551  READ_ULONG (stream, nonDefaultUVSOffset);
552  sub14->Records[i].nonDefaultUVSOffset = nonDefaultUVSOffset;
553  }
554  for (i = 0; i < sub14->nRecords; i++)
555  {
556  OTF_VariationSelectorRecord *record = &sub14->Records[i];
557  unsigned defaultUVSOffset = record->defaultUVSOffset;
558  unsigned nonDefaultUVSOffset = record->nonDefaultUVSOffset;
559 
560  if (defaultUVSOffset)
561  {
562  unsigned numUnicodeValueRanges;
563 
564  SEEK_STREAM (stream, offset+defaultUVSOffset);
565  READ_ULONG (stream, numUnicodeValueRanges);
566  record->numUnicodeValueRanges = numUnicodeValueRanges;
568  numUnicodeValueRanges,
569  "(EncodingSubtable14-Records-unicodeValueRanges)");
570  for (j = 0; j < numUnicodeValueRanges; j++)
571  {
572  OTF_UnicodeValueRange *unicodeValueRange
573  = &record->unicodeValueRanges[j];
574  unsigned startUnicodeValue;
575  char additionalCount;
576 
577  READ_UINT24 (stream, startUnicodeValue);
578  unicodeValueRange->startUnicodeValue=startUnicodeValue;
579  READ_BYTES (stream, &additionalCount, 1);
580  unicodeValueRange->additionalCount
581  = (unsigned short) additionalCount;
582  }
583  }
584  if (nonDefaultUVSOffset)
585  {
586  unsigned numUVSMappings;
587 
588  SEEK_STREAM (stream, offset+nonDefaultUVSOffset);
589  READ_ULONG (stream, numUVSMappings);
590  record->numUVSMappings = numUVSMappings;
591  OTF_MALLOC (record->uvsMappings, numUVSMappings,
592  "(EncodingSubtable14-Records-uvsMappings)");
593  for (j = 0; j < numUVSMappings; j++)
594  {
595  OTF_UVSMapping *uvsMapping = &record->uvsMappings[j];
596  unsigned unicodeValue;
597  unsigned short glyphID;
598 
599  READ_UINT24 (stream, unicodeValue);
600  uvsMapping->unicodeValue = unicodeValue;
601  READ_USHORT (stream, glyphID);
602  uvsMapping->glyphID = glyphID;
603  }
604  }
605  }
606  return sub14;
607 }
608 
609 static void *
611 {
612  OTF_Stream *stream = table->stream;
613  char *errfmt = "cmap%s";
614  void *errret = NULL;
615  OTF_cmap *cmap;
616  int unicode_bmp_index = -1, unicode_full_index = -1;
617  int i;
618 
619  OTF_CALLOC (cmap, 1, "");
620  READ_USHORT (stream, cmap->version);
621  READ_USHORT (stream, cmap->numTables);
622  OTF_MALLOC (cmap->EncodingRecord, cmap->numTables, "");
623  for (i = 0; i < cmap->numTables; i++)
624  {
625  unsigned platformID, encodingID;
626 
627  READ_USHORT (stream, platformID);
628  cmap->EncodingRecord[i].platformID = platformID;
629  READ_USHORT (stream, encodingID);
630  cmap->EncodingRecord[i].encodingID = encodingID;
631  READ_ULONG (stream, cmap->EncodingRecord[i].offset);
632  if (platformID == 0)
633  {
634  if (encodingID <= 3)
635  unicode_bmp_index = i;
636  else
637  unicode_full_index = i;
638  }
639  else if (platformID == 3)
640  {
641  if (encodingID == 1)
642  unicode_bmp_index = i;
643  else if (encodingID == 10)
644  unicode_full_index = i;
645  }
646  }
647  cmap->table_index = unicode_full_index;
648 
649  for (i = 0; i < cmap->numTables; i++)
650  {
651  unsigned format;
652 
653  SEEK_STREAM (stream, cmap->EncodingRecord[i].offset);
655  cmap->EncodingRecord[i].subtable.format = format;
656  if (format == 14)
657  {
658  READ_ULONG (stream, cmap->EncodingRecord[i].subtable.length);
659  cmap->EncodingRecord[i].subtable.language = 0;
660  }
661  else
662  {
663  READ_USHORT (stream, cmap->EncodingRecord[i].subtable.length);
664  if (format == 8 || format == 10 || format == 12)
665  {
666  READ_ULONG (stream, cmap->EncodingRecord[i].subtable.length);
667  READ_ULONG (stream, cmap->EncodingRecord[i].subtable.language);
668  }
669  else
670  {
671  READ_USHORT (stream, cmap->EncodingRecord[i].subtable.language);
672  }
673  }
674  switch (format)
675  {
676  case 0:
677  {
678  OTF_MALLOC (cmap->EncodingRecord[i].subtable.f.f0, 1,
679  " (EncodingRecord)");
681  cmap->EncodingRecord[i].subtable.f.f0->glyphIdArray,
682  256);
683  }
684  break;
685 
686  case 2:
687  {
689  int j, max_key;
690 
691  OTF_MALLOC (sub2, 1, " (EncodingSubtable2)");
692  cmap->EncodingRecord[i].subtable.f.f2 = sub2;
693  for (j = 0, max_key = 0; j < 256; j++)
694  {
695  READ_USHORT (stream, sub2->subHeaderKeys[j]);
696  if (max_key < sub2->subHeaderKeys[j])
697  max_key = sub2->subHeaderKeys[j];
698  }
699  max_key += 8;
700  sub2->subHeaderCount = max_key / 8;
701  OTF_MALLOC (sub2->subHeaders, max_key / 8, " (subHeaders)");
702  for (j = 0; j < sub2->subHeaderCount; j++)
703  {
704  READ_USHORT (stream, sub2->subHeaders[j].firstCode);
705  READ_USHORT (stream, sub2->subHeaders[j].entryCount);
706  READ_SHORT (stream, sub2->subHeaders[j].idDelta);
707  READ_USHORT (stream, sub2->subHeaders[j].idRangeOffset);
708  /* Make it offset from sub2->glyphIndexArray. */
709  sub2->subHeaders[j].idRangeOffset -= max_key - (j * 8 + 6);
710  }
711  sub2->glyphIndexCount = (cmap->EncodingRecord[i].subtable.length
712  - 262 - max_key);
713  OTF_MALLOC (sub2->glyphIndexArray, sub2->glyphIndexCount,
714  " (glyphIndexArray)");
715  READ_BYTES (stream, sub2->glyphIndexArray, sub2->glyphIndexCount);
716  }
717  break;
718 
719  case 4:
720  {
721  OTF_EncodingSubtable4 *sub4;
722  int segCount;
723  int j;
724  unsigned dummy;
725 
726  OTF_MALLOC (sub4, 1, " (EncodingSubtable4)");
727  cmap->EncodingRecord[i].subtable.f.f4 = sub4;
728  READ_USHORT (stream, sub4->segCountX2);
729  segCount = sub4->segCountX2 / 2;
730  READ_USHORT (stream, sub4->searchRange);
732  READ_USHORT (stream, sub4->rangeShift);
733  OTF_MALLOC (sub4->segments, segCount, " (segCount)");
734  for (j = 0; j < segCount; j++)
737  for (j = 0; j < segCount; j++)
739  for (j = 0; j < segCount; j++)
740  READ_SHORT (stream, sub4->segments[j].idDelta);
741  for (j = 0; j < segCount; j++)
742  {
743  unsigned off;
744  unsigned rest = 2 * (segCount - j);
745 
747  if (off == 0)
748  sub4->segments[j].idRangeOffset = 0xFFFF;
749  else
750  sub4->segments[j].idRangeOffset = (off - rest) / 2;
751  }
752  j = (cmap->EncodingRecord[i].subtable.length
753  - (14 + 2 * (segCount * 4 + 1)));
754  sub4->GlyphCount = j / 2;
755  OTF_MALLOC (sub4->glyphIdArray, sub4->GlyphCount, " (GlyphCount)");
756  for (j = 0; j < sub4->GlyphCount; j++)
757  READ_USHORT (stream, sub4->glyphIdArray[j]);
758  }
759  break;
760 
761  case 6:
762  {
763  OTF_EncodingSubtable6 *sub6;
764  int j;
765 
766  OTF_MALLOC (sub6, 1, " (EncodingSubtable6)");
767  cmap->EncodingRecord[i].subtable.f.f6 = sub6;
768  READ_USHORT (stream, sub6->firstCode);
769  READ_USHORT (stream, sub6->entryCount);
770  OTF_MALLOC (sub6->glyphIdArray, sub6->entryCount, " (GlyphCount)");
771  for (j = 0; j < sub6->entryCount; j++)
772  READ_USHORT (stream, sub6->glyphIdArray[j]);
773  }
774  break;
775 
776  case 8:
777  {
778  OTF_EncodingSubtable8 *sub8;
779  int j;
780 
781  OTF_MALLOC (sub8, 1, " (EncodingSubtable8)");
782  cmap->EncodingRecord[i].subtable.f.f8 = sub8;
783  for (j = 0; j < 8192; j++)
784  READ_BYTES (stream, sub8->is32, 8192);
785  READ_ULONG (stream, sub8->nGroups);
786  OTF_MALLOC (sub8->Groups, sub8->nGroups, " (Groups)");
787  for (j = 0; j < sub8->nGroups; j++)
788  {
792  }
793  }
794  break;
795 
796  case 10:
797  {
798  OTF_EncodingSubtable10 *sub10;
799  int j;
800 
801  OTF_MALLOC (sub10, 1, " (EncodingSubtable10)");
802  cmap->EncodingRecord[i].subtable.f.f10 = sub10;
803  READ_ULONG (stream, sub10->startCharCode);
804  READ_ULONG (stream, sub10->numChars);
805  OTF_MALLOC (sub10->glyphs, sub10->numChars, " (GlyphCount)");
806  for (j = 0; j < sub10->numChars; j++)
807  READ_USHORT (stream, sub10->glyphs[j]);
808  }
809  break;
810 
811  case 12:
812  {
813  OTF_EncodingSubtable12 *sub12;
814  int j;
815 
816  OTF_MALLOC (sub12, 1, " (EncodingSubtable12)");
817  cmap->EncodingRecord[i].subtable.f.f12 = sub12;
818  READ_ULONG (stream, sub12->nGroups);
819  OTF_MALLOC (sub12->Groups, sub12->nGroups, " (Groups)");
820  for (j = 0; j < sub12->nGroups; j++)
821  {
823  READ_ULONG (stream, sub12->Groups[j].endCharCode);
825  }
826  }
827  break;
828 
829  case 14:
830  {
831  cmap->EncodingRecord[i].subtable.f.f14
832  = read_cmap_uvs_table (otf, stream,
833  cmap->EncodingRecord[i].offset);
834  break;
835  }
836 
837  default:
838  OTF_ERROR (OTF_ERROR_TABLE, " (invalid Subtable format)");
839  }
840  }
841 
842  if (unicode_bmp_index >= 0)
843  {
844  OTF_EncodingRecord *rec = cmap->EncodingRecord + unicode_bmp_index;
845  OTF_GlyphID glyph_id, max_glyph_id = 0;
846 
847  OTF_CALLOC (cmap->unicode_table, 0x10000, "");
848  switch (rec->subtable.format)
849  {
850  case 4:
851  {
852  OTF_EncodingSubtable4 *sub4 = rec->subtable.f.f4;
853  int segCount = sub4->segCountX2 / 2;
854 
855  for (i = 0; i < segCount; i++)
856  {
857  OTF_cmapSegment *seg = sub4->segments + i;
858  int c;
859 
860  if (seg->idRangeOffset == 0xFFFF)
861  for (c = seg->startCount; c <= seg->endCount; c++)
862  {
863  glyph_id = (c + seg->idDelta) % 0x10000;
864  cmap->unicode_table[c] = glyph_id;
865  if (glyph_id > max_glyph_id)
866  max_glyph_id = glyph_id;
867  }
868  else
869  for (c = seg->startCount; c <= seg->endCount && c != 0xFFFF;
870  c++)
871  {
872  glyph_id = sub4->glyphIdArray[seg->idRangeOffset
873  + (c - seg->startCount)];
874  cmap->unicode_table[c] = glyph_id;
875  if (glyph_id > max_glyph_id)
876  max_glyph_id = glyph_id;
877  }
878  }
879  }
880  }
881 
882  OTF_CALLOC (cmap->decode_table, max_glyph_id + 1, "");
883  for (i = 0; i < 0x10000; i++)
884  if (cmap->unicode_table[i])
885  cmap->decode_table[cmap->unicode_table[i]] = i;
886  cmap->max_glyph_id = max_glyph_id;
887  }
888 
889  *table->address = cmap;
890  return cmap;
891 }
892 
893 ␌
894 /*** (1-5) Structures common to GDEF, GSUB, and GPOS */
895 
896 /* Read Glyph-IDs from STREAM. Allocate memory for IDS, and store the
897  Glyph-IDs there. If COUNT is negative, read the number of
898  Glyphs-IDs at first. MINUS if nozero is how few the actual
899  Glyph-IDs are in STREAM than COUNT. */
900 
901 static int
903  int minus, int count)
904 {
905  char *errfmt = "GlyphID List%s";
906  int errret = -1;
907  int i;
908 
909  if (count < 0)
911  if (! count)
912  return 0;
913  OTF_MALLOC (*ids, count, "");
914  for (i = 0; i < count + minus; i++)
915  READ_GLYPHID (stream, (*ids)[i]);
916  return count;
917 }
918 
919 static unsigned
921 {
922  char *errfmt = "RangeRecord%s";
923  unsigned errret = 0;
924  unsigned count;
925  int i;
926 
928  if (! count)
929  return 0;
930  OTF_MALLOC (*record, count, "");
931  for (i = 0; i < count; i++)
932  {
933  READ_GLYPHID (stream, (*record)[i].Start);
934  READ_GLYPHID (stream, (*record)[i].End);
935  READ_UINT16 (stream, (*record)[i].StartCoverageIndex);
936  }
937  return count;
938 }
939 
940 
941 static int
944 {
945  char *errfmt = "Coverage%s";
946  int errret = -1;
948  int count;
949 
950  READ_OFFSET (stream, coverage->offset);
952  SEEK_STREAM (stream, offset + coverage->offset);
953  READ_UINT16 (stream, coverage->CoverageFormat);
954  if (coverage->CoverageFormat == 1)
955  count = read_glyph_ids (otf, stream, &coverage->table.GlyphArray, 0, -1);
956  else if (coverage->CoverageFormat == 2)
957  count = read_range_records (otf, stream, &coverage->table.RangeRecord);
958  else
959  OTF_ERROR (OTF_ERROR_TABLE, " (Invalid Format)");
960  if (count < 0)
961  return -1;
962  coverage->Count = (unsigned) count;
964  return 0;
965 }
966 
967 /* Read list of Coverages from STREAM. Allocate memory for COVERAGE,
968  and store the Coverages there. If COUNT is negative, read the
969  number of Coverages at first. */
970 
971 static int
973  OTF_Coverage **coverage, int count)
974 {
975  char *errfmt = "Coverage List%s";
976  int errret = -1;
977  int i;
978 
979  if (count < 0)
981  if (! count)
982  return 0;
983  OTF_MALLOC (*coverage, count, "");
984  for (i = 0; i < count; i++)
985  if (read_coverage (otf, stream, offset, (*coverage) + i) < 0)
986  return -1;
987  return count;
988 }
989 
990 
991 static int
993  OTF_ClassDef *class)
994 {
995  char *errfmt = "ClassDef%s";
996  int errret = -1;
997 
998  SEEK_STREAM (stream, class->offset);
999  READ_UINT16 (stream, class->ClassFormat);
1000  if (class->ClassFormat == 1)
1001  {
1002  READ_GLYPHID (stream, class->f.f1.StartGlyph);
1003  class->f.f1.GlyphCount
1004  = (read_glyph_ids
1005  (otf, stream, (OTF_GlyphID **) &class->f.f1.ClassValueArray, 0, -1));
1006  if (! class->f.f1.GlyphCount)
1007  OTF_ERROR (OTF_ERROR_TABLE, " (zero count)");
1008  }
1009  else if (class->ClassFormat == 2)
1010  {
1011  class->f.f2.ClassRangeCount
1013  (otf, stream, (OTF_RangeRecord **) &class->f.f2.ClassRangeRecord));
1014  if (! class->f.f2.ClassRangeCount)
1015  OTF_ERROR (OTF_ERROR_TABLE, " (zero count)");
1016  }
1017  else
1018  OTF_ERROR (OTF_ERROR_TABLE, " (Invalid format)");
1019  return 0;
1020 }
1021 
1022 
1023 static int
1025 {
1026  char *errfmt = "ClassDef%s";
1027  int errret = -1;
1029 
1030  READ_OFFSET (stream, class->offset);
1031  if (! class->offset)
1032  return 0;
1034  SEEK_STREAM (stream, offset + class->offset);
1035  READ_UINT16 (stream, class->ClassFormat);
1036  if (class->ClassFormat == 1)
1037  {
1038  READ_GLYPHID (stream, class->f.f1.StartGlyph);
1039  class->f.f1.GlyphCount
1040  = read_glyph_ids (otf, stream,
1041  (OTF_GlyphID **) &class->f.f1.ClassValueArray,
1042  0, -1);
1043  }
1044  else if (class->ClassFormat == 2)
1045  {
1046  class->f.f2.ClassRangeCount
1047  = read_range_records (otf, stream,
1048  (OTF_RangeRecord **)
1049  &class->f.f2.ClassRangeRecord);
1050  }
1051  else
1052  OTF_ERROR (OTF_ERROR_TABLE, " (Invalid format)");
1053 
1055  return 0;
1056 }
1057 
1058 
1059 static int
1062 {
1063  char *errfmt = "Device Table%s";
1064  int errret = -1;
1065 
1066  int num, i;
1067  unsigned val;
1068  struct {
1069  int int2 : 2;
1070  int int4 : 4;
1071  int int8 : 8;
1072  } intval;
1073 
1074  SEEK_STREAM (stream, offset + table->offset);
1075  READ_UINT16 (stream, table->StartSize);
1076  READ_UINT16 (stream, table->EndSize);
1077  READ_UINT16 (stream, table->DeltaFormat);
1078  num = table->EndSize - table->StartSize + 1;
1079  if (num > 0 && table->DeltaFormat >= 1 && table->DeltaFormat <= 3)
1080  {
1081  OTF_MALLOC (table->DeltaValue, num, "");
1082 
1083  if (table->DeltaFormat == 1)
1084  for (i = 0; i < num; i++)
1085  {
1086  if ((i % 8) == 0)
1087  READ_UINT16 (stream, val);
1088  intval.int2 = (val >> (14 - (i % 8) * 2)) & 0x03;
1089  table->DeltaValue[i] = intval.int2;
1090  }
1091  else if (table->DeltaFormat == 2)
1092  for (i = 0; i < num; i++)
1093  {
1094  if ((i % 4) == 0)
1095  READ_UINT16 (stream, val);
1096  intval.int4 = (val >> (12 - (i % 4) * 4)) & 0x0F;
1097  table->DeltaValue[i] = intval.int4;
1098  }
1099  else /* (table->DeltaFormat == 3) */
1100  for (i = 0; i < num; i++)
1101  {
1102  if ((i % 2) == 0)
1103  {
1104  READ_UINT16 (stream, val);
1105  intval.int8 = val >> 8;
1106  table->DeltaValue[i] = intval.int8;
1107  }
1108  else
1109  {
1110  intval.int8 = val >> 8;
1111  table->DeltaValue[i] = intval.int8;
1112  }
1113  }
1114  }
1115  else
1116  {
1117  /* Invalid DeltaFormat but several fonts has such values (bug of
1118  fontforge?). So accept it with NULL delta values. */
1119  table->DeltaValue = NULL;
1120  }
1121  return 0;
1122 }
1123 
1124 ␌
1125 /*** (1-6) "GDEF" table */
1126 
1127 static int
1130 {
1131  char *errfmt = "AttachList%s";
1132  int errret = -1;
1133  int i, j;
1134 
1135  if (read_coverage (otf, stream, offset, &list->Coverage) < 0)
1136  return -1;
1137  READ_UINT16 (stream, list->GlyphCount);
1138  OTF_MALLOC (list->AttachPoint, list->GlyphCount, "");
1139  for (i = 0; i < list->GlyphCount; i++)
1140  READ_OFFSET (stream, list->AttachPoint[i].offset);
1141  for (i = 0; i < list->GlyphCount; i++)
1142  {
1143  int count;
1144 
1145  SEEK_STREAM (stream, offset + list->AttachPoint[i].offset);
1147  list->AttachPoint[i].PointCount = count;
1148  OTF_MALLOC (list->AttachPoint[i].PointIndex, count, " (PointIndex)");
1149  for (j = 0; j < count; j++)
1150  READ_UINT16 (stream, list->AttachPoint[i].PointIndex[j]);
1151  }
1152  return 0;
1153 }
1154 
1155 static int
1157  OTF_CaretValue *caret)
1158 {
1159  char *errfmt = "CaretValue%s";
1160  int errret = -1;
1161 
1162  SEEK_STREAM (stream, offset + caret->offset);
1164  if (caret->CaretValueFormat == 1)
1165  READ_INT16 (stream, caret->f.f1.Coordinate);
1166  else if (caret->CaretValueFormat == 2)
1168  else if (caret->CaretValueFormat == 3)
1169  {
1170  READ_INT16 (stream, caret->f.f3.Coordinate);
1171  if (read_device_table (otf, stream, offset + caret->offset,
1172  &caret->f.f3.DeviceTable) < 0)
1173  return -1;
1174  }
1175  else
1176  OTF_ERROR (OTF_ERROR_TABLE, " (Invalid format)");
1177  return 0;
1178 }
1179 
1180 static int
1183 {
1184  char *errfmt = "LigCaretList%s";
1185  int errret = -1;
1186  int i, j;
1187 
1188  if (read_coverage (otf, stream, offset, &list->Coverage) < 0)
1189  return -1;
1190  READ_UINT16 (stream, list->LigGlyphCount);
1191  OTF_MALLOC (list->LigGlyph, list->LigGlyphCount, "");
1192  for (i = 0; i < list->LigGlyphCount; i++)
1193  READ_OFFSET (stream, list->LigGlyph[i].offset);
1194  for (i = 0; i < list->LigGlyphCount; i++)
1195  {
1196  int count;
1197 
1198  SEEK_STREAM (stream, offset + list->LigGlyph[i].offset);
1200  list->LigGlyph[i].CaretCount = count;
1201  OTF_MALLOC (list->LigGlyph[i].CaretValue, count, " (CaretValue)");
1202  for (j = 0; j < count; j++)
1203  READ_OFFSET (stream, list->LigGlyph[i].CaretValue[j].offset);
1204  for (j = 0; j < count; j++)
1205  if (read_caret_value (otf, stream, offset + list->LigGlyph[i].offset,
1206  &list->LigGlyph[i].CaretValue[j]) < 0)
1207  return -1;
1208  }
1209  return 0;
1210 }
1211 
1212 static int
1214 {
1215  int errret = -1;
1216 
1217  READ_FIXED (stream, header->Version);
1218  READ_OFFSET (stream, header->GlyphClassDef);
1219  READ_OFFSET (stream, header->AttachList);
1220  READ_OFFSET (stream, header->LigCaretList);
1221  READ_OFFSET (stream, header->MarkAttachClassDef);
1222  return 0;
1223 }
1224 
1225 static void *
1227 {
1228  OTF_Stream *stream = table->stream;
1229  char *errfmt = "GDEF%s";
1230  void *errret = NULL;
1231  OTF_GDEF *gdef;
1232 
1233  OTF_CALLOC (gdef, 1, "");
1234  if (stream->buf)
1235  {
1237  if (gdef->header.GlyphClassDef)
1238  {
1241  &gdef->glyph_class_def);
1242  }
1243  if (gdef->header.AttachList)
1245  &gdef->attach_list);
1246  if (gdef->header.LigCaretList)
1248  &gdef->lig_caret_list);
1249  if (gdef->header.MarkAttachClassDef)
1250  {
1253  &gdef->mark_attach_class_def);
1254  }
1255  }
1256 
1257  *table->address = gdef;
1258  return gdef;
1259 }
1260 
1261 ␌
1262 /*** (1-7) Structures for ScriptList, FeatureList, and LookupList */
1263 
1264 static int
1267 {
1268  char *errfmt = "Script List%s";
1269  int errret = -1;
1270  int i, j, k;
1271 
1273  READ_USHORT (stream, list->ScriptCount);
1274  OTF_CALLOC (list->Script, list->ScriptCount, "");
1275 
1276  for (i = 0; i < list->ScriptCount; i++)
1277  {
1278  READ_TAG (stream, list->Script[i].ScriptTag);
1279  READ_OFFSET (stream, list->Script[i].offset);
1280  }
1281  for (i = 0; i < list->ScriptCount; i++)
1282  {
1283  OTF_Script *script = list->Script + i;
1284  long script_offset = offset + script->offset;
1285 
1286  SEEK_STREAM (stream, script_offset);
1287  READ_OFFSET (stream, script->DefaultLangSysOffset);
1288  READ_USHORT (stream, script->LangSysCount);
1289  OTF_MALLOC (script->LangSysRecord, script->LangSysCount, " (LangSys)");
1290  OTF_CALLOC (script->LangSys, script->LangSysCount, " (LangSys)");
1291  for (j = 0; j < script->LangSysCount; j++)
1292  {
1293  READ_TAG (stream, script->LangSysRecord[j].LangSysTag);
1294  READ_OFFSET (stream, script->LangSysRecord[j].LangSys);
1295  }
1296 
1297  if (script->DefaultLangSysOffset)
1298  {
1299  OTF_LangSys *langsys = &script->DefaultLangSys;
1300 
1301  SEEK_STREAM (stream, script_offset + script->DefaultLangSysOffset);
1302  READ_OFFSET (stream, langsys->LookupOrder);
1303  READ_USHORT (stream, langsys->ReqFeatureIndex);
1304  READ_USHORT (stream, langsys->FeatureCount);
1305  OTF_MALLOC (langsys->FeatureIndex, langsys->FeatureCount,
1306  " (FeatureIndex)");
1307  for (k = 0; k < langsys->FeatureCount; k++)
1308  READ_USHORT (stream, langsys->FeatureIndex[k]);
1309  }
1310 
1311  for (j = 0; j < script->LangSysCount; j++)
1312  {
1313  OTF_LangSys *langsys = script->LangSys + j;
1314 
1316  script_offset + script->LangSysRecord[j].LangSys);
1317  READ_OFFSET (stream, langsys->LookupOrder);
1318  READ_USHORT (stream, langsys->ReqFeatureIndex);
1319  READ_USHORT (stream, langsys->FeatureCount);
1320  OTF_MALLOC (langsys->FeatureIndex, langsys->FeatureCount,
1321  " (FeatureIndex)");
1322  for (k = 0; k < langsys->FeatureCount; k++)
1323  READ_USHORT (stream, langsys->FeatureIndex[k]);
1324  }
1325  }
1326 
1327  return 0;
1328 }
1329 
1330 static int
1333 {
1334  char *errfmt = "Feature List%s";
1335  int errret = -1;
1336  int i, j;
1337 
1339  READ_UINT16 (stream, list->FeatureCount);
1340  OTF_CALLOC (list->Feature, list->FeatureCount, "");
1341  for (i = 0; i < list->FeatureCount; i++)
1342  {
1343  READ_TAG (stream, list->Feature[i].FeatureTag);
1344  READ_OFFSET (stream, list->Feature[i].offset);
1345  }
1346  for (i = 0; i < list->FeatureCount; i++)
1347  {
1348  OTF_Feature *feature = list->Feature + i;
1349 
1351  READ_OFFSET (stream, feature->FeatureParams);
1352  READ_UINT16 (stream, feature->LookupCount);
1353  OTF_MALLOC (feature->LookupListIndex, feature->LookupCount,
1354  " (LookupListIndex)");
1355  for (j = 0; j < feature->LookupCount; j++)
1356  READ_UINT16 (stream, feature->LookupListIndex[j]);
1357  }
1358 
1359  return 0;
1360 }
1361 
1362 static int read_lookup_subtable_gsub (OTF *otf, OTF_Stream *stream,
1363  long offset, unsigned type,
1364  OTF_LookupSubTableGSUB *subtable);
1365 static int read_lookup_subtable_gpos (OTF *otf, OTF_Stream *stream,
1366  long offset, unsigned type,
1367  OTF_LookupSubTableGPOS *subtable);
1368 
1369 static int
1371  OTF_LookupList *list, int gsubp)
1372 {
1373  char *errfmt = "Lookup List%s";
1374  int errret = -1;
1375  int i, j;
1376 
1378  READ_UINT16 (stream, list->LookupCount);
1379  OTF_CALLOC (list->Lookup, list->LookupCount, "");
1380 
1381  for (i = 0; i < list->LookupCount; i++)
1382  READ_OFFSET (stream, list->Lookup[i].offset);
1383  for (i = 0; i < list->LookupCount; i++)
1384  {
1385  OTF_Lookup *lookup = list->Lookup + i;
1386 
1388  READ_UINT16 (stream, lookup->LookupType);
1389  READ_UINT16 (stream, lookup->LookupFlag);
1390  READ_UINT16 (stream, lookup->SubTableCount);
1391  OTF_MALLOC (lookup->SubTableOffset, lookup->SubTableCount,
1392  " (SubTableOffset)");
1393  if (gsubp)
1394  OTF_CALLOC (lookup->SubTable.gsub, lookup->SubTableCount,
1395  " (SubTable)");
1396  else
1397  OTF_CALLOC (lookup->SubTable.gpos, lookup->SubTableCount,
1398  " (SubTable)");
1399  for (j = 0; j < lookup->SubTableCount; j++)
1400  READ_OFFSET (stream, lookup->SubTableOffset[j]);
1401  for (j = 0; j < lookup->SubTableCount; j++)
1402  {
1403  long this_offset
1404  = offset + lookup->offset + lookup->SubTableOffset[j];
1405 
1406  if (gsubp
1407  ? read_lookup_subtable_gsub (otf, stream, this_offset,
1408  lookup->LookupType,
1409  lookup->SubTable.gsub + j) < 0
1410  : read_lookup_subtable_gpos (otf, stream, this_offset,
1411  lookup->LookupType,
1412  lookup->SubTable.gpos + j) < 0)
1413  return errret;
1414  }
1415  }
1416 
1417  return 0;
1418 }
1419 
1420 ␌
1421 /*** (1-8) Structures common to GSUB and GPOS */
1422 
1423 static int
1425  OTF_LookupRecord **record, int count)
1426 {
1427  char *errfmt = "LookupRecord%s";
1428  int errret = -1;
1429  int i;
1430 
1431  if (count < 0)
1433  OTF_MALLOC (*record, count, "");
1434  for (i = 0; i < count; i++)
1435  {
1436  READ_UINT16 (stream, (*record)[i].SequenceIndex);
1437  READ_UINT16 (stream, (*record)[i].LookupListIndex);
1438  }
1439  return count;
1440 }
1441 
1442 static unsigned
1444 {
1445  char *errfmt = "List of Rule%s";
1446  unsigned errret = 0;
1448  unsigned count;
1449  int i;
1450 
1452  if (! count)
1453  OTF_ERROR (OTF_ERROR_TABLE, " (zero count)");
1454  OTF_MALLOC (*rule, count, "");
1455  for (i = 0; i < count; i++)
1456  {
1457  READ_OFFSET (stream, (*rule)[i].offset);
1458  if (! (*rule)[i].offset)
1459  OTF_ERROR (OTF_ERROR_TABLE, " (zero offset)");
1460  }
1462  for (i = 0; i < count; i++)
1463  {
1464  SEEK_STREAM (stream, offset + (*rule)[i].offset);
1466  if ((*rule)[i].GlyphCount == 0)
1467  OTF_ERROR (OTF_ERROR_TABLE, " (zero count)");
1468  READ_UINT16 (stream, (*rule)[i].LookupCount);
1469  if (read_glyph_ids (otf, stream, &(*rule)[i].Input, 0,
1470  (*rule)[i].GlyphCount) < 0)
1471  return errret;
1473  (*rule)[i].LookupCount) < 0)
1474  return errret;
1475  }
1477  return count;
1478 }
1479 
1480 
1481 static unsigned
1483  OTF_RuleSet **set)
1484 {
1485  char *errfmt = "List of RuleSet%s";
1486  unsigned errret = 0;
1488  unsigned count;
1489  int i;
1490 
1492  if (! count)
1493  OTF_ERROR (OTF_ERROR_TABLE, " (zero count)");
1494  OTF_MALLOC (*set, count, "");
1495  for (i = 0; i < count; i++)
1496  {
1497  READ_OFFSET (stream, (*set)[i].offset);
1498  if (! (*set)[i].offset)
1499  OTF_ERROR (OTF_ERROR_TABLE, " (zero offset)");
1500  }
1502  for (i = 0; i < count; i++)
1503  {
1504  SEEK_STREAM (stream, offset + (*set)[i].offset);
1505  (*set)[i].RuleCount
1506  = read_rule_list (otf, stream, offset + (*set)[i].offset,
1507  &(*set)[i].Rule);
1508  if (! (*set)[i].RuleCount)
1509  return errret;
1510  }
1512  return count;
1513 }
1514 
1515 static unsigned
1517  OTF_ClassRule **rule)
1518 {
1519  char *errfmt = "ClassRule%s";
1520  unsigned errret = 0;
1522  unsigned count;
1523  int i;
1524 
1526  if (! count)
1527  OTF_ERROR (OTF_ERROR_TABLE, " (zero count)");
1528  OTF_MALLOC (*rule, count, "");
1529  for (i = 0; i < count; i++)
1530  {
1531  READ_OFFSET (stream, (*rule)[i].offset);
1532  if (! (*rule)[i].offset)
1533  OTF_ERROR (OTF_ERROR_TABLE, " (zero offset)");
1534  }
1536  for (i = 0; i < count; i++)
1537  {
1538  SEEK_STREAM (stream, offset + (*rule)[i].offset);
1540  if (! (*rule)[i].GlyphCount)
1541  OTF_ERROR (OTF_ERROR_TABLE, " (zero count)");
1542  READ_USHORT (stream, (*rule)[i].LookupCount);
1543  if (read_glyph_ids (otf, stream, (OTF_GlyphID **) &(*rule)[i].Class,
1544  0, (*rule)[i].GlyphCount - 1) < 0)
1545  return errret;
1547  (*rule)[i].LookupCount) < 0)
1548  return errret;
1549  }
1551  return count;
1552 }
1553 
1554 static unsigned
1556  OTF_ClassSet **set)
1557 {
1558  char *errfmt = "ClassSet%s";
1559  unsigned errret = 0;
1561  unsigned count;
1562  int i;
1563 
1565  if (! count)
1566  OTF_ERROR (OTF_ERROR_TABLE, " (zero count)");
1567  OTF_CALLOC (*set, count, "");
1568  for (i = 0; i < count; i++)
1569  /* Offset can be zero. */
1570  READ_OFFSET (stream, (*set)[i].offset);
1572  for (i = 0; i < count; i++)
1573  if ((*set)[i].offset)
1574  {
1575  SEEK_STREAM (stream, offset + (*set)[i].offset);
1576  (*set)[i].ClassRuleCnt
1577  = read_class_rule_list (otf, stream, offset + (*set)[i].offset,
1578  &(*set)[i].ClassRule);
1579  if (! (*set)[i].ClassRuleCnt)
1580  return errret;
1581  }
1583  return count;
1584 }
1585 
1586 static unsigned
1588  OTF_ChainRule **rule)
1589 {
1590  char *errfmt = "ChainRule%s";
1591  unsigned errret = 0;
1592  unsigned count;
1593  int i;
1594 
1596  if (! count)
1597  OTF_ERROR (OTF_ERROR_TABLE, " (zero count)");
1598  OTF_MALLOC (*rule, count, "");
1599  for (i = 0; i < count; i++)
1600  READ_OFFSET (stream, (*rule)[i].offset);
1601  for (i = 0; i < count; i++)
1602  {
1603  int lookup_record_count;
1604 
1605  SEEK_STREAM (stream, offset + (*rule)[i].offset);
1606  (*rule)[i].BacktrackGlyphCount
1607  = read_glyph_ids (otf, stream, &(*rule)[i].Backtrack, 0, -1);
1608  (*rule)[i].InputGlyphCount
1609  = read_glyph_ids (otf, stream, &(*rule)[i].Input, -1, -1);
1610  if (! (*rule)[i].InputGlyphCount)
1611  OTF_ERROR (OTF_ERROR_TABLE, " (zero count)");
1612  (*rule)[i].LookaheadGlyphCount
1613  = read_glyph_ids (otf, stream, &(*rule)[i].LookAhead, 0, -1);
1614  lookup_record_count
1616  &(*rule)[i].LookupRecord, -1);
1617  if (lookup_record_count < 0)
1618  return errret;
1619  (*rule)[i].LookupCount = lookup_record_count;
1620  }
1621  return count;
1622 }
1623 
1624 
1625 static unsigned
1627  OTF_ChainRuleSet **set)
1628 {
1629  char *errfmt = "ChainRuleSet%s";
1630  unsigned errret = 0;
1632  unsigned count;
1633  int i;
1634 
1636  if (! count)
1637  OTF_ERROR (OTF_ERROR_TABLE, " (zero count)");
1638  OTF_MALLOC (*set, count, "");
1639  for (i = 0; i < count; i++)
1640  {
1641  READ_OFFSET (stream, (*set)[i].offset);
1642  if (! (*set)[i].offset)
1643  OTF_ERROR (OTF_ERROR_TABLE, " (zero offset)");
1644  }
1646  for (i = 0; i < count; i++)
1647  {
1648  SEEK_STREAM (stream, offset + (*set)[i].offset);
1649  (*set)[i].ChainRuleCount
1650  = read_chain_rule_list (otf, stream, offset + (*set)[i].offset,
1651  &(*set)[i].ChainRule);
1652  if (! (*set)[i].ChainRuleCount)
1653  return errret;
1654  }
1656  return count;
1657 }
1658 
1659 static unsigned
1662 {
1663  char *errfmt = "ChainClassRule%s";
1664  unsigned errret = 0;
1665  unsigned count;
1666  int i;
1667 
1669  if (! count)
1670  OTF_ERROR (OTF_ERROR_TABLE, " (zero count)");
1671  OTF_MALLOC (*rule, count, "");
1672  for (i = 0; i < count; i++)
1673  {
1674  READ_OFFSET (stream, (*rule)[i].offset);
1675  if (! (*rule)[i].offset)
1676  OTF_ERROR (OTF_ERROR_TABLE, " (zero offset)");
1677  }
1678  for (i = 0; i < count; i++)
1679  {
1680  int lookup_record_count;
1681 
1682  SEEK_STREAM (stream, offset + (*rule)[i].offset);
1683  (*rule)[i].BacktrackGlyphCount
1684  = read_glyph_ids (otf, stream,
1685  (OTF_GlyphID **) &(*rule)[i].Backtrack, 0, -1);
1686  (*rule)[i].InputGlyphCount
1687  = read_glyph_ids (otf, stream,
1688  (OTF_GlyphID **) &(*rule)[i].Input, -1, -1);
1689  if (! (*rule)[i].InputGlyphCount)
1690  OTF_ERROR (OTF_ERROR_TABLE, " (zero count)");
1691  (*rule)[i].LookaheadGlyphCount
1692  = read_glyph_ids (otf, stream,
1693  (OTF_GlyphID **) &(*rule)[i].LookAhead, 0, -1);
1694  lookup_record_count
1696  &(*rule)[i].LookupRecord, -1);
1697  if (lookup_record_count < 0)
1698  return errret;
1699  (*rule)[i].LookupCount = lookup_record_count;
1700  }
1701  return count;
1702 }
1703 
1704 static unsigned
1706  OTF_ChainClassSet **set)
1707 {
1708  char *errfmt = "ChainClassSet%s";
1709  unsigned errret = 0;
1711  unsigned count;
1712  int i;
1713 
1715  if (! count)
1716  OTF_ERROR (OTF_ERROR_TABLE, " (zero count)");
1717  OTF_MALLOC (*set, count, "");
1718  for (i = 0; i < count; i++)
1719  /* Offset may be zero. */
1720  READ_OFFSET (stream, (*set)[i].offset);
1722  for (i = 0; i < count; i++)
1723  if ((*set)[i].offset)
1724  {
1725  SEEK_STREAM (stream, offset + (*set)[i].offset);
1726  (*set)[i].ChainClassRuleCnt
1727  = read_chain_class_rule_list (otf, stream, offset + (*set)[i].offset,
1728  &(*set)[i].ChainClassRule);
1729  if (! (*set)[i].ChainClassRuleCnt)
1730  return errret;
1731  }
1733  return count;
1734 }
1735 
1736 static int
1738  OTF_Coverage *coverage,OTF_Context1 *context1)
1739 {
1740  if (read_coverage (otf, stream, offset, coverage) < 0)
1741  return -1;
1742  context1->RuleSetCount
1743  = read_rule_set_list (otf, stream, offset, &context1->RuleSet);
1744  if (! context1->RuleSetCount)
1745  return -1;
1746  return 0;
1747 }
1748 
1749 static int
1751  OTF_Coverage *coverage,OTF_Context2 *context2)
1752 {
1753  if (read_coverage (otf, stream, offset, coverage) < 0
1754  || read_class_def (otf, stream, offset, &context2->ClassDef) < 0)
1755  return -1;
1756  context2->ClassSetCnt
1757  = read_class_set_list (otf, stream, offset, &context2->ClassSet);
1758  if (! context2->ClassSetCnt)
1759  return -1;
1760  return 0;
1761 }
1762 
1763 static int
1765  OTF_Coverage *coverage,OTF_Context3 *context3)
1766 {
1767  char *errfmt = "Context1%s";
1768  int errret = -1;
1769 
1770  READ_USHORT (stream, context3->GlyphCount);
1771  if (context3->GlyphCount < 0)
1772  OTF_ERROR (OTF_ERROR_TABLE, " (zero count)");
1773  READ_USHORT (stream, context3->LookupCount);
1774  if (read_coverage_list (otf, stream, offset, &context3->Coverage,
1775  context3->GlyphCount) < 0)
1776  return errret;
1777  if (read_lookup_record_list (otf, stream, &context3->LookupRecord,
1778  context3->LookupCount) < 0)
1779  return errret;
1780  return 0;
1781 }
1782 
1783 static int
1785  OTF_Coverage *coverage, OTF_ChainContext1 *chain_context1)
1786 {
1787  if (read_coverage (otf, stream, offset, coverage) < 0)
1788  return -1;
1789  chain_context1->ChainRuleSetCount
1791  &chain_context1->ChainRuleSet);
1792  if (! chain_context1->ChainRuleSetCount)
1793  return -1;
1794  return 0;
1795 }
1796 
1797 static int
1799  OTF_Coverage *coverage, OTF_ChainContext2 *chain_context2)
1800 {
1801  if (read_coverage (otf, stream, offset, coverage) < 0
1802  || read_class_def (otf, stream, offset,
1803  &chain_context2->BacktrackClassDef) < 0
1804  || read_class_def (otf, stream, offset,
1805  &chain_context2->InputClassDef) < 0
1806  || read_class_def (otf, stream, offset,
1807  &chain_context2->LookaheadClassDef) < 0)
1808  return -1;
1809  chain_context2->ChainClassSetCnt
1811  &chain_context2->ChainClassSet);
1812  if (! chain_context2->ChainClassSetCnt)
1813  return -1;
1814  return 0;
1815 }
1816 
1817 static int
1819  OTF_Coverage *coverage, OTF_ChainContext3 *chain_context3)
1820 {
1821  int count;
1822 
1824  &chain_context3->Backtrack, -1);
1825  if (count < 0)
1826  return -1;
1827  chain_context3->BacktrackGlyphCount = (unsigned) count;
1829  &chain_context3->Input, -1);
1830  if (count <= 0)
1831  return -1;
1832  chain_context3->InputGlyphCount = (unsigned) count;
1833  *coverage = chain_context3->Input[0];
1835  &chain_context3->LookAhead, -1);
1836  chain_context3->LookaheadGlyphCount = (unsigned) count;
1838  &chain_context3->LookupRecord, -1);
1839  if (count < 0)
1840  return -1;
1841  chain_context3->LookupCount = count;
1842  return 0;
1843 }
1844 
1845 static void *
1847  enum OTF_ReaderFlag flag)
1848 {
1849  OTF_Stream *stream = table->stream;
1850  char *errfmt = gsubp ? "GSUB%s" : "GPOS%s";
1851  void *errret = NULL;
1852  OTF_GSUB_GPOS *gsub_gpos = *table->address;
1853 
1854  if (gsub_gpos)
1855  SEEK_STREAM (stream, 10);
1856  else
1857  {
1858  SEEK_STREAM (stream, 0);
1859  OTF_CALLOC (gsub_gpos, 1, "");
1860  READ_FIXED (stream, gsub_gpos->Version);
1861  READ_OFFSET (stream, gsub_gpos->ScriptList.offset);
1862  READ_OFFSET (stream, gsub_gpos->FeatureList.offset);
1863  READ_OFFSET (stream, gsub_gpos->LookupList.offset);
1864  *table->address = gsub_gpos;
1865  }
1866 
1867  if (! gsub_gpos->ScriptList.Script
1868  && read_script_list (otf, stream, gsub_gpos->ScriptList.offset,
1869  &gsub_gpos->ScriptList) < 0)
1870  return NULL;
1871  if (flag != OTF_READ_SCRIPTS)
1872  {
1873  if (! gsub_gpos->FeatureList.Feature
1874  && read_feature_list (otf, stream, gsub_gpos->FeatureList.offset,
1875  &gsub_gpos->FeatureList) < 0)
1876  return NULL;
1877  if (flag != OTF_READ_FEATURES)
1878  {
1879  if (! gsub_gpos->LookupList.Lookup
1880  && read_lookup_list (otf, stream, gsub_gpos->LookupList.offset,
1881  &gsub_gpos->LookupList, gsubp) < 0)
1882  return NULL;
1883  }
1884  }
1885 
1886  return gsub_gpos;
1887 }
1888 
1889 ␌
1890 /* (1-9) "GSUB" table */
1891 
1892 static unsigned
1894 {
1895  char *errfmt = "Sequence%s";
1896  unsigned errret = 0;
1897  unsigned count;
1898  int i;
1899 
1901  if (! count)
1902  OTF_ERROR (OTF_ERROR_TABLE, " (zero count)");
1903  OTF_MALLOC (*seq, count, "");
1904  for (i = 0; i < count; i++)
1905  READ_OFFSET (stream, (*seq)[i].offset);
1906  for (i = 0; i < count; i++)
1907  {
1908  SEEK_STREAM (stream, offset + (*seq)[i].offset);
1909  (*seq)[i].GlyphCount = read_glyph_ids (otf, stream,
1910  &(*seq)[i].Substitute, 0, -1);
1911  if (! (*seq)[i].GlyphCount)
1912  return 0;
1913  }
1914  return count;
1915 }
1916 
1917 static int
1919  OTF_Ligature **ligature)
1920 {
1921  char *errfmt = "Ligature%s";
1922  int errret = -1;
1923  int count;
1924  int i;
1925 
1927  if (! count)
1928  return 0;
1929  OTF_MALLOC (*ligature, count, "");
1930  for (i = 0; i < count; i++)
1931  READ_OFFSET (stream, (*ligature)[i].offset);
1932  for (i = 0; i < count; i++)
1933  {
1934  SEEK_STREAM (stream, offset + (*ligature)[i].offset);
1935  READ_GLYPHID (stream, (*ligature)[i].LigGlyph);
1936  (*ligature)[i].CompCount
1937  = read_glyph_ids (otf, stream, &(*ligature)[i].Component, -1, -1);
1938  if (! (*ligature)[i].CompCount)
1939  return -1;
1940  }
1941  return count;
1942 }
1943 
1944 static unsigned
1946  OTF_LigatureSet **ligset)
1947 {
1948  char *errfmt = "LigatureSet%s";
1949  int errret = 0;
1950  int count;
1951  int i;
1952 
1954  if (! count)
1955  return errret;
1956  OTF_MALLOC (*ligset, count, "");
1957  for (i = 0; i < count; i++)
1958  READ_OFFSET (stream, (*ligset)[i].offset);
1959  for (i = 0; i < count; i++)
1960  {
1961  int lig_count;
1962 
1963  SEEK_STREAM (stream, offset + (*ligset)[i].offset);
1964  lig_count = read_ligature (otf, stream, offset + (*ligset)[i].offset,
1965  &(*ligset)[i].Ligature);
1966  if (lig_count < 0)
1967  return errret;
1968  (*ligset)[i].LigatureCount = (unsigned) lig_count;
1969  }
1970  return count;
1971 }
1972 
1973 static unsigned
1975  OTF_AlternateSet **altset)
1976 {
1977  char *errfmt = "AlternateSet%s";
1978  int errret = 0;
1979  unsigned count;
1980  int i;
1981 
1983  if (! count)
1984  OTF_ERROR (OTF_ERROR_TABLE, " (zero count)");
1985  OTF_MALLOC (*altset, count, "");
1986  for (i = 0; i < count; i++)
1987  READ_OFFSET (stream, (*altset)[i].offset);
1988  for (i = 0; i < count; i++)
1989  {
1990  int alt_count;
1991 
1992  SEEK_STREAM (stream, offset + (*altset)[i].offset);
1993  alt_count = read_glyph_ids (otf, stream, &(*altset)[i].Alternate, 0, -1);
1994  if (alt_count < 0)
1995  return errret;
1996  (*altset)[i].GlyphCount = (unsigned) alt_count;
1997  }
1998  return count;
1999 }
2000 
2001 static int
2004  OTF_GSUB_ReverseChain1 *reverse_chain)
2005 {
2006  int count;
2007 
2008  if (read_coverage (otf, stream, offset, coverage) < 0)
2009  return -1;
2011  &reverse_chain->Backtrack, -1);
2012  if (count < 0)
2013  return -1;
2014  reverse_chain->BacktrackGlyphCount = (unsigned) count;
2016  &reverse_chain->LookAhead, -1);
2017  if (count <= 0)
2018  return -1;
2019  reverse_chain->LookaheadGlyphCount = (unsigned) count;
2020  count = read_glyph_ids (otf, stream, &reverse_chain->Substitute, 0, -1);
2021  if (count <= 0)
2022  return -1;
2023  reverse_chain->GlyphCount = count;
2024  return 0;
2025 }
2026 
2027 static int
2029  unsigned type, OTF_LookupSubTableGSUB *subtable)
2030 {
2031  char errfmt[256];
2032  int errret = -1;
2033 
2035  READ_USHORT (stream, subtable->Format);
2036  sprintf (errfmt, "GSUB Lookup %d-%d%%s", type, subtable->Format);
2037  switch (type)
2038  {
2039  case 1:
2040  if (subtable->Format == 1)
2041  {
2042  if (read_coverage (otf, stream, offset, &subtable->Coverage) < 0)
2043  return -1;
2044  READ_INT16 (stream, subtable->u.single1.DeltaGlyphID);
2045  }
2046  else if (subtable->Format == 2)
2047  {
2048  if (read_coverage (otf, stream, offset, &subtable->Coverage) < 0)
2049  return -1;
2050  subtable->u.single2.GlyphCount
2051  = read_glyph_ids (otf, stream, &subtable->u.single2.Substitute,
2052  0, -1);
2053  if (! subtable->u.single2.GlyphCount)
2054  return -1;
2055  }
2056  else
2057  OTF_ERROR (OTF_ERROR_TABLE, " (Invalid SubFormat)");
2058  break;
2059 
2060  case 2:
2061  if (subtable->Format == 1)
2062  {
2063  read_coverage (otf, stream, offset, &subtable->Coverage);
2064  subtable->u.multiple1.SequenceCount
2065  = read_sequence (otf, stream, offset,
2066  &subtable->u.multiple1.Sequence);
2067  }
2068  else
2069  OTF_ERROR (OTF_ERROR_TABLE, " (Invalid SubFormat)");
2070  break;
2071 
2072  case 3:
2073  if (subtable->Format == 1)
2074  {
2075  if (read_coverage (otf, stream, offset, &subtable->Coverage) < 0)
2076  return -1;
2077  subtable->u.alternate1.AlternateSetCount
2079  &subtable->u.alternate1.AlternateSet);
2080  if (! subtable->u.alternate1.AlternateSetCount)
2081  return -1;
2082  }
2083  else
2084  OTF_ERROR (OTF_ERROR_TABLE, " (Invalid SubFormat)");
2085  break;
2086 
2087  case 4:
2088  if (subtable->Format == 1)
2089  {
2090  if (read_coverage (otf, stream, offset, &subtable->Coverage) < 0)
2091  return -1;
2092  subtable->u.ligature1.LigSetCount
2094  &subtable->u.ligature1.LigatureSet);
2095  if (! subtable->u.ligature1.LigSetCount)
2096  return -1;
2097  }
2098  else
2099  OTF_ERROR (OTF_ERROR_TABLE, " (Invalid SubFormat)");
2100  break;
2101 
2102  case 5:
2103  if (subtable->Format == 1)
2104  {
2105  if (read_context1 (otf, stream, offset, &subtable->Coverage,
2106  &subtable->u.context1) < 0)
2107  return errret;
2108  }
2109  else if (subtable->Format == 2)
2110  {
2111  if (read_context2 (otf, stream, offset, &subtable->Coverage,
2112  &subtable->u.context2) < 0)
2113  return errret;
2114  }
2115  else if (subtable->Format == 3)
2116  {
2117  if (read_context3 (otf, stream, offset, &subtable->Coverage,
2118  &subtable->u.context3) < 0)
2119  return errret;
2120  }
2121  else
2122  OTF_ERROR (OTF_ERROR_TABLE, " (Invalid SubFormat)");
2123  break;
2124 
2125  case 6:
2126  if (subtable->Format == 1)
2127  {
2128  if (read_chain_context1 (otf, stream, offset, &subtable->Coverage,
2129  &subtable->u.chain_context1) < 0)
2130  return errret;
2131  }
2132  else if (subtable->Format == 2)
2133  {
2134  if (read_chain_context2 (otf, stream, offset, &subtable->Coverage,
2135  &subtable->u.chain_context2) < 0)
2136  return errret;
2137  }
2138  else if (subtable->Format == 3)
2139  {
2140  if (read_chain_context3 (otf, stream, offset, &subtable->Coverage,
2141  &subtable->u.chain_context3) < 0)
2142  return errret;
2143  }
2144  else
2145  OTF_ERROR (OTF_ERROR_TABLE, " (Invalid SubFormat)");
2146  break;
2147 
2148  case 7:
2149  if (subtable->Format == 1)
2150  {
2151  unsigned ex_type;
2152  long ex_offset;
2153  OTF_LookupSubTableGSUB *ex_subtable;
2154 
2155  READ_USHORT (stream, ex_type);
2156  READ_ULONG (stream, ex_offset);
2157  OTF_CALLOC (ex_subtable, 1, " (SubTable)");
2158  if (read_lookup_subtable_gsub (otf, stream, offset + ex_offset,
2159  ex_type, ex_subtable) < 0)
2160  return errret;
2161  subtable->u.extension1.ExtensionLookupType = ex_type;
2162  subtable->u.extension1.ExtensionOffset = ex_offset;
2163  subtable->u.extension1.ExtensionSubtable = ex_subtable;
2164  }
2165  else
2166  OTF_ERROR (OTF_ERROR_TABLE, " (Invalid SubFormat)");
2167  break;
2168 
2169  case 8:
2170  if (subtable->Format == 1)
2171  {
2172  if (read_reverse_chain1 (otf, stream, offset, &subtable->Coverage,
2173  &subtable->u.reverse_chain1) < 0)
2174  return errret;
2175  }
2176  else
2177  OTF_ERROR (OTF_ERROR_TABLE, " (Invalid SubFormat)");
2178  break;
2179 
2180  default:
2181  OTF_ERROR (OTF_ERROR_TABLE, " (Invalid LookupType)");
2182  }
2183  return 0;
2184 }
2185 
2186 static void *
2188 {
2189  return read_gsub_gpos_table (otf, table, 1, flag);
2190 }
2191 
2192 ␌
2193 /* (1-10) "GPOS" table */
2194 
2195 static int
2197  enum OTF_ValueFormat bit, OTF_ValueRecord *value_record)
2198 {
2199  int errret = -1;
2201  int size, i;
2202 
2203  memset (value_record, 0, sizeof (OTF_ValueRecord));
2204  if (! bit)
2205  return 0;
2206  for (i = 0, size = 0; i < 8; i++)
2207  if (bit & (1 << i))
2208  size += 2;
2209 
2210  if (bit & OTF_XPlacement)
2211  READ_INT16 (stream, value_record->XPlacement);
2212  if (bit & OTF_YPlacement)
2213  READ_INT16 (stream, value_record->YPlacement);
2214  if (bit & OTF_XAdvance)
2215  READ_INT16 (stream, value_record->XAdvance);
2216  if (bit & OTF_YAdvance)
2217  READ_INT16 (stream, value_record->YAdvance);
2218  if (bit & OTF_XPlaDevice)
2219  READ_OFFSET (stream, value_record->XPlaDevice.offset);
2220  if (bit & OTF_YPlaDevice)
2221  READ_OFFSET (stream, value_record->YPlaDevice.offset);
2222  if (bit & OTF_XAdvDevice)
2223  READ_OFFSET (stream, value_record->XAdvDevice.offset);
2224  if (bit & OTF_YAdvDevice)
2225  READ_OFFSET (stream, value_record->YAdvDevice.offset);
2227  if (value_record->XPlaDevice.offset)
2228  {
2229  if (read_device_table (otf, stream, offset, &value_record->XPlaDevice) < 0)
2230  return -1;
2231  }
2232  if (value_record->YPlaDevice.offset)
2233  {
2234  if (read_device_table (otf, stream, offset, &value_record->YPlaDevice) < 0)
2235  return -1;
2236  }
2237  if (value_record->XAdvDevice.offset)
2238  {
2239  if (read_device_table (otf, stream, offset, &value_record->XAdvDevice) < 0)
2240  return -1;
2241  }
2242  if (value_record->YAdvDevice.offset)
2243  {
2244  if (read_device_table (otf, stream, offset, &value_record->YAdvDevice) < 0)
2245  return -1;
2246  }
2248  return 0;
2249 }
2250 
2251 
2252 static int
2254 {
2255  char *errfmt = "Anchor%s";
2256  int errret = -1;
2257 
2258  SEEK_STREAM (stream, offset + anchor->offset);
2259  READ_UINT16 (stream, anchor->AnchorFormat);
2260  READ_INT16 (stream, anchor->XCoordinate);
2261  READ_INT16 (stream, anchor->YCoordinate);
2262  if (anchor->AnchorFormat == 1)
2263  ;
2264  else if (anchor->AnchorFormat == 2)
2265  {
2266  READ_UINT16 (stream, anchor->f.f1.AnchorPoint);
2267  }
2268  else if (anchor->AnchorFormat == 3)
2269  {
2272  if (anchor->f.f2.XDeviceTable.offset)
2273  {
2274  if (read_device_table (otf, stream, offset + anchor->offset,
2275  &anchor->f.f2.XDeviceTable) < 0)
2276  return -1;
2277  }
2278  if (anchor->f.f2.YDeviceTable.offset)
2279  {
2280  if (read_device_table (otf, stream, offset + anchor->offset,
2281  &anchor->f.f2.YDeviceTable) < 0)
2282  return -1;
2283  }
2284  }
2285  else
2286  OTF_ERROR (OTF_ERROR_TABLE, " (invalid format)");
2287 
2288  return 0;
2289 }
2290 
2291 static int
2294 {
2295  char *errfmt = "MarkArray%s";
2296  int errret = -1;
2298  int i;
2299 
2300  READ_OFFSET (stream, array->offset);
2302  SEEK_STREAM (stream, offset + array->offset);
2303  READ_UINT16 (stream, array->MarkCount);
2304  OTF_MALLOC (array->MarkRecord, array->MarkCount, "");
2305  for (i = 0; i < array->MarkCount; i++)
2306  {
2307  READ_UINT16 (stream, array->MarkRecord[i].Class);
2308  READ_OFFSET (stream, array->MarkRecord[i].MarkAnchor.offset);
2309  }
2310  for (i = 0; i < array->MarkCount; i++)
2311  if (read_anchor (otf, stream, offset + array->offset,
2312  &array->MarkRecord[i].MarkAnchor) < 0)
2313  return -1;;
2315  return 0;
2316 }
2317 
2318 static int
2320  unsigned ClassCount, OTF_AnchorArray *array)
2321 {
2322  char *errfmt = "AnchorArray%s";
2323  int errret = -1;
2325  int i, j;
2326 
2327  READ_OFFSET (stream, array->offset);
2329  SEEK_STREAM (stream, offset + array->offset);
2330  READ_UINT16 (stream, array->Count);
2331  OTF_MALLOC (array->AnchorRecord, array->Count, "");
2332  for (i = 0; i < array->Count; i++)
2333  {
2334  OTF_MALLOC (array->AnchorRecord[i].Anchor, ClassCount,
2335  " (AnchorRecord)");
2336  for (j = 0; j < ClassCount; j++)
2337  READ_OFFSET (stream, array->AnchorRecord[i].Anchor[j].offset);
2338  }
2339  for (i = 0; i < array->Count; i++)
2340  for (j = 0; j < ClassCount; j++)
2341  if (array->AnchorRecord[i].Anchor[j].offset > 0
2342  && read_anchor (otf, stream, offset + array->offset,
2343  &array->AnchorRecord[i].Anchor[j]) < 0)
2344  return -1;
2346  return 0;
2347 }
2348 
2349 static OTF_PairSet *
2351  enum OTF_ValueFormat bit1, enum OTF_ValueFormat bit2)
2352 {
2353  char *errfmt = "PairSet%s";
2354  void *errret = NULL;
2356  OTF_PairSet *set;
2357  int i, j;
2358 
2359  OTF_MALLOC (set, num, "");
2360  for (i = 0; i < num; i++)
2361  READ_OFFSET (stream, set[i].offset);
2363  for (i = 0; i < num; i++)
2364  {
2365  SEEK_STREAM (stream, offset + set[i].offset);
2366  READ_UINT16 (stream, set[i].PairValueCount);
2367  OTF_MALLOC (set[i].PairValueRecord, set[i].PairValueCount, "");
2368  for (j = 0; j < set[i].PairValueCount; j++)
2369  {
2370  OTF_PairValueRecord *rec = set[i].PairValueRecord + j;
2371 
2372  READ_UINT16 (stream, rec->SecondGlyph);
2373  read_value_record (otf, stream, offset, bit1, &rec->Value1);
2374  read_value_record (otf, stream, offset, bit2, &rec->Value2);
2375  }
2376  }
2378  return set;
2379 }
2380 
2381 static OTF_Class1Record *
2383  unsigned num1, enum OTF_ValueFormat bit1,
2384  unsigned num2, enum OTF_ValueFormat bit2)
2385 {
2386  char *errfmt = "Class1Record%s";
2387  void *errret = NULL;
2388  OTF_Class1Record *rec;
2389  int i, j;
2390 
2391  OTF_MALLOC (rec, num1, "");
2392  for (i = 0; i < num1; i++)
2393  {
2394  OTF_CALLOC (rec[i].Class2Record, num2, " (Class2Record)");
2395  for (j = 0; j < num2; j++)
2396  {
2397  if (read_value_record (otf, stream, offset,
2398  bit1, &rec[i].Class2Record[j].Value1) < 0
2399  || read_value_record (otf, stream, offset,
2400  bit2, &rec[i].Class2Record[j].Value2) < 0)
2401  return NULL;
2402  }
2403  }
2404  return rec;
2405 }
2406 
2407 static unsigned
2409  OTF_EntryExitRecord **rec)
2410 {
2411  char *errfmt = "EntryExitSet%s";
2412  int errret = 0;
2413  unsigned count;
2414  int i;
2416 
2418  if (! count)
2419  OTF_ERROR (OTF_ERROR_TABLE, " (zero count)");
2420  OTF_MALLOC (*rec, count, "");
2421  for (i = 0; i < count; i++)
2422  {
2423  READ_OFFSET (stream, (*rec)[i].EntryAnchor.offset);
2424  READ_OFFSET (stream, (*rec)[i].ExitAnchor.offset);
2425  }
2427  for (i = 0; i < count; i++)
2428  {
2429  if (read_anchor (otf, stream, offset, &(*rec)[i].EntryAnchor) < 0)
2430  return -1;
2431  if (read_anchor (otf, stream, offset, &(*rec)[i].ExitAnchor) < 0)
2432  return -1;
2433  }
2435  return count;
2436 }
2437 
2438 static int
2440  unsigned ClassCount, OTF_LigatureAttach *attach)
2441 {
2442  char *errfmt = "LigatureAttach%s";
2443  int errret = -1;
2444  int i, j;
2445 
2446  SEEK_STREAM (stream, offset + attach->offset);
2447  READ_UINT16 (stream, attach->ComponentCount);
2448  OTF_MALLOC (attach->ComponentRecord, attach->ComponentCount, "");
2449  for (i = 0; i < attach->ComponentCount; i++)
2450  {
2451  OTF_MALLOC (attach->ComponentRecord[i].LigatureAnchor, ClassCount,
2452  " (ComponentRecord)");
2453  for (j = 0; j < ClassCount; j++)
2456  }
2457  for (i = 0; i < attach->ComponentCount; i++)
2458  for (j = 0; j < ClassCount; j++)
2459  {
2460  if (attach->ComponentRecord[i].LigatureAnchor[j].offset)
2461  {
2462  if (read_anchor (otf, stream, offset + attach->offset,
2463  &attach->ComponentRecord[i].LigatureAnchor[j]) < 0)
2464  return -1;
2465  }
2466  else
2468  }
2469  return 0;
2470 }
2471 
2472 static int
2474  unsigned class_count, OTF_LigatureArray *array)
2475 {
2476  char *errfmt = "LigatureArray%s";
2477  int errret = -1;
2479  int i;
2480 
2481  READ_OFFSET (stream, array->offset);
2483  SEEK_STREAM (stream, offset + array->offset);
2484  READ_UINT16 (stream, array->LigatureCount);
2485  OTF_MALLOC (array->LigatureAttach, array->LigatureCount, "");
2486  for (i = 0; i < array->LigatureCount; i++)
2487  READ_OFFSET (stream, array->LigatureAttach[i].offset);
2488  for (i = 0; i < array->LigatureCount; i++)
2489  if (array->LigatureAttach[i].offset > 0
2490  && read_ligature_attach (otf, stream, offset + array->offset,
2491  class_count, array->LigatureAttach + i) < 0)
2492  return -1;
2494  return 0;
2495 }
2496 
2497 static int
2499  long offset, unsigned type,
2500  OTF_LookupSubTableGPOS *subtable)
2501 {
2502  char errfmt[256];
2503  int errret = -1;
2504 
2506  READ_UINT16 (stream, subtable->Format);
2507  sprintf (errfmt, "GPOS Lookup %d-%d%%s", type, subtable->Format);
2508  switch (type)
2509  {
2510  case 1:
2511  if (subtable->Format == 1)
2512  {
2513  if (read_coverage (otf, stream, offset, &subtable->Coverage) < 0)
2514  return -1;
2515  READ_UINT16 (stream, subtable->u.single1.ValueFormat);
2517  subtable->u.single1.ValueFormat,
2518  &subtable->u.single1.Value);
2519  }
2520  else if (subtable->Format == 2)
2521  {
2522  OTF_GPOS_Single2 *single2 = &subtable->u.single2;
2523  int i;
2524 
2525  if (read_coverage (otf, stream, offset, &subtable->Coverage) < 0)
2526  return -1;
2527  READ_UINT16 (stream, single2->ValueFormat);
2528  READ_UINT16 (stream, single2->ValueCount);
2529  OTF_CALLOC (single2->Value, single2->ValueCount," (ValueRecord)");
2530  for (i = 0; i < single2->ValueCount; i++)
2531  read_value_record (otf, stream, offset, single2->ValueFormat,
2532  single2->Value + i);
2533  }
2534  else
2535  OTF_ERROR (OTF_ERROR_TABLE, " (Invalid SubFormat)");
2536  break;
2537 
2538  case 2:
2539  if (subtable->Format == 1)
2540  {
2541  if (read_coverage (otf, stream, offset, &subtable->Coverage) < 0)
2542  return -1;
2543  READ_UINT16 (stream, subtable->u.pair1.ValueFormat1);
2544  READ_UINT16 (stream, subtable->u.pair1.ValueFormat2);
2545  READ_UINT16 (stream, subtable->u.pair1.PairSetCount);
2546  subtable->u.pair1.PairSet
2547  = read_pair_set_list (otf, stream, offset,
2548  subtable->u.pair1.PairSetCount,
2549  subtable->u.pair1.ValueFormat1,
2550  subtable->u.pair1.ValueFormat2);
2551  if (! subtable->u.pair1.PairSet)
2552  return -1;
2553  }
2554  else if (subtable->Format == 2)
2555  {
2556  if (read_coverage (otf, stream, offset, &subtable->Coverage) < 0)
2557  return -1;
2558  READ_UINT16 (stream, subtable->u.pair2.ValueFormat1);
2559  READ_UINT16 (stream, subtable->u.pair2.ValueFormat2);
2560  if (read_class_def (otf, stream, offset,
2561  &subtable->u.pair2.ClassDef1) < 0
2562  || read_class_def (otf, stream, offset,
2563  &subtable->u.pair2.ClassDef2) < 0)
2564  return -1;
2565  READ_UINT16 (stream, subtable->u.pair2.Class1Count);
2566  READ_UINT16 (stream, subtable->u.pair2.Class2Count);
2567  subtable->u.pair2.Class1Record
2569  subtable->u.pair2.Class1Count,
2570  subtable->u.pair2.ValueFormat1,
2571  subtable->u.pair2.Class2Count,
2572  subtable->u.pair2.ValueFormat2);
2573  if (! subtable->u.pair2.Class1Record)
2574  return -1;
2575  }
2576  else
2577  OTF_ERROR (OTF_ERROR_TABLE, " (Invalid SubFormat)");
2578  break;
2579 
2580  case 3:
2581  if (subtable->Format == 1)
2582  {
2583  if (read_coverage (otf, stream, offset, &subtable->Coverage) < 0)
2584  return -1;
2585  subtable->u.cursive1.EntryExitCount
2587  &subtable->u.cursive1.EntryExitRecord);
2588  if (! subtable->u.cursive1.EntryExitCount)
2589  return -1;
2590  }
2591  else
2592  OTF_ERROR (OTF_ERROR_TABLE, " (Invalid SubFormat)");
2593  break;
2594 
2595  case 4:
2596  if (subtable->Format == 1)
2597  {
2598  read_coverage (otf, stream, offset, &subtable->Coverage);
2599  read_coverage (otf, stream, offset,
2600  &subtable->u.mark_base1.BaseCoverage);
2601  READ_UINT16 (stream, subtable->u.mark_base1.ClassCount);
2602  read_mark_array (otf, stream, offset,
2603  &subtable->u.mark_base1.MarkArray);
2605  subtable->u.mark_base1.ClassCount,
2606  &subtable->u.mark_base1.BaseArray);
2607  }
2608  else
2609  OTF_ERROR (OTF_ERROR_TABLE, " (Invalid SubFormat)");
2610  break;
2611 
2612  case 5:
2613  if (subtable->Format == 1)
2614  {
2615  read_coverage (otf, stream, offset, &subtable->Coverage);
2616  read_coverage (otf, stream, offset,
2617  &subtable->u.mark_lig1.LigatureCoverage);
2618  READ_UINT16 (stream, subtable->u.mark_lig1.ClassCount);
2619  read_mark_array (otf, stream, offset,
2620  &subtable->u.mark_lig1.MarkArray);
2622  subtable->u.mark_lig1.ClassCount,
2623  &subtable->u.mark_lig1.LigatureArray);
2624  }
2625  break;
2626 
2627  case 6:
2628  if (subtable->Format == 1)
2629  {
2630  read_coverage (otf, stream, offset, &subtable->Coverage);
2631  read_coverage (otf, stream, offset,
2632  &subtable->u.mark_mark1.Mark2Coverage);
2633  READ_UINT16 (stream, subtable->u.mark_mark1.ClassCount);
2634  read_mark_array (otf, stream, offset,
2635  &subtable->u.mark_mark1.Mark1Array);
2637  subtable->u.mark_mark1.ClassCount,
2638  &subtable->u.mark_mark1.Mark2Array);
2639  }
2640  else
2641  OTF_ERROR (OTF_ERROR_TABLE, " (Invalid SubFormat)");
2642  break;
2643 
2644  case 7:
2645  if (subtable->Format == 1)
2646  {
2647  if (read_context1 (otf, stream, offset, &subtable->Coverage,
2648  &subtable->u.context1) < 0)
2649  return errret;
2650  }
2651  else if (subtable->Format == 2)
2652  {
2653  if (read_context2 (otf, stream, offset, &subtable->Coverage,
2654  &subtable->u.context2) < 0)
2655  return errret;
2656  }
2657  else if (subtable->Format == 3)
2658  {
2659  if (read_context3 (otf, stream, offset, &subtable->Coverage,
2660  &subtable->u.context3) < 0)
2661  return errret;
2662  }
2663  else
2664  OTF_ERROR (OTF_ERROR_TABLE, " (Invalid SubFormat)");
2665  break;
2666 
2667  case 8:
2668  if (subtable->Format == 1)
2669  {
2670  if (read_chain_context1 (otf, stream, offset, &subtable->Coverage,
2671  &subtable->u.chain_context1) < 0)
2672  return errret;
2673  }
2674  else if (subtable->Format == 2)
2675  {
2676  if (read_chain_context2 (otf, stream, offset, &subtable->Coverage,
2677  &subtable->u.chain_context2) < 0)
2678  return errret;
2679  }
2680  else if (subtable->Format == 3)
2681  {
2682  if (read_chain_context3 (otf, stream, offset, &subtable->Coverage,
2683  &subtable->u.chain_context3) < 0)
2684  return errret;
2685  }
2686  else
2687  OTF_ERROR (OTF_ERROR_TABLE, " (Invalid SubFormat)");
2688  break;
2689 
2690  case 9:
2691  if (subtable->Format == 1)
2692  {
2693  unsigned ex_type;
2694  long ex_offset;
2695  OTF_LookupSubTableGPOS *ex_subtable;
2696 
2697  READ_USHORT (stream, ex_type);
2698  READ_ULONG (stream, ex_offset);
2699  OTF_CALLOC (ex_subtable, 1, " (SubTable)");
2700  if (read_lookup_subtable_gpos (otf, stream, offset + ex_offset,
2701  ex_type, ex_subtable) < 0)
2702  return errret;
2703  subtable->u.extension1.ExtensionLookupType = ex_type;
2704  subtable->u.extension1.ExtensionOffset = ex_offset;
2705  subtable->u.extension1.ExtensionSubtable = ex_subtable;
2706  }
2707  else
2708  OTF_ERROR (OTF_ERROR_TABLE, " (Invalid SubFormat)");
2709  break;
2710 
2711  default:
2712  OTF_ERROR (OTF_ERROR_TABLE, " (Invalid LookupType)");
2713  }
2714  return 0;
2715 }
2716 
2717 static void *
2719 {
2720  return read_gsub_gpos_table (otf, table, 0, flag);
2721 }
2722 
2723 ␌
2724 #if 0
2725 /* BASE */
2726 
2727 static OTF_BASE *
2728 read_base_table (OTF_Stream *stream, long offset)
2729 {
2730  OTF_BASE *base;
2731 
2732  OTF_MALLOC (base, 1);
2733 
2734  return base;
2735 }
2736 
2737 ␌
2738 /* JSTF */
2739 
2740 static OTF_JSTF *
2741 read_jstf_table (OTF_Stream *stream, long offset)
2742 {
2743  OTF_JSTF *jstf;
2744 
2745  OTF_MALLOC (jstf, 1);
2746 
2747  return jstf;
2748 }
2749 #endif /* 0 */
2750 ␌
2751 /*** (1-11) Structure for OTF */
2752 
2753 static int
2755 {
2756  int errret = -1;
2757 
2758  READ_FIXED (stream, table->sfnt_version);
2759  READ_USHORT (stream, table->numTables);
2760  READ_USHORT (stream, table->searchRange);
2761  READ_USHORT (stream, table->enterSelector);
2762  READ_USHORT (stream, table->rangeShift);
2763  return 0;
2764 }
2765 
2766 static OTF_Tag
2768 {
2769  int errret = 0;
2770  OTF_Tag tag;
2771 
2772  READ_TAG (stream, tag);
2773  table->tag = tag;
2774  table->name[0] = tag >> 24;
2775  table->name[1] = (tag >> 16) & 0xFF;
2776  table->name[2] = (tag >> 8) & 0xFF;
2777  table->name[3] = tag & 0xFF;
2778  table->name[4] = '\0';
2779  READ_ULONG (stream, table->checkSum);
2780  READ_ULONG (stream, table->offset);
2781  READ_ULONG (stream, table->length);
2782  return tag;
2783 }
2784 
2785 static int
2787 {
2788  char *errfmt = "otf header%s";
2789  int errret = -1;
2790  int i;
2791  OTF_InternalData *internal_data = (OTF_InternalData *) otf->internal_data;
2792 
2793  internal_data->table_info[OTF_TABLE_TYPE_HEAD].address = (void *) &otf->head;
2795  internal_data->table_info[OTF_TABLE_TYPE_NAME].address = (void *) &otf->name;
2797  internal_data->table_info[OTF_TABLE_TYPE_CMAP].address = (void *) &otf->cmap;
2799  internal_data->table_info[OTF_TABLE_TYPE_GDEF].address = (void *) &otf->gdef;
2801  internal_data->table_info[OTF_TABLE_TYPE_GSUB].address = (void *) &otf->gsub;
2803  internal_data->table_info[OTF_TABLE_TYPE_GPOS].address = (void *) &otf->gpos;
2805 
2806  if (fp)
2807  {
2808  OTF_Tag head_tag = OTF_tag ("head");
2809  OTF_Tag name_tag = OTF_tag ("name");
2810  OTF_Tag cmap_tag = OTF_tag ("cmap");
2811  OTF_Tag gdef_tag = OTF_tag ("GDEF");
2812  OTF_Tag gsub_tag = OTF_tag ("GSUB");
2813  OTF_Tag gpos_tag = OTF_tag ("GPOS");
2814  OTF_Stream *stream = make_stream ("Offset Table");
2815  unsigned char ttctag[4];
2816 
2817  if (! stream)
2818  return -1;
2819  internal_data->header_stream = stream;
2820 
2821  /* Size of Offset Table is 12 bytes. Size of TTC header
2822  (including only the an offset of the first font) is 16. */
2823  if (setup_stream (stream, fp, 0, 16) < 0)
2824  return -1;
2825  READ_BYTES (stream, ttctag, 4);
2826  if (memcmp (ttctag, "ttcf", 4) == 0)
2827  {
2828  /* This is a TrueType Collection file. We extract the first font. */
2829  unsigned version, numfonts, offset;
2831  READ_ULONG (stream, numfonts);
2832  READ_ULONG (stream, offset); /* Offset of the first font. */
2833  if (setup_stream (stream, fp, offset, 12) < 0)
2834  return -1;
2835  }
2836  else
2837  SEEK_STREAM (stream, 0L);
2838  if (read_offset_table (otf, stream, &otf->offset_table) < 0)
2839  return -1;
2840  /* Size of each Table Directory is 16 bytes. */
2841  if (setup_stream (stream, fp, stream->pos,
2842  16 * otf->offset_table.numTables) < 0)
2843  return -1;
2844 
2846  " (OffsetTable)");
2847  for (i = 0; i < otf->offset_table.numTables; i++)
2848  {
2850  OTF_TableInfo *table_info = NULL;
2851 
2852  if (! tag)
2853  return -1;
2854  if (tag == head_tag)
2855  table_info = internal_data->table_info + OTF_TABLE_TYPE_HEAD;
2856  else if (tag == name_tag)
2857  table_info = internal_data->table_info + OTF_TABLE_TYPE_NAME;
2858  else if (tag == cmap_tag)
2859  table_info = internal_data->table_info + OTF_TABLE_TYPE_CMAP;
2860  else if (tag == gdef_tag)
2861  table_info = internal_data->table_info + OTF_TABLE_TYPE_GDEF;
2862  else if (tag == gsub_tag)
2863  table_info = internal_data->table_info + OTF_TABLE_TYPE_GSUB;
2864  else if (tag == gpos_tag)
2865  table_info = internal_data->table_info + OTF_TABLE_TYPE_GPOS;
2866 
2867  if (table_info)
2868  {
2869  table_info->stream = make_stream (otf->table_dirs[i].name);
2870  if (setup_stream (table_info->stream, fp,
2871  otf->table_dirs[i].offset,
2872  otf->table_dirs[i].length) < 0)
2873  return -1;
2874  }
2875  }
2876 
2877  internal_data->header_stream = NULL;
2878  free_stream (stream);
2879  }
2880  else
2881  {
2882  OTF_Stream *stream;
2883 
2884  internal_data->header_stream = NULL;
2885  if ((stream = make_stream_from_ft_face (face, "head")))
2886  internal_data->table_info[OTF_TABLE_TYPE_HEAD].stream = stream;
2887  if ((stream = make_stream_from_ft_face (face, "name")))
2888  internal_data->table_info[OTF_TABLE_TYPE_NAME].stream = stream;
2889  if ((stream = make_stream_from_ft_face (face, "cmap")))
2890  internal_data->table_info[OTF_TABLE_TYPE_CMAP].stream = stream;
2891  if ((stream = make_stream_from_ft_face (face, "GDEF")))
2892  internal_data->table_info[OTF_TABLE_TYPE_GDEF].stream = stream;
2893  if ((stream = make_stream_from_ft_face (face, "GSUB")))
2894  internal_data->table_info[OTF_TABLE_TYPE_GSUB].stream = stream;
2895  if ((stream = make_stream_from_ft_face (face, "GPOS")))
2896  internal_data->table_info[OTF_TABLE_TYPE_GPOS].stream = stream;
2897  }
2898 
2899  if (! internal_data->table_info[OTF_TABLE_TYPE_GDEF].stream)
2900  /* We can simulate the GDEF table. */
2901  internal_data->table_info[OTF_TABLE_TYPE_GDEF].stream
2902  = make_stream ("GDEF");
2903  return 0;
2904 }
2905 
2907 get_table_info (OTF *otf, const char *name)
2908 {
2909  char *errfmt = "OTF Table Read%s";
2910  OTF_TableInfo *errret = NULL;
2911  OTF_InternalData *internal_data = otf->internal_data;
2912  OTF_TableInfo *table_info;
2913  OTF_Tag tag = OTF_tag (name);
2914 
2915  if (! tag)
2916  OTF_ERROR (OTF_ERROR_TABLE, " (invalid table name)");
2917 
2918  if (tag == OTF_tag ("head"))
2919  table_info = internal_data->table_info + OTF_TABLE_TYPE_HEAD;
2920  else if (tag == OTF_tag ("name"))
2921  table_info = internal_data->table_info + OTF_TABLE_TYPE_NAME;
2922  else if (tag == OTF_tag ("cmap"))
2923  table_info = internal_data->table_info + OTF_TABLE_TYPE_CMAP;
2924  else if (tag == OTF_tag ("GDEF"))
2925  table_info = internal_data->table_info + OTF_TABLE_TYPE_GDEF;
2926  else if (tag == OTF_tag ("GSUB"))
2927  table_info = internal_data->table_info + OTF_TABLE_TYPE_GSUB;
2928  else if (tag == OTF_tag ("GPOS"))
2929  table_info = internal_data->table_info + OTF_TABLE_TYPE_GPOS;
2930  else
2931  OTF_ERROR (OTF_ERROR_TABLE, " (unsupported table name)");
2932 
2933  if (*table_info->address)
2934  /* Already read. */
2935  return table_info;
2936  if (! table_info->stream)
2937  OTF_ERROR (OTF_ERROR_TABLE, " (table not found)");
2938  if (! table_info->reader)
2939  OTF_ERROR (OTF_ERROR_TABLE, " (invalid contents)");
2940  return table_info;
2941 }
2942 
2943 
2944 ␌
2945 /*** (2) API for reading OTF */
2946 
2947 /*** (2-1) OTF_open() */
2948 
2949 /* Note: We can't use memory allocation macros in the following
2950  functions because those macros return from the functions before
2951  freeing memory previously allocated. */
2952 
2954 OTF_open (const char *otf_name)
2955 {
2956  FILE *fp;
2957  char *errfmt = "opening otf (%s)";
2958  void *errret = NULL;
2959  OTF *otf;
2960  OTF_InternalData *internal_data;
2961  int len = strlen (otf_name);
2962  const char *ext = otf_name + (len - 4);
2963 
2964  if (debug_flag < 0)
2965  set_debug_flag ();
2966 
2967  if (len < 4
2968  || ext[0] != '.'
2969  || (strncasecmp (ext + 1, "otf", 3)
2970  && strncasecmp (ext + 1, "ttf", 3)
2971  && strncasecmp (ext + 1, "ttc", 3)))
2972  OTF_ERROR (OTF_ERROR_FILE, otf_name);
2973  fp = fopen (otf_name, "rb");
2974  if (! fp)
2975  OTF_ERROR (OTF_ERROR_FILE, otf_name);
2976  otf = calloc (1, sizeof (OTF));
2977  if (! otf)
2978  OTF_ERROR (OTF_ERROR_MEMORY, "body allocation");
2979  otf->filename = strdup (otf_name);
2980  if (! otf->filename)
2981  {
2982  OTF_close (otf);
2983  fclose (fp);
2984  OTF_ERROR (OTF_ERROR_MEMORY, "filename allocation");
2985  }
2986 
2987  internal_data = calloc (1, sizeof (OTF_InternalData));
2988  if (! internal_data)
2989  OTF_ERROR (OTF_ERROR_MEMORY, " (InternalData");
2990  otf->internal_data = internal_data;
2991  if (! allocate_memory_record (otf))
2992  OTF_ERROR (OTF_ERROR_MEMORY, " (InternalData)");
2993 
2994  /* Here after, all pointers to allocated memory are recorded in
2995  otf->internal_data->memory_record except for what allocated by
2996  the functions allocate_memory_record and make_stream. */
2997 
2998  if (read_header_part (otf, fp, NULL) < 0)
2999  {
3000  OTF_close (otf);
3001  fclose (fp);
3002  return NULL;
3003  }
3004 
3005  fclose (fp);
3006  return otf;
3007 }
3008 
3011 {
3012  char *errfmt = "opening otf from Freetype (%s)";
3013  void *errret = NULL;
3014  OTF *otf;
3015  OTF_InternalData *internal_data;
3016 
3017  if (debug_flag < 0)
3018  set_debug_flag ();
3019 
3020  if (! FT_IS_SFNT (face))
3022  otf = calloc (1, sizeof (OTF));
3023  if (! otf)
3024  OTF_ERROR (OTF_ERROR_MEMORY, "body allocation");
3025  otf->filename = NULL;
3026 
3027  internal_data = calloc (1, sizeof (OTF_InternalData));
3028  if (! internal_data)
3029  OTF_ERROR (OTF_ERROR_MEMORY, " (InternalData");
3030  otf->internal_data = internal_data;
3031  if (! allocate_memory_record (otf))
3032  OTF_ERROR (OTF_ERROR_MEMORY, " (InternalData)");
3033 
3034  if (read_header_part (otf, NULL, face) < 0)
3035  {
3036  OTF_close (otf);
3037  return NULL;
3038  }
3039 
3040  return otf;
3041 }
3042 
3043 /*** (2-2) OTF_close() */
3044 
3045 void
3046 OTF_close (OTF *otf)
3047 {
3048  OTF_InternalData *internal_data = otf->internal_data;
3049  int i;
3050 
3051  if (internal_data)
3052  {
3053  OTF_MemoryRecord *memrec = internal_data->memory_record;
3054  OTF_ApplicationData *app_data = internal_data->app_data;
3055 
3056  if (internal_data->header_stream)
3057  free_stream (internal_data->header_stream);
3058 
3059  for (i = 0; i < OTF_TABLE_TYPE_MAX; i++)
3060  if (internal_data->table_info[i].stream)
3061  free_stream (internal_data->table_info[i].stream);
3062 
3063  for (; app_data; app_data = app_data->next)
3064  if (app_data->data && app_data->freer)
3065  app_data->freer (app_data->data);
3066 
3067  while (memrec)
3068  {
3069  OTF_MemoryRecord *next = memrec->next;
3070 
3071  for (i = memrec->used - 1; i >= 0; i--)
3072  free (memrec->memory[i]);
3073  free (memrec);
3074  memrec = next;
3075  }
3076 
3077  free (internal_data);
3078  }
3079  if (otf->filename)
3080  free (otf->filename);
3081  free (otf);
3082 }
3083 
3084 /*** (2-3) OTF_get_table() */
3085 
3086 int
3087 OTF_get_table (OTF *otf, const char *name)
3088 {
3089  OTF_TableInfo *table_info = get_table_info (otf, name);
3090  void *address;
3091 
3092  if (! table_info)
3093  return -1;
3094  if (! table_info->stream)
3095  /* Already fully loaded. */
3096  return 0;
3097 
3098  address = (*table_info->reader) (otf, table_info, OTF_READ_FULL);
3099  free_stream (table_info->stream);
3100  table_info->stream = NULL;
3101  if (! address)
3102  {
3103  table_info->reader = NULL;
3104  return -1;
3105  }
3106  return 0;
3107 }
3108 
3109 /*** (2-4) OTF_check_table() */
3110 
3111 int
3112 OTF_check_table (OTF *otf, const char *name)
3113 {
3114  return (get_table_info (otf, name) ? 0 : -1);
3115 }
3116 
3117 /*** (2-5) OTF_get_scripts() */
3118 
3119 int
3120 OTF_get_scripts (OTF *otf, int gsubp)
3121 {
3122  OTF_TableInfo *table_info
3123  = (otf->internal_data->table_info
3125  void *address;
3126 
3127  if (! table_info->reader)
3128  return -1;
3129  if (! table_info->stream)
3130  /* Already fully loaded. */
3131  return 0;
3132 
3133  address = (*table_info->reader) (otf, table_info, OTF_READ_SCRIPTS);
3134  if (! address)
3135  {
3136  table_info->reader = NULL;
3137  return -1;
3138  }
3139  return 0;
3140 }
3141 
3142 /*** (2-6) OTF_get_features() */
3143 
3144 int
3145 OTF_get_features (OTF *otf, int gsubp)
3146 {
3147  OTF_TableInfo *table_info
3148  = (otf->internal_data->table_info
3150  void *address;
3151 
3152  if (! table_info->reader)
3153  return -1;
3154  if (! table_info->stream)
3155  {
3156  if (*table_info->address)
3157  /* Already fully loaded. */
3158  return 0;
3159  return -1;
3160  }
3161 
3162  address = (*table_info->reader) (otf, table_info, OTF_READ_FEATURES);
3163  if (! address)
3164  {
3165  table_info->reader = NULL;
3166  return -1;
3167  }
3168  return 0;
3169 }
3170 
3171 /*** (2-7) OTF_check_features */
3172 
3173 int
3174 OTF_check_features (OTF *otf, int gsubp,
3176  int n_features)
3177 {
3178  OTF_ScriptList *script_list;
3179  OTF_Script *Script = NULL;
3181  OTF_FeatureList *feature_list;
3182  int i, j;
3183 
3184  if (OTF_get_features (otf, gsubp) < 0)
3185  {
3186  if (gsubp ? ! otf->gsub : ! otf->gpos)
3187  return 0;
3188  for (i = 0; i < n_features; i++)
3189  {
3191 
3192  if (feature == 0)
3193  continue;
3194  if ((((unsigned) feature) & 0x80000000) == 0)
3195  return -1;
3196  }
3197  }
3198  if (gsubp)
3199  {
3200  script_list = &otf->gsub->ScriptList;
3201  feature_list = &otf->gsub->FeatureList;
3202  }
3203  else
3204  {
3205  script_list = &otf->gpos->ScriptList;
3206  feature_list = &otf->gpos->FeatureList;
3207  }
3208  for (i = 0; i < script_list->ScriptCount && ! Script; i++)
3209  if (script_list->Script[i].ScriptTag == script)
3210  Script = script_list->Script + i;
3211  if (! Script)
3212  return 0;
3213  if (language)
3214  {
3215  for (i = 0; i < Script->LangSysCount && ! LangSys; i++)
3216  if (Script->LangSysRecord[i].LangSysTag == language)
3217  LangSys = Script->LangSys + i;
3218  if (! LangSys)
3219  return 0;
3220  }
3221  else
3222  LangSys = &Script->DefaultLangSys;
3223  for (j = 0; j < n_features; j++)
3224  {
3226  int negate = 0;
3227 
3228  if (feature == 0)
3229  continue;
3230  if (((unsigned) feature) & 0x80000000)
3231  {
3232  feature = (OTF_Tag) (((unsigned) feature) & 0x7FFFFFFF);
3233  negate = 1;
3234  }
3235  for (i = 0; i < LangSys->FeatureCount; i++)
3236  if (feature_list->Feature[LangSys->FeatureIndex[i]].FeatureTag
3237  == feature)
3238  {
3239  if (negate)
3240  return 0;
3241  break;
3242  }
3243  if (i == LangSys->FeatureCount)
3244  return 0;
3245  }
3246  return 1;
3247 }
3248 
3249 ␌
3250 /*** (5) API miscellaneous ***/
3251 
3253 OTF_tag (const char *name)
3254 {
3255  const unsigned char *p = (unsigned char *) name;
3256 
3257  if (! name)
3258  return (OTF_Tag) 0;
3259  return (OTF_Tag) ((p[0] << 24)
3260  | (! p[1] ? 0
3261  : ((p[1] << 16)
3262  | (! p[2] ? 0
3263  : (p[2] << 8) | p[3]))));
3264 }
3265 
3266 void
3267 OTF_tag_name (OTF_Tag tag, char *name)
3268 {
3269  name[0] = (char) (tag >> 24);
3270  name[1] = (char) ((tag >> 16) & 0xFF);
3271  name[2] = (char) ((tag >> 8) & 0xFF);
3272  name[3] = (char) (tag & 0xFF);
3273  name[4] = '\0';
3274 }
3275 
3276 int
3277 OTF_put_data (OTF *otf, char *id, void *data, void (*freer) (void *data))
3278 {
3279  char *errfmt = "appdata %s";
3280  int errret = -1;
3281  OTF_InternalData *internal_data = (OTF_InternalData *) otf->internal_data;
3282  OTF_ApplicationData *app_data = internal_data->app_data;
3283  int len = strlen (id) + 1;
3284 
3285  for (; app_data; app_data = app_data->next)
3286  if (memcmp (app_data->id, id, len) == 0)
3287  {
3288  if (app_data->data && app_data->freer)
3289  app_data->freer (app_data->data);
3290  break;
3291  }
3292  if (! app_data)
3293  {
3294  OTF_MALLOC (app_data, sizeof (OTF_ApplicationData), id);
3295  app_data->next = internal_data->app_data;
3296  internal_data->app_data = app_data;
3297  OTF_MALLOC (app_data->id, len, id);
3298  memcpy (app_data->id, id, len);
3299  }
3300  app_data->data = data;
3301  app_data->freer = freer;
3302  return 0;
3303 }
3304 
3305 void *
3306 OTF_get_data (OTF *otf, char *id)
3307 {
3308  OTF_InternalData *internal_data = (OTF_InternalData *) otf->internal_data;
3309  OTF_ApplicationData *app_data = internal_data->app_data;
3310 
3311  for (; app_data; app_data = app_data->next)
3312  if (strcmp (app_data->id, id) == 0)
3313  return app_data->data;
3314  return NULL;
3315 }
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
#define strdup
Definition: Utility.h:167
struct @88 table[500]
#define negate(x)
Definition: aptex-macros.h:51
#define state
Definition: aptex-macros.h:996
#define num1(a)
#define type(a)
Definition: aptex-macros.h:171
#define head
Definition: aptex-macros.h:513
#define count(a)
Definition: aptex-macros.h:781
#define name
#define language
Definition: aptex-macros.h:837
#define next(a)
Definition: aptex-macros.h:924
#define sub2(a)
#define num2(a)
Definition: rule.hpp:20
#define free(a)
Definition: decNumber.cpp:310
#define Input
Definition: detex.c:1846
#define dummy
Definition: devnag.c:313
int dummy
Definition: dummy.c:29
#define fopen
Definition: xxstdio.h:21
#define fread
Definition: xxstdio.h:25
#define fseek
Definition: xxstdio.h:30
int strcmp()
Definition: coll.cpp:143
struct rect data
Definition: dvipdfm.c:64
long int flag
Definition: f2c.h:53
static void
Definition: fpif.c:118
#define c(n)
Definition: gpos-common.c:150
int base
Definition: gsftopk.c:1502
#define memcmp(s1, s2, n)
Definition: gsftopk.c:66
#define memcpy(d, s, n)
Definition: gsftopk.c:64
unsigned nbytes
Definition: in_pcx.cpp:355
#define SEEK_SET
Definition: jmemansi.c:26
#define FT_IS_SFNT(face)
Definition: freetype.h:1290
unsigned long FT_ULong
Definition: fttypes.h:253
#define FT_MAKE_TAG(_x1, _x2, _x3, _x4)
Definition: fttypes.h:488
#define NULL
Definition: ftobjs.h:61
FT_Load_Sfnt_Table(FT_Face face, FT_ULong tag, FT_Long offset, FT_Byte *buffer, FT_ULong *length)
Definition: ftobjs.c:4197
small capitals from c petite p
Definition: afcover.h:72
small capitals from c petite p scientific i
Definition: afcover.h:80
xD9 x84 xD8 xAD xD9 x80 xF0 x90 xAC x9A xE0 xA7 xA6 xE0 xA7 xAA xF0 x91 x84 xA4 xF0 x91 x84 x89 xF0 x91 x84 x9B xF0 x90 x8A xAB xF0 x90 x8B x89 xE2 xB2 x9E xE2 xB2 x9F xD0 xBE xD0 x9E xF0 x90 x90 x84 xF0 x90 x90 xAC xE1 x83 x98 xE1 x83 x94 xE1 x83 x90 xE1 xB2 xBF xE2 xB0 x95 xE2 xB1 x85 xCE xBF xCE x9F xE0 xA8 xA0 xE0 xA8 xB0 xE0 xA9 xA6 Kayah xEA xA4 x8D xEA xA4 x80 Khmer xE1 xA7 xA1 xE1 xA7 xAA xE0 xBB x90 Latin Subscript xE2 x82 x92 xE2 x82 x80 xEA x93 xB3 xF0 x96 xB9 xA1 xF0 x96 xB9 x9B xF0 x96 xB9 xAF xE1 x80 x9D xE1 x80 x84 xE1 x80 x82 no script
Definition: afscript.h:271
for(n=0;n< outline->n_points;n++)
Definition: ftbbox.c:494
FT_Face face
Definition: cffdrivr.c:659
char * getenv()
voidp calloc()
int num
Definition: disdvi.c:621
#define buf
#define fclose
Definition: debug.h:100
void * address
Definition: simpletypes.h:62
#define strncasecmp
Definition: win32lib.h:115
#define malloc
Definition: alloca.c:91
#define sprintf
Definition: snprintf.c:44
#define int8
Definition: unibasics.h:54
hb_script_t Script
Definition: luaharfbuzz.h:18
long ucs
Definition: main-euc.c:16
dictionary off
Definition: fc-lang.py:226
size_t GlyphCount(const void *pMaxp)
Definition: TtfUtil.cpp:361
#define version
Definition: nup.c:10
#define OTF_ERROR_FT_FACE
Definition: otf.h:1665
unsigned OTF_Offset
Definition: otf.h:90
unsigned OTF_GlyphID
Definition: otf.h:89
#define OTF_ERROR_MEMORY
Definition: otf.h:1621
#define OTF_ERROR_FILE
Definition: otf.h:1628
OTF_ValueFormat
Definition: otf.h:814
@ OTF_YPlacement
Definition: otf.h:816
@ OTF_YPlaDevice
Definition: otf.h:820
@ OTF_XAdvance
Definition: otf.h:817
@ OTF_YAdvDevice
Definition: otf.h:822
@ OTF_XPlaDevice
Definition: otf.h:819
@ OTF_XAdvDevice
Definition: otf.h:821
@ OTF_XPlacement
Definition: otf.h:815
@ OTF_YAdvance
Definition: otf.h:818
unsigned OTF_Tag
Definition: otf.h:88
#define OTF_max_nameID
Definition: otf.h:128
#define OTF_ERROR_TABLE
Definition: otf.h:1634
static const Mapping features[]
Definition: otfdescrip.cc:537
static int read_offset_table(OTF *otf, OTF_Stream *stream, OTF_OffsetTable *table)
Definition: otfopen.c:2753
static unsigned read_rule_set_list(OTF *otf, OTF_Stream *stream, long offset, OTF_RuleSet **set)
Definition: otfopen.c:1482
static int read_lookup_list(OTF *otf, OTF_Stream *stream, long offset, OTF_LookupList *list, int gsubp)
Definition: otfopen.c:1370
#define OTF_MALLOC(p, size, arg)
Definition: otfopen.c:352
static unsigned read_chain_class_set_list(OTF *otf, OTF_Stream *stream, long offset, OTF_ChainClassSet **set)
Definition: otfopen.c:1705
static int read_header_part(OTF *otf, FILE *fp, FT_Face face)
Definition: otfopen.c:2785
void * OTF_get_data(OTF *otf, char *id)
Definition: otfopen.c:3305
static unsigned read_chain_rule_list(OTF *otf, OTF_Stream *stream, long offset, OTF_ChainRule **rule)
Definition: otfopen.c:1587
#define READ_TAG
Definition: otfopen.c:257
#define READ_SHORT(stream, var)
Definition: otfopen.c:204
static void * read_name_table(OTF *otf, OTF_TableInfo *table, enum OTF_ReaderFlag flag)
Definition: otfopen.c:485
static int read_device_table(OTF *otf, OTF_Stream *stream, long offset, OTF_DeviceTable *table)
Definition: otfopen.c:1060
void OTF_close(OTF *otf)
Definition: otfopen.c:3045
static OTF_PairSet * read_pair_set_list(OTF *otf, OTF_Stream *stream, long offset, unsigned num, enum OTF_ValueFormat bit1, enum OTF_ValueFormat bit2)
Definition: otfopen.c:2350
static unsigned read_entry_exit_list(OTF *otf, OTF_Stream *stream, long offset, OTF_EntryExitRecord **rec)
Definition: otfopen.c:2408
static int read_class_def(OTF *otf, OTF_Stream *stream, long offset, OTF_ClassDef *class)
Definition: otfopen.c:1024
#define READ_USHORT(stream, var)
Definition: otfopen.c:196
OTF_Tag OTF_tag(const char *name)
Definition: otfopen.c:3252
int debug_flag
Definition: otfopen.c:61
static int read_value_record(OTF *otf, OTF_Stream *stream, long offset, enum OTF_ValueFormat bit, OTF_ValueRecord *value_record)
Definition: otfopen.c:2196
#define RESTORE_STREAM(stream, state)
Definition: otfopen.c:182
void OTF_tag_name(OTF_Tag tag, char *name)
Definition: otfopen.c:3266
static unsigned read_rule_list(OTF *otf, OTF_Stream *stream, long offset, OTF_Rule **rule)
Definition: otfopen.c:1443
int OTF_get_scripts(OTF *otf, int gsubp)
Definition: otfopen.c:3119
static unsigned read_range_records(OTF *otf, OTF_Stream *stream, OTF_RangeRecord **record)
Definition: otfopen.c:920
static unsigned read_chain_rule_set_list(OTF *otf, OTF_Stream *stream, long offset, OTF_ChainRuleSet **set)
Definition: otfopen.c:1626
static OTF_Tag read_table_directory(OTF_Stream *stream, OTF_TableDirectory *table)
Definition: otfopen.c:2766
static void * read_cmap_table(OTF *otf, OTF_TableInfo *table, enum OTF_ReaderFlag flag)
Definition: otfopen.c:610
#define READ_BYTES(stream, p, nbytes)
Definition: otfopen.c:249
int OTF_check_features(OTF *otf, int gsubp, OTF_Tag script, OTF_Tag language, const OTF_Tag *features, int n_features)
Definition: otfopen.c:3173
#define READ_FIXED(stream, fixed)
Definition: otfopen.c:242
OTF * OTF_open_ft_face(FT_Face face)
Definition: otfopen.c:3009
static int read_caret_value(OTF *otf, OTF_Stream *stream, long offset, OTF_CaretValue *caret)
Definition: otfopen.c:1156
static int read_chain_context1(OTF *otf, OTF_Stream *stream, long offset, OTF_Coverage *coverage, OTF_ChainContext1 *chain_context1)
Definition: otfopen.c:1784
int OTF_put_data(OTF *otf, char *id, void *data, void(*freer)(void *data))
Definition: otfopen.c:3276
static int read_lig_caret_list(OTF *otf, OTF_Stream *stream, long offset, OTF_LigCaretList *list)
Definition: otfopen.c:1181
#define SAVE_STREAM(stream, state)
Definition: otfopen.c:181
int OTF_get_features(OTF *otf, int gsubp)
Definition: otfopen.c:3144
static int read_coverage(OTF *otf, OTF_Stream *stream, long offset, OTF_Coverage *coverage)
Definition: otfopen.c:942
static void set_debug_flag()
Definition: otfopen.c:64
static OTF_TableInfo * get_table_info(OTF *otf, const char *name)
Definition: otfopen.c:2906
#define OTF_CALLOC(p, size, arg)
Definition: otfopen.c:370
#define OTF_MEMORY_RECORD_SIZE
Definition: otfopen.c:279
static unsigned read_alternate_set_list(OTF *otf, OTF_Stream *stream, long offset, OTF_AlternateSet **altset)
Definition: otfopen.c:1974
static int read_glyph_ids(OTF *otf, OTF_Stream *stream, OTF_GlyphID **ids, int minus, int count)
Definition: otfopen.c:902
#define READ_UINT24(stream, var)
Definition: otfopen.c:212
static OTF_EncodingSubtable14 * read_cmap_uvs_table(OTF *otf, OTF_Stream *stream, OTF_Offset offset)
Definition: otfopen.c:531
static int read_lookup_subtable_gsub(OTF *otf, OTF_Stream *stream, long offset, unsigned type, OTF_LookupSubTableGSUB *subtable)
Definition: otfopen.c:2028
static int read_lookup_record_list(OTF *otf, OTF_Stream *stream, OTF_LookupRecord **record, int count)
Definition: otfopen.c:1424
static void * read_gsub_table(OTF *otf, OTF_TableInfo *table, enum OTF_ReaderFlag flag)
Definition: otfopen.c:2187
static void free_stream(OTF_Stream *stream)
Definition: otfopen.c:174
static int read_anchor(OTF *otf, OTF_Stream *stream, long offset, OTF_Anchor *anchor)
Definition: otfopen.c:2253
static int read_ligature_array(OTF *otf, OTF_Stream *stream, long offset, unsigned class_count, OTF_LigatureArray *array)
Definition: otfopen.c:2472
static void * read_gdef_table(OTF *otf, OTF_TableInfo *table, enum OTF_ReaderFlag flag)
Definition: otfopen.c:1226
static unsigned read_class_set_list(OTF *otf, OTF_Stream *stream, long offset, OTF_ClassSet **set)
Definition: otfopen.c:1555
static void * read_gpos_table(OTF *otf, OTF_TableInfo *table, enum OTF_ReaderFlag flag)
Definition: otfopen.c:2717
static int read_lookup_subtable_gpos(OTF *otf, OTF_Stream *stream, long offset, unsigned type, OTF_LookupSubTableGPOS *subtable)
Definition: otfopen.c:2497
static int read_class_def_without_offset(OTF *otf, OTF_Stream *stream, OTF_ClassDef *class)
Definition: otfopen.c:992
static int read_coverage_list(OTF *otf, OTF_Stream *stream, long offset, OTF_Coverage **coverage, int count)
Definition: otfopen.c:972
static int read_ligature(OTF *otf, OTF_Stream *stream, long offset, OTF_Ligature **ligature)
Definition: otfopen.c:1918
#define READ_GLYPHID
Definition: otfopen.c:261
static void * read_head_table(OTF *otf, OTF_TableInfo *table, enum OTF_ReaderFlag flag)
Definition: otfopen.c:391
static OTF_Stream * make_stream_from_ft_face(FT_Face face, const char *name)
Definition: otfopen.c:144
static void * read_gsub_gpos_table(OTF *otf, OTF_TableInfo *table, int gsubp, enum OTF_ReaderFlag flag)
Definition: otfopen.c:1846
static unsigned read_chain_class_rule_list(OTF *otf, OTF_Stream *stream, long offset, OTF_ChainClassRule **rule)
Definition: otfopen.c:1660
static int read_mark_array(OTF *otf, OTF_Stream *stream, long offset, OTF_MarkArray *array)
Definition: otfopen.c:2292
static int read_context1(OTF *otf, OTF_Stream *stream, long offset, OTF_Coverage *coverage, OTF_Context1 *context1)
Definition: otfopen.c:1737
static int read_context3(OTF *otf, OTF_Stream *stream, long offset, OTF_Coverage *coverage, OTF_Context3 *context3)
Definition: otfopen.c:1764
OTF * OTF_open(const char *otf_name)
Definition: otfopen.c:2953
OTF_ReaderFlag
Definition: otfopen.c:291
@ OTF_READ_FULL
Definition: otfopen.c:292
@ OTF_READ_SCRIPTS
Definition: otfopen.c:293
@ OTF_READ_MAX
Definition: otfopen.c:295
@ OTF_READ_FEATURES
Definition: otfopen.c:294
static unsigned read_ligature_set_list(OTF *otf, OTF_Stream *stream, long offset, OTF_LigatureSet **ligset)
Definition: otfopen.c:1945
int OTF_check_table(OTF *otf, const char *name)
Definition: otfopen.c:3111
#define READ_UINT16
Definition: otfopen.c:259
static int read_anchor_array(OTF *otf, OTF_Stream *stream, long offset, unsigned ClassCount, OTF_AnchorArray *array)
Definition: otfopen.c:2319
static int read_context2(OTF *otf, OTF_Stream *stream, long offset, OTF_Coverage *coverage, OTF_Context2 *context2)
Definition: otfopen.c:1750
static int read_script_list(OTF *otf, OTF_Stream *stream, long offset, OTF_ScriptList *list)
Definition: otfopen.c:1265
#define READ_INT16
Definition: otfopen.c:260
static OTF_MemoryRecord * allocate_memory_record(OTF *otf)
Definition: otfopen.c:337
static unsigned read_sequence(OTF *otf, OTF_Stream *stream, long offset, OTF_Sequence **seq)
Definition: otfopen.c:1893
static int read_attach_list(OTF *otf, OTF_Stream *stream, long offset, OTF_AttachList *list)
Definition: otfopen.c:1128
#define SEEK_STREAM(stream, offset)
Definition: otfopen.c:183
static int read_name(OTF *otf, OTF_Stream *stream, OTF_NameRecord *rec)
Definition: otfopen.c:414
static int read_feature_list(OTF *otf, OTF_Stream *stream, long offset, OTF_FeatureList *list)
Definition: otfopen.c:1331
#define READ_OFFSET
Definition: otfopen.c:258
static int read_chain_context3(OTF *otf, OTF_Stream *stream, long offset, OTF_Coverage *coverage, OTF_ChainContext3 *chain_context3)
Definition: otfopen.c:1818
static int read_gdef_header(OTF_Stream *stream, OTF_GDEFHeader *header)
Definition: otfopen.c:1213
static unsigned read_class_rule_list(OTF *otf, OTF_Stream *stream, long offset, OTF_ClassRule **rule)
Definition: otfopen.c:1516
static OTF_Stream * make_stream(const char *name)
Definition: otfopen.c:104
static OTF_Class1Record * read_class1_record_list(OTF *otf, OTF_Stream *stream, long offset, unsigned num1, enum OTF_ValueFormat bit1, unsigned num2, enum OTF_ValueFormat bit2)
Definition: otfopen.c:2382
static int setup_stream(OTF_Stream *stream, FILE *fp, long offset, int nbytes)
Definition: otfopen.c:118
static int read_reverse_chain1(OTF *otf, OTF_Stream *stream, long offset, OTF_Coverage *coverage, OTF_GSUB_ReverseChain1 *reverse_chain)
Definition: otfopen.c:2002
#define READ_ULONG(stream, var)
Definition: otfopen.c:221
static int read_chain_context2(OTF *otf, OTF_Stream *stream, long offset, OTF_Coverage *coverage, OTF_ChainContext2 *chain_context2)
Definition: otfopen.c:1798
static int read_ligature_attach(OTF *otf, OTF_Stream *stream, long offset, unsigned ClassCount, OTF_LigatureAttach *attach)
Definition: otfopen.c:2439
long OTF_StreamState
Definition: otfopen.c:101
int OTF_get_table(OTF *otf, const char *name)
Definition: otfopen.c:3086
OTF_TableType
Definition: otfopen.c:269
@ OTF_TABLE_TYPE_GDEF
Definition: otfopen.c:273
@ OTF_TABLE_TYPE_GPOS
Definition: otfopen.c:275
@ OTF_TABLE_TYPE_MAX
Definition: otfopen.c:276
@ OTF_TABLE_TYPE_CMAP
Definition: otfopen.c:272
@ OTF_TABLE_TYPE_GSUB
Definition: otfopen.c:274
@ OTF_TABLE_TYPE_HEAD
Definition: otfopen.c:270
@ OTF_TABLE_TYPE_NAME
Definition: otfopen.c:271
int k
Definition: otp-parser.c:70
unsigned char bit
Definition: pbm.h:9
static int format
Definition: pbmclean.c:15
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
logical rest[4800]
Definition: pmxab.c:91
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
hb_script_t
Definition: hb-common.h:448
#define flag
Definition: round_prec.c:45
FT_String * family_name
Definition: freetype.h:1038
Definition: gsub.h:72
unsigned AnchorFormat
Definition: otf.h:840
unsigned AnchorPoint
Definition: otf.h:845
OTF_Offset offset
Definition: otf.h:839
int YCoordinate
Definition: otf.h:842
int XCoordinate
Definition: otf.h:841
struct OTF_Anchor::@1638::@1640 f2
struct OTF_Anchor::@1638::@1639 f1
OTF_DeviceTable XDeviceTable
Definition: otf.h:848
OTF_DeviceTable YDeviceTable
Definition: otf.h:849
union OTF_Anchor::@1638 f
union OTF_CaretValue::@1632 f
union OTF_CaretValue::@1632::@1635 f3
union OTF_CaretValue::@1632::@1634 f2
OTF_DeviceTable DeviceTable
Definition: otf.h:391
union OTF_CaretValue::@1632::@1633 f1
OTF_Offset offset
Definition: otf.h:380
unsigned CaretValuePoint
Definition: otf.h:387
unsigned CaretValueFormat
Definition: otf.h:381
int Coordinate
Definition: otf.h:384
unsigned ChainRuleSetCount
Definition: otf.h:649
OTF_ChainRuleSet * ChainRuleSet
Definition: otf.h:650
OTF_ChainClassSet * ChainClassSet
Definition: otf.h:659
unsigned ChainClassSetCnt
Definition: otf.h:658
OTF_ClassDef LookaheadClassDef
Definition: otf.h:657
OTF_ClassDef InputClassDef
Definition: otf.h:656
OTF_ClassDef BacktrackClassDef
Definition: otf.h:655
unsigned LookupCount
Definition: otf.h:670
OTF_LookupRecord * LookupRecord
Definition: otf.h:671
OTF_Coverage * Input
Definition: otf.h:667
OTF_Coverage * LookAhead
Definition: otf.h:669
unsigned BacktrackGlyphCount
Definition: otf.h:664
OTF_Coverage * Backtrack
Definition: otf.h:665
unsigned LookaheadGlyphCount
Definition: otf.h:668
unsigned InputGlyphCount
Definition: otf.h:666
OTF_Offset offset
Definition: otf.h:328
OTF_Anchor * LigatureAnchor
Definition: otf.h:958
OTF_RuleSet * RuleSet
Definition: otf.h:626
unsigned RuleSetCount
Definition: otf.h:625
unsigned ClassSetCnt
Definition: otf.h:632
OTF_ClassDef ClassDef
Definition: otf.h:631
OTF_ClassSet * ClassSet
Definition: otf.h:633
OTF_Coverage * Coverage
Definition: otf.h:640
unsigned LookupCount
Definition: otf.h:639
OTF_LookupRecord * LookupRecord
Definition: otf.h:641
unsigned GlyphCount
Definition: otf.h:638
OTF_Offset offset
Definition: otf.h:312
OTF_EncodingSubtable subtable
Definition: otf.h:270
unsigned * glyphs
Definition: otf.h:208
unsigned startCharCode
Definition: otf.h:206
unsigned numChars
Definition: otf.h:207
OTF_cmapGroup * Groups
Definition: otf.h:214
unsigned nGroups
Definition: otf.h:213
OTF_VariationSelectorRecord * Records
Definition: otf.h:245
unsigned nRecords
Definition: otf.h:244
unsigned rangeShift
Definition: otf.h:177
OTF_cmapSegment * segments
Definition: otf.h:178
unsigned searchRange
Definition: otf.h:175
unsigned entrySelector
Definition: otf.h:176
unsigned * glyphIdArray
Definition: otf.h:180
unsigned segCountX2
Definition: otf.h:174
unsigned * glyphIdArray
Definition: otf.h:187
unsigned entryCount
Definition: otf.h:186
unsigned firstCode
Definition: otf.h:185
unsigned nGroups
Definition: otf.h:200
unsigned char is32[8192]
Definition: otf.h:199
OTF_cmapGroup * Groups
Definition: otf.h:201
union OTF_EncodingSubtable::@1627 f
OTF_EncodingSubtable4 * f4
Definition: otf.h:256
unsigned format
Definition: otf.h:250
OTF_Feature * Feature
Definition: otf.h:498
OTF_Offset offset
Definition: otf.h:496
OTF_Tag FeatureTag
Definition: otf.h:487
OTF_Offset LigCaretList
Definition: otf.h:351
OTF_Offset GlyphClassDef
Definition: otf.h:349
OTF_Offset MarkAttachClassDef
Definition: otf.h:352
OTF_Offset AttachList
Definition: otf.h:350
Definition: otf.h:411
OTF_GDEFHeader header
Definition: otf.h:412
OTF_ClassDef glyph_class_def
Definition: otf.h:413
OTF_LigCaretList lig_caret_list
Definition: otf.h:415
OTF_ClassDef mark_attach_class_def
Definition: otf.h:416
OTF_AttachList attach_list
Definition: otf.h:414
unsigned EntryExitCount
Definition: otf.h:932
OTF_EntryExitRecord * EntryExitRecord
Definition: otf.h:933
unsigned ExtensionLookupType
Definition: otf.h:1005
unsigned ExtensionOffset
Definition: otf.h:1006
OTF_LookupSubTableGPOS * ExtensionSubtable
Definition: otf.h:1007
OTF_Coverage BaseCoverage
Definition: otf.h:950
unsigned ClassCount
Definition: otf.h:951
OTF_AnchorArray BaseArray
Definition: otf.h:953
OTF_MarkArray MarkArray
Definition: otf.h:952
OTF_LigatureArray LigatureArray
Definition: otf.h:980
OTF_MarkArray MarkArray
Definition: otf.h:979
OTF_Coverage LigatureCoverage
Definition: otf.h:977
unsigned ClassCount
Definition: otf.h:978
OTF_MarkArray Mark1Array
Definition: otf.h:987
unsigned ClassCount
Definition: otf.h:986
OTF_AnchorArray Mark2Array
Definition: otf.h:988
OTF_Coverage Mark2Coverage
Definition: otf.h:985
unsigned ValueFormat1
Definition: otf.h:896
unsigned PairSetCount
Definition: otf.h:898
unsigned ValueFormat2
Definition: otf.h:897
OTF_PairSet * PairSet
Definition: otf.h:899
unsigned ValueFormat2
Definition: otf.h:916
unsigned Class1Count
Definition: otf.h:919
unsigned ValueFormat1
Definition: otf.h:915
OTF_Class1Record * Class1Record
Definition: otf.h:921
OTF_ClassDef ClassDef1
Definition: otf.h:917
unsigned Class2Count
Definition: otf.h:920
OTF_ClassDef ClassDef2
Definition: otf.h:918
unsigned ValueFormat
Definition: otf.h:869
OTF_ValueRecord Value
Definition: otf.h:870
unsigned ValueCount
Definition: otf.h:876
unsigned ValueFormat
Definition: otf.h:875
OTF_ValueRecord * Value
Definition: otf.h:877
unsigned AlternateSetCount
Definition: otf.h:716
OTF_AlternateSet * AlternateSet
Definition: otf.h:717
unsigned ExtensionLookupType
Definition: otf.h:765
unsigned ExtensionOffset
Definition: otf.h:766
OTF_LookupSubTableGSUB * ExtensionSubtable
Definition: otf.h:767
OTF_FeatureList FeatureList
Definition: otf.h:680
OTF_ScriptList ScriptList
Definition: otf.h:679
OTF_Fixed Version
Definition: otf.h:678
OTF_LookupList LookupList
Definition: otf.h:681
unsigned LigSetCount
Definition: otf.h:732
OTF_LigatureSet * LigatureSet
Definition: otf.h:733
unsigned SequenceCount
Definition: otf.h:701
OTF_Sequence * Sequence
Definition: otf.h:702
unsigned BacktrackGlyphCount
Definition: otf.h:772
OTF_Coverage * LookAhead
Definition: otf.h:775
unsigned GlyphCount
Definition: otf.h:776
OTF_GlyphID * Substitute
Definition: otf.h:777
unsigned LookaheadGlyphCount
Definition: otf.h:774
OTF_Coverage * Backtrack
Definition: otf.h:773
int DeltaGlyphID
Definition: otf.h:688
OTF_GlyphID * Substitute
Definition: otf.h:694
unsigned GlyphCount
Definition: otf.h:693
OTF_Stream * header_stream
Definition: otfopen.c:327
OTF_TableInfo table_info[OTF_TABLE_TYPE_MAX]
Definition: otfopen.c:324
OTF_MemoryRecord * memory_record
Definition: otfopen.c:330
OTF_ApplicationData * app_data
Definition: otfopen.c:333
unsigned ComponentCount
Definition: otf.h:964
OTF_ComponentRecord * ComponentRecord
Definition: otf.h:965
OTF_Offset offset
Definition: otf.h:963
OTF_Lookup * Lookup
Definition: otf.h:534
OTF_Offset offset
Definition: otf.h:532
OTF_GPOS_Cursive1 cursive1
Definition: otf.h:1023
OTF_GPOS_MarkMark1 mark_mark1
Definition: otf.h:1029