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)  

luafflib.c
Go to the documentation of this file.
1 /* luafflib.c
2 
3  Copyright 2007-2010 Taco Hoekwater <taco@luatex.org>
4 
5  This file is part of LuaTeX.
6 
7  LuaTeX is free software; you can redistribute it and/or modify it under
8  the terms of the GNU General Public License as published by the Free
9  Software Foundation; either version 2 of the License, or (at your
10  option) any later version.
11 
12  LuaTeX is distributed in the hope that it will be useful, but WITHOUT
13  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14  FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
15  License for more details.
16 
17  You should have received a copy of the GNU General Public License along
18  with LuaTeX; if not, see <http://www.gnu.org/licenses/>. */
19 
20 /**
21 * @desc Support interface for fontforge 20070607
22 * @version 1.0
23 * @author Taco Hoekwater
24 */
25 
26 #ifdef _MSC_VER
27 #define boolean my_boolean
28 typedef char * string;
29 typedef const char * const_string;
30 typedef int integer;
31 typedef int boolean;
32 #include "w32snprintf.h"
33 extern char *xstrdup(const char *s);
34 #endif
35 
36 #include "pfaedit.h"
37 #include "ustring.h"
38 #include "lib/lib.h" /* web2c's lib, for recorder_record_input */
39 
40 #include "ffdummies.h"
41 #include "splinefont.h"
42 
43 #define FONT_METATABLE "fontloader.splinefont"
44 #define FONT_SUBFONT_METATABLE "fontloader.splinefont.subfont"
45 #define FONT_GLYPHS_METATABLE "fontloader.splinefont.glyphs"
46 #define FONT_GLYPH_METATABLE "fontloader.splinefont.glyph"
47 
48 #define LUA_OTF_VERSION "0.5"
49 
50 extern void normal_error(const char *t, const char *p);
51 extern void formatted_error(const char *t, const char *fmt, ...);
52 
53 static const char *possub_type_enum[] = {
54  "null", "position", "pair", "substitution",
55  "alternate", "multiple", "ligature", "lcaret",
56  "kerning", "vkerning", "anchors", "contextpos",
57  "contextsub", "chainpos", "chainsub", "reversesub",
58  "max", "kernback", "vkernback", NULL
59 };
60 
61 #define LAST_POSSUB_TYPE_ENUM 18
62 
63 #define eight_nulls() NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL
64 
65 static const char *otf_lookup_type_enum[] = {
66  "gsub_start", "gsub_single", "gsub_multiple", "gsub_alternate",
67  "gsub_ligature", "gsub_context", "gsub_contextchain", NULL,
68  "gsub_reversecontextchain", NULL, NULL, NULL, NULL, NULL, NULL, NULL, /*0x00F */
84  "gpos_start", "gpos_single", "gpos_pair", "gpos_cursive",
85  "gpos_mark2base", "gpos_mark2ligature", "gpos_mark2mark", "gpos_context",
86  "gpos_contextchain", NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* 0x10F */
102 };
103 
104 static const char *anchor_type_enum[] = {
105  "mark", "basechar", "baselig", "basemark", "centry", "cexit", "max", NULL
106 };
107 
108 #define MAX_ANCHOR_TYPE 7
109 
110 static const char *anchorclass_type_enum[] = {
111  "mark", "mkmk", "curs", "mklg", NULL
112 };
113 
114 static const char *glyph_class_enum[] = {
115  "automatic", "none", "base", "ligature", "mark", "component", NULL
116 };
117 
118 static const char *ttfnames_enum[ttf_namemax] = {
119  "copyright", "family", "subfamily", "uniqueid",
120  "fullname", "version", "postscriptname", "trademark",
121  "manufacturer", "designer", "descriptor", "venderurl",
122  "designerurl", "license", "licenseurl", "idontknow",
123  "preffamilyname", "prefmodifiers", "compatfull", "sampletext",
124  "cidfindfontname", "wwsfamily", "wwssubfamily"
125 };
126 
127 static const char *fpossub_format_enum[] = {
128  "glyphs", "class", "coverage", "reversecoverage", NULL
129 };
130 
131 static const char *tex_type_enum[4] = { "unset", "text", "math", "mathext" };
132 
133 /* has an offset of 1, ui_none = 0. */
134 static const char *uni_interp_enum[9] = {
135  "unset", "none", "adobe", "greek", "japanese",
136  "trad_chinese", "simp_chinese", "korean", "ams"
137 };
138 
139 #define check_isfont(L,b) (SplineFont **)luaL_checkudata(L,b,FONT_METATABLE)
140 #define check_isglyph(L,b) (struct splinechar **)luaL_checkudata(L,b,FONT_GLYPH_METATABLE)
141 
142 /* forward declarations */
143 static void handle_generic_pst(lua_State * L, struct generic_pst *pst);
144 static void handle_generic_fpst(lua_State * L, struct generic_fpst *fpst);
145 static void handle_kernclass(lua_State * L, struct kernclass *kerns, const char *name);
146 static void handle_splinefont(lua_State * L, struct splinefont *sf);
147 static void handle_kernpair(lua_State * L, struct kernpair *kp);
148 static void handle_liglist(lua_State * L, struct liglist *ligofme);
149 static void handle_anchorpoint(lua_State * L, struct anchorpoint *anchor);
150 
151 static int is_userdata(lua_State *L, int b, const char *utype)
152 {
153  if (lua_type(L,b) == LUA_TUSERDATA) {
154  lua_getmetatable(L, b);
155  luaL_getmetatable(L, utype);
156  if (lua_compare(L, -2, -1, LUA_OPEQ)) {
157  lua_pop(L,2);
158  return 1;
159  }
160  lua_pop(L,2);
161  }
162  return 0;
163 }
164 
166 {
167  SplineFont **a;
168  if (sf == NULL) {
169  lua_pushnil(L);
170  } else {
171  a = lua_newuserdata(L, sizeof(SplineFont *));
172  *a = sf;
174  lua_setmetatable(L, -2);
175  }
176  return;
177 }
178 
180 {
181  SplineFont **a;
182  if (sf == NULL) {
183  lua_pushnil(L);
184  } else {
185  a = lua_newuserdata(L, sizeof(SplineFont *));
186  *a = sf;
188  lua_setmetatable(L, -2);
189  }
190  return;
191 }
192 
193 static void lua_ff_pushglyph(lua_State * L, struct splinechar *sc)
194 {
195  struct splinechar **a;
196  if (sc == NULL) {
197  lua_pushnil(L);
198  } else {
199  a = lua_newuserdata(L, sizeof(struct splinechar *));
200  *a = sc;
202  lua_setmetatable(L, -2);
203  }
204  return;
205 }
206 
207 
208 static int ff_open(lua_State * L)
209 {
210  SplineFont *sf;
211  const char *fontname;
212  FILE *l;
213  char s[511];
214  size_t len;
215  int args, i;
216  int openflags = 1 + 4;
218  /* test fontname for existance */
219  if ((l = fopen(fontname, "r"))) {
221  fclose(l);
222  } else {
223  lua_pushnil(L);
224  lua_pushfstring(L, "font loading failed for %s (read error)\n", fontname);
225  return 2;
226  }
227  args = lua_gettop(L);
228  if (args >= 2 && (lua_type(L, 2) == LUA_TSTRING)) {
229  len = strlen(fontname);
230  if (*(fontname + len) != ')') {
231  /* possibly fails for embedded parens in the font name */
232  if (len == 0) {
233  snprintf(s, 511, "%s", fontname);
234  } else {
235  snprintf(s, 511, "%s(%s)", fontname, lua_tolstring(L, 2, &len));
236  }
237  }
238  } else {
239  snprintf(s, 511, "%s", fontname);
240  }
241  if (strlen(s) > 0) {
242  gww_error_count = 0;
243  sf = ReadSplineFont((char *) s, openflags);
244  if (sf == NULL) {
245  lua_pushnil(L);
246  lua_pushfstring(L, "font loading failed for %s\n", s);
247  if (gww_error_count > 0) {
248  for (i = 0; i < gww_error_count; i++) {
250  lua_concat(L, 2);
251  }
253  }
254  } else {
256  lua_ff_pushfont(L, sf);
257  if (gww_error_count > 0) {
258  lua_newtable(L);
259  for (i = 0; i < gww_error_count; i++) {
261  lua_rawseti(L, -2, (i + 1));
262  }
264  } else {
265  lua_pushnil(L);
266  }
267  }
268  } else {
269  lua_pushnil(L);
270  lua_pushfstring(L, "font loading failed: empty string given\n", fontname);
271  }
272  return 2;
273 }
274 
275 static int ff_close(lua_State * L)
276 {
277  SplineFont **sf;
278  /*fputs("ff_close called",stderr); */
279  sf = check_isfont(L, 1);
280  if (*sf != NULL) {
281  if ((*sf)->fv) { /* condition might be improved */
282  FontViewClose((*sf)->fv);
283  } else {
284  EncMapFree((*sf)->map);
285  SplineFontFree(*sf);
286  }
287  *sf = NULL;
288  }
289  return 0;
290 }
291 
292 /*
293 static int notdef_loc(SplineFont * sf)
294 {
295  int k;
296  int l = -1;
297  for (k = 0; k < sf->glyphcnt; k++) {
298  if (sf->glyphs[k]) {
299  if (strcmp(sf->glyphs[k]->name, ".notdef") == 0) {
300  l = k;
301  }
302  }
303  }
304  if (l == -1)
305  l = sf->glyphcnt;
306  return l;
307 }
308 */
309 
310 static int notdef_loc(SplineFont * sf)
311 {
312  int k;
313  for (k = 0; k < sf->glyphcnt; k++) {
314  if (sf->glyphs[k]) {
315  if (strcmp(sf->glyphs[k]->name, ".notdef") == 0) {
316  return k ;
317  }
318  }
319  }
320  return -1;
321 }
322 
324 {
325  SplineFont **sf;
326  char *fname;
327  sf = check_isfont(L, 1);
331  free(fname);
332  if (gww_error_count > 0) {
333  int i;
334  lua_newtable(L);
335  for (i = 0; i < gww_error_count; i++) {
337  lua_rawseti(L, -2, (i + 1));
338  }
340  } else {
341  lua_pushnil(L);
342  }
343  return 1;
344 }
345 
347 {
348  SplineFont **sf;
349  const char *fname;
350  sf = check_isfont(L, 1);
351  fname = luaL_checkstring(L, 2);
352  CheckAfmOfPostscript(*sf, fname, (*sf)->map);
353  if (gww_error_count > 0) {
354  int i;
355  lua_newtable(L);
356  for (i = 0; i < gww_error_count; i++) {
358  lua_rawseti(L, -2, (i + 1));
359  }
361  } else {
362  lua_pushnil(L);
363  }
364  return 1;
365 }
366 
367 static void dump_intfield(lua_State * L, const char *name, long int field)
368 {
369  lua_checkstack(L, 2);
372  lua_rawset(L, -3);
373 }
374 
375 static void dump_uintfield(lua_State * L, const char *name, unsigned int field)
376 {
377  lua_checkstack(L, 2);
380  lua_rawset(L, -3);
381 }
382 
383 static void dump_realfield(lua_State * L, const char *name, real field)
384 {
385  lua_checkstack(L, 2);
388  lua_rawset(L, -3);
389 }
390 
391 #define dump_cond_intfield(a,b,c) if ((c)!=0) { dump_intfield ((a),(b),(c)); }
392 
393 static void dump_stringfield(lua_State * L, const char *name, const char *field)
394 {
395  lua_checkstack(L, 2);
398  lua_rawset(L, -3);
399 }
400 
401 static void dump_char_ref(lua_State * L, struct splinechar *spchar)
402 {
403  lua_checkstack(L, 2);
404  lua_pushstring(L, "char");
405  lua_pushstring(L, spchar->name);
406  lua_rawset(L, -3);
407 }
408 
409 static void dump_lstringfield(lua_State * L, const char *name, char *field, int len)
410 {
411  lua_checkstack(L, 2);
414  lua_rawset(L, -3);
415 }
416 
417 static void dump_enumfield(lua_State * L, const char *name, int fid, const char **fields)
418 {
419  lua_checkstack(L, 2);
421  lua_pushstring(L, fields[fid]);
422  lua_rawset(L, -3);
423 }
424 
425 static void dump_floatfield(lua_State * L, const char *name, double field)
426 {
427  lua_checkstack(L, 2);
430  lua_rawset(L, -3);
431 }
432 
433 static char tag_string[5] = { 0 };
434 
435 static char *make_tag_string(unsigned int field)
436 {
437  tag_string[0] = (field & 0xFF000000) >> 24;
438  tag_string[1] = (field & 0x00FF0000) >> 16;
439  tag_string[2] = (field & 0x0000FF00) >> 8;
440  tag_string[3] = (field & 0x000000FF);
441  return (char *) tag_string;
442 }
443 
444 static void dump_tag(lua_State * L, const char *name, unsigned int field)
445 {
446  lua_checkstack(L, 2);
449  lua_rawset(L, -3);
450 }
451 
452 static void dump_subtable_name(lua_State * L, const char *name, struct lookup_subtable *s)
453 {
454  /* this is likely a backref */
455  if (s == NULL)
456  return;
457  lua_checkstack(L, 2);
458  if (s->next == NULL) {
459  dump_stringfield(L, name, s->subtable_name);
460  } else {
461  /* can this really happen ? */
462  int i = 0;
463  lua_newtable(L);
464  while (s != NULL) {
465  lua_pushstring(L, s->subtable_name);
466  lua_rawseti(L, -2, ++i);
467  s = s->next;
468  }
469  lua_setfield(L, -2, name);
470  }
471 }
472 
473 #define NESTED_TABLE(a,b,c) { \
474  int k = 1;\
475  next = b; \
476  while (next != NULL) { \
477  lua_checkstack(L,2); \
478  lua_pushinteger(L,k); k++; \
479  lua_createtable(L,0,c); \
480  a(L, next); \
481  lua_rawset(L,-3); \
482  next = next->next; \
483  } \
484 }
485 
486 #define NESTED_TABLE_SF(a,b,c,d) { \
487  int k = 1; \
488  next = b; \
489  while (next != NULL) { \
490  lua_checkstack(L,2); \
491  lua_pushinteger(L,k); k++; \
492  lua_createtable(L,0,d); \
493  if (a(L, next, c)) \
494  lua_rawset(L,-3); \
495  else { \
496  lua_pop(L,2); \
497  } \
498  next = next->next; \
499  } \
500 }
501 
503 {
504  int k;
505  dump_tag(L, "script", sl->script);
506 
507  lua_checkstack(L, 3);
508  lua_newtable(L);
509  for (k = 0; k < MAX_LANG; k++) {
510  if (sl->langs[k] != 0) {
511  lua_pushinteger(L, (k + 1));
513  lua_rawset(L, -3);
514  }
515  }
516 
517  if (sl->lang_cnt >= MAX_LANG) {
518  for (k = MAX_LANG; k < sl->lang_cnt; k++) {
519  lua_pushinteger(L, (k + 1));
521  lua_rawset(L, -3);
522  }
523  }
524  lua_setfield(L, -2, "langs");
525 }
526 
527 static void handle_scriptlanglist(lua_State * L, struct scriptlanglist *sll)
528 {
529  struct scriptlanglist *next;
531 }
532 
533 static void
536 {
537  dump_tag(L, "tag", features->featuretag);
538  lua_newtable(L);
539  handle_scriptlanglist(L, features->scripts);
540  lua_setfield(L, -2, "scripts");
541 }
542 
543 static void
546 {
547  struct featurescriptlanglist *next;
549 }
550 
551 static void do_handle_lookup_subtable(lua_State * L, struct lookup_subtable *subtable)
552 {
553 
554  dump_stringfield(L, "name", subtable->subtable_name);
555  dump_stringfield(L, "suffix", subtable->suffix);
556 
557  /* struct otlookup *lookup; *//* this is the parent */
558 
559  /* dump_intfield (L,"unused", subtable->unused); */
560  /* The next one is true if there is no fpst, false otherwise */
561  /*
562  dump_intfield (L,"per_glyph_pst_or_kern",subtable->per_glyph_pst_or_kern);
563  */
564  dump_cond_intfield(L, "anchor_classes", subtable->anchor_classes);
565  dump_cond_intfield(L, "vertical_kerning", subtable->vertical_kerning);
566 
567  if (subtable->kc != NULL) {
568  lua_newtable(L);
569  handle_kernclass(L, subtable->kc, subtable->subtable_name);
570  lua_setfield(L, -2, "kernclass");
571  }
572 #if 0
573  if (subtable->fpst != NULL) {
574  /* lua_newtable(L); */
575  handle_generic_fpst(L, subtable->fpst);
576  /* lua_setfield(L,-2, "fpst"); */
577  }
578 #endif
579 
580  /* int subtable_offset; *//* used by OTF file generation */
581  /* int32 *extra_subtables; *//* used by OTF file generation */
582 }
583 
584 static void handle_lookup_subtable(lua_State * L, struct lookup_subtable *subtable)
585 {
586  struct lookup_subtable *next;
588 }
589 
591 {
592  int mc;
593 
594  dump_enumfield(L, "type", lookup->lookup_type, otf_lookup_type_enum);
595 
596  lua_newtable(L);
597  if (lookup->lookup_flags & pst_r2l) {
598  lua_pushstring(L, "r2l");
599  lua_pushboolean(L, 1);
600  lua_rawset(L, -3);
601  }
602  if (lookup->lookup_flags & pst_ignorebaseglyphs) {
603  lua_pushstring(L, "ignorebaseglyphs");
604  lua_pushboolean(L, 1);
605  lua_rawset(L, -3);
606  }
607  if (lookup->lookup_flags & pst_ignoreligatures) {
608  lua_pushstring(L, "ignoreligatures");
609  lua_pushboolean(L, 1);
610  lua_rawset(L, -3);
611  }
612  if (lookup->lookup_flags & pst_ignorecombiningmarks) {
613  lua_pushstring(L, "ignorecombiningmarks");
614  lua_pushboolean(L, 1);
615  lua_rawset(L, -3);
616  }
617  mc = (lookup->lookup_flags >> 8);
618  if (mc > 0 && mc < sf->mark_class_cnt && sf->mark_class_names[mc] != NULL) {
619  lua_pushstring(L, "mark_class");
620  lua_pushstring(L, sf->mark_class_names[mc]);
621  lua_rawset(L, -3);
622  }
623  lua_setfield(L, -2, "flags");
624 
625  dump_stringfield(L, "name", lookup->lookup_name);
626 
627  if (lookup->features != NULL) {
628  lua_newtable(L);
630  lua_setfield(L, -2, "features");
631  }
632 
633  if (lookup->subtables != NULL) {
634  lua_newtable(L);
635  handle_lookup_subtable(L, lookup->subtables);
636  lua_setfield(L, -2, "subtables");
637  }
638 
639  /* dump_intfield (L,"unused", lookup->unused); */
640  /* dump_intfield (L,"empty", lookup->empty); */
641  /* dump_intfield (L,"store_in_afm", lookup->store_in_afm); */
642  /* dump_intfield (L,"needs_extension", lookup->needs_extension); */
643  /* dump_intfield (L,"temporary_kern", lookup->temporary_kern); */
644  /* dump_intfield (L,"def_lang_checked", lookup->def_lang_checked); */
645  /* dump_intfield (L,"def_lang_found", lookup->def_lang_found); */
646  /* dump_intfield (L,"ticked", lookup->ticked); */
647  /* dump_intfield (L,"subcnt", lookup->subcnt); */
648  /* dump_intfield (L,"lookup_index", lookup->lookup_index); *//* identical to array index */
649  /* dump_intfield (L,"lookup_offset", lookup->lookup_offset); */
650  /* dump_intfield (L,"lookup_length", lookup->lookup_length); */
651  /* dump_stringfield(L,"tempname", lookup->tempname); */
652  return 1;
653 }
654 
656 {
657  struct otlookup *next;
658  NESTED_TABLE_SF(do_handle_lookup, lookup, sf, 18); /* 18 is a guess */
659 }
660 
661 static void do_handle_kernpair(lua_State * L, struct kernpair *kp)
662 {
663 
664  if (kp->sc != NULL)
665  dump_char_ref(L, kp->sc);
666  dump_intfield(L, "off", kp->off);
667  /* uint16 kcid; *//* temporary value */
668  dump_subtable_name(L, "lookup", kp->subtable);
669 }
670 
671 static void handle_kernpair(lua_State * L, struct kernpair *kp)
672 {
673  struct kernpair *next;
675 }
676 
677 static void handle_splinecharlist(lua_State * L, struct splinecharlist *scl)
678 {
679 
680  struct splinecharlist *next = scl;
681  int k = 1;
682  lua_checkstack(L, 10);
683  while (next != NULL) {
684  if (next->sc != NULL) {
685  lua_pushinteger(L, k);
686  k++;
687  lua_pushstring(L, next->sc->name);
688  lua_rawset(L, -3);
689  }
690  next = next->next;
691  }
692 }
693 
694 /* vs is the "variation selector" a unicode codepoint which modifieds */
695 /* the code point before it. If vs is -1 then unienc is just an */
696 /* alternate encoding (greek Alpha and latin A), but if vs is one */
697 /* of unicode's variation selectors then this glyph is somehow a */
698 /* variant shape. The specifics depend on the selector and script */
699 /* fid is currently unused, but may, someday, be used to do ttcs */
700 /* NOTE: GlyphInfo displays vs==-1 as vs==0, and fixes things up */
701 
702 static int handle_altuni(lua_State * L, struct altuni *au)
703 {
704  struct altuni *next = au;
705  int i = 0;
706  int k = 1;
707  lua_checkstack(L, 3);
708  while (next != NULL) {
709  if (next->unienc<0x10FFFF) {
710  lua_newtable(L);
711  dump_intfield(L, "unicode", next->unienc);
712  i++;
713  if (next->vs != -1) {
714  dump_intfield(L, "variant", next->vs);
715  /* dump_intfield(L, "fid", next->fid); */
716  }
717  lua_rawseti(L, -2, k++);
718  } else {
719  printf("ignoring variant %i %i\n",next->unienc,next->vs);
720  }
721  next = next->next;
722  }
723  return i;
724 }
725 
726 #define interesting_vr(a) (((a)->xoff!=0) || ((a)->yoff!=0) || ((a)->h_adv_off!=0) || ((a)->v_adv_off!=0))
727 
728 static void handle_vr(lua_State * L, struct vr *pos)
729 {
730 
731  dump_cond_intfield(L, "x", pos->xoff);
732  dump_cond_intfield(L, "y", pos->yoff);
733  dump_cond_intfield(L, "h", pos->h_adv_off);
734  dump_cond_intfield(L, "v", pos->v_adv_off);
735 
736 }
737 
738 static void do_handle_generic_pst(lua_State * L, struct generic_pst *pst)
739 {
740  int k;
741  if (pst->type > LAST_POSSUB_TYPE_ENUM) {
742  dump_tag(L, "type", pst->type);
743  } else {
744  dump_enumfield(L, "type", pst->type, possub_type_enum);
745  }
746  /* unsigned int ticked: 1; */
747  /* unsigned int temporary: 1; *//* Used in afm ligature closure */
748  /* struct lookup_subtable *subtable; *//* handled by caller */
749 
750  lua_checkstack(L, 4);
751  lua_pushstring(L, "specification");
752  lua_createtable(L, 0, 4);
753  if (pst->type == pst_position) {
754  handle_vr(L, &pst->u.pos);
755  } else if (pst->type == pst_pair) {
756  dump_stringfield(L, "paired", pst->u.pair.paired);
757  if (pst->u.pair.vr != NULL) {
758  lua_pushstring(L, "offsets");
759  lua_createtable(L, 2, 0);
760  if (interesting_vr(pst->u.pair.vr)) {
761  lua_createtable(L, 0, 4);
762  handle_vr(L, pst->u.pair.vr);
763  lua_rawseti(L, -2, 1);
764  }
765  if (interesting_vr(pst->u.pair.vr + 1)) {
766  lua_createtable(L, 0, 4);
767  handle_vr(L, pst->u.pair.vr + 1);
768  lua_rawseti(L, -2, 2);
769  }
770  lua_rawset(L, -3);
771  }
772  } else if (pst->type == pst_substitution) {
773  dump_stringfield(L, "variant", pst->u.subs.variant);
774  } else if (pst->type == pst_alternate) {
775  dump_stringfield(L, "components", pst->u.mult.components);
776  } else if (pst->type == pst_multiple) {
777  dump_stringfield(L, "components", pst->u.alt.components);
778  } else if (pst->type == pst_ligature) {
779  dump_stringfield(L, "components", pst->u.lig.components);
780  if (pst->u.lig.lig != NULL) {
781  dump_char_ref(L, pst->u.lig.lig);
782  }
783  } else if (pst->type == pst_lcaret) {
784  for (k = 0; k < pst->u.lcaret.cnt; k++) {
785  lua_pushinteger(L, (k + 1));
786  lua_pushinteger(L, pst->u.lcaret.carets[k]);
787  lua_rawset(L, -3);
788  }
789  }
790  lua_rawset(L, -3);
791 }
792 
793 static void handle_generic_pst(lua_State * L, struct generic_pst *pst)
794 {
795  struct generic_pst *next;
796  int k;
797  int l = 1;
798  next = pst;
799  /* most likely everything arrives in proper order. But to prevent
800  * surprises, better do this is the proper way
801  */
802  while (next != NULL) {
803  if (next->subtable != NULL && next->subtable->subtable_name != NULL) {
804  lua_checkstack(L, 3); /* just in case */
805  lua_getfield(L, -1, next->subtable->subtable_name);
806  if (!lua_istable(L, -1)) {
807  lua_pop(L, 1);
808  lua_newtable(L);
809  lua_setfield(L, -2, next->subtable->subtable_name);
810  lua_getfield(L, -1, next->subtable->subtable_name);
811  }
812  k = lua_rawlen(L, -1) + 1;
813  lua_pushinteger(L, k);
814  lua_createtable(L, 0, 4);
816  lua_rawset(L, -3);
817  next = next->next;
818  lua_pop(L, 1); /* pop the subtable */
819  } else {
820  /* Found a pst without subtable, or without subtable name */
821  lua_pushinteger(L, l);
822  l++;
823  lua_createtable(L, 0, 4);
825  lua_rawset(L, -3);
826  next = next->next;
827  }
828  }
829 }
830 
831 static void do_handle_liglist(lua_State * L, struct liglist *ligofme)
832 {
833  lua_checkstack(L, 2);
834  if (ligofme->lig != NULL) {
835  lua_createtable(L, 0, 6);
836  handle_generic_pst(L, ligofme->lig);
837  lua_setfield(L, -2, "lig");
838  }
839  dump_char_ref(L, ligofme->first);
840  if (ligofme->components != NULL) {
841  lua_newtable(L);
843  lua_setfield(L, -2, "components");
844  }
845  dump_intfield(L, "ccnt", ligofme->ccnt);
846 }
847 
848 
849 static void handle_liglist(lua_State * L, struct liglist *ligofme)
850 {
851  struct liglist *next;
852  NESTED_TABLE(do_handle_liglist, ligofme, 3);
853 }
854 
855 static void do_handle_anchorpoint(lua_State * L, struct anchorpoint *anchor)
856 {
857 
858  if (anchor->anchor == NULL) {
859  return;
860  }
861  if (anchor->type >= 0 && anchor->type <= MAX_ANCHOR_TYPE) {
863  } else {
864  lua_pushstring(L, "Anchorpoint has an unknown type!");
865  lua_error(L);
866  }
867  /* unsigned int selected: 1; */
868  /* unsigned int ticked: 1; */
869 
870  lua_rawget(L, -2);
871  if (!lua_istable(L, -1)) {
872  /* create the table first */
873  lua_pop(L, 1);
875  lua_pushvalue(L, -1);
876  lua_newtable(L);
877  lua_rawset(L, -4);
878  lua_rawget(L, -2);
879  }
880  /* now the 'type' table is top of stack */
881  if (anchor->type == at_baselig) {
882  lua_pushstring(L, anchor->anchor->name);
883  lua_rawget(L, -2);
884  if (!lua_istable(L, -1)) {
885  /* create the table first */
886  lua_pop(L, 1);
887  lua_pushstring(L, anchor->anchor->name);
888  lua_pushvalue(L, -1);
889  lua_newtable(L);
890  lua_rawset(L, -4);
891  lua_rawget(L, -2);
892  }
893  lua_newtable(L);
894  dump_intfield(L, "x", anchor->me.x);
895  dump_intfield(L, "y", anchor->me.y);
896  if (anchor->has_ttf_pt)
897  dump_intfield(L, "ttf_pt_index", anchor->ttf_pt_index);
898  dump_intfield(L, "lig_index", anchor->lig_index);
899  lua_rawseti(L, -2, (anchor->lig_index + 1));
900  lua_pop(L, 1);
901  } else {
902  lua_pushstring(L, anchor->anchor->name);
903  lua_newtable(L);
904  dump_intfield(L, "x", anchor->me.x);
905  dump_intfield(L, "y", anchor->me.y);
906  if (anchor->has_ttf_pt)
907  dump_intfield(L, "ttf_pt_index", anchor->ttf_pt_index);
908  dump_intfield(L, "lig_index", anchor->lig_index);
909  lua_rawset(L, -3);
910  }
911  lua_pop(L, 1);
912 }
913 
914 static void handle_anchorpoint(lua_State * L, struct anchorpoint *anchor)
915 {
916  struct anchorpoint *next;
917  next = anchor;
918  while (next != NULL) {
920  next = next->next;
921  }
922 }
923 
925 {
926  int i;
927  dump_stringfield(L, "variants", vars->variants);
928  dump_intfield(L, "italic_correction", vars->italic_correction);
929  lua_newtable(L);
930  for (i = 0; i < vars->part_cnt; i++) {
931  lua_newtable(L);
932  dump_stringfield(L, "component", vars->parts[i].component);
933  dump_intfield(L, "extender", vars->parts[i].is_extender);
934  dump_intfield(L, "start", vars->parts[i].startConnectorLength);
935  dump_intfield(L, "end", vars->parts[i].endConnectorLength);
936  dump_intfield(L, "advance", vars->parts[i].fullAdvance);
937  lua_rawseti(L, -2, (i + 1));
938  }
939  lua_setfield(L, -2, "parts");
940 }
941 
942 static void handle_mathkernvertex(lua_State * L, struct mathkernvertex *mkv)
943 {
944  int i;
945  for (i = 0; i < mkv->cnt; i++) {
946  lua_newtable(L);
947  dump_intfield(L, "height", mkv->mkd[i].height);
948  dump_intfield(L, "kern", mkv->mkd[i].kern);
949  lua_rawseti(L, -2, (i + 1));
950  }
951 }
952 
953 static void handle_mathkern(lua_State * L, struct mathkern *mk)
954 {
955  lua_newtable(L);
957  lua_setfield(L, -2, "top_right");
958  lua_newtable(L);
960  lua_setfield(L, -2, "top_left");
961  lua_newtable(L);
963  lua_setfield(L, -2, "bottom_right");
964  lua_newtable(L);
966  lua_setfield(L, -2, "bottom_left");
967 }
968 
969 static void handle_splinechar(lua_State * L, struct splinechar *glyph, int hasvmetrics)
970 {
971  DBounds bb;
972  if (glyph->xmax == 0 && glyph->ymax == 0 && glyph->xmin == 0
973  && glyph->ymin == 0) {
975  glyph->xmin = bb.minx;
976  glyph->ymin = bb.miny;
977  glyph->xmax = bb.maxx;
978  glyph->ymax = bb.maxy;
979  }
980  dump_stringfield(L, "name", glyph->name);
981  dump_intfield(L, "unicode", glyph->unicodeenc);
982  lua_createtable(L, 4, 0);
983  lua_pushinteger(L, 1);
984  lua_pushinteger(L, glyph->xmin);
985  lua_rawset(L, -3);
986  lua_pushinteger(L, 2);
987  lua_pushinteger(L, glyph->ymin);
988  lua_rawset(L, -3);
989  lua_pushinteger(L, 3);
990  lua_pushinteger(L, glyph->xmax);
991  lua_rawset(L, -3);
992  lua_pushinteger(L, 4);
993  lua_pushinteger(L, glyph->ymax);
994  lua_rawset(L, -3);
995  lua_setfield(L, -2, "boundingbox");
996  if (hasvmetrics) {
997  dump_intfield(L, "vwidth", glyph->vwidth);
998  if (glyph->tsb != 0)
999  dump_intfield(L, "tsidebearing", glyph->tsb);
1000  }
1001  dump_intfield(L, "width", glyph->width);
1002 
1003  if (glyph->lsidebearing != glyph->xmin) {
1004  dump_cond_intfield(L, "lsidebearing", glyph->lsidebearing);
1005  }
1006  /* dump_intfield(L,"ttf_glyph", glyph->ttf_glyph); */
1007 
1008  /* Layer layers[2]; *//* TH Not used */
1009  /* int layer_cnt; *//* TH Not used */
1010  /* StemInfo *hstem; *//* TH Not used */
1011  /* StemInfo *vstem; *//* TH Not used */
1012  /* DStemInfo *dstem; *//* TH Not used */
1013 
1014  /* MinimumDistance *md; *//* TH Not used */
1015  /* struct charviewbase *views; *//* TH Not used */
1016  /* struct charinfo *charinfo; *//* TH ? (charinfo.c) */
1017  /* struct splinefont *parent; *//* TH Not used */
1018 
1019  if (glyph->glyph_class > 0) {
1020  dump_enumfield(L, "class", glyph->glyph_class, glyph_class_enum);
1021  }
1022  /* TH: internal fontforge stuff
1023  dump_intfield(L,"changed", glyph->changed);
1024  dump_intfield(L,"changedsincelasthinted", glyph->changedsincelasthinted);
1025  dump_intfield(L,"manualhints", glyph->manualhints);
1026  dump_intfield(L,"ticked", glyph->ticked);
1027  dump_intfield(L,"changed_since_autosave", glyph->changed_since_autosave);
1028  dump_intfield(L,"widthset", glyph->widthset);
1029  dump_intfield(L,"vconflicts", glyph->vconflicts);
1030  dump_intfield(L,"hconflicts", glyph->hconflicts);
1031  dump_intfield(L,"searcherdummy", glyph->searcherdummy);
1032  dump_intfield(L,"changed_since_search", glyph->changed_since_search);
1033  dump_intfield(L,"wasopen", glyph->wasopen);
1034  dump_intfield(L,"namechanged", glyph->namechanged);
1035  dump_intfield(L,"blended", glyph->blended);
1036  dump_intfield(L,"ticked2", glyph->ticked2);
1037  dump_intfield(L,"unused_so_far", glyph->unused_so_far);
1038  dump_intfield(L,"numberpointsbackards", glyph->numberpointsbackards);
1039  dump_intfield(L,"instructions_out_of_date", glyph->instructions_out_of_date);
1040  dump_intfield(L,"complained_about_ptnums", glyph->complained_about_ptnums);
1041  unsigned int vs_open: 1;
1042  unsigned int unlink_rm_ovrlp_save_undo: 1;
1043  unsigned int inspiro: 1;
1044  unsigned int lig_caret_cnt_fixed: 1;
1045 
1046 
1047  uint8 *ttf_instrs;
1048  int16 ttf_instrs_len;
1049  int16 countermask_cnt;
1050  HintMask *countermasks;
1051  */
1052 
1053  if (glyph->kerns != NULL) {
1054  lua_newtable(L);
1055  handle_kernpair(L, glyph->kerns);
1056  lua_setfield(L, -2, "kerns");
1057  }
1058  if (glyph->vkerns != NULL) {
1059  lua_newtable(L);
1060  handle_kernpair(L, glyph->vkerns);
1061  lua_setfield(L, -2, "vkerns");
1062  }
1063 
1064  if (glyph->dependents != NULL) {
1065  lua_newtable(L);
1066  handle_splinecharlist(L, glyph->dependents);
1067  lua_setfield(L, -2, "dependents");
1068 
1069  }
1070  if (glyph->possub != NULL) {
1071  lua_newtable(L);
1072  handle_generic_pst(L, glyph->possub);
1073  lua_setfield(L, -2, "lookups");
1074  }
1075 
1076  if (glyph->ligofme != NULL) {
1077  lua_newtable(L);
1078  handle_liglist(L, glyph->ligofme);
1079  lua_setfield(L, -2, "ligatures");
1080  }
1081 
1082  if (glyph->comment != NULL)
1083  dump_stringfield(L, "comment", glyph->comment);
1084 
1085  /* Color color; *//* dont care */
1086 
1087  if (glyph->anchor != NULL) {
1088  lua_newtable(L);
1089  handle_anchorpoint(L, glyph->anchor);
1090  lua_setfield(L, -2, "anchors");
1091  }
1092 
1093  if (glyph->altuni != NULL) {
1094  int i;
1095  lua_newtable(L);
1096  i = handle_altuni(L, glyph->altuni);
1097  if (i>0) {
1098  lua_setfield(L, -2, "altuni");
1099  } else {
1100  lua_pop(L,1);
1101  }
1102  }
1103 
1104  if (glyph->tex_height != TEX_UNDEF)
1105  dump_intfield(L, "tex_height", glyph->tex_height);
1106  if (glyph->tex_depth != TEX_UNDEF)
1107  dump_intfield(L, "tex_depth", glyph->tex_depth);
1108 
1109  dump_cond_intfield(L, "is_extended_shape", glyph->is_extended_shape);
1110  if (glyph->italic_correction != TEX_UNDEF)
1111  dump_intfield(L, "italic_correction", glyph->italic_correction);
1112  if (glyph->top_accent_horiz != TEX_UNDEF)
1113  dump_intfield(L, "top_accent", glyph->top_accent_horiz);
1114 
1115  if (glyph->vert_variants != NULL) {
1116  lua_newtable(L);
1117  handle_glyphvariants(L, glyph->vert_variants);
1118  lua_setfield(L, -2, "vert_variants");
1119  }
1120  if (glyph->horiz_variants != NULL) {
1121  lua_newtable(L);
1122  handle_glyphvariants(L, glyph->horiz_variants);
1123  lua_setfield(L, -2, "horiz_variants");
1124  }
1125  if (glyph->mathkern != NULL) {
1126  lua_newtable(L);
1127  handle_mathkern(L, glyph->mathkern);
1128  lua_setfield(L, -2, "mathkern");
1129  }
1130 }
1131 
1132 const char *panose_values_0[] = {
1133  "Any", "No Fit", "Text and Display", "Script", "Decorative", "Pictorial"
1134 };
1135 
1136 const char *panose_values_1[] = {
1137  "Any", "No Fit", "Cove", "Obtuse Cove", "Square Cove",
1138  "Obtuse Square Cove",
1139  "Square", "Thin", "Bone", "Exaggerated", "Triangle", "Normal Sans",
1140  "Obtuse Sans", "Perp Sans", "Flared", "Rounded"
1141 };
1142 
1143 const char *panose_values_2[] = {
1144  "Any", "No Fit", "Very Light", "Light", "Thin", "Book",
1145  "Medium", "Demi", "Bold", "Heavy", "Black", "Nord"
1146 };
1147 
1148 const char *panose_values_3[] = {
1149  "Any", "No Fit", "Old Style", "Modern", "Even Width",
1150  "Expanded", "Condensed", "Very Expanded", "Very Condensed", "Monospaced"
1151 };
1152 
1153 const char *panose_values_4[] = {
1154  "Any", "No Fit", "None", "Very Low", "Low", "Medium Low",
1155  "Medium", "Medium High", "High", "Very High"
1156 };
1157 
1158 const char *panose_values_5[] = {
1159  "Any", "No Fit", "Gradual/Diagonal", "Gradual/Transitional",
1160  "Gradual/Vertical",
1161  "Gradual/Horizontal", "Rapid/Vertical", "Rapid/Horizontal",
1162  "Instant/Vertical"
1163 };
1164 
1165 const char *panose_values_6[] = {
1166  "Any", "No Fit", "Straight Arms/Horizontal", "Straight Arms/Wedge",
1167  "Straight Arms/Vertical",
1168  "Straight Arms/Single Serif", "Straight Arms/Double Serif",
1169  "Non-Straight Arms/Horizontal",
1170  "Non-Straight Arms/Wedge", "Non-Straight Arms/Vertical",
1171  "Non-Straight Arms/Single Serif",
1172  "Non-Straight Arms/Double Serif"
1173 };
1174 
1175 const char *panose_values_7[] = {
1176  "Any", "No Fit", "Normal/Contact", "Normal/Weighted", "Normal/Boxed",
1177  "Normal/Flattened",
1178  "Normal/Rounded", "Normal/Off Center", "Normal/Square", "Oblique/Contact",
1179  "Oblique/Weighted",
1180  "Oblique/Boxed", "Oblique/Flattened", "Oblique/Rounded",
1181  "Oblique/Off Center", "Oblique/Square"
1182 };
1183 
1184 const char *panose_values_8[] = {
1185  "Any", "No Fit", "Standard/Trimmed", "Standard/Pointed",
1186  "Standard/Serifed", "High/Trimmed",
1187  "High/Pointed", "High/Serifed", "Constant/Trimmed", "Constant/Pointed",
1188  "Constant/Serifed",
1189  "Low/Trimmed", "Low/Pointed", "Low/Serifed"
1190 };
1191 
1192 const char *panose_values_9[] = {
1193  "Any", "No Fit", "Constant/Small", "Constant/Standard",
1194  "Constant/Large", "Ducking/Small", "Ducking/Standard", "Ducking/Large"
1195 };
1196 
1197 #define panose_values_0_max 5
1198 #define panose_values_1_max 15
1199 #define panose_values_2_max 11
1200 #define panose_values_3_max 9
1201 #define panose_values_4_max 9
1202 #define panose_values_5_max 8
1203 #define panose_values_6_max 11
1204 #define panose_values_7_max 15
1205 #define panose_values_8_max 13
1206 #define panose_values_9_max 7
1207 
1208 #define fix_range(a,b) (b<0 ? 0 : (b>a ? 0 : b))
1209 
1210 static void handle_pfminfo(lua_State * L, struct pfminfo pfm)
1211 {
1212 
1213  dump_intfield(L, "pfmset", pfm.pfmset);
1214  dump_intfield(L, "winascent_add", pfm.winascent_add);
1215  dump_intfield(L, "windescent_add", pfm.windescent_add);
1216  dump_intfield(L, "hheadascent_add", pfm.hheadascent_add);
1217  dump_intfield(L, "hheaddescent_add", pfm.hheaddescent_add);
1218  dump_intfield(L, "typoascent_add", pfm.typoascent_add);
1219  dump_intfield(L, "typodescent_add", pfm.typodescent_add);
1220  dump_intfield(L, "subsuper_set", pfm.subsuper_set);
1221  dump_intfield(L, "panose_set", pfm.panose_set);
1222  dump_intfield(L, "hheadset", pfm.hheadset);
1223  dump_intfield(L, "vheadset", pfm.vheadset);
1224  dump_intfield(L, "pfmfamily", pfm.pfmfamily);
1225  dump_intfield(L, "weight", pfm.weight);
1226  dump_intfield(L, "width", pfm.width);
1227  dump_intfield(L, "avgwidth", pfm.avgwidth);
1228  dump_intfield(L, "firstchar", pfm.firstchar);
1229  dump_intfield(L, "lastchar", pfm.lastchar);
1230  lua_createtable(L, 0, 10);
1231 
1232  dump_enumfield(L, "familytype", fix_range(panose_values_0_max, pfm.panose[0]), panose_values_0);
1233  dump_enumfield(L, "serifstyle", fix_range(panose_values_1_max, pfm.panose[1]), panose_values_1);
1235  dump_enumfield(L, "proportion", fix_range(panose_values_3_max, pfm.panose[3]), panose_values_3);
1236  dump_enumfield(L, "contrast", fix_range(panose_values_4_max, pfm.panose[4]), panose_values_4);
1237  dump_enumfield(L, "strokevariation", fix_range(panose_values_5_max, pfm.panose[5]), panose_values_5);
1238  dump_enumfield(L, "armstyle", fix_range(panose_values_6_max, pfm.panose[6]), panose_values_6);
1239  dump_enumfield(L, "letterform", fix_range(panose_values_7_max, pfm.panose[7]), panose_values_7);
1242  lua_setfield(L, -2, "panose");
1243 
1244  dump_intfield(L, "fstype", pfm.fstype);
1245  dump_intfield(L, "linegap", pfm.linegap);
1246  dump_intfield(L, "vlinegap", pfm.vlinegap);
1247  dump_intfield(L, "hhead_ascent", pfm.hhead_ascent);
1248  dump_intfield(L, "hhead_descent", pfm.hhead_descent);
1249  dump_intfield(L, "hhead_descent", pfm.hhead_descent);
1250  dump_intfield(L, "os2_typoascent", pfm.os2_typoascent);
1251  dump_intfield(L, "os2_typodescent", pfm.os2_typodescent);
1252  dump_intfield(L, "os2_typolinegap", pfm.os2_typolinegap);
1253  dump_intfield(L, "os2_winascent", pfm.os2_winascent);
1254  dump_intfield(L, "os2_windescent", pfm.os2_windescent);
1255  dump_intfield(L, "os2_subxsize", pfm.os2_subxsize);
1256  dump_intfield(L, "os2_subysize", pfm.os2_subysize);
1257  dump_intfield(L, "os2_subxoff", pfm.os2_subxoff);
1258  dump_intfield(L, "os2_subyoff", pfm.os2_subyoff);
1259  dump_intfield(L, "os2_supxsize", pfm.os2_supxsize);
1260  dump_intfield(L, "os2_supysize", pfm.os2_supysize);
1261  dump_intfield(L, "os2_supxoff", pfm.os2_supxoff);
1262  dump_intfield(L, "os2_supyoff", pfm.os2_supyoff);
1263  dump_intfield(L, "os2_strikeysize", pfm.os2_strikeysize);
1264  dump_intfield(L, "os2_strikeypos", pfm.os2_strikeypos);
1265  dump_lstringfield(L, "os2_vendor", pfm.os2_vendor, 4);
1266  dump_intfield(L, "os2_family_class", pfm.os2_family_class);
1267  dump_intfield(L, "os2_xheight", pfm.os2_xheight);
1268  dump_intfield(L, "os2_capheight", pfm.os2_capheight);
1269  dump_intfield(L, "os2_defaultchar", pfm.os2_defaultchar);
1270  dump_intfield(L, "os2_breakchar", pfm.os2_breakchar);
1271  if (pfm.hascodepages) {
1272  lua_newtable(L);
1273  lua_pushinteger(L, pfm.codepages[0]);
1274  lua_rawseti(L, -2, 1);
1275  lua_pushinteger(L, pfm.codepages[1]);
1276  lua_rawseti(L, -2, 2);
1277  lua_setfield(L, -2, "codepages");
1278  }
1279  if (pfm.hasunicoderanges) {
1280  lua_newtable(L);
1281  lua_pushinteger(L, pfm.unicoderanges[0]);
1282  lua_rawseti(L, -2, 1);
1283  lua_pushinteger(L, pfm.unicoderanges[1]);
1284  lua_rawseti(L, -2, 2);
1285  lua_pushinteger(L, pfm.unicoderanges[2]);
1286  lua_rawseti(L, -2, 3);
1287  lua_pushinteger(L, pfm.unicoderanges[3]);
1288  lua_rawseti(L, -2, 4);
1289  lua_setfield(L, -2, "unicoderanges");
1290  }
1291 }
1292 
1293 
1294 static char *do_handle_enc(lua_State * L, struct enc *enc)
1295 {
1296  int i;
1297  char *ret = enc->enc_name;
1298  dump_stringfield(L, "enc_name", enc->enc_name);
1299  dump_intfield(L, "char_cnt", enc->char_cnt);
1300 
1301  lua_checkstack(L, 4);
1302  if (enc->char_cnt && enc->unicode != NULL) {
1303  lua_createtable(L, enc->char_cnt, 1);
1304  for (i = 0; i < enc->char_cnt; i++) {
1305  lua_pushinteger(L, i);
1307  lua_rawset(L, -3);
1308  }
1309  lua_setfield(L, -2, "unicode");
1310  }
1311 
1312  if (enc->char_cnt && enc->psnames != NULL) {
1313  lua_createtable(L, enc->char_cnt, 1);
1314  for (i = 0; i < enc->char_cnt; i++) {
1315  lua_pushinteger(L, i);
1317  lua_rawset(L, -3);
1318  }
1319  lua_setfield(L, -2, "psnames");
1320  }
1321  dump_intfield(L, "builtin", enc->builtin);
1322  dump_intfield(L, "hidden", enc->hidden);
1323  dump_intfield(L, "only_1byte", enc->only_1byte);
1324  dump_intfield(L, "has_1byte", enc->has_1byte);
1325  dump_intfield(L, "has_2byte", enc->has_2byte);
1326  dump_cond_intfield(L, "is_unicodebmp", enc->is_unicodebmp);
1327  dump_cond_intfield(L, "is_unicodefull", enc->is_unicodefull);
1328  dump_cond_intfield(L, "is_custom", enc->is_custom);
1329  dump_cond_intfield(L, "is_original", enc->is_original);
1330  dump_cond_intfield(L, "is_compact", enc->is_compact);
1331  dump_cond_intfield(L, "is_japanese", enc->is_japanese);
1332  dump_cond_intfield(L, "is_korean", enc->is_korean);
1333  dump_cond_intfield(L, "is_tradchinese", enc->is_tradchinese);
1334  dump_cond_intfield(L, "is_simplechinese", enc->is_simplechinese);
1335 
1336  if (enc->iso_2022_escape_len > 0) {
1338  }
1339  dump_intfield(L, "low_page", enc->low_page);
1340  dump_intfield(L, "high_page", enc->high_page);
1341 
1342  dump_stringfield(L, "iconv_name", enc->iconv_name);
1343 
1344  dump_intfield(L, "char_max", enc->char_max);
1345  return ret;
1346 }
1347 
1348 #if 0 /* unused */
1349 static void handle_enc(lua_State * L, struct enc *enc)
1350 {
1351  struct enc *next;
1353 }
1354 #endif
1355 
1356 static void handle_encmap(lua_State * L, struct encmap *map, int notdef_loc)
1357 {
1358  int i;
1359  dump_intfield(L, "enccount", map->enccount);
1360  dump_intfield(L, "encmax", map->encmax);
1361  dump_intfield(L, "backmax", map->backmax);
1362  /*dump_intfield(L,"ticked", map->ticked) ; */
1363  if (map->remap != NULL) {
1364  lua_newtable(L);
1365  dump_intfield(L, "firstenc", map->remap->firstenc);
1366  dump_intfield(L, "lastenc", map->remap->lastenc);
1367  dump_intfield(L, "infont", map->remap->infont);
1368  lua_setfield(L, -2, "remap");
1369  }
1370  lua_checkstack(L, 4);
1371  if (map->encmax > 0 && map->map != NULL) {
1372  lua_createtable(L, map->encmax, 1);
1373  for (i = 0; i < map->encmax; i++) {
1374  if (map->map[i] != -1) {
1375  int l = map->map[i];
1376  lua_pushinteger(L, i);
1377  /*
1378  if (l < notdef_loc)
1379  lua_pushinteger(L, (l + 1));
1380  else
1381  */
1382  lua_pushinteger(L, l);
1383  lua_rawset(L, -3);
1384  }
1385  }
1386  lua_setfield(L, -2, "map");
1387  }
1388 
1389  if (map->backmax > 0 && map->backmap != NULL) {
1390  lua_newtable(L);
1391  for (i = 0; i < map->backmax; i++) {
1392  if (map->backmap[i] != -1) {
1393  /*
1394  if (i < notdef_loc)
1395  lua_pushinteger(L, (i + 1));
1396  else
1397  */
1398  lua_pushinteger(L, i);
1399  lua_pushinteger(L, map->backmap[i]);
1400  lua_rawset(L, -3);
1401  }
1402  }
1403  lua_setfield(L, -2, "backmap");
1404  }
1405 
1406  if (map->enc != NULL) {
1407  char *encname;
1408  lua_newtable(L);
1409  encname = do_handle_enc(L, map->enc);
1410  lua_setfield(L, -2, "enc");
1411  lua_pushstring(L, encname);
1412  lua_setfield(L, -2, "enc_name");
1413  }
1414 }
1415 
1416 static void handle_psdict(lua_State * L, struct psdict *private)
1417 {
1418  int k;
1419  if (private->keys != NULL && private->values != NULL) {
1420  for (k = 0; k < private->next; k++) {
1421  lua_pushstring(L, private->keys[k]);
1422  lua_pushstring(L, private->values[k]);
1423  lua_rawset(L, -3);
1424  }
1425  }
1426 }
1427 
1429 {
1430  int k;
1431  dump_stringfield(L, "lang", MSLangString(names->lang));
1432  lua_checkstack(L, 4);
1434  for (k = 0; k < ttf_namemax; k++) {
1436  lua_pushstring(L, names->names[k]);
1437  lua_rawset(L, -3);
1438  }
1439  lua_setfield(L, -2, "names");
1440 }
1441 
1443 {
1444  struct ttflangname *next;
1446 }
1447 
1448 static void do_handle_anchorclass(lua_State * L, struct anchorclass *anchor)
1449 {
1450  dump_stringfield(L, "name", anchor->name);
1451  dump_subtable_name(L, "lookup", anchor->subtable);
1452  dump_enumfield(L, "type", anchor->type, anchorclass_type_enum);
1453  /* uint8 has_base; */
1454  /* uint8 processed, has_mark, matches, ac_num; */
1455  /* uint8 ticked; */
1456 }
1457 
1458 static void handle_anchorclass(lua_State * L, struct anchorclass *anchor)
1459 {
1460  struct anchorclass *next;
1461  NESTED_TABLE(do_handle_anchorclass, anchor, 10);
1462 }
1463 
1464 static void do_handle_ttf_table(lua_State * L, struct ttf_table *ttf_tab)
1465 {
1466 
1467  dump_tag(L, "tag", ttf_tab->tag);
1468  dump_intfield(L, "len", ttf_tab->len);
1469  dump_intfield(L, "maxlen", ttf_tab->maxlen);
1470  dump_lstringfield(L, "data", (char *) ttf_tab->data, ttf_tab->len);
1471 }
1472 
1473 static void handle_ttf_table(lua_State * L, struct ttf_table *ttf_tab)
1474 {
1475  struct ttf_table *next;
1476  NESTED_TABLE(do_handle_ttf_table, ttf_tab, 4);
1477 }
1478 
1479 static int do_handle_kernclass(lua_State * L, struct kernclass *kerns, const char *name)
1480 {
1481  int k;
1482  int match = 0;
1483  if (name) {
1484  struct lookup_subtable *s = kerns->subtable;
1485  while (s != NULL) {
1486  if (strcmp(s->subtable_name,name)==0) {
1487  match = 1;
1488  break;
1489  }
1490  s = s->next;
1491  }
1492  } else {
1493  match = 1;
1494  }
1495  if (!match) {
1496  return 0;
1497  }
1498  lua_checkstack(L, 4);
1499  lua_createtable(L, kerns->first_cnt, 1);
1500  for (k = 0; k < kerns->first_cnt; k++) {
1501  lua_pushinteger(L, (k + 1));
1502  lua_pushstring(L, kerns->firsts[k]);
1503  lua_rawset(L, -3);
1504  }
1505  lua_setfield(L, -2, "firsts");
1506 
1507  lua_createtable(L, kerns->second_cnt, 1);
1508  for (k = 0; k < kerns->second_cnt; k++) {
1509  lua_pushinteger(L, (k + 1));
1510  lua_pushstring(L, kerns->seconds[k]);
1511  lua_rawset(L, -3);
1512  }
1513  lua_setfield(L, -2, "seconds");
1514 
1515  if (!name) {
1516  dump_subtable_name(L, "lookup", kerns->subtable);
1517  }
1518  lua_createtable(L, kerns->second_cnt * kerns->first_cnt, 1);
1519  for (k = 0; k < (kerns->second_cnt * kerns->first_cnt); k++) {
1520  if (kerns->offsets[k] != 0) {
1521  lua_pushinteger(L, (k + 1));
1522  lua_pushinteger(L, kerns->offsets[k]);
1523  lua_rawset(L, -3);
1524  }
1525  }
1526  lua_setfield(L, -2, "offsets");
1527  return 1;
1528 }
1529 
1530 static void handle_kernclass(lua_State * L, struct kernclass *kerns, const char *name)
1531 {
1532  struct kernclass *next;
1534 }
1535 
1536 
1537 #define DUMP_NUMBER_ARRAY(s,cnt,item) { \
1538  if (cnt>0 && item != NULL) { \
1539  int kk; \
1540  lua_newtable(L); \
1541  for (kk=0;kk<cnt;kk++) { \
1542  lua_pushinteger(L,(kk+1)); \
1543  lua_pushinteger(L,item[kk]); \
1544  lua_rawset(L,-3); } \
1545  lua_setfield(L,-2,s); } }
1546 
1547 
1548 #define DUMP_STRING_ARRAY(s,cnt,item) { \
1549  if (cnt>0 && item!=NULL) { \
1550  int kk; \
1551  lua_newtable(L); \
1552  for (kk=0;kk<cnt;kk++) { \
1553  lua_pushinteger(L,(kk+1)); \
1554  lua_pushstring(L,item[kk]); \
1555  lua_rawset(L,-3); } \
1556  lua_setfield(L,-2,s); } }
1557 
1558 #define DUMP_EXACT_STRING_ARRAY(s,cnt,item) { \
1559  if (cnt>0 && item!=NULL) { \
1560  int kk; \
1561  lua_newtable(L); \
1562  for (kk=0;kk<cnt;kk++) { \
1563  lua_pushinteger(L,(kk)); \
1564  lua_pushstring(L,item[kk]); \
1565  lua_rawset(L,-3); } \
1566  lua_setfield(L,-2,s); } }
1567 
1568 static void handle_fpst_rule(lua_State * L, struct fpst_rule *rule, int format)
1569 {
1570  int k;
1571 
1572  if (format == pst_glyphs) {
1573 
1574  lua_newtable(L);
1575  dump_stringfield(L, "names", rule->u.glyph.names);
1576  dump_stringfield(L, "back", rule->u.glyph.back);
1577  dump_stringfield(L, "fore", rule->u.glyph.fore);
1579 
1580  } else if (format == pst_class) {
1581 
1582  lua_newtable(L);
1583  DUMP_NUMBER_ARRAY("current", rule->u.class.ncnt,
1584  rule->u.class.nclasses);
1585  DUMP_NUMBER_ARRAY("before", rule->u.class.bcnt, rule->u.class.bclasses);
1586  DUMP_NUMBER_ARRAY("after", rule->u.class.fcnt, rule->u.class.fclasses);
1587 #if 0
1588  DUMP_NUMBER_ARRAY("allclasses", 0, rule->u.class.allclasses);
1589 #endif
1591 
1592  } else if (format == pst_coverage) {
1593 
1594  lua_newtable(L);
1595  DUMP_STRING_ARRAY("current", rule->u.coverage.ncnt,
1596  rule->u.coverage.ncovers);
1597  DUMP_STRING_ARRAY("before", rule->u.coverage.bcnt,
1598  rule->u.coverage.bcovers);
1599  DUMP_STRING_ARRAY("after", rule->u.coverage.fcnt,
1600  rule->u.coverage.fcovers);
1602 
1603  } else if (format == pst_reversecoverage) {
1604 
1605  lua_newtable(L);
1606  DUMP_STRING_ARRAY("current", rule->u.rcoverage.always1,
1607  rule->u.rcoverage.ncovers);
1608  DUMP_STRING_ARRAY("before", rule->u.rcoverage.bcnt,
1609  rule->u.rcoverage.bcovers);
1610  DUMP_STRING_ARRAY("after", rule->u.rcoverage.fcnt,
1611  rule->u.rcoverage.fcovers);
1612  dump_stringfield(L, "replacements", rule->u.rcoverage.replacements);
1614  } else {
1615  fprintf(stderr, "handle_fpst_rule(): Unknown rule format: %d\n",
1616  format);
1617  }
1618 
1619  if (rule->lookup_cnt > 0) {
1620  lua_newtable(L);
1621  for (k = 0; k < rule->lookup_cnt; k++) {
1622  lua_pushinteger(L, (rule->lookups[k].seq + 1));
1623  if (rule->lookups[k].lookup != NULL) {
1624  lua_pushstring(L, rule->lookups[k].lookup->lookup_name);
1625  } else {
1626  lua_pushnil(L);
1627  }
1628  lua_rawset(L, -3);
1629  }
1630  lua_setfield(L, -2, "lookups");
1631  } else {
1632  /*
1633  fprintf(stderr,"handle_fpst_rule(): No lookups?\n");
1634  */
1635  }
1636 }
1637 
1638 static void do_handle_generic_fpst(lua_State * L, struct generic_fpst *fpst)
1639 {
1640  int k;
1641 
1642  if (fpst->type > LAST_POSSUB_TYPE_ENUM) {
1643  dump_intfield(L, "type", fpst->type);
1644  } else {
1645  dump_enumfield(L, "type", fpst->type, possub_type_enum);
1646  }
1647  dump_enumfield(L, "format", fpst->format, fpossub_format_enum);
1648 
1649  if (fpst->format == pst_class) {
1650  DUMP_EXACT_STRING_ARRAY("current_class", fpst->nccnt, fpst->nclass);
1651  DUMP_EXACT_STRING_ARRAY("before_class", fpst->bccnt, fpst->bclass);
1652  DUMP_EXACT_STRING_ARRAY("after_class", fpst->fccnt, fpst->fclass);
1653  } else {
1654  DUMP_STRING_ARRAY("current_class", fpst->nccnt, fpst->nclass);
1655  DUMP_STRING_ARRAY("before_class", fpst->bccnt, fpst->bclass);
1656  DUMP_STRING_ARRAY("after_class", fpst->fccnt, fpst->fclass);
1657  }
1658 
1659  lua_checkstack(L, 4);
1660  if (fpst->rule_cnt > 0) {
1661  lua_createtable(L, fpst->rule_cnt, 1);
1662  for (k = 0; k < fpst->rule_cnt; k++) {
1663  lua_pushinteger(L, (k + 1));
1664  lua_newtable(L);
1665  handle_fpst_rule(L, &(fpst->rules[k]), fpst->format);
1666  lua_rawset(L, -3);
1667  }
1668  lua_setfield(L, -2, "rules");
1669  }
1670  /*dump_intfield (L,"ticked", fpst->ticked); */
1671 }
1672 
1673 static void handle_generic_fpst(lua_State * L, struct generic_fpst *fpst)
1674 {
1675  struct generic_fpst *next;
1676  int k = 1;
1677  lua_checkstack(L, 3);
1678  if (fpst->subtable != NULL && fpst->subtable->subtable_name != NULL) {
1680  } else {
1681  lua_pushinteger(L, k);
1682  k++;
1683  }
1684  lua_createtable(L, 0, 10);
1685  do_handle_generic_fpst(L, fpst);
1686  lua_rawset(L, -3);
1687  next = fpst->next;
1688  while (next != NULL) {
1689  lua_checkstack(L, 3);
1690  if (next->subtable != NULL && next->subtable->subtable_name != NULL) {
1691  lua_pushstring(L, next->subtable->subtable_name);
1692  } else {
1693  lua_pushinteger(L, k);
1694  k++;
1695  }
1696  lua_createtable(L, 0, 10);
1698  lua_rawset(L, -3);
1699  next = next->next;
1700  }
1701 }
1702 
1703 static void do_handle_otfname(lua_State * L, struct otfname *oname)
1704 {
1705  dump_intfield(L, "lang", oname->lang);
1706  dump_stringfield(L, "name", oname->name);
1707 }
1708 
1709 static void handle_otfname(lua_State * L, struct otfname *oname)
1710 {
1711  struct otfname *next;
1713 }
1714 
1715 static void handle_MATH(lua_State * L, struct MATH *MATH)
1716 {
1717  dump_intfield(L, "ScriptPercentScaleDown", MATH->ScriptPercentScaleDown);
1718  dump_intfield(L, "ScriptScriptPercentScaleDown", MATH->ScriptScriptPercentScaleDown);
1719  dump_intfield(L, "DelimitedSubFormulaMinHeight", MATH->DelimitedSubFormulaMinHeight);
1720  dump_intfield(L, "DisplayOperatorMinHeight", MATH->DisplayOperatorMinHeight);
1721  dump_intfield(L, "MathLeading", MATH->MathLeading);
1722  dump_intfield(L, "AxisHeight", MATH->AxisHeight);
1723  dump_intfield(L, "AccentBaseHeight", MATH->AccentBaseHeight);
1724  dump_intfield(L, "FlattenedAccentBaseHeight", MATH->FlattenedAccentBaseHeight);
1725  dump_intfield(L, "SubscriptShiftDown", MATH->SubscriptShiftDown);
1726  dump_intfield(L, "SubscriptTopMax", MATH->SubscriptTopMax);
1727  dump_intfield(L, "SubscriptBaselineDropMin", MATH->SubscriptBaselineDropMin);
1728  dump_intfield(L, "SuperscriptShiftUp", MATH->SuperscriptShiftUp);
1729  dump_intfield(L, "SuperscriptShiftUpCramped", MATH->SuperscriptShiftUpCramped);
1730  dump_intfield(L, "SuperscriptBottomMin", MATH->SuperscriptBottomMin);
1731  dump_intfield(L, "SuperscriptBaselineDropMax", MATH->SuperscriptBaselineDropMax);
1732  dump_intfield(L, "SubSuperscriptGapMin", MATH->SubSuperscriptGapMin);
1733  dump_intfield(L, "SuperscriptBottomMaxWithSubscript", MATH->SuperscriptBottomMaxWithSubscript);
1734  dump_intfield(L, "SpaceAfterScript", MATH->SpaceAfterScript);
1735  dump_intfield(L, "UpperLimitGapMin", MATH->UpperLimitGapMin);
1736  dump_intfield(L, "UpperLimitBaselineRiseMin", MATH->UpperLimitBaselineRiseMin);
1737  dump_intfield(L, "LowerLimitGapMin", MATH->LowerLimitGapMin);
1738  dump_intfield(L, "LowerLimitBaselineDropMin", MATH->LowerLimitBaselineDropMin);
1739  dump_intfield(L, "StackTopShiftUp", MATH->StackTopShiftUp);
1740  dump_intfield(L, "StackTopDisplayStyleShiftUp", MATH->StackTopDisplayStyleShiftUp);
1741  dump_intfield(L, "StackBottomShiftDown", MATH->StackBottomShiftDown);
1742  dump_intfield(L, "StackBottomDisplayStyleShiftDown", MATH->StackBottomDisplayStyleShiftDown);
1743  dump_intfield(L, "StackGapMin", MATH->StackGapMin);
1744  dump_intfield(L, "StackDisplayStyleGapMin", MATH->StackDisplayStyleGapMin);
1745  dump_intfield(L, "StretchStackTopShiftUp", MATH->StretchStackTopShiftUp);
1746  dump_intfield(L, "StretchStackBottomShiftDown", MATH->StretchStackBottomShiftDown);
1747  dump_intfield(L, "StretchStackGapAboveMin", MATH->StretchStackGapAboveMin);
1748  dump_intfield(L, "StretchStackGapBelowMin", MATH->StretchStackGapBelowMin);
1749  dump_intfield(L, "FractionNumeratorShiftUp", MATH->FractionNumeratorShiftUp);
1750  dump_intfield(L, "FractionNumeratorDisplayStyleShiftUp", MATH->FractionNumeratorDisplayStyleShiftUp);
1751  dump_intfield(L, "FractionDenominatorShiftDown", MATH->FractionDenominatorShiftDown);
1752  dump_intfield(L, "FractionDenominatorDisplayStyleShiftDown", MATH->FractionDenominatorDisplayStyleShiftDown);
1753  dump_intfield(L, "FractionNumeratorGapMin", MATH->FractionNumeratorGapMin);
1754  dump_intfield(L, "FractionNumeratorDisplayStyleGapMin", MATH->FractionNumeratorDisplayStyleGapMin);
1755  dump_intfield(L, "FractionRuleThickness", MATH->FractionRuleThickness);
1756  dump_intfield(L, "FractionDenominatorGapMin", MATH->FractionDenominatorGapMin);
1757  dump_intfield(L, "FractionDenominatorDisplayStyleGapMin", MATH->FractionDenominatorDisplayStyleGapMin);
1758  dump_intfield(L, "SkewedFractionHorizontalGap", MATH->SkewedFractionHorizontalGap);
1759  dump_intfield(L, "SkewedFractionVerticalGap", MATH->SkewedFractionVerticalGap);
1760  dump_intfield(L, "OverbarVerticalGap", MATH->OverbarVerticalGap);
1761  dump_intfield(L, "OverbarRuleThickness", MATH->OverbarRuleThickness);
1762  dump_intfield(L, "OverbarExtraAscender", MATH->OverbarExtraAscender);
1763  dump_intfield(L, "UnderbarVerticalGap", MATH->UnderbarVerticalGap);
1764  dump_intfield(L, "UnderbarRuleThickness", MATH->UnderbarRuleThickness);
1765  dump_intfield(L, "UnderbarExtraDescender", MATH->UnderbarExtraDescender);
1766  dump_intfield(L, "RadicalVerticalGap", MATH->RadicalVerticalGap);
1767  dump_intfield(L, "RadicalDisplayStyleVerticalGap", MATH->RadicalDisplayStyleVerticalGap);
1768  dump_intfield(L, "RadicalRuleThickness", MATH->RadicalRuleThickness);
1769  dump_intfield(L, "RadicalExtraAscender", MATH->RadicalExtraAscender);
1770  dump_intfield(L, "RadicalKernBeforeDegree", MATH->RadicalKernBeforeDegree);
1771  dump_intfield(L, "RadicalKernAfterDegree", MATH->RadicalKernAfterDegree);
1772  dump_intfield(L, "RadicalDegreeBottomRaisePercent", MATH->RadicalDegreeBottomRaisePercent);
1773  dump_intfield(L, "MinConnectorOverlap", MATH->MinConnectorOverlap);
1774 }
1775 
1776 /* the handling of BASE is untested, no font */
1777 static void handle_baselangextent(lua_State * L, struct baselangextent *ble);
1778 
1780 {
1781  dump_tag(L, "tag", ble->lang);
1782  dump_intfield(L, "ascent", ble->ascent);
1783  dump_intfield(L, "descent", ble->descent);
1784  lua_newtable(L);
1786  lua_setfield(L, -2, "features");
1787 }
1788 
1790 {
1791  struct baselangextent *next;
1793 }
1794 
1795 static void handle_base(lua_State * L, struct Base *Base)
1796 {
1797  int i;
1798  struct basescript *next = Base->scripts;
1799  lua_newtable(L);
1800  for (i = 0; i < Base->baseline_cnt; i++) {
1802  lua_rawseti(L, -2, (i + 1));
1803  }
1804  lua_setfield(L, -2, "tags");
1805  if (next != NULL) {
1806  lua_newtable(L);
1807  while (next != NULL) {
1808  lua_pushstring(L, make_tag_string(next->script));
1809  lua_newtable(L);
1810  dump_intfield(L, "default_baseline", (next->def_baseline + 1));
1811  lua_newtable(L);
1812  for (i = 0; i < Base->baseline_cnt; i++) {
1813  if (next->baseline_pos != NULL) /* default omitted */
1814  lua_pushinteger(L, next->baseline_pos[i]);
1815  else
1816  lua_pushinteger(L, 0);
1817  lua_rawseti(L, -2, (i + 1));
1818  }
1819  lua_setfield(L, -2, "baseline");
1820  lua_newtable(L);
1821  handle_baselangextent(L, next->langs);
1822  lua_setfield(L, -2, "lang");
1823  lua_rawset(L, -3);
1824  next = next->next;
1825  }
1826  lua_setfield(L, -2, "scripts");
1827  }
1828 }
1829 
1830 static void handle_axismap(lua_State * L, struct axismap *am)
1831 {
1832  int i;
1833  lua_checkstack(L, 3);
1834  lua_newtable(L);
1835  for (i = 0; i < am->points; i++) {
1836  lua_pushinteger(L, am->blends[i]);
1837  lua_rawseti(L, -2, (i + 1));
1838  }
1839  lua_setfield(L, -2, "blends");
1840  lua_newtable(L);
1841  for (i = 0; i < am->points; i++) {
1842  lua_pushinteger(L, am->designs[i]);
1843  lua_rawseti(L, -2, (i + 1));
1844  }
1845  lua_setfield(L, -2, "designs");
1846  dump_realfield(L, "min", am->min);
1847  dump_realfield(L, "def", am->def);
1848  dump_realfield(L, "max", am->max);
1849 }
1850 
1851 static void handle_mmset(lua_State * L, struct mmset *mm)
1852 {
1853  int i;
1854  lua_newtable(L);
1855  for (i = 0; i < mm->axis_count; i++) {
1856  lua_pushstring(L, mm->axes[i]);
1857  lua_rawseti(L, -2, (i + 1));
1858  }
1859  lua_setfield(L, -2, "axes");
1860 
1861  dump_intfield(L, "instance_count", mm->instance_count);
1862  /* SplineFont *normal; *//* this is the parent */
1863  if (mm->instance_count > 0) {
1864  lua_newtable(L);
1865  for (i = 0; i < mm->instance_count * mm->axis_count; i++) {
1866  lua_pushinteger(L, mm->positions[i]);
1867  lua_rawseti(L, -2, (i + 1));
1868  }
1869  lua_setfield(L, -2, "positions");
1870 
1871  /* better not to do this */
1872 #if 0
1873  {
1874  struct mmset *mmsave;
1875  lua_newtable(L);
1876  for (i = 0; i < mm->instance_count; i++) {
1877  lua_checkstack(L, 20);
1878  lua_createtable(L, 0, 60);
1879  mmsave = mm->instances[i]->mm;
1880  mm->instances[i]->mm = NULL;
1881  handle_splinefont(L, mm->instances[i]);
1882  mm->instances[i]->mm = mmsave;
1883  lua_rawseti(L, -2, (i + 1));
1884  }
1885  lua_setfield(L, -2, "instances");
1886  }
1887 #endif
1888 
1889  lua_newtable(L);
1890  for (i = 0; i < mm->instance_count; i++) {
1891  lua_pushinteger(L, mm->defweights[i]);
1892  lua_rawseti(L, -2, (i + 1));
1893  }
1894  lua_setfield(L, -2, "defweights");
1895  }
1896 
1897  if (mm->axismaps != NULL) {
1898  lua_newtable(L);
1899  for (i = 0; i < mm->axis_count; i++) {
1900  lua_newtable(L);
1901  handle_axismap(L, &(mm->axismaps[i]));
1902  lua_rawseti(L, -2, (i + 1));
1903  }
1904  lua_setfield(L, -2, "axismaps");
1905  }
1906  dump_stringfield(L, "cdv", mm->cdv);
1907  dump_stringfield(L, "ndv", mm->ndv);
1908 }
1909 
1910 static void handle_splinefont(lua_State * L, struct splinefont *sf)
1911 {
1912  int k;
1913  int fix_notdef = 0; /* obsolete */
1914  int l = -1;
1915 
1916  dump_stringfield(L, "table_version", LUA_OTF_VERSION);
1917  dump_stringfield(L, "fontname", sf->fontname);
1918  dump_stringfield(L, "fullname", sf->fullname);
1919  dump_stringfield(L, "familyname", sf->familyname);
1920  dump_stringfield(L, "weight", sf->weight);
1921  dump_stringfield(L, "copyright", sf->copyright);
1922  dump_stringfield(L, "filename", sf->filename);
1923  /* dump_stringfield(L,"defbasefilename", sf->defbasefilename); */
1924  dump_stringfield(L, "version", sf->version);
1925  dump_floatfield(L, "italicangle", sf->italicangle);
1926  dump_floatfield(L, "upos", sf->upos);
1927  dump_floatfield(L, "uwidth", sf->uwidth);
1928  dump_intfield(L, "ascent", sf->ascent);
1929  dump_intfield(L, "descent", sf->descent);
1930  dump_intfield(L, "notdef_loc",notdef_loc(sf));
1931  if (sf->uniqueid!=0) {
1932  dump_intfield(L, "uniqueid", sf->uniqueid);
1933  }
1934 
1935  if (sf->glyphcnt > 0) {
1936  dump_intfield(L, "glyphcnt", sf->glyphmax - sf->glyphmin + 1);
1937  } else {
1938  dump_intfield(L, "glyphcnt", 0);
1939  }
1940 
1941  if (sf->names != NULL) {
1942  /*
1943  this is not the best way to determine it but for now it will do; otherwise
1944  we need to mess with the ff library
1945  */
1946  lua_pushstring(L, "truetype");
1947  lua_pushboolean(L, 1);
1948  lua_rawset(L, -3);
1949  }
1950 
1951  dump_intfield(L, "glyphmax", sf->glyphmax - 1);
1952  dump_intfield(L, "glyphmin", sf->glyphmin);
1953  dump_intfield(L, "units_per_em", sf->units_per_em);
1954 
1955  if (sf->possub != NULL) {
1956  lua_newtable(L);
1957  handle_generic_fpst(L, sf->possub);
1958  lua_setfield(L, -2, "lookups");
1959  }
1960 
1961  lua_checkstack(L, 4);
1962  lua_createtable(L, sf->glyphcnt, 0);
1963 
1964  /* This after-the-fact type discovery is not brilliant,
1965  I should really add a 'format' key in the structure */
1966 
1967  /*
1968  if ((sf->origname != NULL) &&
1969  (strmatch(sf->origname + strlen(sf->origname) - 4, ".pfa") == 0 ||
1970  strmatch(sf->origname + strlen(sf->origname) - 4, ".pfb") == 0)) {
1971  fix_notdef = 1;
1972  }
1973  */
1974 
1975  if (fix_notdef) {
1976 
1977  /* this is obsolete */
1978 
1979  /* some code to ensure that the .notdef ends up in slot 0
1980  (this will actually be enforced by the CFF writer) */
1981  for (k = 0; k < sf->glyphcnt; k++) {
1982  if (sf->glyphs[k]) {
1983  if (strcmp(sf->glyphs[k]->name, ".notdef") == 0) {
1984  l = k;
1985  }
1986  }
1987  }
1988  if (l == -1) { /* fake a .notdef at the end */
1989  l = sf->glyphcnt;
1990  }
1991  for (k = 0; k < l; k++) {
1992  if (sf->glyphs[k]) {
1993  lua_pushinteger(L, (k + 1));
1994  lua_createtable(L, 0, 12);
1995  handle_splinechar(L, sf->glyphs[k], sf->hasvmetrics);
1996  lua_rawset(L, -3);
1997  }
1998  }
1999  if (sf->glyphs != NULL && l < sf->glyphcnt) {
2000  lua_pushinteger(L, 0);
2001  if (sf->glyphs[l]) {
2002  lua_createtable(L, 0, 12);
2003  handle_splinechar(L, sf->glyphs[l], sf->hasvmetrics);
2004  } else {
2005  lua_createtable(L, 0, 0);
2006  }
2007  lua_rawset(L, -3);
2008  }
2009  }
2010  if ((l + 1) < sf->glyphcnt) {
2011  for (k = (l + 1); k < sf->glyphcnt; k++) {
2012  if (sf->glyphs[k]) {
2013  lua_pushinteger(L, k);
2014  lua_createtable(L, 0, 12);
2015  handle_splinechar(L, sf->glyphs[k], sf->hasvmetrics);
2016  lua_rawset(L, -3);
2017  }
2018  }
2019  }
2020  lua_setfield(L, -2, "glyphs");
2021 
2022  /* dump_intfield(L,"changed", sf->changed); */
2023  dump_intfield(L, "hasvmetrics", sf->hasvmetrics);
2024  dump_intfield(L, "onlybitmaps", sf->onlybitmaps);
2025  dump_intfield(L, "serifcheck", sf->serifcheck);
2026  dump_intfield(L, "isserif", sf->isserif);
2027  dump_intfield(L, "issans", sf->issans);
2028  dump_intfield(L, "encodingchanged", sf->encodingchanged);
2029  dump_intfield(L, "strokedfont", sf->strokedfont);
2030  dump_intfield(L, "use_typo_metrics", sf->use_typo_metrics);
2031  dump_intfield(L, "weight_width_slope_only", sf->weight_width_slope_only);
2032  dump_intfield(L, "head_optimized_for_cleartype",
2033  sf->head_optimized_for_cleartype);
2034 
2035  dump_enumfield(L, "uni_interp", (sf->uni_interp + 1), uni_interp_enum);
2036 
2037  if (sf->map != NULL) {
2038  lua_newtable(L);
2039  handle_encmap(L, sf->map, l);
2040  lua_setfield(L, -2, "map");
2041  }
2042 
2043  dump_stringfield(L, "origname", sf->origname); /* new */
2044 
2045  if (sf->private != NULL) {
2046  lua_newtable(L);
2047  handle_psdict(L, sf->private);
2048  lua_setfield(L, -2, "private");
2049  }
2050 
2051  dump_stringfield(L, "xuid", sf->xuid);
2052 
2053  lua_createtable(L, 0, 40);
2054  handle_pfminfo(L, sf->pfminfo);
2055  lua_setfield(L, -2, "pfminfo");
2056 
2057  if (sf->names != NULL) {
2058  lua_newtable(L);
2059  handle_ttflangname(L, sf->names);
2060  lua_setfield(L, -2, "names");
2061  }
2062 
2063  lua_createtable(L, 0, 4);
2064  dump_stringfield(L, "registry", sf->cidregistry);
2065  dump_stringfield(L, "ordering", sf->ordering);
2066  dump_intfield(L, "version", sf->cidversion);
2067  dump_intfield(L, "supplement", sf->supplement);
2068  lua_setfield(L, -2, "cidinfo");
2069 
2070  /* SplineFont *cidmaster *//* parent in a subfont */
2071  if (sf->subfontcnt > 0) {
2072  lua_createtable(L, sf->subfontcnt, 0);
2073  for (k = 0; k < sf->subfontcnt; k++) {
2074  lua_checkstack(L, 10);
2075  lua_newtable(L);
2076  handle_splinefont(L, sf->subfonts[k]);
2077  lua_rawseti(L, -2, (k + 1));
2078  }
2079  lua_setfield(L, -2, "subfonts");
2080  }
2081 
2082  dump_stringfield(L, "comments", sf->comments);
2083  dump_stringfield(L, "fontlog", sf->fontlog);
2084 
2085  if (sf->cvt_names != NULL) {
2086  lua_newtable(L);
2087  for (k = 0; sf->cvt_names[k] != END_CVT_NAMES; ++k) {
2088  lua_pushstring(L, sf->cvt_names[k]);
2089  lua_rawseti(L, -2, (k + 1));
2090  }
2091  lua_setfield(L, -2, "cvt_names");
2092  }
2093 
2094  if (sf->ttf_tables != NULL) {
2095  lua_newtable(L);
2096  handle_ttf_table(L, sf->ttf_tables);
2097  lua_setfield(L, -2, "ttf_tables");
2098  }
2099 
2100  if (sf->ttf_tab_saved != NULL) {
2101  lua_newtable(L);
2102  handle_ttf_table(L, sf->ttf_tab_saved);
2103  lua_setfield(L, -2, "ttf_tab_saved");
2104  }
2105 
2106  if (sf->texdata.type != tex_unset) {
2107  lua_newtable(L);
2108  dump_enumfield(L, "type", sf->texdata.type, tex_type_enum);
2109  lua_newtable(L);
2110  for (k = 0; k < 22; k++) {
2111  lua_pushinteger(L, k);
2112  lua_pushinteger(L, sf->texdata.params[k]);
2113  lua_rawset(L, -3);
2114  }
2115  lua_setfield(L, -2, "params");
2116  lua_setfield(L, -2, "texdata");
2117  }
2118  if (sf->anchor != NULL) {
2119  lua_newtable(L);
2120  handle_anchorclass(L, sf->anchor);
2121  lua_setfield(L, -2, "anchor_classes");
2122  }
2123  if (sf->kerns != NULL) {
2124  lua_newtable(L);
2125  handle_kernclass(L, sf->kerns, NULL);
2126  lua_setfield(L, -2, "kerns");
2127  }
2128  if (sf->vkerns != NULL) {
2129  lua_newtable(L);
2130  handle_kernclass(L, sf->vkerns, NULL);
2131  lua_setfield(L, -2, "vkerns");
2132  }
2133  if (sf->gsub_lookups != NULL) {
2134  lua_newtable(L);
2135  handle_lookup(L, sf->gsub_lookups, sf);
2136  lua_setfield(L, -2, "gsub");
2137  }
2138  if (sf->gpos_lookups != NULL) {
2139  lua_newtable(L);
2140  handle_lookup(L, sf->gpos_lookups, sf);
2141  lua_setfield(L, -2, "gpos");
2142  }
2143 
2144  if (sf->mm != NULL) {
2145  lua_newtable(L);
2146  handle_mmset(L, sf->mm);
2147  lua_setfield(L, -2, "mm");
2148  }
2149  dump_stringfield(L, "chosenname", sf->chosenname);
2150 
2151  if (sf->macstyle!=-1) {
2152  dump_intfield(L, "macstyle", sf->macstyle);
2153  }
2154  dump_stringfield(L, "fondname", sf->fondname);
2155 
2156  dump_intfield(L, "design_size", sf->design_size);
2157  dump_intfield(L, "fontstyle_id", sf->fontstyle_id);
2158 
2159  if (sf->fontstyle_name != NULL) {
2160  lua_newtable(L);
2161  handle_otfname(L, sf->fontstyle_name);
2162  lua_setfield(L, -2, "fontstyle_name");
2163  }
2164 
2165  dump_intfield(L, "design_range_bottom", sf->design_range_bottom);
2166  dump_intfield(L, "design_range_top", sf->design_range_top);
2167  dump_floatfield(L, "strokewidth", sf->strokewidth);
2168 
2169  if (sf->mark_class_cnt > 0) {
2170  lua_newtable(L);
2171  for (k = 0; k < sf->mark_class_cnt; k++) {
2172  if (sf->mark_class_names[k] != NULL) {
2173  lua_pushstring(L, sf->mark_class_names[k]);
2174  lua_pushstring(L, sf->mark_classes[k]);
2175  lua_rawset(L, -3);
2176  }
2177  }
2178  lua_setfield(L, -2, "mark_classes");
2179  }
2180 
2181  dump_uintfield(L, "creationtime", sf->creationtime);
2182  dump_uintfield(L, "modificationtime", sf->modificationtime);
2183 
2184  dump_intfield(L, "os2_version", sf->os2_version);
2185  dump_intfield(L, "sfd_version", sf->sfd_version);
2186 
2187  if (sf->MATH != NULL) {
2188  lua_newtable(L);
2189  handle_MATH(L, sf->MATH);
2190  lua_setfield(L, -2, "math");
2191  }
2192 
2193  if (sf->loadvalidation_state != 0) {
2194  int val, st;
2195  lua_newtable(L);
2196  val = 1;
2197  st = sf->loadvalidation_state;
2198  if (st & lvs_bad_ps_fontname) {
2199  lua_pushliteral(L, "bad_ps_fontname");
2200  lua_rawseti(L, -2, val++);
2201  }
2202  if (st & lvs_bad_glyph_table) {
2203  lua_pushliteral(L, "bad_glyph_table");
2204  lua_rawseti(L, -2, val++);
2205  }
2206  if (st & lvs_bad_cff_table) {
2207  lua_pushliteral(L, "bad_cff_table");
2208  lua_rawseti(L, -2, val++);
2209  }
2210  if (st & lvs_bad_metrics_table) {
2211  lua_pushliteral(L, "bad_metrics_table");
2212  lua_rawseti(L, -2, val++);
2213  }
2214  if (st & lvs_bad_cmap_table) {
2215  lua_pushliteral(L, "bad_cmap_table");
2216  lua_rawseti(L, -2, val++);
2217  }
2218  if (st & lvs_bad_bitmaps_table) {
2219  lua_pushliteral(L, "bad_bitmaps_table");
2220  lua_rawseti(L, -2, val++);
2221  }
2222  if (st & lvs_bad_gx_table) {
2223  lua_pushliteral(L, "bad_gx_table");
2224  lua_rawseti(L, -2, val++);
2225  }
2226  if (st & lvs_bad_ot_table) {
2227  lua_pushliteral(L, "bad_ot_table");
2228  lua_rawseti(L, -2, val++);
2229  }
2230  if (st & lvs_bad_os2_version) {
2231  lua_pushliteral(L, "bad_os2_version");
2232  lua_rawseti(L, -2, val++);
2233  }
2234  if (st & lvs_bad_sfnt_header) {
2235  lua_pushliteral(L, "bad_sfnt_header");
2236  lua_rawseti(L, -2, val++);
2237  }
2238  lua_setfield(L, -2, "validation_state");
2239  }
2240 
2241  if (sf->horiz_base != NULL) {
2242  lua_newtable(L);
2243  handle_base(L, sf->horiz_base);
2244  lua_setfield(L, -2, "horiz_base");
2245  }
2246  if (sf->vert_base != NULL) {
2247  lua_newtable(L);
2248  handle_base(L, sf->vert_base);
2249  lua_setfield(L, -2, "vert_base");
2250  }
2251  dump_intfield(L, "extrema_bound", sf->extrema_bound);
2252 }
2253 
2255 {
2256  SplineFont *sf;
2257  sf = *(check_isfont(L, 1));
2258  if (sf == NULL) {
2259  lua_pushboolean(L, 0);
2260  } else {
2261  lua_createtable(L, 0, 60);
2263  }
2264  return 1;
2265 }
2266 
2268 {
2269  lua_newtable(L);
2270  dump_stringfield(L, "familyname", sf->familyname);
2271  dump_stringfield(L, "fontname", sf->fontname);
2272  dump_stringfield(L, "fullname", sf->fullname);
2273  dump_floatfield(L, "italicangle", sf->italicangle);
2274  dump_stringfield(L, "version", sf->version);
2275  dump_stringfield(L, "weight", sf->weight);
2276 
2277  dump_intfield(L, "units_per_em", sf->units_per_em);
2278 
2279  /*dump_intfield(L, "design_range_bottom", sf->design_range_bottom);*/
2280  /*dump_intfield(L, "design_range_top", sf->design_range_top);*/
2281  /*dump_intfield(L, "design_size", sf->design_size);*/
2282 
2283  lua_createtable(L, 0, 40);
2284  handle_pfminfo(L, sf->pfminfo);
2285  lua_setfield(L, -2, "pfminfo");
2286 
2287  /* Do we need this ? */
2288 
2289  if (sf->names != NULL) {
2290  lua_newtable(L);
2291  handle_ttflangname(L, sf->names);
2292  lua_setfield(L, -2, "names");
2293  }
2294 }
2295 
2296 typedef enum {
2347  /* FK_sm, */ /* AAT is not supported anymore */
2370 } font_key_values;
2371 
2372 const char *font_keys[] = {
2373  "table_version",
2374  "fontname",
2375  "fullname",
2376  "familyname",
2377  "weight",
2378  "copyright",
2379  "filename",
2380  "version",
2381  "italicangle",
2382  "upos",
2383  "uwidth",
2384  "ascent",
2385  "descent",
2386  "uniqueid",
2387  "glyphcnt",
2388  "glyphmax",
2389  "glyphmin",
2390  "units_per_em",
2391  "lookups",
2392  "glyphs",
2393  "hasvmetrics",
2394  "onlybitmaps",
2395  "serifcheck",
2396  "isserif",
2397  "issans",
2398  "encodingchanged",
2399  "strokedfont",
2400  "use_typo_metrics",
2401  "weight_width_slope_only",
2402  "head_optimized_for_cleartype",
2403  "uni_interp",
2404  "map",
2405  "origname",
2406  "private",
2407  "xuid",
2408  "pfminfo",
2409  "names",
2410  "cidinfo",
2411  "subfonts",
2412  "comments",
2413  "fontlog",
2414  "cvt_names",
2415  "ttf_tables",
2416  "ttf_tab_saved",
2417  "texdata",
2418  "anchor_classes",
2419  "kerns",
2420  "vkerns",
2421  "gsub",
2422  "gpos",
2423  "features",
2424  "mm",
2425  "chosenname",
2426  "macstyle",
2427  "fondname",
2428  "design_size",
2429  "fontstyle_id",
2430  "fontstyle_name",
2431  "design_range_bottom",
2432  "design_range_top",
2433  "strokewidth",
2434  "mark_classes",
2435  "creationtime",
2436  "modificationtime",
2437  "os2_version",
2438  "sfd_version",
2439  "math",
2440  "validation_state",
2441  "horiz_base",
2442  "vert_base",
2443  "extrema_bound",
2444  "notdef_loc",
2445  NULL
2446 };
2447 
2448 typedef enum {
2449  GK_name = 0,
2473 
2474 const char *font_glyph_keys[] = {
2475  "name",
2476  "unicode",
2477  "boundingbox",
2478  "vwidth",
2479  "width",
2480  "lsidebearing",
2481  "class",
2482  "kerns",
2483  "vkerns",
2484  "dependents",
2485  "lookups",
2486  "ligatures",
2487  "comment",
2488  "anchors",
2489  "altuni",
2490  "tex_height",
2491  "tex_depth",
2492  "is_extended_shape",
2493  "italic_correction",
2494  "top_accent",
2495  "vert_variants",
2496  "horiz_variants",
2497  "mathkern",
2498  NULL
2499 };
2500 
2501 static int ff_fields(lua_State * L)
2502 {
2503  int i;
2504  const char **fields = NULL;
2505  if (is_userdata(L, 1, FONT_METATABLE) ||
2507  fields = font_keys;
2508  } else if (is_userdata(L, 1, FONT_GLYPH_METATABLE)) {
2510  }
2511  if (fields != NULL) {
2512  lua_newtable(L);
2513  for (i = 0; fields[i] != NULL; i++) {
2514  lua_pushstring(L, fields[i]);
2515  lua_rawseti(L, -2, (i + 1));
2516  }
2517  } else {
2518  lua_pushnil(L);
2519  }
2520  return 1;
2521 }
2522 
2524 {
2525 
2526  SplineFont *sf;
2527  int gid = 0;
2528  int l = -1;
2529  int fix_notdef = 0; /* obsolete */
2530  lua_pushstring(L, "__sf");
2531  lua_rawget(L, 1);
2532  /* sf = *check_isfont(L, -1); */
2533  if (!(is_userdata(L, -1, FONT_METATABLE) ||
2535  return luaL_error(L, "fontloader.__index: expected a (sub)font userdata object\n");
2536  }
2537  sf = *((SplineFont **)lua_touserdata(L, -1));
2538 
2539  lua_pop(L, 1);
2540  gid = luaL_checkinteger(L, 2);
2541  /* if (gid < sf->glyphmin || gid >= sf->glyphmax) {*/
2542  if (gid < sf->glyphmin || gid > sf->glyphmax) {
2543  return luaL_error(L, "fontloader.glyphs.__index: index is invalid\n");
2544  }
2545  /* This after-the-fact type discovery is not brilliant,
2546  I should really add a 'format' key in the structure */
2547  /*
2548  if ((sf->origname != NULL) &&
2549  (strmatch(sf->origname + strlen(sf->origname) - 4, ".pfa") == 0 ||
2550  strmatch(sf->origname + strlen(sf->origname) - 4, ".pfb") == 0)) {
2551  fix_notdef = 1;
2552  }
2553  */
2554  /* some code to ensure that the .notdef ends up in slot 0
2555  (this will actually be enforced by the CFF writer) */
2556  if (fix_notdef) {
2557  /* this is obsolete */
2558  l = notdef_loc(sf);
2559  /* now l is the .notdef location, adjust gid if needed */
2560  if (l == sf->glyphcnt) {
2561  /* no .notdef at all, will be created at zero */
2562  if (gid == 0) {
2563  /* we ask for .notdef but .notdef was added at end */
2564  gid = l;
2565  } else {
2566  /* f.glyphs[gid] == sf->glyphs[gid-1] */
2567  gid--;
2568  }
2569  } else if (l != 0) {
2570  if (gid == 0) {
2571  gid = l;
2572  } else if (gid < l) {
2573  gid--;
2574  }
2575  }
2576  }
2577 
2578  if (sf->glyphs[gid] && sf->glyphs[gid] != (struct splinechar *)-1) {
2579  lua_ff_pushglyph(L, sf->glyphs[gid]);
2580  } else {
2581  lua_pushnil(L);
2582  }
2583  return 1;
2584 }
2585 
2587 {
2588  struct splinechar *glyph;
2589  int key;
2590  glyph = *check_isglyph(L, 1);
2591  if (glyph == NULL) {
2592  return luaL_error(L, "fontloader.glyph.__index: glyph is nonexistent\n");
2593  }
2594  if (lua_type(L, 2) != LUA_TSTRING) { /* 1 == 'font' */
2595  return luaL_error(L, "fontloader.glyph.__index: can only be indexed by string\n");
2596  }
2598  switch (key) {
2599  case GK_name:
2601  break;
2602  case GK_unicode:
2603  lua_pushinteger(L, glyph->unicodeenc);
2604  break;
2605  case GK_boundingbox:
2606  if (glyph->xmax == 0 && glyph->ymax == 0 && glyph->xmin == 0 && glyph->ymin == 0) {
2607  DBounds bb;
2609  glyph->xmin = bb.minx;
2610  glyph->ymin = bb.miny;
2611  glyph->xmax = bb.maxx;
2612  glyph->ymax = bb.maxy;
2613  }
2614  lua_createtable(L, 4, 0);
2615  lua_pushinteger(L, 1);
2616  lua_pushinteger(L, glyph->xmin);
2617  lua_rawset(L, -3);
2618  lua_pushinteger(L, 2);
2619  lua_pushinteger(L, glyph->ymin);
2620  lua_rawset(L, -3);
2621  lua_pushinteger(L, 3);
2622  lua_pushinteger(L, glyph->xmax);
2623  lua_rawset(L, -3);
2624  lua_pushinteger(L, 4);
2625  lua_pushinteger(L, glyph->ymax);
2626  lua_rawset(L, -3);
2627  break;
2628  case GK_vwidth:
2629  lua_pushinteger(L, glyph->vwidth);
2630  break;
2631  case GK_width:
2633  break;
2634  case GK_lsidebearing:
2635  lua_pushinteger(L, glyph->lsidebearing);
2636  break;
2637  case GK_class:
2638  if (glyph->glyph_class > 0) {
2639  lua_pushstring(L, glyph_class_enum[glyph->glyph_class]);
2640  } else {
2641  lua_pushnil(L);
2642  }
2643  break;
2644  case GK_kerns:
2645  if (glyph->kerns != NULL) {
2646  lua_newtable(L);
2647  handle_kernpair(L, glyph->kerns);
2648  } else {
2649  lua_pushnil(L);
2650  }
2651  break;
2652  case GK_vkerns:
2653  if (glyph->vkerns != NULL) {
2654  lua_newtable(L);
2655  handle_kernpair(L, glyph->vkerns);
2656  } else {
2657  lua_pushnil(L);
2658  }
2659  break;
2660  case GK_dependents:
2661  if (glyph->dependents != NULL) {
2662  lua_newtable(L);
2663  handle_splinecharlist(L, glyph->dependents);
2664  } else {
2665  lua_pushnil(L);
2666  }
2667  break;
2668  case GK_lookups:
2669  if (glyph->possub != NULL) {
2670  lua_newtable(L);
2671  handle_generic_pst(L, glyph->possub);
2672  } else {
2673  lua_pushnil(L);
2674  }
2675  break;
2676  case GK_ligatures:
2677  if (glyph->ligofme != NULL) {
2678  lua_newtable(L);
2679  handle_liglist(L, glyph->ligofme);
2680  } else {
2681  lua_pushnil(L);
2682  }
2683  break;
2684  case GK_comment:
2685  lua_pushstring(L, glyph->comment);
2686  break;
2687  case GK_anchors:
2688  if (glyph->anchor != NULL) {
2689  lua_newtable(L);
2690  handle_anchorpoint(L, glyph->anchor);
2691  } else {
2692  lua_pushnil(L);
2693  }
2694  break;
2695  case GK_altuni:
2696  if (glyph->altuni != NULL) {
2697  lua_newtable(L);
2698  handle_altuni(L, glyph->altuni);
2699  } else {
2700  lua_pushnil(L);
2701  }
2702  break;
2703  case GK_tex_height:
2704  if (glyph->tex_height != TEX_UNDEF) {
2705  lua_pushinteger(L, glyph->tex_height);
2706  } else {
2707  lua_pushnil(L);
2708  }
2709  break;
2710  case GK_tex_depth:
2711  if (glyph->tex_height != TEX_UNDEF) {
2712  lua_pushinteger(L, glyph->tex_depth);
2713  } else {
2714  lua_pushnil(L);
2715  }
2716  break;
2717  case GK_is_extended_shape:
2718  lua_pushinteger(L, glyph->is_extended_shape);
2719  break;
2720  case GK_italic_correction:
2721  if (glyph->italic_correction != TEX_UNDEF) {
2722  lua_pushinteger(L, glyph->italic_correction);
2723  } else {
2724  lua_pushnil(L);
2725  }
2726  break;
2727  case GK_top_accent:
2728  if (glyph->top_accent_horiz != TEX_UNDEF) {
2729  lua_pushinteger(L, glyph->top_accent_horiz);
2730  } else {
2731  lua_pushnil(L);
2732  }
2733  break;
2734  case GK_vert_variants:
2735  if (glyph->vert_variants != NULL) {
2736  lua_newtable(L);
2737  handle_glyphvariants(L, glyph->vert_variants);
2738  } else {
2739  lua_pushnil(L);
2740  }
2741  break;
2742  case GK_horiz_variants:
2743  if (glyph->horiz_variants != NULL) {
2744  lua_newtable(L);
2745  handle_glyphvariants(L, glyph->horiz_variants);
2746  } else {
2747  lua_pushnil(L);
2748  }
2749  break;
2750  case GK_mathkern:
2751  if (glyph->mathkern != NULL) {
2752  lua_newtable(L);
2753  handle_mathkern(L, glyph->mathkern);
2754  } else {
2755  lua_pushnil(L);
2756  }
2757  break;
2758  default:
2759  lua_pushnil(L);
2760  }
2761  return 1;
2762 }
2763 
2764 static int ff_index(lua_State * L)
2765 {
2766  SplineFont *sf;
2767  int k, key;
2768  /* sf = *check_isfont(L, 1); */
2770  return luaL_error(L, "fontloader.__index: expected a (sub)font userdata object\n");
2771  }
2772  sf = *((SplineFont **)lua_touserdata(L, 1));
2773  if (sf == NULL) {
2774  lua_pushnil(L);
2775  return 1;
2776  }
2777  if (lua_type(L, 2) != LUA_TSTRING) { /* 1 == 'font' */
2778  return luaL_error(L, "fontloader.__index: can only be indexed by string\n");
2779  }
2781  switch (key) {
2782  case FK_table_version:
2784  break;
2785  case FK_fontname:
2786  lua_pushstring(L, sf->fontname);
2787  break;
2788  case FK_fullname:
2789  lua_pushstring(L, sf->fullname);
2790  break;
2791  case FK_familyname:
2792  lua_pushstring(L, sf->familyname);
2793  break;
2794  case FK_weight:
2795  lua_pushstring(L, sf->weight);
2796  break;
2797  case FK_copyright:
2798  lua_pushstring(L, sf->copyright);
2799  break;
2800  case FK_filename:
2801  lua_pushstring(L, sf->filename);
2802  break;
2803  case FK_version:
2804  lua_pushstring(L, sf->version);
2805  break;
2806  case FK_italicangle:
2807  lua_pushinteger(L, sf->italicangle);
2808  break;
2809  case FK_upos:
2810  lua_pushinteger(L, sf->upos);
2811  break;
2812  case FK_uwidth:
2813  lua_pushinteger(L, sf->uwidth);
2814  break;
2815  case FK_ascent:
2816  lua_pushinteger(L, sf->ascent);
2817  break;
2818  case FK_descent:
2819  lua_pushinteger(L, sf->descent);
2820  break;
2821  case FK_uniqueid:
2822  lua_pushinteger(L, sf->uniqueid);
2823  break;
2824  case FK_glyphcnt:
2825  if (sf->glyphcnt > 0) {
2826  lua_pushinteger(L, sf->glyphmax - sf->glyphmin + 1);
2827  } else {
2828  lua_pushinteger(L, 0);
2829  }
2830  break;
2831  case FK_glyphmax:
2832  lua_pushinteger(L, sf->glyphmax - 1);
2833  break;
2834  case FK_glyphmin:
2835  lua_pushinteger(L, sf->glyphmin);
2836  break;
2837  case FK_units_per_em:
2838  lua_pushinteger(L, sf->units_per_em);
2839  break;
2840  case FK_lookups:
2841  if (sf->possub != NULL) {
2842  lua_newtable(L);
2843  handle_generic_fpst(L, sf->possub);
2844  } else {
2845  lua_pushnil(L);
2846  }
2847  break;
2848  case FK_glyphs:
2849  lua_newtable(L); /* the virtual glyph table */
2850  lua_pushstring(L, "__sf");
2851  lua_pushvalue(L, 1); /* that is our font */
2852  lua_rawset(L, -3);
2854  lua_setmetatable(L, -2); /* assign the metatable */
2855  break;
2856  case FK_hasvmetrics:
2857  lua_pushinteger(L, sf->hasvmetrics);
2858  break;
2859  case FK_onlybitmaps:
2860  lua_pushinteger(L, sf->onlybitmaps);
2861  break;
2862  case FK_serifcheck:
2863  lua_pushinteger(L, sf->serifcheck);
2864  break;
2865  case FK_isserif:
2866  lua_pushinteger(L, sf->isserif);
2867  break;
2868  case FK_issans:
2869  lua_pushinteger(L, sf->issans);
2870  break;
2871  case FK_encodingchanged:
2872  lua_pushinteger(L, sf->encodingchanged);
2873  break;
2874  case FK_strokedfont:
2875  lua_pushinteger(L, sf->strokedfont);
2876  break;
2877  case FK_use_typo_metrics:
2878  lua_pushinteger(L, sf->use_typo_metrics);
2879  break;
2881  lua_pushinteger(L, sf->weight_width_slope_only);
2882  break;
2884  lua_pushinteger(L, sf->head_optimized_for_cleartype);
2885  break;
2886  case FK_uni_interp:
2887  lua_pushstring(L, uni_interp_enum[(sf->uni_interp + 1)]);
2888  break;
2889  case FK_map:
2890  if (sf->map != NULL) {
2891  lua_newtable(L);
2892  handle_encmap(L, sf->map, 0); /* notdef_loc(sf)); */
2893  } else {
2894  lua_pushnil(L);
2895  }
2896  break;
2897  case FK_origname:
2898  lua_pushstring(L, sf->origname);
2899  break;
2900  case FK_private:
2901  if (sf->private != NULL) {
2902  lua_newtable(L);
2903  handle_psdict(L, sf->private);
2904  } else {
2905  lua_pushnil(L);
2906  }
2907  break;
2908  case FK_xuid:
2909  lua_pushstring(L, sf->xuid);
2910  break;
2911  case FK_pfminfo:
2912  lua_createtable(L, 0, 40);
2913  handle_pfminfo(L, sf->pfminfo);
2914  break;
2915  case FK_names:
2916  if (sf->names != NULL) {
2917  lua_newtable(L);
2918  handle_ttflangname(L, sf->names);
2919  } else {
2920  lua_pushnil(L);
2921  }
2922  break;
2923  case FK_cidinfo:
2924  lua_createtable(L, 0, 4);
2925  dump_stringfield(L, "registry", sf->cidregistry);
2926  dump_stringfield(L, "ordering", sf->ordering);
2927  dump_intfield(L, "version", sf->cidversion);
2928  dump_intfield(L, "supplement", sf->supplement);
2929  break;
2930  case FK_subfonts:
2931  if (sf->subfontcnt > 0) {
2932  lua_createtable(L, sf->subfontcnt, 0);
2933  for (k = 0; k < sf->subfontcnt; k++) {
2934  lua_ff_pushsubfont(L, sf->subfonts[k]);
2935  lua_rawseti(L, -2, (k + 1));
2936  }
2937  } else {
2938  lua_pushnil(L);
2939  }
2940  break;
2941  case FK_comments:
2942  lua_pushstring(L, sf->comments);
2943  break;
2944  case FK_fontlog:
2945  lua_pushstring(L, sf->fontlog);
2946  break;
2947  case FK_cvt_names:
2948  if (sf->cvt_names != NULL) {
2949  lua_newtable(L);
2950  for (k = 0; sf->cvt_names[k] != END_CVT_NAMES; ++k) {
2951  lua_pushstring(L, sf->cvt_names[k]);
2952  lua_rawseti(L, -2, (k + 1));
2953  }
2954  } else {
2955  lua_pushnil(L);
2956  }
2957  break;
2958  case FK_ttf_tables:
2959  if (sf->ttf_tables != NULL) {
2960  lua_newtable(L);
2961  handle_ttf_table(L, sf->ttf_tables);
2962  } else {
2963  lua_pushnil(L);
2964  }
2965  break;
2966  case FK_ttf_tab_saved:
2967  if (sf->ttf_tab_saved != NULL) {
2968  lua_newtable(L);
2969  handle_ttf_table(L, sf->ttf_tab_saved);
2970  } else {
2971  lua_pushnil(L);
2972  }
2973  break;
2974  case FK_texdata:
2975  if (sf->texdata.type != tex_unset) {
2976  lua_newtable(L);
2977  dump_enumfield(L, "type", sf->texdata.type, tex_type_enum);
2978  lua_newtable(L);
2979  for (k = 0; k < 22; k++) {
2980  lua_pushinteger(L, k);
2981  lua_pushinteger(L, sf->texdata.params[k]);
2982  lua_rawset(L, -3);
2983  }
2984  lua_setfield(L, -2, "params");
2985  } else {
2986  lua_pushnil(L);
2987  }
2988  break;
2989  case FK_anchor_classes:
2990  if (sf->anchor != NULL) {
2991  lua_newtable(L);
2992  handle_anchorclass(L, sf->anchor);
2993  } else {
2994  lua_pushnil(L);
2995  }
2996  break;
2997  case FK_kerns:
2998  if (sf->kerns != NULL) {
2999  lua_newtable(L);
3000  handle_kernclass(L, sf->kerns, NULL);
3001  } else {
3002  lua_pushnil(L);
3003  }
3004  break;
3005  case FK_vkerns:
3006  if (sf->vkerns != NULL) {
3007  lua_newtable(L);
3008  handle_kernclass(L, sf->vkerns, NULL);
3009  } else {
3010  lua_pushnil(L);
3011  }
3012  break;
3013  case FK_gsub:
3014  if (sf->gsub_lookups != NULL) {
3015  lua_newtable(L);
3016  handle_lookup(L, sf->gsub_lookups, sf);
3017  } else {
3018  lua_pushnil(L);
3019  }
3020  break;
3021  case FK_gpos:
3022  if (sf->gpos_lookups != NULL) {
3023  lua_newtable(L);
3024  handle_lookup(L, sf->gpos_lookups, sf);
3025  } else {
3026  lua_pushnil(L);
3027  }
3028  break;
3029  case FK_mm:
3030  if (sf->mm != NULL) {
3031  lua_newtable(L);
3032  handle_mmset(L, sf->mm);
3033  } else {
3034  lua_pushnil(L);
3035  }
3036  break;
3037  case FK_chosenname:
3038  lua_pushstring(L, sf->chosenname);
3039  break;
3040  case FK_macstyle:
3041  lua_pushinteger(L, sf->macstyle);
3042  break;
3043  case FK_fondname:
3044  lua_pushstring(L, sf->fondname);
3045  break;
3046  case FK_design_size:
3047  lua_pushinteger(L, sf->design_size);
3048  break;
3049  case FK_fontstyle_id:
3050  lua_pushinteger(L, sf->fontstyle_id);
3051  break;
3052  case FK_fontstyle_name:
3053  if (sf->fontstyle_name != NULL) {
3054  lua_newtable(L);
3055  handle_otfname(L, sf->fontstyle_name);
3056  } else {
3057  lua_pushnil(L);
3058  }
3059  break;
3061  lua_pushinteger(L, sf->design_range_bottom);
3062  break;
3063  case FK_design_range_top:
3064  lua_pushinteger(L, sf->design_range_top);
3065  break;
3066  case FK_strokewidth:
3067  lua_pushinteger(L, sf->strokewidth);
3068  break;
3069  case FK_mark_classes:
3070  if (sf->mark_class_cnt > 0) {
3071  lua_newtable(L);
3072  for (k = 0; k < sf->mark_class_cnt; k++) {
3073  if (sf->mark_class_names[k] != NULL) {
3074  lua_pushstring(L, sf->mark_class_names[k]);
3075  lua_pushstring(L, sf->mark_classes[k]);
3076  lua_rawset(L, -3);
3077  }
3078  }
3079  } else {
3080  lua_pushnil(L);
3081  }
3082  break;
3083  case FK_creationtime:
3084  lua_pushinteger(L, sf->creationtime);
3085  break;
3086  case FK_modificationtime:
3087  lua_pushinteger(L, sf->modificationtime);
3088  break;
3089  case FK_os2_version:
3090  lua_pushinteger(L, sf->os2_version);
3091  break;
3092  case FK_sfd_version:
3093  lua_pushinteger(L, sf->sfd_version);
3094  break;
3095  case FK_math:
3096  if (sf->MATH != NULL) {
3097  lua_newtable(L);
3098  handle_MATH(L, sf->MATH);
3099  } else {
3100  lua_pushnil(L);
3101  }
3102  break;
3103  case FK_validation_state:
3104  if (sf->loadvalidation_state != 0) {
3105  int val, st;
3106  lua_newtable(L);
3107  val = 1;
3108  st = sf->loadvalidation_state;
3109  if (st & lvs_bad_ps_fontname) {
3110  lua_pushliteral(L, "bad_ps_fontname");
3111  lua_rawseti(L, -2, val++);
3112  }
3113  if (st & lvs_bad_glyph_table) {
3114  lua_pushliteral(L, "bad_glyph_table");
3115  lua_rawseti(L, -2, val++);
3116  }
3117  if (st & lvs_bad_cff_table) {
3118  lua_pushliteral(L, "bad_cff_table");
3119  lua_rawseti(L, -2, val++);
3120  }
3121  if (st & lvs_bad_metrics_table) {
3122  lua_pushliteral(L, "bad_metrics_table");
3123  lua_rawseti(L, -2, val++);
3124  }
3125  if (st & lvs_bad_cmap_table) {
3126  lua_pushliteral(L, "bad_cmap_table");
3127  lua_rawseti(L, -2, val++);
3128  }
3129  if (st & lvs_bad_bitmaps_table) {
3130  lua_pushliteral(L, "bad_bitmaps_table");
3131  lua_rawseti(L, -2, val++);
3132  }
3133  if (st & lvs_bad_gx_table) {
3134  lua_pushliteral(L, "bad_gx_table");
3135  lua_rawseti(L, -2, val++);
3136  }
3137  if (st & lvs_bad_ot_table) {
3138  lua_pushliteral(L, "bad_ot_table");
3139  lua_rawseti(L, -2, val++);
3140  }
3141  if (st & lvs_bad_os2_version) {
3142  lua_pushliteral(L, "bad_os2_version");
3143  lua_rawseti(L, -2, val++);
3144  }
3145  if (st & lvs_bad_sfnt_header) {
3146  lua_pushliteral(L, "bad_sfnt_header");
3147  lua_rawseti(L, -2, val++);
3148  }
3149  } else {
3150  lua_pushnil(L);
3151  }
3152  break;
3153  case FK_horiz_base:
3154  if (sf->horiz_base != NULL) {
3155  lua_newtable(L);
3156  handle_base(L, sf->horiz_base);
3157  } else {
3158  lua_pushnil(L);
3159  }
3160  break;
3161  case FK_vert_base:
3162  if (sf->vert_base != NULL) {
3163  lua_newtable(L);
3164  handle_base(L, sf->vert_base);
3165  } else {
3166  lua_pushnil(L);
3167  }
3168  break;
3169  case FK_extrema_bound:
3170  lua_pushinteger(L, sf->extrema_bound);
3171  break;
3172  case FK_notdef_loc:
3174  break;
3175  default:
3176  /* can't actually happen, |luaL_checkoption| raises an error instead */
3177  lua_pushnil(L);
3178  break;
3179  }
3180  return 1;
3181 }
3182 
3183 static int ff_info(lua_State * L)
3184 {
3185  SplineFont *sf;
3186  FILE *l;
3187  int i;
3188  const char *fontname;
3189  char *fontnamecopy;
3190  int openflags = 1;
3191  fontname = luaL_checkstring(L, 1);
3192  if (!strlen(fontname)) {
3193  lua_pushnil(L);
3194  lua_pushfstring(L, "font loading failed: empty string given\n", fontname);
3195  return 2;
3196  }
3197  /* test fontname for existance */
3198  if ((l = fopen(fontname, "r"))) {
3200  fclose(l);
3201  } else {
3202  lua_pushnil(L);
3203  lua_pushfstring(L, "font loading failed for %s (read error)\n", fontname);
3204  return 2;
3205  }
3206  gww_error_count = 0;
3207  fontnamecopy = xstrdup(fontname);
3208  sf = ReadSplineFontInfo(fontnamecopy, openflags);
3209  free(fontnamecopy);
3210  if (gww_error_count > 0)
3211  gwwv_errors_free();
3212 
3213  if (sf == NULL) {
3214  lua_pushnil(L);
3215  lua_pushfstring(L, "font loading failed for %s\n", fontname);
3216  return 2;
3217  } else {
3218  if (sf->next != NULL) {
3219  SplineFont *sf_next;
3220  i = 1;
3221  lua_newtable(L);
3222  while (sf) {
3223  do_ff_info(L, sf);
3224  lua_rawseti(L, -2, i);
3225  i++;
3226  sf_next = sf->next;
3227  EncMapFree(sf->map);
3228  SplineFontFree(sf);
3229  sf = sf_next;
3230  }
3231  } else {
3232  do_ff_info(L, sf);
3233  EncMapFree(sf->map);
3234  SplineFontFree(sf);
3235  }
3236  }
3237  return 1;
3238 }
3239 
3240 static void ff_do_cff(SplineFont * sf, char *filename, unsigned char **buf,
3241  int *bufsiz)
3242 {
3243  FILE *f;
3244  int32 *bsizes = NULL;
3246  EncMap *map;
3247 
3248  map = EncMap1to1(sf->glyphcnt);
3249 
3250  if (WriteTTFFont
3251  (filename, sf, ff_cff, bsizes, bf_none, flags, map, ly_fore)) {
3252  /* success */
3253  f = fopen(filename, "rb");
3255  readbinfile(f, buf, bufsiz);
3256  /*fprintf(stdout,"\n%s => CFF, size: %d\n", sf->filename, *bufsiz); */
3257  fclose(f);
3258  return;
3259  }
3260  formatted_error("fontloader","%s to CFF conversion failed", sf->filename);
3261 }
3262 
3263 /* exported for writecff.c */
3264 
3265 int ff_createcff(char *file, unsigned char **buf, int *bufsiz)
3266 {
3267  SplineFont *sf;
3268  int k;
3269  char s[] = "tempfile.cff";
3270  int openflags = 1;
3271  int notdefpos = 0;
3273  if (sf) {
3274  /* this is not the best way. nicer to have no temp file at all */
3275  ff_do_cff(sf, s, buf, bufsiz);
3276  for (k = 0; k < sf->glyphcnt; k++) {
3277  if (sf->glyphs[k] && strcmp(sf->glyphs[k]->name, ".notdef") == 0) {
3278  notdefpos = k;
3279  break;
3280  }
3281  }
3282  remove(s);
3283  EncMapFree(sf->map);
3284  SplineFontFree(sf);
3285  }
3286  return notdefpos;
3287 }
3288 
3289 int ff_get_ttc_index(char *ffname, char *psname)
3290 {
3291  SplineFont *sf;
3292  int i = 0;
3293  int openflags = 1;
3294  int index = -1;
3295 
3296  sf = ReadSplineFontInfo((char *) ffname, openflags);
3297  if (sf == NULL) {
3298  normal_error("fontloader","font loading failed unexpectedly");
3299  }
3300  while (sf != NULL) {
3301  if (strcmp(sf->fontname, psname) == 0) {
3302  index = i;
3303  }
3304  i++;
3305  sf = sf->next;
3306  }
3307  if (index>=0)
3308  return (i-index-1);
3309  return -1;
3310 }
3311 
3312 static struct luaL_Reg fllib[] = {
3313  {"open", ff_open},
3314  {"info", ff_info},
3315  {"close", ff_close},
3316  {"fields", ff_fields},
3317  {"apply_afmfile", ff_apply_afmfile},
3318  {"apply_featurefile", ff_apply_featurefile},
3319  {"to_table", ff_make_table},
3320  {NULL, NULL}
3321 };
3322 
3323 static const struct luaL_Reg fflib_m[] = {
3324  {"__gc", ff_close}, /* doesnt work yet! */
3325  {"__index", ff_index},
3326  {NULL, NULL} /* sentinel */
3327 };
3328 
3330 {
3331  static char coord_sep_string[] = ",";
3332  static char SaveTablesPref_string[] = "VORG,JSTF,acnt,bsln,fdsc,fmtx,hsty,just,trak,Zapf,LINO";
3333  InitSimpleStuff();
3334  setlocale(LC_ALL, "C"); /* undo whatever InitSimpleStuff has caused */
3335  coord_sep = coord_sep_string;
3337  default_encoding = FindOrMakeEncoding("ISO8859-1");
3338  SaveTablesPref = SaveTablesPref_string;
3340  luaL_openlib(L, NULL, fflib_m, 0);
3341 
3342  /* virtual subfont table */
3344  lua_pushstring(L, "__index");
3346  lua_rawset(L, -3);
3347  lua_pop(L, 1);
3348  /* virtual glyphs table */
3350  lua_pushstring(L, "__index");
3352  lua_rawset(L, -3);
3353  lua_pop(L, 1);
3354  /* virtual glyph table */
3356  lua_pushstring(L, "__index");
3358  lua_rawset(L, -3);
3359  lua_pop(L, 1);
3360 
3361  luaL_openlib(L, "fontloader", fllib, 0);
3362 
3363  return 1;
3364 }
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