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)  

lj_parse.c
Go to the documentation of this file.
1 /*
2 ** Lua parser (source code -> bytecode).
3 ** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h
4 **
5 ** Major portions taken verbatim or adapted from the Lua interpreter.
6 ** Copyright (C) 1994-2008 Lua.org, PUC-Rio. See Copyright Notice in lua.h
7 */
8 
9 #define lj_parse_c
10 #define LUA_CORE
11 
12 #include "lj_obj.h"
13 #include "lj_gc.h"
14 #include "lj_err.h"
15 #include "lj_debug.h"
16 #include "lj_buf.h"
17 #include "lj_str.h"
18 #include "lj_tab.h"
19 #include "lj_func.h"
20 #include "lj_state.h"
21 #include "lj_bc.h"
22 #if LJ_HASFFI
23 #include "lj_ctype.h"
24 #endif
25 #include "lj_strfmt.h"
26 #include "lj_lex.h"
27 #include "lj_parse.h"
28 #include "lj_vm.h"
29 #include "lj_vmevent.h"
30 
31 /* -- Parser structures and definitions ----------------------------------- */
32 
33 /* Expression kinds. */
34 typedef enum {
35  /* Constant expressions must be first and in this order: */
39  VKSTR, /* sval = string value */
40  VKNUM, /* nval = number value */
42  VKCDATA, /* nval = cdata value, not treated as a constant expression */
43  /* Non-constant expressions follow: */
44  VLOCAL, /* info = local register, aux = vstack index */
45  VUPVAL, /* info = upvalue index, aux = vstack index */
46  VGLOBAL, /* sval = string value */
47  VINDEXED, /* info = table register, aux = index reg/byte/string const */
48  VJMP, /* info = instruction PC */
49  VRELOCABLE, /* info = instruction PC */
50  VNONRELOC, /* info = result register */
51  VCALL, /* info = instruction PC, aux = base */
52  VVOID
54 
55 /* Expression descriptor. */
56 typedef struct ExpDesc {
57  union {
58  struct {
59  uint32_t info; /* Primary info. */
60  uint32_t aux; /* Secondary info. */
61  } s;
62  TValue nval; /* Number value. */
63  GCstr *sval; /* String value. */
64  } u;
65  ExpKind k;
66  BCPos t; /* True condition jump list. */
67  BCPos f; /* False condition jump list. */
69 
70 /* Macros for expressions. */
71 #define expr_hasjump(e) ((e)->t != (e)->f)
72 
73 #define expr_isk(e) ((e)->k <= VKLAST)
74 #define expr_isk_nojump(e) (expr_isk(e) && !expr_hasjump(e))
75 #define expr_isnumk(e) ((e)->k == VKNUM)
76 #define expr_isnumk_nojump(e) (expr_isnumk(e) && !expr_hasjump(e))
77 #define expr_isstrk(e) ((e)->k == VKSTR)
78 
79 #define expr_numtv(e) check_exp(expr_isnumk((e)), &(e)->u.nval)
80 #define expr_numberV(e) numberVnum(expr_numtv((e)))
81 
82 /* Initialize expression. */
83 static LJ_AINLINE void expr_init(ExpDesc *e, ExpKind k, uint32_t info)
84 {
85  e->k = k;
86  e->u.s.info = info;
87  e->f = e->t = NO_JMP;
88 }
89 
90 /* Check number constant for +-0. */
91 static int expr_numiszero(ExpDesc *e)
92 {
93  TValue *o = expr_numtv(e);
94  return tvisint(o) ? (intV(o) == 0) : tviszero(o);
95 }
96 
97 /* Per-function linked list of scope blocks. */
98 typedef struct FuncScope {
99  struct FuncScope *prev; /* Link to outer scope. */
100  MSize vstart; /* Start of block-local variables. */
101  uint8_t nactvar; /* Number of active vars outside the scope. */
102  uint8_t flags; /* Scope flags. */
104 
105 #define FSCOPE_LOOP 0x01 /* Scope is a (breakable) loop. */
106 #define FSCOPE_BREAK 0x02 /* Break used in scope. */
107 #define FSCOPE_GOLA 0x04 /* Goto or label used in scope. */
108 #define FSCOPE_UPVAL 0x08 /* Upvalue in scope. */
109 #define FSCOPE_NOCLOSE 0x10 /* Do not close upvalues. */
110 
111 #define NAME_BREAK ((GCstr *)(uintptr_t)1)
112 
113 /* Index into variable stack. */
115 #define LJ_MAX_VSTACK (65536 - LJ_MAX_UPVAL)
116 
117 /* Variable/goto/label info. */
118 #define VSTACK_VAR_RW 0x01 /* R/W variable. */
119 #define VSTACK_GOTO 0x02 /* Pending goto. */
120 #define VSTACK_LABEL 0x04 /* Label. */
121 
122 /* Per-function state. */
123 typedef struct FuncState {
124  GCtab *kt; /* Hash table for constants. */
125  LexState *ls; /* Lexer state. */
126  lua_State *L; /* Lua state. */
127  FuncScope *bl; /* Current scope. */
128  struct FuncState *prev; /* Enclosing function. */
129  BCPos pc; /* Next bytecode position. */
130  BCPos lasttarget; /* Bytecode position of last jump target. */
131  BCPos jpc; /* Pending jump list to next bytecode. */
132  BCReg freereg; /* First free register. */
133  BCReg nactvar; /* Number of active local variables. */
134  BCReg nkn, nkgc; /* Number of lua_Number/GCobj constants */
135  BCLine linedefined; /* First line of the function definition. */
136  BCInsLine *bcbase; /* Base of bytecode stack. */
137  BCPos bclim; /* Limit of bytecode stack. */
138  MSize vbase; /* Base of variable stack for this function. */
139  uint8_t flags; /* Prototype flags. */
140  uint8_t numparams; /* Number of parameters. */
141  uint8_t framesize; /* Fixed frame size. */
142  uint8_t nuv; /* Number of upvalues */
143  VarIndex varmap[LJ_MAX_LOCVAR]; /* Map from register to variable idx. */
144  VarIndex uvmap[LJ_MAX_UPVAL]; /* Map from upvalue to variable idx. */
145  VarIndex uvtmp[LJ_MAX_UPVAL]; /* Temporary upvalue map. */
147 
148 /* Binary and unary operators. ORDER OPR */
149 typedef enum BinOpr {
150  OPR_ADD, OPR_SUB, OPR_MUL, OPR_DIV, OPR_MOD, OPR_POW, /* ORDER ARITH */
157 
158 LJ_STATIC_ASSERT((int)BC_ISGE-(int)BC_ISLT == (int)OPR_GE-(int)OPR_LT);
159 LJ_STATIC_ASSERT((int)BC_ISLE-(int)BC_ISLT == (int)OPR_LE-(int)OPR_LT);
160 LJ_STATIC_ASSERT((int)BC_ISGT-(int)BC_ISLT == (int)OPR_GT-(int)OPR_LT);
165 
166 /* -- Error handling ------------------------------------------------------ */
167 
168 LJ_NORET LJ_NOINLINE static void err_syntax(LexState *ls, ErrMsg em)
169 {
170  lj_lex_error(ls, ls->tok, em);
171 }
172 
173 LJ_NORET LJ_NOINLINE static void err_token(LexState *ls, LexToken tok)
174 {
175  lj_lex_error(ls, ls->tok, LJ_ERR_XTOKEN, lj_lex_token2str(ls, tok));
176 }
177 
178 LJ_NORET static void err_limit(FuncState *fs, uint32_t limit, const char *what)
179 {
180  if (fs->linedefined == 0)
181  lj_lex_error(fs->ls, 0, LJ_ERR_XLIMM, limit, what);
182  else
183  lj_lex_error(fs->ls, 0, LJ_ERR_XLIMF, fs->linedefined, limit, what);
184 }
185 
186 #define checklimit(fs, v, l, m) if ((v) >= (l)) err_limit(fs, l, m)
187 #define checklimitgt(fs, v, l, m) if ((v) > (l)) err_limit(fs, l, m)
188 #define checkcond(ls, c, em) { if (!(c)) err_syntax(ls, em); }
189 
190 /* -- Management of constants --------------------------------------------- */
191 
192 /* Return bytecode encoding for primitive constant. */
193 #define const_pri(e) check_exp((e)->k <= VKTRUE, (e)->k)
194 
195 #define tvhaskslot(o) ((o)->u32.hi == 0)
196 #define tvkslot(o) ((o)->u32.lo)
197 
198 /* Add a number constant. */
200 {
201  lua_State *L = fs->L;
202  TValue *o;
204  o = lj_tab_set(L, fs->kt, &e->u.nval);
205  if (tvhaskslot(o))
206  return tvkslot(o);
207  o->u64 = fs->nkn;
208  return fs->nkn++;
209 }
210 
211 /* Add a GC object constant. */
213 {
214  lua_State *L = fs->L;
215  TValue key, *o;
216  setgcV(L, &key, gc, itype);
217  /* NOBARRIER: the key is new or kept alive. */
218  o = lj_tab_set(L, fs->kt, &key);
219  if (tvhaskslot(o))
220  return tvkslot(o);
221  o->u64 = fs->nkgc;
222  return fs->nkgc++;
223 }
224 
225 /* Add a string constant. */
227 {
228  lua_assert(expr_isstrk(e) || e->k == VGLOBAL);
229  return const_gc(fs, obj2gco(e->u.sval), LJ_TSTR);
230 }
231 
232 /* Anchor string constant to avoid GC. */
233 GCstr *lj_parse_keepstr(LexState *ls, const char *str, size_t len)
234 {
235  /* NOBARRIER: the key is new or kept alive. */
236  lua_State *L = ls->L;
237  GCstr *s = lj_str_new(L, str, len);
238  TValue *tv = lj_tab_setstr(L, ls->fs->kt, s);
239  if (tvisnil(tv)) setboolV(tv, 1);
240  lj_gc_check(L);
241  return s;
242 }
243 
244 #if LJ_HASFFI
245 /* Anchor cdata to avoid GC. */
247 {
248  /* NOBARRIER: the key is new or kept alive. */
249  lua_State *L = ls->L;
250  setcdataV(L, tv, cd);
251  setboolV(lj_tab_set(L, ls->fs->kt, tv), 1);
252 }
253 #endif
254 
255 /* -- Jump list handling -------------------------------------------------- */
256 
257 /* Get next element in jump list. */
259 {
260  ptrdiff_t delta = bc_j(fs->bcbase[pc].ins);
261  if ((BCPos)delta == NO_JMP)
262  return NO_JMP;
263  else
264  return (BCPos)(((ptrdiff_t)pc+1)+delta);
265 }
266 
267 /* Check if any of the instructions on the jump list produce no value. */
268 static int jmp_novalue(FuncState *fs, BCPos list)
269 {
270  for (; list != NO_JMP; list = jmp_next(fs, list)) {
271  BCIns p = fs->bcbase[list >= 1 ? list-1 : list].ins;
272  if (!(bc_op(p) == BC_ISTC || bc_op(p) == BC_ISFC || bc_a(p) == NO_REG))
273  return 1;
274  }
275  return 0;
276 }
277 
278 /* Patch register of test instructions. */
280 {
281  BCInsLine *ilp = &fs->bcbase[pc >= 1 ? pc-1 : pc];
282  BCOp op = bc_op(ilp->ins);
283  if (op == BC_ISTC || op == BC_ISFC) {
284  if (reg != NO_REG && reg != bc_d(ilp->ins)) {
285  setbc_a(&ilp->ins, reg);
286  } else { /* Nothing to store or already in the right register. */
287  setbc_op(&ilp->ins, op+(BC_IST-BC_ISTC));
288  setbc_a(&ilp->ins, 0);
289  }
290  } else if (bc_a(ilp->ins) == NO_REG) {
291  if (reg == NO_REG) {
292  ilp->ins = BCINS_AJ(BC_JMP, bc_a(fs->bcbase[pc].ins), 0);
293  } else {
294  setbc_a(&ilp->ins, reg);
295  if (reg >= bc_a(ilp[1].ins))
296  setbc_a(&ilp[1].ins, reg+1);
297  }
298  } else {
299  return 0; /* Cannot patch other instructions. */
300  }
301  return 1;
302 }
303 
304 /* Drop values for all instructions on jump list. */
305 static void jmp_dropval(FuncState *fs, BCPos list)
306 {
307  for (; list != NO_JMP; list = jmp_next(fs, list))
309 }
310 
311 /* Patch jump instruction to target. */
313 {
314  BCIns *jmp = &fs->bcbase[pc].ins;
315  BCPos offset = dest-(pc+1)+BCBIAS_J;
316  lua_assert(dest != NO_JMP);
317  if (offset > BCMAX_D)
318  err_syntax(fs->ls, LJ_ERR_XJUMP);
319  setbc_d(jmp, offset);
320 }
321 
322 /* Append to jump list. */
323 static void jmp_append(FuncState *fs, BCPos *l1, BCPos l2)
324 {
325  if (l2 == NO_JMP) {
326  return;
327  } else if (*l1 == NO_JMP) {
328  *l1 = l2;
329  } else {
330  BCPos list = *l1;
331  BCPos next;
332  while ((next = jmp_next(fs, list)) != NO_JMP) /* Find last element. */
333  list = next;
334  jmp_patchins(fs, list, l2);
335  }
336 }
337 
338 /* Patch jump list and preserve produced values. */
339 static void jmp_patchval(FuncState *fs, BCPos list, BCPos vtarget,
340  BCReg reg, BCPos dtarget)
341 {
342  while (list != NO_JMP) {
343  BCPos next = jmp_next(fs, list);
344  if (jmp_patchtestreg(fs, list, reg))
345  jmp_patchins(fs, list, vtarget); /* Jump to target with value. */
346  else
347  jmp_patchins(fs, list, dtarget); /* Jump to default target. */
348  list = next;
349  }
350 }
351 
352 /* Jump to following instruction. Append to list of pending jumps. */
353 static void jmp_tohere(FuncState *fs, BCPos list)
354 {
355  fs->lasttarget = fs->pc;
356  jmp_append(fs, &fs->jpc, list);
357 }
358 
359 /* Patch jump list to target. */
361 {
362  if (target == fs->pc) {
363  jmp_tohere(fs, list);
364  } else {
365  lua_assert(target < fs->pc);
367  }
368 }
369 
370 /* -- Bytecode register allocator ----------------------------------------- */
371 
372 /* Bump frame size. */
373 static void bcreg_bump(FuncState *fs, BCReg n)
374 {
375  BCReg sz = fs->freereg + n;
376  if (sz > fs->framesize) {
377  if (sz >= LJ_MAX_SLOTS)
378  err_syntax(fs->ls, LJ_ERR_XSLOTS);
379  fs->framesize = (uint8_t)sz;
380  }
381 }
382 
383 /* Reserve registers. */
384 static void bcreg_reserve(FuncState *fs, BCReg n)
385 {
386  bcreg_bump(fs, n);
387  fs->freereg += n;
388 }
389 
390 /* Free register. */
391 static void bcreg_free(FuncState *fs, BCReg reg)
392 {
393  if (reg >= fs->nactvar) {
394  fs->freereg--;
395  lua_assert(reg == fs->freereg);
396  }
397 }
398 
399 /* Free register for expression. */
400 static void expr_free(FuncState *fs, ExpDesc *e)
401 {
402  if (e->k == VNONRELOC)
403  bcreg_free(fs, e->u.s.info);
404 }
405 
406 /* -- Bytecode emitter ---------------------------------------------------- */
407 
408 /* Emit bytecode instruction. */
410 {
411  BCPos pc = fs->pc;
412  LexState *ls = fs->ls;
413  jmp_patchval(fs, fs->jpc, pc, NO_REG, pc);
414  fs->jpc = NO_JMP;
415  if (LJ_UNLIKELY(pc >= fs->bclim)) {
416  ptrdiff_t base = fs->bcbase - ls->bcstack;
417  checklimit(fs, ls->sizebcstack, LJ_MAX_BCINS, "bytecode instructions");
419  fs->bclim = (BCPos)(ls->sizebcstack - base);
420  fs->bcbase = ls->bcstack + base;
421  }
422  fs->bcbase[pc].ins = ins;
423  fs->bcbase[pc].line = ls->lastline;
424  fs->pc = pc+1;
425  return pc;
426 }
427 
428 #define bcemit_ABC(fs, o, a, b, c) bcemit_INS(fs, BCINS_ABC(o, a, b, c))
429 #define bcemit_AD(fs, o, a, d) bcemit_INS(fs, BCINS_AD(o, a, d))
430 #define bcemit_AJ(fs, o, a, j) bcemit_INS(fs, BCINS_AJ(o, a, j))
431 
432 #define bcptr(fs, e) (&(fs)->bcbase[(e)->u.s.info].ins)
433 
434 /* -- Bytecode emitter for expressions ------------------------------------ */
435 
436 /* Discharge non-constant expression to any register. */
437 static void expr_discharge(FuncState *fs, ExpDesc *e)
438 {
439  BCIns ins;
440  if (e->k == VUPVAL) {
441  ins = BCINS_AD(BC_UGET, 0, e->u.s.info);
442  } else if (e->k == VGLOBAL) {
443  ins = BCINS_AD(BC_GGET, 0, const_str(fs, e));
444  } else if (e->k == VINDEXED) {
445  BCReg rc = e->u.s.aux;
446  if ((int32_t)rc < 0) {
447  ins = BCINS_ABC(BC_TGETS, 0, e->u.s.info, ~rc);
448  } else if (rc > BCMAX_C) {
449  ins = BCINS_ABC(BC_TGETB, 0, e->u.s.info, rc-(BCMAX_C+1));
450  } else {
451  bcreg_free(fs, rc);
452  ins = BCINS_ABC(BC_TGETV, 0, e->u.s.info, rc);
453  }
454  bcreg_free(fs, e->u.s.info);
455  } else if (e->k == VCALL) {
456  e->u.s.info = e->u.s.aux;
457  e->k = VNONRELOC;
458  return;
459  } else if (e->k == VLOCAL) {
460  e->k = VNONRELOC;
461  return;
462  } else {
463  return;
464  }
465  e->u.s.info = bcemit_INS(fs, ins);
466  e->k = VRELOCABLE;
467 }
468 
469 /* Emit bytecode to set a range of registers to nil. */
470 static void bcemit_nil(FuncState *fs, BCReg from, BCReg n)
471 {
472  if (fs->pc > fs->lasttarget) { /* No jumps to current position? */
473  BCIns *ip = &fs->bcbase[fs->pc-1].ins;
474  BCReg pto, pfrom = bc_a(*ip);
475  switch (bc_op(*ip)) { /* Try to merge with the previous instruction. */
476  case BC_KPRI:
477  if (bc_d(*ip) != ~LJ_TNIL) break;
478  if (from == pfrom) {
479  if (n == 1) return;
480  } else if (from == pfrom+1) {
481  from = pfrom;
482  n++;
483  } else {
484  break;
485  }
486  *ip = BCINS_AD(BC_KNIL, from, from+n-1); /* Replace KPRI. */
487  return;
488  case BC_KNIL:
489  pto = bc_d(*ip);
490  if (pfrom <= from && from <= pto+1) { /* Can we connect both ranges? */
491  if (from+n-1 > pto)
492  setbc_d(ip, from+n-1); /* Patch previous instruction range. */
493  return;
494  }
495  break;
496  default:
497  break;
498  }
499  }
500  /* Emit new instruction or replace old instruction. */
501  bcemit_INS(fs, n == 1 ? BCINS_AD(BC_KPRI, from, VKNIL) :
502  BCINS_AD(BC_KNIL, from, from+n-1));
503 }
504 
505 /* Discharge an expression to a specific register. Ignore branches. */
507 {
508  BCIns ins;
509  expr_discharge(fs, e);
510  if (e->k == VKSTR) {
511  ins = BCINS_AD(BC_KSTR, reg, const_str(fs, e));
512  } else if (e->k == VKNUM) {
513 #if LJ_DUALNUM
514  cTValue *tv = expr_numtv(e);
515  if (tvisint(tv) && checki16(intV(tv)))
517  else
518 #else
520  int32_t k = lj_num2int(n);
521  if (checki16(k) && n == (lua_Number)k)
523  else
524 #endif
525  ins = BCINS_AD(BC_KNUM, reg, const_num(fs, e));
526 #if LJ_HASFFI
527  } else if (e->k == VKCDATA) {
528  fs->flags |= PROTO_FFI;
530  const_gc(fs, obj2gco(cdataV(&e->u.nval)), LJ_TCDATA));
531 #endif
532  } else if (e->k == VRELOCABLE) {
533  setbc_a(bcptr(fs, e), reg);
534  goto noins;
535  } else if (e->k == VNONRELOC) {
536  if (reg == e->u.s.info)
537  goto noins;
538  ins = BCINS_AD(BC_MOV, reg, e->u.s.info);
539  } else if (e->k == VKNIL) {
540  bcemit_nil(fs, reg, 1);
541  goto noins;
542  } else if (e->k <= VKTRUE) {
544  } else {
545  lua_assert(e->k == VVOID || e->k == VJMP);
546  return;
547  }
548  bcemit_INS(fs, ins);
549 noins:
550  e->u.s.info = reg;
551  e->k = VNONRELOC;
552 }
553 
554 /* Forward declaration. */
555 static BCPos bcemit_jmp(FuncState *fs);
556 
557 /* Discharge an expression to a specific register. */
558 static void expr_toreg(FuncState *fs, ExpDesc *e, BCReg reg)
559 {
560  expr_toreg_nobranch(fs, e, reg);
561  if (e->k == VJMP)
562  jmp_append(fs, &e->t, e->u.s.info); /* Add it to the true jump list. */
563  if (expr_hasjump(e)) { /* Discharge expression with branches. */
564  BCPos jend, jfalse = NO_JMP, jtrue = NO_JMP;
565  if (jmp_novalue(fs, e->t) || jmp_novalue(fs, e->f)) {
566  BCPos jval = (e->k == VJMP) ? NO_JMP : bcemit_jmp(fs);
567  jfalse = bcemit_AD(fs, BC_KPRI, reg, VKFALSE);
568  bcemit_AJ(fs, BC_JMP, fs->freereg, 1);
569  jtrue = bcemit_AD(fs, BC_KPRI, reg, VKTRUE);
570  jmp_tohere(fs, jval);
571  }
572  jend = fs->pc;
573  fs->lasttarget = jend;
574  jmp_patchval(fs, e->f, jend, reg, jfalse);
575  jmp_patchval(fs, e->t, jend, reg, jtrue);
576  }
577  e->f = e->t = NO_JMP;
578  e->u.s.info = reg;
579  e->k = VNONRELOC;
580 }
581 
582 /* Discharge an expression to the next free register. */
583 static void expr_tonextreg(FuncState *fs, ExpDesc *e)
584 {
585  expr_discharge(fs, e);
586  expr_free(fs, e);
587  bcreg_reserve(fs, 1);
588  expr_toreg(fs, e, fs->freereg - 1);
589 }
590 
591 /* Discharge an expression to any register. */
593 {
594  expr_discharge(fs, e);
595  if (e->k == VNONRELOC) {
596  if (!expr_hasjump(e)) return e->u.s.info; /* Already in a register. */
597  if (e->u.s.info >= fs->nactvar) {
598  expr_toreg(fs, e, e->u.s.info); /* Discharge to temp. register. */
599  return e->u.s.info;
600  }
601  }
602  expr_tonextreg(fs, e); /* Discharge to next register. */
603  return e->u.s.info;
604 }
605 
606 /* Partially discharge expression to a value. */
607 static void expr_toval(FuncState *fs, ExpDesc *e)
608 {
609  if (expr_hasjump(e))
610  expr_toanyreg(fs, e);
611  else
612  expr_discharge(fs, e);
613 }
614 
615 /* Emit store for LHS expression. */
617 {
618  BCIns ins;
619  if (var->k == VLOCAL) {
620  fs->ls->vstack[var->u.s.aux].info |= VSTACK_VAR_RW;
621  expr_free(fs, e);
622  expr_toreg(fs, e, var->u.s.info);
623  return;
624  } else if (var->k == VUPVAL) {
625  fs->ls->vstack[var->u.s.aux].info |= VSTACK_VAR_RW;
626  expr_toval(fs, e);
627  if (e->k <= VKTRUE)
628  ins = BCINS_AD(BC_USETP, var->u.s.info, const_pri(e));
629  else if (e->k == VKSTR)
630  ins = BCINS_AD(BC_USETS, var->u.s.info, const_str(fs, e));
631  else if (e->k == VKNUM)
632  ins = BCINS_AD(BC_USETN, var->u.s.info, const_num(fs, e));
633  else
634  ins = BCINS_AD(BC_USETV, var->u.s.info, expr_toanyreg(fs, e));
635  } else if (var->k == VGLOBAL) {
636  BCReg ra = expr_toanyreg(fs, e);
637  ins = BCINS_AD(BC_GSET, ra, const_str(fs, var));
638  } else {
639  BCReg ra, rc;
640  lua_assert(var->k == VINDEXED);
641  ra = expr_toanyreg(fs, e);
642  rc = var->u.s.aux;
643  if ((int32_t)rc < 0) {
644  ins = BCINS_ABC(BC_TSETS, ra, var->u.s.info, ~rc);
645  } else if (rc > BCMAX_C) {
646  ins = BCINS_ABC(BC_TSETB, ra, var->u.s.info, rc-(BCMAX_C+1));
647  } else {
648  /* Free late alloced key reg to avoid assert on free of value reg. */
649  /* This can only happen when called from expr_table(). */
650  lua_assert(e->k != VNONRELOC || ra < fs->nactvar ||
651  rc < ra || (bcreg_free(fs, rc),1));
652  ins = BCINS_ABC(BC_TSETV, ra, var->u.s.info, rc);
653  }
654  }
655  bcemit_INS(fs, ins);
656  expr_free(fs, e);
657 }
658 
659 /* Emit method lookup expression. */
661 {
662  BCReg idx, func, obj = expr_toanyreg(fs, e);
663  expr_free(fs, e);
664  func = fs->freereg;
665  bcemit_AD(fs, BC_MOV, func+1+LJ_FR2, obj); /* Copy object to 1st argument. */
667  idx = const_str(fs, key);
668  if (idx <= BCMAX_C) {
669  bcreg_reserve(fs, 2+LJ_FR2);
670  bcemit_ABC(fs, BC_TGETS, func, obj, idx);
671  } else {
672  bcreg_reserve(fs, 3+LJ_FR2);
673  bcemit_AD(fs, BC_KSTR, func+2+LJ_FR2, idx);
674  bcemit_ABC(fs, BC_TGETV, func, obj, func+2+LJ_FR2);
675  fs->freereg--;
676  }
677  e->u.s.info = func;
678  e->k = VNONRELOC;
679 }
680 
681 /* -- Bytecode emitter for branches --------------------------------------- */
682 
683 /* Emit unconditional branch. */
685 {
686  BCPos jpc = fs->jpc;
687  BCPos j = fs->pc - 1;
688  BCIns *ip = &fs->bcbase[j].ins;
689  fs->jpc = NO_JMP;
690  if ((int32_t)j >= (int32_t)fs->lasttarget && bc_op(*ip) == BC_UCLO) {
691  setbc_j(ip, NO_JMP);
692  fs->lasttarget = j+1;
693  } else {
694  j = bcemit_AJ(fs, BC_JMP, fs->freereg, NO_JMP);
695  }
696  jmp_append(fs, &j, jpc);
697  return j;
698 }
699 
700 /* Invert branch condition of bytecode instruction. */
701 static void invertcond(FuncState *fs, ExpDesc *e)
702 {
703  BCIns *ip = &fs->bcbase[e->u.s.info - 1].ins;
704  setbc_op(ip, bc_op(*ip)^1);
705 }
706 
707 /* Emit conditional branch. */
709 {
710  BCPos pc;
711  if (e->k == VRELOCABLE) {
712  BCIns *ip = bcptr(fs, e);
713  if (bc_op(*ip) == BC_NOT) {
714  *ip = BCINS_AD(cond ? BC_ISF : BC_IST, 0, bc_d(*ip));
715  return bcemit_jmp(fs);
716  }
717  }
718  if (e->k != VNONRELOC) {
719  bcreg_reserve(fs, 1);
720  expr_toreg_nobranch(fs, e, fs->freereg-1);
721  }
722  bcemit_AD(fs, cond ? BC_ISTC : BC_ISFC, NO_REG, e->u.s.info);
723  pc = bcemit_jmp(fs);
724  expr_free(fs, e);
725  return pc;
726 }
727 
728 /* Emit branch on true condition. */
729 static void bcemit_branch_t(FuncState *fs, ExpDesc *e)
730 {
731  BCPos pc;
732  expr_discharge(fs, e);
733  if (e->k == VKSTR || e->k == VKNUM || e->k == VKTRUE)
734  pc = NO_JMP; /* Never jump. */
735  else if (e->k == VJMP)
736  invertcond(fs, e), pc = e->u.s.info;
737  else if (e->k == VKFALSE || e->k == VKNIL)
739  else
740  pc = bcemit_branch(fs, e, 0);
741  jmp_append(fs, &e->f, pc);
742  jmp_tohere(fs, e->t);
743  e->t = NO_JMP;
744 }
745 
746 /* Emit branch on false condition. */
747 static void bcemit_branch_f(FuncState *fs, ExpDesc *e)
748 {
749  BCPos pc;
750  expr_discharge(fs, e);
751  if (e->k == VKNIL || e->k == VKFALSE)
752  pc = NO_JMP; /* Never jump. */
753  else if (e->k == VJMP)
754  pc = e->u.s.info;
755  else if (e->k == VKSTR || e->k == VKNUM || e->k == VKTRUE)
757  else
758  pc = bcemit_branch(fs, e, 1);
759  jmp_append(fs, &e->t, pc);
760  jmp_tohere(fs, e->f);
761  e->f = NO_JMP;
762 }
763 
764 /* -- Bytecode emitter for operators -------------------------------------- */
765 
766 /* Try constant-folding of arithmetic operators. */
767 static int foldarith(BinOpr opr, ExpDesc *e1, ExpDesc *e2)
768 {
769  TValue o;
770  lua_Number n;
771  if (!expr_isnumk_nojump(e1) || !expr_isnumk_nojump(e2)) return 0;
772  n = lj_vm_foldarith(expr_numberV(e1), expr_numberV(e2), (int)opr-OPR_ADD);
773  setnumV(&o, n);
774  if (tvisnan(&o) || tvismzero(&o)) return 0; /* Avoid NaN and -0 as consts. */
775  if (LJ_DUALNUM) {
776  int32_t k = lj_num2int(n);
777  if ((lua_Number)k == n) {
778  setintV(&e1->u.nval, k);
779  return 1;
780  }
781  }
782  setnumV(&e1->u.nval, n);
783  return 1;
784 }
785 
786 /* Emit arithmetic operator. */
787 static void bcemit_arith(FuncState *fs, BinOpr opr, ExpDesc *e1, ExpDesc *e2)
788 {
789  BCReg rb, rc, t;
790  uint32_t op;
791  if (foldarith(opr, e1, e2))
792  return;
793  if (opr == OPR_POW) {
794  op = BC_POW;
795  rc = expr_toanyreg(fs, e2);
796  rb = expr_toanyreg(fs, e1);
797  } else {
798  op = opr-OPR_ADD+BC_ADDVV;
799  /* Must discharge 2nd operand first since VINDEXED might free regs. */
800  expr_toval(fs, e2);
801  if (expr_isnumk(e2) && (rc = const_num(fs, e2)) <= BCMAX_C)
802  op -= BC_ADDVV-BC_ADDVN;
803  else
804  rc = expr_toanyreg(fs, e2);
805  /* 1st operand discharged by bcemit_binop_left, but need KNUM/KSHORT. */
806  lua_assert(expr_isnumk(e1) || e1->k == VNONRELOC);
807  expr_toval(fs, e1);
808  /* Avoid two consts to satisfy bytecode constraints. */
809  if (expr_isnumk(e1) && !expr_isnumk(e2) &&
810  (t = const_num(fs, e1)) <= BCMAX_B) {
811  rb = rc; rc = t; op -= BC_ADDVV-BC_ADDNV;
812  } else {
813  rb = expr_toanyreg(fs, e1);
814  }
815  }
816  /* Using expr_free might cause asserts if the order is wrong. */
817  if (e1->k == VNONRELOC && e1->u.s.info >= fs->nactvar) fs->freereg--;
818  if (e2->k == VNONRELOC && e2->u.s.info >= fs->nactvar) fs->freereg--;
819  e1->u.s.info = bcemit_ABC(fs, op, 0, rb, rc);
820  e1->k = VRELOCABLE;
821 }
822 
823 /* Emit comparison operator. */
824 static void bcemit_comp(FuncState *fs, BinOpr opr, ExpDesc *e1, ExpDesc *e2)
825 {
826  ExpDesc *eret = e1;
827  BCIns ins;
828  expr_toval(fs, e1);
829  if (opr == OPR_EQ || opr == OPR_NE) {
830  BCOp op = opr == OPR_EQ ? BC_ISEQV : BC_ISNEV;
831  BCReg ra;
832  if (expr_isk(e1)) { e1 = e2; e2 = eret; } /* Need constant in 2nd arg. */
833  ra = expr_toanyreg(fs, e1); /* First arg must be in a reg. */
834  expr_toval(fs, e2);
835  switch (e2->k) {
836  case VKNIL: case VKFALSE: case VKTRUE:
838  break;
839  case VKSTR:
840  ins = BCINS_AD(op+(BC_ISEQS-BC_ISEQV), ra, const_str(fs, e2));
841  break;
842  case VKNUM:
843  ins = BCINS_AD(op+(BC_ISEQN-BC_ISEQV), ra, const_num(fs, e2));
844  break;
845  default:
846  ins = BCINS_AD(op, ra, expr_toanyreg(fs, e2));
847  break;
848  }
849  } else {
850  uint32_t op = opr-OPR_LT+BC_ISLT;
851  BCReg ra, rd;
852  if ((op-BC_ISLT) & 1) { /* GT -> LT, GE -> LE */
853  e1 = e2; e2 = eret; /* Swap operands. */
854  op = ((op-BC_ISLT)^3)+BC_ISLT;
855  expr_toval(fs, e1);
856  }
857  rd = expr_toanyreg(fs, e2);
858  ra = expr_toanyreg(fs, e1);
859  ins = BCINS_AD(op, ra, rd);
860  }
861  /* Using expr_free might cause asserts if the order is wrong. */
862  if (e1->k == VNONRELOC && e1->u.s.info >= fs->nactvar) fs->freereg--;
863  if (e2->k == VNONRELOC && e2->u.s.info >= fs->nactvar) fs->freereg--;
864  bcemit_INS(fs, ins);
865  eret->u.s.info = bcemit_jmp(fs);
866  eret->k = VJMP;
867 }
868 
869 /* Fixup left side of binary operator. */
871 {
872  if (op == OPR_AND) {
873  bcemit_branch_t(fs, e);
874  } else if (op == OPR_OR) {
875  bcemit_branch_f(fs, e);
876  } else if (op == OPR_CONCAT) {
877  expr_tonextreg(fs, e);
878  } else if (op == OPR_EQ || op == OPR_NE) {
879  if (!expr_isk_nojump(e)) expr_toanyreg(fs, e);
880  } else {
881  if (!expr_isnumk_nojump(e)) expr_toanyreg(fs, e);
882  }
883 }
884 
885 /* Emit binary operator. */
886 static void bcemit_binop(FuncState *fs, BinOpr op, ExpDesc *e1, ExpDesc *e2)
887 {
888  if (op <= OPR_POW) {
889  bcemit_arith(fs, op, e1, e2);
890  } else if (op == OPR_AND) {
891  lua_assert(e1->t == NO_JMP); /* List must be closed. */
892  expr_discharge(fs, e2);
893  jmp_append(fs, &e2->f, e1->f);
894  *e1 = *e2;
895  } else if (op == OPR_OR) {
896  lua_assert(e1->f == NO_JMP); /* List must be closed. */
897  expr_discharge(fs, e2);
898  jmp_append(fs, &e2->t, e1->t);
899  *e1 = *e2;
900  } else if (op == OPR_CONCAT) {
901  expr_toval(fs, e2);
902  if (e2->k == VRELOCABLE && bc_op(*bcptr(fs, e2)) == BC_CAT) {
903  lua_assert(e1->u.s.info == bc_b(*bcptr(fs, e2))-1);
904  expr_free(fs, e1);
905  setbc_b(bcptr(fs, e2), e1->u.s.info);
906  e1->u.s.info = e2->u.s.info;
907  } else {
908  expr_tonextreg(fs, e2);
909  expr_free(fs, e2);
910  expr_free(fs, e1);
911  e1->u.s.info = bcemit_ABC(fs, BC_CAT, 0, e1->u.s.info, e2->u.s.info);
912  }
913  e1->k = VRELOCABLE;
914  } else {
915  lua_assert(op == OPR_NE || op == OPR_EQ ||
916  op == OPR_LT || op == OPR_GE || op == OPR_LE || op == OPR_GT);
917  bcemit_comp(fs, op, e1, e2);
918  }
919 }
920 
921 /* Emit unary operator. */
922 static void bcemit_unop(FuncState *fs, BCOp op, ExpDesc *e)
923 {
924  if (op == BC_NOT) {
925  /* Swap true and false lists. */
926  { BCPos temp = e->f; e->f = e->t; e->t = temp; }
927  jmp_dropval(fs, e->f);
928  jmp_dropval(fs, e->t);
929  expr_discharge(fs, e);
930  if (e->k == VKNIL || e->k == VKFALSE) {
931  e->k = VKTRUE;
932  return;
933  } else if (expr_isk(e) || (LJ_HASFFI && e->k == VKCDATA)) {
934  e->k = VKFALSE;
935  return;
936  } else if (e->k == VJMP) {
937  invertcond(fs, e);
938  return;
939  } else if (e->k == VRELOCABLE) {
940  bcreg_reserve(fs, 1);
941  setbc_a(bcptr(fs, e), fs->freereg-1);
942  e->u.s.info = fs->freereg-1;
943  e->k = VNONRELOC;
944  } else {
945  lua_assert(e->k == VNONRELOC);
946  }
947  } else {
948  lua_assert(op == BC_UNM || op == BC_LEN);
949  if (op == BC_UNM && !expr_hasjump(e)) { /* Constant-fold negations. */
950 #if LJ_HASFFI
951  if (e->k == VKCDATA) { /* Fold in-place since cdata is not interned. */
952  GCcdata *cd = cdataV(&e->u.nval);
953  int64_t *p = (int64_t *)cdataptr(cd);
954  if (cd->ctypeid == CTID_COMPLEX_DOUBLE)
955  p[1] ^= (int64_t)U64x(80000000,00000000);
956  else
957  *p = -*p;
958  return;
959  } else
960 #endif
961  if (expr_isnumk(e) && !expr_numiszero(e)) { /* Avoid folding to -0. */
962  TValue *o = expr_numtv(e);
963  if (tvisint(o)) {
964  int32_t k = intV(o);
965  if (k == -k)
966  setnumV(o, -(lua_Number)k);
967  else
968  setintV(o, -k);
969  return;
970  } else {
971  o->u64 ^= U64x(80000000,00000000);
972  return;
973  }
974  }
975  }
976  expr_toanyreg(fs, e);
977  }
978  expr_free(fs, e);
979  e->u.s.info = bcemit_AD(fs, op, 0, e->u.s.info);
980  e->k = VRELOCABLE;
981 }
982 
983 /* -- Lexer support ------------------------------------------------------- */
984 
985 /* Check and consume optional token. */
987 {
988  if (ls->tok == tok) {
989  lj_lex_next(ls);
990  return 1;
991  }
992  return 0;
993 }
994 
995 /* Check and consume token. */
997 {
998  if (ls->tok != tok)
999  err_token(ls, tok);
1000  lj_lex_next(ls);
1001 }
1002 
1003 /* Check for matching token. */
1005 {
1006  if (!lex_opt(ls, what)) {
1007  if (line == ls->linenumber) {
1008  err_token(ls, what);
1009  } else {
1010  const char *swhat = lj_lex_token2str(ls, what);
1011  const char *swho = lj_lex_token2str(ls, who);
1012  lj_lex_error(ls, ls->tok, LJ_ERR_XMATCH, swhat, swho, line);
1013  }
1014  }
1015 }
1016 
1017 /* Check for string token. */
1019 {
1020  GCstr *s;
1021  if (ls->tok != TK_name && (LJ_52 || ls->tok != TK_goto))
1022  err_token(ls, TK_name);
1023  s = strV(&ls->tokval);
1024  lj_lex_next(ls);
1025  return s;
1026 }
1027 
1028 /* -- Variable handling --------------------------------------------------- */
1029 
1030 #define var_get(ls, fs, i) ((ls)->vstack[(fs)->varmap[(i)]])
1031 
1032 /* Define a new local variable. */
1033 static void var_new(LexState *ls, BCReg n, GCstr *name)
1034 {
1035  FuncState *fs = ls->fs;
1036  MSize vtop = ls->vtop;
1037  checklimit(fs, fs->nactvar+n, LJ_MAX_LOCVAR, "local variables");
1038  if (LJ_UNLIKELY(vtop >= ls->sizevstack)) {
1039  if (ls->sizevstack >= LJ_MAX_VSTACK)
1040  lj_lex_error(ls, 0, LJ_ERR_XLIMC, LJ_MAX_VSTACK);
1042  }
1044  lj_tab_getstr(fs->kt, name) != NULL);
1045  /* NOBARRIER: name is anchored in fs->kt and ls->vstack is not a GCobj. */
1046  setgcref(ls->vstack[vtop].name, obj2gco(name));
1047  fs->varmap[fs->nactvar+n] = (uint16_t)vtop;
1048  ls->vtop = vtop+1;
1049 }
1050 
1051 #define var_new_lit(ls, n, v) \
1052  var_new(ls, (n), lj_parse_keepstr(ls, "" v, sizeof(v)-1))
1053 
1054 #define var_new_fixed(ls, n, vn) \
1055  var_new(ls, (n), (GCstr *)(uintptr_t)(vn))
1056 
1057 /* Add local variables. */
1058 static void var_add(LexState *ls, BCReg nvars)
1059 {
1060  FuncState *fs = ls->fs;
1061  BCReg nactvar = fs->nactvar;
1062  while (nvars--) {
1063  VarInfo *v = &var_get(ls, fs, nactvar);
1064  v->startpc = fs->pc;
1065  v->slot = nactvar++;
1066  v->info = 0;
1067  }
1068  fs->nactvar = nactvar;
1069 }
1070 
1071 /* Remove local variables. */
1072 static void var_remove(LexState *ls, BCReg tolevel)
1073 {
1074  FuncState *fs = ls->fs;
1075  while (fs->nactvar > tolevel)
1076  var_get(ls, fs, --fs->nactvar).endpc = fs->pc;
1077 }
1078 
1079 /* Lookup local variable name. */
1081 {
1082  int i;
1083  for (i = fs->nactvar-1; i >= 0; i--) {
1084  if (n == strref(var_get(fs->ls, fs, i).name))
1085  return (BCReg)i;
1086  }
1087  return (BCReg)-1; /* Not found. */
1088 }
1089 
1090 /* Lookup or add upvalue index. */
1092 {
1093  MSize i, n = fs->nuv;
1094  for (i = 0; i < n; i++)
1095  if (fs->uvmap[i] == vidx)
1096  return i; /* Already exists. */
1097  /* Otherwise create a new one. */
1098  checklimit(fs, fs->nuv, LJ_MAX_UPVAL, "upvalues");
1099  lua_assert(e->k == VLOCAL || e->k == VUPVAL);
1100  fs->uvmap[n] = (uint16_t)vidx;
1101  fs->uvtmp[n] = (uint16_t)(e->k == VLOCAL ? vidx : LJ_MAX_VSTACK+e->u.s.info);
1102  fs->nuv = n+1;
1103  return n;
1104 }
1105 
1106 /* Forward declaration. */
1107 static void fscope_uvmark(FuncState *fs, BCReg level);
1108 
1109 /* Recursively lookup variables in enclosing functions. */
1111 {
1112  if (fs) {
1113  BCReg reg = var_lookup_local(fs, name);
1114  if ((int32_t)reg >= 0) { /* Local in this function? */
1115  expr_init(e, VLOCAL, reg);
1116  if (!first)
1117  fscope_uvmark(fs, reg); /* Scope now has an upvalue. */
1118  return (MSize)(e->u.s.aux = (uint32_t)fs->varmap[reg]);
1119  } else {
1120  MSize vidx = var_lookup_(fs->prev, name, e, 0); /* Var in outer func? */
1121  if ((int32_t)vidx >= 0) { /* Yes, make it an upvalue here. */
1122  e->u.s.info = (uint8_t)var_lookup_uv(fs, vidx, e);
1123  e->k = VUPVAL;
1124  return vidx;
1125  }
1126  }
1127  } else { /* Not found in any function, must be a global. */
1128  expr_init(e, VGLOBAL, 0);
1129  e->u.sval = name;
1130  }
1131  return (MSize)-1; /* Global. */
1132 }
1133 
1134 /* Lookup variable name. */
1135 #define var_lookup(ls, e) \
1136  var_lookup_((ls)->fs, lex_str(ls), (e), 1)
1137 
1138 /* -- Goto an label handling ---------------------------------------------- */
1139 
1140 /* Add a new goto or label. */
1142 {
1143  FuncState *fs = ls->fs;
1144  MSize vtop = ls->vtop;
1145  if (LJ_UNLIKELY(vtop >= ls->sizevstack)) {
1146  if (ls->sizevstack >= LJ_MAX_VSTACK)
1147  lj_lex_error(ls, 0, LJ_ERR_XLIMC, LJ_MAX_VSTACK);
1149  }
1151  /* NOBARRIER: name is anchored in fs->kt and ls->vstack is not a GCobj. */
1152  setgcref(ls->vstack[vtop].name, obj2gco(name));
1153  ls->vstack[vtop].startpc = pc;
1154  ls->vstack[vtop].slot = (uint8_t)fs->nactvar;
1155  ls->vstack[vtop].info = info;
1156  ls->vtop = vtop+1;
1157  return vtop;
1158 }
1159 
1160 #define gola_isgoto(v) ((v)->info & VSTACK_GOTO)
1161 #define gola_islabel(v) ((v)->info & VSTACK_LABEL)
1162 #define gola_isgotolabel(v) ((v)->info & (VSTACK_GOTO|VSTACK_LABEL))
1163 
1164 /* Patch goto to jump to label. */
1165 static void gola_patch(LexState *ls, VarInfo *vg, VarInfo *vl)
1166 {
1167  FuncState *fs = ls->fs;
1168  BCPos pc = vg->startpc;
1169  setgcrefnull(vg->name); /* Invalidate pending goto. */
1170  setbc_a(&fs->bcbase[pc].ins, vl->slot);
1171  jmp_patch(fs, pc, vl->startpc);
1172 }
1173 
1174 /* Patch goto to close upvalues. */
1175 static void gola_close(LexState *ls, VarInfo *vg)
1176 {
1177  FuncState *fs = ls->fs;
1178  BCPos pc = vg->startpc;
1179  BCIns *ip = &fs->bcbase[pc].ins;
1180  lua_assert(gola_isgoto(vg));
1181  lua_assert(bc_op(*ip) == BC_JMP || bc_op(*ip) == BC_UCLO);
1182  setbc_a(ip, vg->slot);
1183  if (bc_op(*ip) == BC_JMP) {
1184  BCPos next = jmp_next(fs, pc);
1185  if (next != NO_JMP) jmp_patch(fs, next, pc); /* Jump to UCLO. */
1186  setbc_op(ip, BC_UCLO); /* Turn into UCLO. */
1187  setbc_j(ip, NO_JMP);
1188  }
1189 }
1190 
1191 /* Resolve pending forward gotos for label. */
1193 {
1194  VarInfo *vg = ls->vstack + bl->vstart;
1195  VarInfo *vl = ls->vstack + idx;
1196  for (; vg < vl; vg++)
1197  if (gcrefeq(vg->name, vl->name) && gola_isgoto(vg)) {
1198  if (vg->slot < vl->slot) {
1199  GCstr *name = strref(var_get(ls, ls->fs, vg->slot).name);
1201  ls->linenumber = ls->fs->bcbase[vg->startpc].line;
1202  lua_assert(strref(vg->name) != NAME_BREAK);
1203  lj_lex_error(ls, 0, LJ_ERR_XGSCOPE,
1204  strdata(strref(vg->name)), strdata(name));
1205  }
1206  gola_patch(ls, vg, vl);
1207  }
1208 }
1209 
1210 /* Fixup remaining gotos and labels for scope. */
1212 {
1213  VarInfo *v = ls->vstack + bl->vstart;
1214  VarInfo *ve = ls->vstack + ls->vtop;
1215  for (; v < ve; v++) {
1216  GCstr *name = strref(v->name);
1217  if (name != NULL) { /* Only consider remaining valid gotos/labels. */
1218  if (gola_islabel(v)) {
1219  VarInfo *vg;
1220  setgcrefnull(v->name); /* Invalidate label that goes out of scope. */
1221  for (vg = v+1; vg < ve; vg++) /* Resolve pending backward gotos. */
1222  if (strref(vg->name) == name && gola_isgoto(vg)) {
1223  if ((bl->flags&FSCOPE_UPVAL) && vg->slot > v->slot)
1224  gola_close(ls, vg);
1225  gola_patch(ls, vg, v);
1226  }
1227  } else if (gola_isgoto(v)) {
1228  if (bl->prev) { /* Propagate goto or break to outer scope. */
1229  bl->prev->flags |= name == NAME_BREAK ? FSCOPE_BREAK : FSCOPE_GOLA;
1230  v->slot = bl->nactvar;
1231  if ((bl->flags & FSCOPE_UPVAL))
1232  gola_close(ls, v);
1233  } else { /* No outer scope: undefined goto label or no loop. */
1234  ls->linenumber = ls->fs->bcbase[v->startpc].line;
1235  if (name == NAME_BREAK)
1236  lj_lex_error(ls, 0, LJ_ERR_XBREAK);
1237  else
1238  lj_lex_error(ls, 0, LJ_ERR_XLUNDEF, strdata(name));
1239  }
1240  }
1241  }
1242  }
1243 }
1244 
1245 /* Find existing label. */
1247 {
1248  VarInfo *v = ls->vstack + ls->fs->bl->vstart;
1249  VarInfo *ve = ls->vstack + ls->vtop;
1250  for (; v < ve; v++)
1251  if (strref(v->name) == name && gola_islabel(v))
1252  return v;
1253  return NULL;
1254 }
1255 
1256 /* -- Scope handling ------------------------------------------------------ */
1257 
1258 /* Begin a scope. */
1259 static void fscope_begin(FuncState *fs, FuncScope *bl, int flags)
1260 {
1261  bl->nactvar = (uint8_t)fs->nactvar;
1262  bl->flags = flags;
1263  bl->vstart = fs->ls->vtop;
1264  bl->prev = fs->bl;
1265  fs->bl = bl;
1266  lua_assert(fs->freereg == fs->nactvar);
1267 }
1268 
1269 /* End a scope. */
1270 static void fscope_end(FuncState *fs)
1271 {
1272  FuncScope *bl = fs->bl;
1273  LexState *ls = fs->ls;
1274  fs->bl = bl->prev;
1275  var_remove(ls, bl->nactvar);
1276  fs->freereg = fs->nactvar;
1277  lua_assert(bl->nactvar == fs->nactvar);
1278  if ((bl->flags & (FSCOPE_UPVAL|FSCOPE_NOCLOSE)) == FSCOPE_UPVAL)
1279  bcemit_AJ(fs, BC_UCLO, bl->nactvar, 0);
1280  if ((bl->flags & FSCOPE_BREAK)) {
1281  if ((bl->flags & FSCOPE_LOOP)) {
1283  ls->vtop = idx; /* Drop break label immediately. */
1284  gola_resolve(ls, bl, idx);
1285  } else { /* Need the fixup step to propagate the breaks. */
1286  gola_fixup(ls, bl);
1287  return;
1288  }
1289  }
1290  if ((bl->flags & FSCOPE_GOLA)) {
1291  gola_fixup(ls, bl);
1292  }
1293 }
1294 
1295 /* Mark scope as having an upvalue. */
1297 {
1298  FuncScope *bl;
1299  for (bl = fs->bl; bl && bl->nactvar > level; bl = bl->prev)
1300  ;
1301  if (bl)
1302  bl->flags |= FSCOPE_UPVAL;
1303 }
1304 
1305 /* -- Function state management ------------------------------------------- */
1306 
1307 /* Fixup bytecode for prototype. */
1309 {
1310  BCInsLine *base = fs->bcbase;
1311  MSize i;
1312  pt->sizebc = n;
1313  bc[0] = BCINS_AD((fs->flags & PROTO_VARARG) ? BC_FUNCV : BC_FUNCF,
1314  fs->framesize, 0);
1315  for (i = 1; i < n; i++)
1316  bc[i] = base[i].ins;
1317 }
1318 
1319 /* Fixup upvalues for child prototype, step #2. */
1320 static void fs_fixup_uv2(FuncState *fs, GCproto *pt)
1321 {
1322  VarInfo *vstack = fs->ls->vstack;
1323  uint16_t *uv = proto_uv(pt);
1324  MSize i, n = pt->sizeuv;
1325  for (i = 0; i < n; i++) {
1326  VarIndex vidx = uv[i];
1327  if (vidx >= LJ_MAX_VSTACK)
1328  uv[i] = vidx - LJ_MAX_VSTACK;
1329  else if ((vstack[vidx].info & VSTACK_VAR_RW))
1330  uv[i] = vstack[vidx].slot | PROTO_UV_LOCAL;
1331  else
1332  uv[i] = vstack[vidx].slot | PROTO_UV_LOCAL | PROTO_UV_IMMUTABLE;
1333  }
1334 }
1335 
1336 /* Fixup constants for prototype. */
1337 static void fs_fixup_k(FuncState *fs, GCproto *pt, void *kptr)
1338 {
1339  GCtab *kt;
1340  TValue *array;
1341  Node *node;
1342  MSize i, hmask;
1343  checklimitgt(fs, fs->nkn, BCMAX_D+1, "constants");
1344  checklimitgt(fs, fs->nkgc, BCMAX_D+1, "constants");
1345  setmref(pt->k, kptr);
1346  pt->sizekn = fs->nkn;
1347  pt->sizekgc = fs->nkgc;
1348  kt = fs->kt;
1349  array = tvref(kt->array);
1350  for (i = 0; i < kt->asize; i++)
1351  if (tvhaskslot(&array[i])) {
1352  TValue *tv = &((TValue *)kptr)[tvkslot(&array[i])];
1353  if (LJ_DUALNUM)
1354  setintV(tv, (int32_t)i);
1355  else
1356  setnumV(tv, (lua_Number)i);
1357  }
1358  node = noderef(kt->node);
1359  hmask = kt->hmask;
1360  for (i = 0; i <= hmask; i++) {
1361  Node *n = &node[i];
1362  if (tvhaskslot(&n->val)) {
1363  ptrdiff_t kidx = (ptrdiff_t)tvkslot(&n->val);
1364  lua_assert(!tvisint(&n->key));
1365  if (tvisnum(&n->key)) {
1366  TValue *tv = &((TValue *)kptr)[kidx];
1367  if (LJ_DUALNUM) {
1368  lua_Number nn = numV(&n->key);
1369  int32_t k = lj_num2int(nn);
1370  lua_assert(!tvismzero(&n->key));
1371  if ((lua_Number)k == nn)
1372  setintV(tv, k);
1373  else
1374  *tv = n->key;
1375  } else {
1376  *tv = n->key;
1377  }
1378  } else {
1379  GCobj *o = gcV(&n->key);
1380  setgcref(((GCRef *)kptr)[~kidx], o);
1381  lj_gc_objbarrier(fs->L, pt, o);
1382  if (tvisproto(&n->key))
1383  fs_fixup_uv2(fs, gco2pt(o));
1384  }
1385  }
1386  }
1387 }
1388 
1389 /* Fixup upvalues for prototype, step #1. */
1390 static void fs_fixup_uv1(FuncState *fs, GCproto *pt, uint16_t *uv)
1391 {
1392  setmref(pt->uv, uv);
1393  pt->sizeuv = fs->nuv;
1394  memcpy(uv, fs->uvtmp, fs->nuv*sizeof(VarIndex));
1395 }
1396 
1397 #ifndef LUAJIT_DISABLE_DEBUGINFO
1398 /* Prepare lineinfo for prototype. */
1400 {
1401  return (fs->pc-1) << (numline < 256 ? 0 : numline < 65536 ? 1 : 2);
1402 }
1403 
1404 /* Fixup lineinfo for prototype. */
1405 static void fs_fixup_line(FuncState *fs, GCproto *pt,
1406  void *lineinfo, BCLine numline)
1407 {
1408  BCInsLine *base = fs->bcbase + 1;
1409  BCLine first = fs->linedefined;
1410  MSize i = 0, n = fs->pc-1;
1411  pt->firstline = fs->linedefined;
1412  pt->numline = numline;
1413  setmref(pt->lineinfo, lineinfo);
1414  if (LJ_LIKELY(numline < 256)) {
1415  uint8_t *li = (uint8_t *)lineinfo;
1416  do {
1417  BCLine delta = base[i].line - first;
1418  lua_assert(delta >= 0 && delta < 256);
1419  li[i] = (uint8_t)delta;
1420  } while (++i < n);
1421  } else if (LJ_LIKELY(numline < 65536)) {
1422  uint16_t *li = (uint16_t *)lineinfo;
1423  do {
1424  BCLine delta = base[i].line - first;
1425  lua_assert(delta >= 0 && delta < 65536);
1426  li[i] = (uint16_t)delta;
1427  } while (++i < n);
1428  } else {
1429  uint32_t *li = (uint32_t *)lineinfo;
1430  do {
1431  BCLine delta = base[i].line - first;
1432  lua_assert(delta >= 0);
1433  li[i] = (uint32_t)delta;
1434  } while (++i < n);
1435  }
1436 }
1437 
1438 /* Prepare variable info for prototype. */
1439 static size_t fs_prep_var(LexState *ls, FuncState *fs, size_t *ofsvar)
1440 {
1441  VarInfo *vs =ls->vstack, *ve;
1442  MSize i, n;
1443  BCPos lastpc;
1444  lj_buf_reset(&ls->sb); /* Copy to temp. string buffer. */
1445  /* Store upvalue names. */
1446  for (i = 0, n = fs->nuv; i < n; i++) {
1447  GCstr *s = strref(vs[fs->uvmap[i]].name);
1448  MSize len = s->len+1;
1449  char *p = lj_buf_more(&ls->sb, len);
1450  p = lj_buf_wmem(p, strdata(s), len);
1451  setsbufP(&ls->sb, p);
1452  }
1453  *ofsvar = sbuflen(&ls->sb);
1454  lastpc = 0;
1455  /* Store local variable names and compressed ranges. */
1456  for (ve = vs + ls->vtop, vs += fs->vbase; vs < ve; vs++) {
1457  if (!gola_isgotolabel(vs)) {
1458  GCstr *s = strref(vs->name);
1459  BCPos startpc;
1460  char *p;
1461  if ((uintptr_t)s < VARNAME__MAX) {
1462  p = lj_buf_more(&ls->sb, 1 + 2*5);
1463  *p++ = (char)(uintptr_t)s;
1464  } else {
1465  MSize len = s->len+1;
1466  p = lj_buf_more(&ls->sb, len + 2*5);
1467  p = lj_buf_wmem(p, strdata(s), len);
1468  }
1469  startpc = vs->startpc;
1470  p = lj_strfmt_wuleb128(p, startpc-lastpc);
1471  p = lj_strfmt_wuleb128(p, vs->endpc-startpc);
1472  setsbufP(&ls->sb, p);
1473  lastpc = startpc;
1474  }
1475  }
1476  lj_buf_putb(&ls->sb, '\0'); /* Terminator for varinfo. */
1477  return sbuflen(&ls->sb);
1478 }
1479 
1480 /* Fixup variable info for prototype. */
1481 static void fs_fixup_var(LexState *ls, GCproto *pt, uint8_t *p, size_t ofsvar)
1482 {
1483  setmref(pt->uvinfo, p);
1484  setmref(pt->varinfo, (char *)p + ofsvar);
1485  memcpy(p, sbufB(&ls->sb), sbuflen(&ls->sb)); /* Copy from temp. buffer. */
1486 }
1487 #else
1488 
1489 /* Initialize with empty debug info, if disabled. */
1490 #define fs_prep_line(fs, numline) (UNUSED(numline), 0)
1491 #define fs_fixup_line(fs, pt, li, numline) \
1492  pt->firstline = pt->numline = 0, setmref((pt)->lineinfo, NULL)
1493 #define fs_prep_var(ls, fs, ofsvar) (UNUSED(ofsvar), 0)
1494 #define fs_fixup_var(ls, pt, p, ofsvar) \
1495  setmref((pt)->uvinfo, NULL), setmref((pt)->varinfo, NULL)
1496 
1497 #endif
1498 
1499 /* Check if bytecode op returns. */
1500 static int bcopisret(BCOp op)
1501 {
1502  switch (op) {
1503  case BC_CALLMT: case BC_CALLT:
1504  case BC_RETM: case BC_RET: case BC_RET0: case BC_RET1:
1505  return 1;
1506  default:
1507  return 0;
1508  }
1509 }
1510 
1511 /* Fixup return instruction for prototype. */
1512 static void fs_fixup_ret(FuncState *fs)
1513 {
1514  BCPos lastpc = fs->pc;
1515  if (lastpc <= fs->lasttarget || !bcopisret(bc_op(fs->bcbase[lastpc-1].ins))) {
1516  if ((fs->bl->flags & FSCOPE_UPVAL))
1517  bcemit_AJ(fs, BC_UCLO, 0, 0);
1518  bcemit_AD(fs, BC_RET0, 0, 1); /* Need final return. */
1519  }
1520  fs->bl->flags |= FSCOPE_NOCLOSE; /* Handled above. */
1521  fscope_end(fs);
1522  lua_assert(fs->bl == NULL);
1523  /* May need to fixup returns encoded before first function was created. */
1524  if (fs->flags & PROTO_FIXUP_RETURN) {
1525  BCPos pc;
1526  for (pc = 1; pc < lastpc; pc++) {
1527  BCIns ins = fs->bcbase[pc].ins;
1528  BCPos offset;
1529  switch (bc_op(ins)) {
1530  case BC_CALLMT: case BC_CALLT:
1531  case BC_RETM: case BC_RET: case BC_RET0: case BC_RET1:
1532  offset = bcemit_INS(fs, ins); /* Copy original instruction. */
1533  fs->bcbase[offset].line = fs->bcbase[pc].line;
1534  offset = offset-(pc+1)+BCBIAS_J;
1535  if (offset > BCMAX_D)
1536  err_syntax(fs->ls, LJ_ERR_XFIXUP);
1537  /* Replace with UCLO plus branch. */
1538  fs->bcbase[pc].ins = BCINS_AD(BC_UCLO, 0, offset);
1539  break;
1540  case BC_UCLO:
1541  return; /* We're done. */
1542  default:
1543  break;
1544  }
1545  }
1546  }
1547 }
1548 
1549 /* Finish a FuncState and return the new prototype. */
1551 {
1552  lua_State *L = ls->L;
1553  FuncState *fs = ls->fs;
1554  BCLine numline = line - fs->linedefined;
1555  size_t sizept, ofsk, ofsuv, ofsli, ofsdbg, ofsvar;
1556  GCproto *pt;
1557 
1558  /* Apply final fixups. */
1559  fs_fixup_ret(fs);
1560 
1561  /* Calculate total size of prototype including all colocated arrays. */
1562  sizept = sizeof(GCproto) + fs->pc*sizeof(BCIns) + fs->nkgc*sizeof(GCRef);
1563  sizept = (sizept + sizeof(TValue)-1) & ~(sizeof(TValue)-1);
1564  ofsk = sizept; sizept += fs->nkn*sizeof(TValue);
1565  ofsuv = sizept; sizept += ((fs->nuv+1)&~1)*2;
1566  ofsli = sizept; sizept += fs_prep_line(fs, numline);
1567  ofsdbg = sizept; sizept += fs_prep_var(ls, fs, &ofsvar);
1568 
1569  /* Allocate prototype and initialize its fields. */
1570  pt = (GCproto *)lj_mem_newgco(L, (MSize)sizept);
1571  pt->gct = ~~LJ_TPROTO;
1572  pt->sizept = (MSize)sizept;
1573  pt->trace = 0;
1574  pt->flags = (uint8_t)(fs->flags & ~(PROTO_HAS_RETURN|PROTO_FIXUP_RETURN));
1575  pt->numparams = fs->numparams;
1576  pt->framesize = fs->framesize;
1577  setgcref(pt->chunkname, obj2gco(ls->chunkname));
1578 
1579  /* Close potentially uninitialized gap between bc and kgc. */
1580  *(uint32_t *)((char *)pt + ofsk - sizeof(GCRef)*(fs->nkgc+1)) = 0;
1581  fs_fixup_bc(fs, pt, (BCIns *)((char *)pt + sizeof(GCproto)), fs->pc);
1582  fs_fixup_k(fs, pt, (void *)((char *)pt + ofsk));
1583  fs_fixup_uv1(fs, pt, (uint16_t *)((char *)pt + ofsuv));
1584  fs_fixup_line(fs, pt, (void *)((char *)pt + ofsli), numline);
1585  fs_fixup_var(ls, pt, (uint8_t *)((char *)pt + ofsdbg), ofsvar);
1586 
1587  lj_vmevent_send(L, BC,
1588  setprotoV(L, L->top++, pt);
1589  );
1590 
1591  L->top--; /* Pop table of constants. */
1592  ls->vtop = fs->vbase; /* Reset variable stack. */
1593  ls->fs = fs->prev;
1594  lua_assert(ls->fs != NULL || ls->tok == TK_eof);
1595  return pt;
1596 }
1597 
1598 /* Initialize a new FuncState. */
1599 static void fs_init(LexState *ls, FuncState *fs)
1600 {
1601  lua_State *L = ls->L;
1602  fs->prev = ls->fs; ls->fs = fs; /* Append to list. */
1603  fs->ls = ls;
1604  fs->vbase = ls->vtop;
1605  fs->L = L;
1606  fs->pc = 0;
1607  fs->lasttarget = 0;
1608  fs->jpc = NO_JMP;
1609  fs->freereg = 0;
1610  fs->nkgc = 0;
1611  fs->nkn = 0;
1612  fs->nactvar = 0;
1613  fs->nuv = 0;
1614  fs->bl = NULL;
1615  fs->flags = 0;
1616  fs->framesize = 1; /* Minimum frame size. */
1617  fs->kt = lj_tab_new(L, 0, 0);
1618  /* Anchor table of constants in stack to avoid being collected. */
1619  settabV(L, L->top, fs->kt);
1620  incr_top(L);
1621 }
1622 
1623 /* -- Expressions --------------------------------------------------------- */
1624 
1625 /* Forward declaration. */
1626 static void expr(LexState *ls, ExpDesc *v);
1627 
1628 /* Return string expression. */
1629 static void expr_str(LexState *ls, ExpDesc *e)
1630 {
1631  expr_init(e, VKSTR, 0);
1632  e->u.sval = lex_str(ls);
1633 }
1634 
1635 /* Return index expression. */
1636 static void expr_index(FuncState *fs, ExpDesc *t, ExpDesc *e)
1637 {
1638  /* Already called: expr_toval(fs, e). */
1639  t->k = VINDEXED;
1640  if (expr_isnumk(e)) {
1641 #if LJ_DUALNUM
1642  if (tvisint(expr_numtv(e))) {
1643  int32_t k = intV(expr_numtv(e));
1644  if (checku8(k)) {
1645  t->u.s.aux = BCMAX_C+1+(uint32_t)k; /* 256..511: const byte key */
1646  return;
1647  }
1648  }
1649 #else
1651  int32_t k = lj_num2int(n);
1652  if (checku8(k) && n == (lua_Number)k) {
1653  t->u.s.aux = BCMAX_C+1+(uint32_t)k; /* 256..511: const byte key */
1654  return;
1655  }
1656 #endif
1657  } else if (expr_isstrk(e)) {
1658  BCReg idx = const_str(fs, e);
1659  if (idx <= BCMAX_C) {
1660  t->u.s.aux = ~~idx; /* -256..-1: const string key */
1661  return;
1662  }
1663  }
1664  t->u.s.aux = expr_toanyreg(fs, e); /* 0..255: register */
1665 }
1666 
1667 /* Parse index expression with named field. */
1668 static void expr_field(LexState *ls, ExpDesc *v)
1669 {
1670  FuncState *fs = ls->fs;
1671  ExpDesc key;
1672  expr_toanyreg(fs, v);
1673  lj_lex_next(ls); /* Skip dot or colon. */
1674  expr_str(ls, &key);
1675  expr_index(fs, v, &key);
1676 }
1677 
1678 /* Parse index expression with brackets. */
1680 {
1681  lj_lex_next(ls); /* Skip '['. */
1682  expr(ls, v);
1683  expr_toval(ls->fs, v);
1684  lex_check(ls, ']');
1685 }
1686 
1687 /* Get value of constant expression. */
1688 static void expr_kvalue(TValue *v, ExpDesc *e)
1689 {
1690  if (e->k <= VKTRUE) {
1691  setpriV(v, ~(uint32_t)e->k);
1692  } else if (e->k == VKSTR) {
1693  setgcVraw(v, obj2gco(e->u.sval), LJ_TSTR);
1694  } else {
1696  *v = *expr_numtv(e);
1697  }
1698 }
1699 
1700 /* Parse table constructor expression. */
1701 static void expr_table(LexState *ls, ExpDesc *e)
1702 {
1703  FuncState *fs = ls->fs;
1704  BCLine line = ls->linenumber;
1705  GCtab *t = NULL;
1706  int vcall = 0, needarr = 0, fixt = 0;
1707  uint32_t narr = 1; /* First array index. */
1708  uint32_t nhash = 0; /* Number of hash entries. */
1709  BCReg freg = fs->freereg;
1710  BCPos pc = bcemit_AD(fs, BC_TNEW, freg, 0);
1711  expr_init(e, VNONRELOC, freg);
1712  bcreg_reserve(fs, 1);
1713  freg++;
1714  lex_check(ls, '{');
1715  while (ls->tok != '}') {
1716  ExpDesc key, val;
1717  vcall = 0;
1718  if (ls->tok == '[') {
1719  expr_bracket(ls, &key); /* Already calls expr_toval. */
1720  if (!expr_isk(&key)) expr_index(fs, e, &key);
1721  if (expr_isnumk(&key) && expr_numiszero(&key)) needarr = 1; else nhash++;
1722  lex_check(ls, '=');
1723  } else if ((ls->tok == TK_name || (!LJ_52 && ls->tok == TK_goto)) &&
1724  lj_lex_lookahead(ls) == '=') {
1725  expr_str(ls, &key);
1726  lex_check(ls, '=');
1727  nhash++;
1728  } else {
1729  expr_init(&key, VKNUM, 0);
1730  setintV(&key.u.nval, (int)narr);
1731  narr++;
1732  needarr = vcall = 1;
1733  }
1734  expr(ls, &val);
1735  if (expr_isk(&key) && key.k != VKNIL &&
1736  (key.k == VKSTR || expr_isk_nojump(&val))) {
1737  TValue k, *v;
1738  if (!t) { /* Create template table on demand. */
1739  BCReg kidx;
1740  t = lj_tab_new(fs->L, needarr ? narr : 0, hsize2hbits(nhash));
1741  kidx = const_gc(fs, obj2gco(t), LJ_TTAB);
1742  fs->bcbase[pc].ins = BCINS_AD(BC_TDUP, freg-1, kidx);
1743  }
1744  vcall = 0;
1745  expr_kvalue(&k, &key);
1746  v = lj_tab_set(fs->L, t, &k);
1747  lj_gc_anybarriert(fs->L, t);
1748  if (expr_isk_nojump(&val)) { /* Add const key/value to template table. */
1749  expr_kvalue(v, &val);
1750  } else { /* Otherwise create dummy string key (avoids lj_tab_newkey). */
1751  settabV(fs->L, v, t); /* Preserve key with table itself as value. */
1752  fixt = 1; /* Fix this later, after all resizes. */
1753  goto nonconst;
1754  }
1755  } else {
1756  nonconst:
1757  if (val.k != VCALL) { expr_toanyreg(fs, &val); vcall = 0; }
1758  if (expr_isk(&key)) expr_index(fs, e, &key);
1759  bcemit_store(fs, e, &val);
1760  }
1761  fs->freereg = freg;
1762  if (!lex_opt(ls, ',') && !lex_opt(ls, ';')) break;
1763  }
1764  lex_match(ls, '}', '{', line);
1765  if (vcall) {
1766  BCInsLine *ilp = &fs->bcbase[fs->pc-1];
1767  ExpDesc en;
1768  lua_assert(bc_a(ilp->ins) == freg &&
1769  bc_op(ilp->ins) == (narr > 256 ? BC_TSETV : BC_TSETB));
1770  expr_init(&en, VKNUM, 0);
1771  en.u.nval.u32.lo = narr-1;
1772  en.u.nval.u32.hi = 0x43300000; /* Biased integer to avoid denormals. */
1773  if (narr > 256) { fs->pc--; ilp--; }
1774  ilp->ins = BCINS_AD(BC_TSETM, freg, const_num(fs, &en));
1775  setbc_b(&ilp[-1].ins, 0);
1776  }
1777  if (pc == fs->pc-1) { /* Make expr relocable if possible. */
1778  e->u.s.info = pc;
1779  fs->freereg--;
1780  e->k = VRELOCABLE;
1781  } else {
1782  e->k = VNONRELOC; /* May have been changed by expr_index. */
1783  }
1784  if (!t) { /* Construct TNEW RD: hhhhhaaaaaaaaaaa. */
1785  BCIns *ip = &fs->bcbase[pc].ins;
1786  if (!needarr) narr = 0;
1787  else if (narr < 3) narr = 3;
1788  else if (narr > 0x7ff) narr = 0x7ff;
1789  setbc_d(ip, narr|(hsize2hbits(nhash)<<11));
1790  } else {
1791  if (needarr && t->asize < narr)
1792  lj_tab_reasize(fs->L, t, narr-1);
1793  if (fixt) { /* Fix value for dummy keys in template table. */
1794  Node *node = noderef(t->node);
1795  uint32_t i, hmask = t->hmask;
1796  for (i = 0; i <= hmask; i++) {
1797  Node *n = &node[i];
1798  if (tvistab(&n->val)) {
1799  lua_assert(tabV(&n->val) == t);
1800  setnilV(&n->val); /* Turn value into nil. */
1801  }
1802  }
1803  }
1804  lj_gc_check(fs->L);
1805  }
1806 }
1807 
1808 /* Parse function parameters. */
1809 static BCReg parse_params(LexState *ls, int needself)
1810 {
1811  FuncState *fs = ls->fs;
1812  BCReg nparams = 0;
1813  lex_check(ls, '(');
1814  if (needself)
1815  var_new_lit(ls, nparams++, "self");
1816  if (ls->tok != ')') {
1817  do {
1818  if (ls->tok == TK_name || (!LJ_52 && ls->tok == TK_goto)) {
1819  var_new(ls, nparams++, lex_str(ls));
1820  } else if (ls->tok == TK_dots) {
1821  lj_lex_next(ls);
1822  fs->flags |= PROTO_VARARG;
1823  break;
1824  } else {
1825  err_syntax(ls, LJ_ERR_XPARAM);
1826  }
1827  } while (lex_opt(ls, ','));
1828  }
1829  var_add(ls, nparams);
1830  lua_assert(fs->nactvar == nparams);
1831  bcreg_reserve(fs, nparams);
1832  lex_check(ls, ')');
1833  return nparams;
1834 }
1835 
1836 /* Forward declaration. */
1837 static void parse_chunk(LexState *ls);
1838 
1839 /* Parse body of a function. */
1840 static void parse_body(LexState *ls, ExpDesc *e, int needself, BCLine line)
1841 {
1842  FuncState fs, *pfs = ls->fs;
1843  FuncScope bl;
1844  GCproto *pt;
1845  ptrdiff_t oldbase = pfs->bcbase - ls->bcstack;
1846  fs_init(ls, &fs);
1847  fscope_begin(&fs, &bl, 0);
1848  fs.linedefined = line;
1849  fs.numparams = (uint8_t)parse_params(ls, needself);
1850  fs.bcbase = pfs->bcbase + pfs->pc;
1851  fs.bclim = pfs->bclim - pfs->pc;
1852  bcemit_AD(&fs, BC_FUNCF, 0, 0); /* Placeholder. */
1853  parse_chunk(ls);
1854  if (ls->tok != TK_end) lex_match(ls, TK_end, TK_function, line);
1855  pt = fs_finish(ls, (ls->lastline = ls->linenumber));
1856  pfs->bcbase = ls->bcstack + oldbase; /* May have been reallocated. */
1857  pfs->bclim = (BCPos)(ls->sizebcstack - oldbase);
1858  /* Store new prototype in the constant array of the parent. */
1860  bcemit_AD(pfs, BC_FNEW, 0, const_gc(pfs, obj2gco(pt), LJ_TPROTO)));
1861 #if LJ_HASFFI
1862  pfs->flags |= (fs.flags & PROTO_FFI);
1863 #endif
1864  if (!(pfs->flags & PROTO_CHILD)) {
1865  if (pfs->flags & PROTO_HAS_RETURN)
1866  pfs->flags |= PROTO_FIXUP_RETURN;
1867  pfs->flags |= PROTO_CHILD;
1868  }
1869  lj_lex_next(ls);
1870 }
1871 
1872 /* Parse expression list. Last expression is left open. */
1874 {
1875  BCReg n = 1;
1876  expr(ls, v);
1877  while (lex_opt(ls, ',')) {
1878  expr_tonextreg(ls->fs, v);
1879  expr(ls, v);
1880  n++;
1881  }
1882  return n;
1883 }
1884 
1885 /* Parse function argument list. */
1886 static void parse_args(LexState *ls, ExpDesc *e)
1887 {
1888  FuncState *fs = ls->fs;
1889  ExpDesc args;
1890  BCIns ins;
1891  BCReg base;
1892  BCLine line = ls->linenumber;
1893  if (ls->tok == '(') {
1894 #if !LJ_52
1895  if (line != ls->lastline)
1896  err_syntax(ls, LJ_ERR_XAMBIG);
1897 #endif
1898  lj_lex_next(ls);
1899  if (ls->tok == ')') { /* f(). */
1900  args.k = VVOID;
1901  } else {
1902  expr_list(ls, &args);
1903  if (args.k == VCALL) /* f(a, b, g()) or f(a, b, ...). */
1904  setbc_b(bcptr(fs, &args), 0); /* Pass on multiple results. */
1905  }
1906  lex_match(ls, ')', '(', line);
1907  } else if (ls->tok == '{') {
1908  expr_table(ls, &args);
1909  } else if (ls->tok == TK_string) {
1910  expr_init(&args, VKSTR, 0);
1911  args.u.sval = strV(&ls->tokval);
1912  lj_lex_next(ls);
1913  } else {
1914  err_syntax(ls, LJ_ERR_XFUNARG);
1915  return; /* Silence compiler. */
1916  }
1917  lua_assert(e->k == VNONRELOC);
1918  base = e->u.s.info; /* Base register for call. */
1919  if (args.k == VCALL) {
1920  ins = BCINS_ABC(BC_CALLM, base, 2, args.u.s.aux - base - 1 - LJ_FR2);
1921  } else {
1922  if (args.k != VVOID)
1923  expr_tonextreg(fs, &args);
1924  ins = BCINS_ABC(BC_CALL, base, 2, fs->freereg - base - LJ_FR2);
1925  }
1926  expr_init(e, VCALL, bcemit_INS(fs, ins));
1927  e->u.s.aux = base;
1928  fs->bcbase[fs->pc - 1].line = line;
1929  fs->freereg = base+1; /* Leave one result by default. */
1930 }
1931 
1932 /* Parse primary expression. */
1934 {
1935  FuncState *fs = ls->fs;
1936  /* Parse prefix expression. */
1937  if (ls->tok == '(') {
1938  BCLine line = ls->linenumber;
1939  lj_lex_next(ls);
1940  expr(ls, v);
1941  lex_match(ls, ')', '(', line);
1942  expr_discharge(ls->fs, v);
1943  } else if (ls->tok == TK_name || (!LJ_52 && ls->tok == TK_goto)) {
1944  var_lookup(ls, v);
1945  } else {
1946  err_syntax(ls, LJ_ERR_XSYMBOL);
1947  }
1948  for (;;) { /* Parse multiple expression suffixes. */
1949  if (ls->tok == '.') {
1950  expr_field(ls, v);
1951  } else if (ls->tok == '[') {
1952  ExpDesc key;
1953  expr_toanyreg(fs, v);
1954  expr_bracket(ls, &key);
1955  expr_index(fs, v, &key);
1956  } else if (ls->tok == ':') {
1957  ExpDesc key;
1958  lj_lex_next(ls);
1959  expr_str(ls, &key);
1960  bcemit_method(fs, v, &key);
1961  parse_args(ls, v);
1962  } else if (ls->tok == '(' || ls->tok == TK_string || ls->tok == '{') {
1963  expr_tonextreg(fs, v);
1964  if (LJ_FR2) bcreg_reserve(fs, 1);
1965  parse_args(ls, v);
1966  } else {
1967  break;
1968  }
1969  }
1970 }
1971 
1972 /* Parse simple expression. */
1974 {
1975  switch (ls->tok) {
1976  case TK_number:
1977  expr_init(v, (LJ_HASFFI && tviscdata(&ls->tokval)) ? VKCDATA : VKNUM, 0);
1978  copyTV(ls->L, &v->u.nval, &ls->tokval);
1979  break;
1980  case TK_string:
1981  expr_init(v, VKSTR, 0);
1982  v->u.sval = strV(&ls->tokval);
1983  break;
1984  case TK_nil:
1985  expr_init(v, VKNIL, 0);
1986  break;
1987  case TK_true:
1988  expr_init(v, VKTRUE, 0);
1989  break;
1990  case TK_false:
1991  expr_init(v, VKFALSE, 0);
1992  break;
1993  case TK_dots: { /* Vararg. */
1994  FuncState *fs = ls->fs;
1995  BCReg base;
1996  checkcond(ls, fs->flags & PROTO_VARARG, LJ_ERR_XDOTS);
1997  bcreg_reserve(fs, 1);
1998  base = fs->freereg-1;
1999  expr_init(v, VCALL, bcemit_ABC(fs, BC_VARG, base, 2, fs->numparams));
2000  v->u.s.aux = base;
2001  break;
2002  }
2003  case '{': /* Table constructor. */
2004  expr_table(ls, v);
2005  return;
2006  case TK_function:
2007  lj_lex_next(ls);
2008  parse_body(ls, v, 0, ls->linenumber);
2009  return;
2010  default:
2011  expr_primary(ls, v);
2012  return;
2013  }
2014  lj_lex_next(ls);
2015 }
2016 
2017 /* Manage syntactic levels to avoid blowing up the stack. */
2019 {
2020  if (++ls->level >= LJ_MAX_XLEVEL)
2021  lj_lex_error(ls, 0, LJ_ERR_XLEVELS);
2022 }
2023 
2024 #define synlevel_end(ls) ((ls)->level--)
2025 
2026 /* Convert token to binary operator. */
2028 {
2029  switch (tok) {
2030  case '+': return OPR_ADD;
2031  case '-': return OPR_SUB;
2032  case '*': return OPR_MUL;
2033  case '/': return OPR_DIV;
2034  case '%': return OPR_MOD;
2035  case '^': return OPR_POW;
2036  case TK_concat: return OPR_CONCAT;
2037  case TK_ne: return OPR_NE;
2038  case TK_eq: return OPR_EQ;
2039  case '<': return OPR_LT;
2040  case TK_le: return OPR_LE;
2041  case '>': return OPR_GT;
2042  case TK_ge: return OPR_GE;
2043  case TK_and: return OPR_AND;
2044  case TK_or: return OPR_OR;
2045  default: return OPR_NOBINOPR;
2046  }
2047 }
2048 
2049 /* Priorities for each binary operator. ORDER OPR. */
2050 static const struct {
2051  uint8_t left; /* Left priority. */
2052  uint8_t right; /* Right priority. */
2053 } priority[] = {
2054  {6,6}, {6,6}, {7,7}, {7,7}, {7,7}, /* ADD SUB MUL DIV MOD */
2055  {10,9}, {5,4}, /* POW CONCAT (right associative) */
2056  {3,3}, {3,3}, /* EQ NE */
2057  {3,3}, {3,3}, {3,3}, {3,3}, /* LT GE GT LE */
2058  {2,2}, {1,1} /* AND OR */
2059 };
2060 
2061 #define UNARY_PRIORITY 8 /* Priority for unary operators. */
2062 
2063 /* Forward declaration. */
2065 
2066 /* Parse unary expression. */
2067 static void expr_unop(LexState *ls, ExpDesc *v)
2068 {
2069  BCOp op;
2070  if (ls->tok == TK_not) {
2071  op = BC_NOT;
2072  } else if (ls->tok == '-') {
2073  op = BC_UNM;
2074  } else if (ls->tok == '#') {
2075  op = BC_LEN;
2076  } else {
2077  expr_simple(ls, v);
2078  return;
2079  }
2080  lj_lex_next(ls);
2081  expr_binop(ls, v, UNARY_PRIORITY);
2082  bcemit_unop(ls->fs, op, v);
2083 }
2084 
2085 /* Parse binary expressions with priority higher than the limit. */
2087 {
2088  BinOpr op;
2089  synlevel_begin(ls);
2090  expr_unop(ls, v);
2091  op = token2binop(ls->tok);
2092  while (op != OPR_NOBINOPR && priority[op].left > limit) {
2093  ExpDesc v2;
2094  BinOpr nextop;
2095  lj_lex_next(ls);
2096  bcemit_binop_left(ls->fs, op, v);
2097  /* Parse binary expression with higher priority. */
2098  nextop = expr_binop(ls, &v2, priority[op].right);
2099  bcemit_binop(ls->fs, op, v, &v2);
2100  op = nextop;
2101  }
2102  synlevel_end(ls);
2103  return op; /* Return unconsumed binary operator (if any). */
2104 }
2105 
2106 /* Parse expression. */
2107 static void expr(LexState *ls, ExpDesc *v)
2108 {
2109  expr_binop(ls, v, 0); /* Priority 0: parse whole expression. */
2110 }
2111 
2112 /* Assign expression to the next register. */
2113 static void expr_next(LexState *ls)
2114 {
2115  ExpDesc e;
2116  expr(ls, &e);
2117  expr_tonextreg(ls->fs, &e);
2118 }
2119 
2120 /* Parse conditional expression. */
2122 {
2123  ExpDesc v;
2124  expr(ls, &v);
2125  if (v.k == VKNIL) v.k = VKFALSE;
2126  bcemit_branch_t(ls->fs, &v);
2127  return v.f;
2128 }
2129 
2130 /* -- Assignments --------------------------------------------------------- */
2131 
2132 /* List of LHS variables. */
2133 typedef struct LHSVarList {
2134  ExpDesc v; /* LHS variable. */
2135  struct LHSVarList *prev; /* Link to previous LHS variable. */
2137 
2138 /* Eliminate write-after-read hazards for local variable assignment. */
2139 static void assign_hazard(LexState *ls, LHSVarList *lh, const ExpDesc *v)
2140 {
2141  FuncState *fs = ls->fs;
2142  BCReg reg = v->u.s.info; /* Check against this variable. */
2143  BCReg tmp = fs->freereg; /* Rename to this temp. register (if needed). */
2144  int hazard = 0;
2145  for (; lh; lh = lh->prev) {
2146  if (lh->v.k == VINDEXED) {
2147  if (lh->v.u.s.info == reg) { /* t[i], t = 1, 2 */
2148  hazard = 1;
2149  lh->v.u.s.info = tmp;
2150  }
2151  if (lh->v.u.s.aux == reg) { /* t[i], i = 1, 2 */
2152  hazard = 1;
2153  lh->v.u.s.aux = tmp;
2154  }
2155  }
2156  }
2157  if (hazard) {
2158  bcemit_AD(fs, BC_MOV, tmp, reg); /* Rename conflicting variable. */
2159  bcreg_reserve(fs, 1);
2160  }
2161 }
2162 
2163 /* Adjust LHS/RHS of an assignment. */
2164 static void assign_adjust(LexState *ls, BCReg nvars, BCReg nexps, ExpDesc *e)
2165 {
2166  FuncState *fs = ls->fs;
2167  int32_t extra = (int32_t)nvars - (int32_t)nexps;
2168  if (e->k == VCALL) {
2169  extra++; /* Compensate for the VCALL itself. */
2170  if (extra < 0) extra = 0;
2171  setbc_b(bcptr(fs, e), extra+1); /* Fixup call results. */
2172  if (extra > 1) bcreg_reserve(fs, (BCReg)extra-1);
2173  } else {
2174  if (e->k != VVOID)
2175  expr_tonextreg(fs, e); /* Close last expression. */
2176  if (extra > 0) { /* Leftover LHS are set to nil. */
2177  BCReg reg = fs->freereg;
2178  bcreg_reserve(fs, (BCReg)extra);
2179  bcemit_nil(fs, reg, (BCReg)extra);
2180  }
2181  }
2182  if (nexps > nvars)
2183  ls->fs->freereg -= nexps - nvars; /* Drop leftover regs. */
2184 }
2185 
2186 /* Recursively parse assignment statement. */
2187 static void parse_assignment(LexState *ls, LHSVarList *lh, BCReg nvars)
2188 {
2189  ExpDesc e;
2190  checkcond(ls, VLOCAL <= lh->v.k && lh->v.k <= VINDEXED, LJ_ERR_XSYNTAX);
2191  if (lex_opt(ls, ',')) { /* Collect LHS list and recurse upwards. */
2192  LHSVarList vl;
2193  vl.prev = lh;
2194  expr_primary(ls, &vl.v);
2195  if (vl.v.k == VLOCAL)
2196  assign_hazard(ls, lh, &vl.v);
2197  checklimit(ls->fs, ls->level + nvars, LJ_MAX_XLEVEL, "variable names");
2198  parse_assignment(ls, &vl, nvars+1);
2199  } else { /* Parse RHS. */
2200  BCReg nexps;
2201  lex_check(ls, '=');
2202  nexps = expr_list(ls, &e);
2203  if (nexps == nvars) {
2204  if (e.k == VCALL) {
2205  if (bc_op(*bcptr(ls->fs, &e)) == BC_VARG) { /* Vararg assignment. */
2206  ls->fs->freereg--;
2207  e.k = VRELOCABLE;
2208  } else { /* Multiple call results. */
2209  e.u.s.info = e.u.s.aux; /* Base of call is not relocatable. */
2210  e.k = VNONRELOC;
2211  }
2212  }
2213  bcemit_store(ls->fs, &lh->v, &e);
2214  return;
2215  }
2216  assign_adjust(ls, nvars, nexps, &e);
2217  }
2218  /* Assign RHS to LHS and recurse downwards. */
2219  expr_init(&e, VNONRELOC, ls->fs->freereg-1);
2220  bcemit_store(ls->fs, &lh->v, &e);
2221 }
2222 
2223 /* Parse call statement or assignment. */
2224 static void parse_call_assign(LexState *ls)
2225 {
2226  FuncState *fs = ls->fs;
2227  LHSVarList vl;
2228  expr_primary(ls, &vl.v);
2229  if (vl.v.k == VCALL) { /* Function call statement. */
2230  setbc_b(bcptr(fs, &vl.v), 1); /* No results. */
2231  } else { /* Start of an assignment. */
2232  vl.prev = NULL;
2233  parse_assignment(ls, &vl, 1);
2234  }
2235 }
2236 
2237 /* Parse 'local' statement. */
2238 static void parse_local(LexState *ls)
2239 {
2240  if (lex_opt(ls, TK_function)) { /* Local function declaration. */
2241  ExpDesc v, b;
2242  FuncState *fs = ls->fs;
2243  var_new(ls, 0, lex_str(ls));
2244  expr_init(&v, VLOCAL, fs->freereg);
2245  v.u.s.aux = fs->varmap[fs->freereg];
2246  bcreg_reserve(fs, 1);
2247  var_add(ls, 1);
2248  parse_body(ls, &b, 0, ls->linenumber);
2249  /* bcemit_store(fs, &v, &b) without setting VSTACK_VAR_RW. */
2250  expr_free(fs, &b);
2251  expr_toreg(fs, &b, v.u.s.info);
2252  /* The upvalue is in scope, but the local is only valid after the store. */
2253  var_get(ls, fs, fs->nactvar - 1).startpc = fs->pc;
2254  } else { /* Local variable declaration. */
2255  ExpDesc e;
2256  BCReg nexps, nvars = 0;
2257  do { /* Collect LHS. */
2258  var_new(ls, nvars++, lex_str(ls));
2259  } while (lex_opt(ls, ','));
2260  if (lex_opt(ls, '=')) { /* Optional RHS. */
2261  nexps = expr_list(ls, &e);
2262  } else { /* Or implicitly set to nil. */
2263  e.k = VVOID;
2264  nexps = 0;
2265  }
2266  assign_adjust(ls, nvars, nexps, &e);
2267  var_add(ls, nvars);
2268  }
2269 }
2270 
2271 /* Parse 'function' statement. */
2272 static void parse_func(LexState *ls, BCLine line)
2273 {
2274  FuncState *fs;
2275  ExpDesc v, b;
2276  int needself = 0;
2277  lj_lex_next(ls); /* Skip 'function'. */
2278  /* Parse function name. */
2279  var_lookup(ls, &v);
2280  while (ls->tok == '.') /* Multiple dot-separated fields. */
2281  expr_field(ls, &v);
2282  if (ls->tok == ':') { /* Optional colon to signify method call. */
2283  needself = 1;
2284  expr_field(ls, &v);
2285  }
2286  parse_body(ls, &b, needself, line);
2287  fs = ls->fs;
2288  bcemit_store(fs, &v, &b);
2289  fs->bcbase[fs->pc - 1].line = line; /* Set line for the store. */
2290 }
2291 
2292 /* -- Control transfer statements ----------------------------------------- */
2293 
2294 /* Check for end of block. */
2296 {
2297  switch (tok) {
2298  case TK_else: case TK_elseif: case TK_end: case TK_until: case TK_eof:
2299  return 1;
2300  default:
2301  return 0;
2302  }
2303 }
2304 
2305 /* Parse 'return' statement. */
2306 static void parse_return(LexState *ls)
2307 {
2308  BCIns ins;
2309  FuncState *fs = ls->fs;
2310  lj_lex_next(ls); /* Skip 'return'. */
2311  fs->flags |= PROTO_HAS_RETURN;
2312  if (parse_isend(ls->tok) || ls->tok == ';') { /* Bare return. */
2313  ins = BCINS_AD(BC_RET0, 0, 1);
2314  } else { /* Return with one or more values. */
2315  ExpDesc e; /* Receives the _last_ expression in the list. */
2316  BCReg nret = expr_list(ls, &e);
2317  if (nret == 1) { /* Return one result. */
2318  if (e.k == VCALL) { /* Check for tail call. */
2319  BCIns *ip = bcptr(fs, &e);
2320  /* It doesn't pay off to add BC_VARGT just for 'return ...'. */
2321  if (bc_op(*ip) == BC_VARG) goto notailcall;
2322  fs->pc--;
2324  } else { /* Can return the result from any register. */
2325  ins = BCINS_AD(BC_RET1, expr_toanyreg(fs, &e), 2);
2326  }
2327  } else {
2328  if (e.k == VCALL) { /* Append all results from a call. */
2329  notailcall:
2330  setbc_b(bcptr(fs, &e), 0);
2331  ins = BCINS_AD(BC_RETM, fs->nactvar, e.u.s.aux - fs->nactvar);
2332  } else {
2333  expr_tonextreg(fs, &e); /* Force contiguous registers. */
2334  ins = BCINS_AD(BC_RET, fs->nactvar, nret+1);
2335  }
2336  }
2337  }
2338  if (fs->flags & PROTO_CHILD)
2339  bcemit_AJ(fs, BC_UCLO, 0, 0); /* May need to close upvalues first. */
2340  bcemit_INS(fs, ins);
2341 }
2342 
2343 /* Parse 'break' statement. */
2344 static void parse_break(LexState *ls)
2345 {
2346  ls->fs->bl->flags |= FSCOPE_BREAK;
2348 }
2349 
2350 /* Parse 'goto' statement. */
2351 static void parse_goto(LexState *ls)
2352 {
2353  FuncState *fs = ls->fs;
2354  GCstr *name = lex_str(ls);
2355  VarInfo *vl = gola_findlabel(ls, name);
2356  if (vl) /* Treat backwards goto within same scope like a loop. */
2357  bcemit_AJ(fs, BC_LOOP, vl->slot, -1); /* No BC range check. */
2358  fs->bl->flags |= FSCOPE_GOLA;
2359  gola_new(ls, name, VSTACK_GOTO, bcemit_jmp(fs));
2360 }
2361 
2362 /* Parse label. */
2363 static void parse_label(LexState *ls)
2364 {
2365  FuncState *fs = ls->fs;
2366  GCstr *name;
2367  MSize idx;
2368  fs->lasttarget = fs->pc;
2369  fs->bl->flags |= FSCOPE_GOLA;
2370  lj_lex_next(ls); /* Skip '::'. */
2371  name = lex_str(ls);
2372  if (gola_findlabel(ls, name))
2373  lj_lex_error(ls, 0, LJ_ERR_XLDUP, strdata(name));
2374  idx = gola_new(ls, name, VSTACK_LABEL, fs->pc);
2375  lex_check(ls, TK_label);
2376  /* Recursively parse trailing statements: labels and ';' (Lua 5.2 only). */
2377  for (;;) {
2378  if (ls->tok == TK_label) {
2379  synlevel_begin(ls);
2380  parse_label(ls);
2381  synlevel_end(ls);
2382  } else if (LJ_52 && ls->tok == ';') {
2383  lj_lex_next(ls);
2384  } else {
2385  break;
2386  }
2387  }
2388  /* Trailing label is considered to be outside of scope. */
2389  if (parse_isend(ls->tok) && ls->tok != TK_until)
2390  ls->vstack[idx].slot = fs->bl->nactvar;
2391  gola_resolve(ls, fs->bl, idx);
2392 }
2393 
2394 /* -- Blocks, loops and conditional statements ---------------------------- */
2395 
2396 /* Parse a block. */
2397 static void parse_block(LexState *ls)
2398 {
2399  FuncState *fs = ls->fs;
2400  FuncScope bl;
2401  fscope_begin(fs, &bl, 0);
2402  parse_chunk(ls);
2403  fscope_end(fs);
2404 }
2405 
2406 /* Parse 'while' statement. */
2407 static void parse_while(LexState *ls, BCLine line)
2408 {
2409  FuncState *fs = ls->fs;
2410  BCPos start, loop, condexit;
2411  FuncScope bl;
2412  lj_lex_next(ls); /* Skip 'while'. */
2413  start = fs->lasttarget = fs->pc;
2414  condexit = expr_cond(ls);
2415  fscope_begin(fs, &bl, FSCOPE_LOOP);
2416  lex_check(ls, TK_do);
2417  loop = bcemit_AD(fs, BC_LOOP, fs->nactvar, 0);
2418  parse_block(ls);
2419  jmp_patch(fs, bcemit_jmp(fs), start);
2420  lex_match(ls, TK_end, TK_while, line);
2421  fscope_end(fs);
2422  jmp_tohere(fs, condexit);
2423  jmp_patchins(fs, loop, fs->pc);
2424 }
2425 
2426 /* Parse 'repeat' statement. */
2428 {
2429  FuncState *fs = ls->fs;
2430  BCPos loop = fs->lasttarget = fs->pc;
2431  BCPos condexit;
2432  FuncScope bl1, bl2;
2433  fscope_begin(fs, &bl1, FSCOPE_LOOP); /* Breakable loop scope. */
2434  fscope_begin(fs, &bl2, 0); /* Inner scope. */
2435  lj_lex_next(ls); /* Skip 'repeat'. */
2436  bcemit_AD(fs, BC_LOOP, fs->nactvar, 0);
2437  parse_chunk(ls);
2439  condexit = expr_cond(ls); /* Parse condition (still inside inner scope). */
2440  if (!(bl2.flags & FSCOPE_UPVAL)) { /* No upvalues? Just end inner scope. */
2441  fscope_end(fs);
2442  } else { /* Otherwise generate: cond: UCLO+JMP out, !cond: UCLO+JMP loop. */
2443  parse_break(ls); /* Break from loop and close upvalues. */
2444  jmp_tohere(fs, condexit);
2445  fscope_end(fs); /* End inner scope and close upvalues. */
2446  condexit = bcemit_jmp(fs);
2447  }
2448  jmp_patch(fs, condexit, loop); /* Jump backwards if !cond. */
2449  jmp_patchins(fs, loop, fs->pc);
2450  fscope_end(fs); /* End loop scope. */
2451 }
2452 
2453 /* Parse numeric 'for'. */
2454 static void parse_for_num(LexState *ls, GCstr *varname, BCLine line)
2455 {
2456  FuncState *fs = ls->fs;
2457  BCReg base = fs->freereg;
2458  FuncScope bl;
2459  BCPos loop, loopend;
2460  /* Hidden control variables. */
2464  /* Visible copy of index variable. */
2465  var_new(ls, FORL_EXT, varname);
2466  lex_check(ls, '=');
2467  expr_next(ls);
2468  lex_check(ls, ',');
2469  expr_next(ls);
2470  if (lex_opt(ls, ',')) {
2471  expr_next(ls);
2472  } else {
2473  bcemit_AD(fs, BC_KSHORT, fs->freereg, 1); /* Default step is 1. */
2474  bcreg_reserve(fs, 1);
2475  }
2476  var_add(ls, 3); /* Hidden control variables. */
2477  lex_check(ls, TK_do);
2478  loop = bcemit_AJ(fs, BC_FORI, base, NO_JMP);
2479  fscope_begin(fs, &bl, 0); /* Scope for visible variables. */
2480  var_add(ls, 1);
2481  bcreg_reserve(fs, 1);
2482  parse_block(ls);
2483  fscope_end(fs);
2484  /* Perform loop inversion. Loop control instructions are at the end. */
2485  loopend = bcemit_AJ(fs, BC_FORL, base, NO_JMP);
2486  fs->bcbase[loopend].line = line; /* Fix line for control ins. */
2487  jmp_patchins(fs, loopend, loop+1);
2488  jmp_patchins(fs, loop, fs->pc);
2489 }
2490 
2491 /* Try to predict whether the iterator is next() and specialize the bytecode.
2492 ** Detecting next() and pairs() by name is simplistic, but quite effective.
2493 ** The interpreter backs off if the check for the closure fails at runtime.
2494 */
2495 static int predict_next(LexState *ls, FuncState *fs, BCPos pc)
2496 {
2497  BCIns ins = fs->bcbase[pc].ins;
2498  GCstr *name;
2499  cTValue *o;
2500  switch (bc_op(ins)) {
2501  case BC_MOV:
2502  name = gco2str(gcref(var_get(ls, fs, bc_d(ins)).name));
2503  break;
2504  case BC_UGET:
2505  name = gco2str(gcref(ls->vstack[fs->uvmap[bc_d(ins)]].name));
2506  break;
2507  case BC_GGET:
2508  /* There's no inverse index (yet), so lookup the strings. */
2509  o = lj_tab_getstr(fs->kt, lj_str_newlit(ls->L, "pairs"));
2510  if (o && tvhaskslot(o) && tvkslot(o) == bc_d(ins))
2511  return 1;
2512  o = lj_tab_getstr(fs->kt, lj_str_newlit(ls->L, "next"));
2513  if (o && tvhaskslot(o) && tvkslot(o) == bc_d(ins))
2514  return 1;
2515  return 0;
2516  default:
2517  return 0;
2518  }
2519  return (name->len == 5 && !strcmp(strdata(name), "pairs")) ||
2520  (name->len == 4 && !strcmp(strdata(name), "next"));
2521 }
2522 
2523 /* Parse 'for' iterator. */
2524 static void parse_for_iter(LexState *ls, GCstr *indexname)
2525 {
2526  FuncState *fs = ls->fs;
2527  ExpDesc e;
2528  BCReg nvars = 0;
2529  BCLine line;
2530  BCReg base = fs->freereg + 3;
2531  BCPos loop, loopend, exprpc = fs->pc;
2532  FuncScope bl;
2533  int isnext;
2534  /* Hidden control variables. */
2535  var_new_fixed(ls, nvars++, VARNAME_FOR_GEN);
2536  var_new_fixed(ls, nvars++, VARNAME_FOR_STATE);
2537  var_new_fixed(ls, nvars++, VARNAME_FOR_CTL);
2538  /* Visible variables returned from iterator. */
2539  var_new(ls, nvars++, indexname);
2540  while (lex_opt(ls, ','))
2541  var_new(ls, nvars++, lex_str(ls));
2542  lex_check(ls, TK_in);
2543  line = ls->linenumber;
2544  assign_adjust(ls, 3, expr_list(ls, &e), &e);
2545  /* The iterator needs another 3 [4] slots (func [pc] | state ctl). */
2546  bcreg_bump(fs, 3+LJ_FR2);
2547  isnext = (nvars <= 5 && predict_next(ls, fs, exprpc));
2548  var_add(ls, 3); /* Hidden control variables. */
2549  lex_check(ls, TK_do);
2550  loop = bcemit_AJ(fs, isnext ? BC_ISNEXT : BC_JMP, base, NO_JMP);
2551  fscope_begin(fs, &bl, 0); /* Scope for visible variables. */
2552  var_add(ls, nvars-3);
2553  bcreg_reserve(fs, nvars-3);
2554  parse_block(ls);
2555  fscope_end(fs);
2556  /* Perform loop inversion. Loop control instructions are at the end. */
2557  jmp_patchins(fs, loop, fs->pc);
2558  bcemit_ABC(fs, isnext ? BC_ITERN : BC_ITERC, base, nvars-3+1, 2+1);
2559  loopend = bcemit_AJ(fs, BC_ITERL, base, NO_JMP);
2560  fs->bcbase[loopend-1].line = line; /* Fix line for control ins. */
2561  fs->bcbase[loopend].line = line;
2562  jmp_patchins(fs, loopend, loop+1);
2563 }
2564 
2565 /* Parse 'for' statement. */
2566 static void parse_for(LexState *ls, BCLine line)
2567 {
2568  FuncState *fs = ls->fs;
2569  GCstr *varname;
2570  FuncScope bl;
2571  fscope_begin(fs, &bl, FSCOPE_LOOP);
2572  lj_lex_next(ls); /* Skip 'for'. */
2573  varname = lex_str(ls); /* Get first variable name. */
2574  if (ls->tok == '=')
2575  parse_for_num(ls, varname, line);
2576  else if (ls->tok == ',' || ls->tok == TK_in)
2577  parse_for_iter(ls, varname);
2578  else
2579  err_syntax(ls, LJ_ERR_XFOR);
2580  lex_match(ls, TK_end, TK_for, line);
2581  fscope_end(fs); /* Resolve break list. */
2582 }
2583 
2584 /* Parse condition and 'then' block. */
2586 {
2587  BCPos condexit;
2588  lj_lex_next(ls); /* Skip 'if' or 'elseif'. */
2589  condexit = expr_cond(ls);
2590  lex_check(ls, TK_then);
2591  parse_block(ls);
2592  return condexit;
2593 }
2594 
2595 /* Parse 'if' statement. */
2596 static void parse_if(LexState *ls, BCLine line)
2597 {
2598  FuncState *fs = ls->fs;
2599  BCPos flist;
2600  BCPos escapelist = NO_JMP;
2601  flist = parse_then(ls);
2602  while (ls->tok == TK_elseif) { /* Parse multiple 'elseif' blocks. */
2603  jmp_append(fs, &escapelist, bcemit_jmp(fs));
2604  jmp_tohere(fs, flist);
2605  flist = parse_then(ls);
2606  }
2607  if (ls->tok == TK_else) { /* Parse optional 'else' block. */
2608  jmp_append(fs, &escapelist, bcemit_jmp(fs));
2609  jmp_tohere(fs, flist);
2610  lj_lex_next(ls); /* Skip 'else'. */
2611  parse_block(ls);
2612  } else {
2613  jmp_append(fs, &escapelist, flist);
2614  }
2615  jmp_tohere(fs, escapelist);
2616  lex_match(ls, TK_end, TK_if, line);
2617 }
2618 
2619 /* -- Parse statements ---------------------------------------------------- */
2620 
2621 /* Parse a statement. Returns 1 if it must be the last one in a chunk. */
2622 static int parse_stmt(LexState *ls)
2623 {
2624  BCLine line = ls->linenumber;
2625  switch (ls->tok) {
2626  case TK_if:
2627  parse_if(ls, line);
2628  break;
2629  case TK_while:
2630  parse_while(ls, line);
2631  break;
2632  case TK_do:
2633  lj_lex_next(ls);
2634  parse_block(ls);
2635  lex_match(ls, TK_end, TK_do, line);
2636  break;
2637  case TK_for:
2638  parse_for(ls, line);
2639  break;
2640  case TK_repeat:
2641  parse_repeat(ls, line);
2642  break;
2643  case TK_function:
2644  parse_func(ls, line);
2645  break;
2646  case TK_local:
2647  lj_lex_next(ls);
2648  parse_local(ls);
2649  break;
2650  case TK_return:
2651  parse_return(ls);
2652  return 1; /* Must be last. */
2653  case TK_break:
2654  lj_lex_next(ls);
2655  parse_break(ls);
2656  return !LJ_52; /* Must be last in Lua 5.1. */
2657 #if LJ_52
2658  case ';':
2659  lj_lex_next(ls);
2660  break;
2661 #endif
2662  case TK_label:
2663  parse_label(ls);
2664  break;
2665  case TK_goto:
2666  if (LJ_52 || lj_lex_lookahead(ls) == TK_name) {
2667  lj_lex_next(ls);
2668  parse_goto(ls);
2669  break;
2670  } /* else: fallthrough */
2671  default:
2672  parse_call_assign(ls);
2673  break;
2674  }
2675  return 0;
2676 }
2677 
2678 /* A chunk is a list of statements optionally separated by semicolons. */
2679 static void parse_chunk(LexState *ls)
2680 {
2681  int islast = 0;
2682  synlevel_begin(ls);
2683  while (!islast && !parse_isend(ls->tok)) {
2684  islast = parse_stmt(ls);
2685  lex_opt(ls, ';');
2686  lua_assert(ls->fs->framesize >= ls->fs->freereg &&
2687  ls->fs->freereg >= ls->fs->nactvar);
2688  ls->fs->freereg = ls->fs->nactvar; /* Free registers after each stmt. */
2689  }
2690  synlevel_end(ls);
2691 }
2692 
2693 /* Entry point of bytecode parser. */
2695 {
2696  FuncState fs;
2697  FuncScope bl;
2698  GCproto *pt;
2699  lua_State *L = ls->L;
2700 #ifdef LUAJIT_DISABLE_DEBUGINFO
2701  ls->chunkname = lj_str_newlit(L, "=");
2702 #else
2703  ls->chunkname = lj_str_newz(L, ls->chunkarg);
2704 #endif
2705  setstrV(L, L->top, ls->chunkname); /* Anchor chunkname string. */
2706  incr_top(L);
2707  ls->level = 0;
2708  fs_init(ls, &fs);
2709  fs.linedefined = 0;
2710  fs.numparams = 0;
2711  fs.bcbase = NULL;
2712  fs.bclim = 0;
2713  fs.flags |= PROTO_VARARG; /* Main chunk is always a vararg func. */
2714  fscope_begin(&fs, &bl, 0);
2715  bcemit_AD(&fs, BC_FUNCV, 0, 0); /* Placeholder. */
2716  lj_lex_next(ls); /* Read-ahead first token. */
2717  parse_chunk(ls);
2718  if (ls->tok != TK_eof)
2719  err_token(ls, TK_eof);
2720  pt = fs_finish(ls, ls->linenumber);
2721  L->top--; /* Drop chunkname. */
2722  lua_assert(fs.prev == NULL);
2723  lua_assert(ls->fs == NULL);
2724  lua_assert(pt->sizeuv == 0);
2725  return pt;
2726 }
2727 
return _Result< 0 ? -1 :_Result;} #line 1069 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _vsnwprintf_s_l(wchar_t *const _Buffer, size_t const _BufferCount, size_t const _MaxCount, wchar_t const *const _Format, _locale_t const _Locale, va_list _ArgList) { int const _Result=__stdio_common_vsnwprintf_s((*__local_stdio_printf_options()), _Buffer, _BufferCount, _MaxCount, _Format, _Locale, _ArgList);return _Result< 0 ? -1 :_Result;} #line 1091 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _vsnwprintf_s(wchar_t *const _Buffer, size_t const _BufferCount, size_t const _MaxCount, wchar_t const *const _Format, va_list _ArgList) { return _vsnwprintf_s_l(_Buffer, _BufferCount, _MaxCount, _Format,((void *) 0), _ArgList);} #line 1108 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __declspec(deprecated("This function or variable may be unsafe. Consider using " "_snwprintf_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) __inline int __cdecl _snwprintf(wchar_t *_Buffer, size_t _BufferCount, wchar_t const *_Format,...);__declspec(deprecated("This function or variable may be unsafe. Consider using " "_vsnwprintf_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) __inline int __cdecl _vsnwprintf(wchar_t *_Buffer, size_t _BufferCount, wchar_t const *_Format, va_list _Args);__declspec(deprecated("This function or variable may be unsafe. Consider using " "_vsnwprintf_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) __inline int __cdecl _vsnwprintf(wchar_t *_Buffer, size_t _BufferCount, wchar_t const *_Format, va_list _ArgList) { return _vsnwprintf_l(_Buffer, _BufferCount, _Format,((void *) 0), _ArgList);} #line 1133 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _vswprintf_c_l(wchar_t *const _Buffer, size_t const _BufferCount, wchar_t const *const _Format, _locale_t const _Locale, va_list _ArgList) { int const _Result=__stdio_common_vswprintf((*__local_stdio_printf_options()), _Buffer, _BufferCount, _Format, _Locale, _ArgList);return _Result< 0 ? -1 :_Result;} #line 1163 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _vswprintf_c(wchar_t *const _Buffer, size_t const _BufferCount, wchar_t const *const _Format, va_list _ArgList) { return _vswprintf_c_l(_Buffer, _BufferCount, _Format,((void *) 0), _ArgList);} #line 1179 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _vswprintf_l(wchar_t *const _Buffer, size_t const _BufferCount, wchar_t const *const _Format, _locale_t const _Locale, va_list _ArgList) { return _vswprintf_c_l(_Buffer, _BufferCount, _Format, _Locale, _ArgList);} #line 1196 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl __vswprintf_l(wchar_t *const _Buffer, wchar_t const *const _Format, _locale_t const _Locale, va_list _ArgList) { return _vswprintf_l(_Buffer,(size_t) -1, _Format, _Locale, _ArgList);} #line 1212 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _vswprintf(wchar_t *const _Buffer, wchar_t const *const _Format, va_list _ArgList) { return _vswprintf_l(_Buffer,(size_t) -1, _Format,((void *) 0), _ArgList);} #line 1227 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl vswprintf(wchar_t *const _Buffer, size_t const _BufferCount, wchar_t const *const _Format, va_list _ArgList) { return _vswprintf_c_l(_Buffer, _BufferCount, _Format,((void *) 0), _ArgList);} #line 1243 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _vswprintf_s_l(wchar_t *const _Buffer, size_t const _BufferCount, wchar_t const *const _Format, _locale_t const _Locale, va_list _ArgList) { int const _Result=__stdio_common_vswprintf_s((*__local_stdio_printf_options()), _Buffer, _BufferCount, _Format, _Locale, _ArgList);return _Result< 0 ? -1 :_Result;} #line 1264 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl vswprintf_s(wchar_t *const _Buffer, size_t const _BufferCount, wchar_t const *const _Format, va_list _ArgList) { return _vswprintf_s_l(_Buffer, _BufferCount, _Format,((void *) 0), _ArgList);} #line 1281 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" #line 1283 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _vswprintf_p_l(wchar_t *const _Buffer, size_t const _BufferCount, wchar_t const *const _Format, _locale_t const _Locale, va_list _ArgList) { int const _Result=__stdio_common_vswprintf_p((*__local_stdio_printf_options()), _Buffer, _BufferCount, _Format, _Locale, _ArgList);return _Result< 0 ? -1 :_Result;} #line 1312 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _vswprintf_p(wchar_t *const _Buffer, size_t const _BufferCount, wchar_t const *const _Format, va_list _ArgList) { return _vswprintf_p_l(_Buffer, _BufferCount, _Format,((void *) 0), _ArgList);} #line 1328 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _vscwprintf_l(wchar_t const *const _Format, _locale_t const _Locale, va_list _ArgList) { int const _Result=__stdio_common_vswprintf((*__local_stdio_printf_options())|(1ULL<< 1),((void *) 0), 0, _Format, _Locale, _ArgList);return _Result< 0 ? -1 :_Result;} #line 1347 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _vscwprintf(wchar_t const *const _Format, va_list _ArgList) { return _vscwprintf_l(_Format,((void *) 0), _ArgList);} #line 1361 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _vscwprintf_p_l(wchar_t const *const _Format, _locale_t const _Locale, va_list _ArgList) { int const _Result=__stdio_common_vswprintf_p((*__local_stdio_printf_options())|(1ULL<< 1),((void *) 0), 0, _Format, _Locale, _ArgList);return _Result< 0 ? -1 :_Result;} #line 1380 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _vscwprintf_p(wchar_t const *const _Format, va_list _ArgList) { return _vscwprintf_p_l(_Format,((void *) 0), _ArgList);} #line 1394 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl __swprintf_l(wchar_t *const _Buffer, wchar_t const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=__vswprintf_l(_Buffer, _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1414 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _swprintf_l(wchar_t *const _Buffer, size_t const _BufferCount, wchar_t const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vswprintf_c_l(_Buffer, _BufferCount, _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1435 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _swprintf(wchar_t *const _Buffer, wchar_t const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=__vswprintf_l(_Buffer, _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1454 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl swprintf(wchar_t *const _Buffer, size_t const _BufferCount, wchar_t const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vswprintf_c_l(_Buffer, _BufferCount, _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1474 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __declspec(deprecated("This function or variable may be unsafe. Consider using " "__swprintf_l_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) __inline int __cdecl __swprintf_l(wchar_t *_Buffer, wchar_t const *_Format, _locale_t _Locale,...);__declspec(deprecated("This function or variable may be unsafe. Consider using " "_vswprintf_s_l" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) __inline int __cdecl __vswprintf_l(wchar_t *_Buffer, wchar_t const *_Format, _locale_t _Locale, va_list _Args);__declspec(deprecated("This function or variable may be unsafe. Consider using " "swprintf_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) __inline int __cdecl _swprintf(wchar_t *_Buffer, wchar_t const *_Format,...);__declspec(deprecated("This function or variable may be unsafe. Consider using " "vswprintf_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) __inline int __cdecl _vswprintf(wchar_t *_Buffer, wchar_t const *_Format, va_list _Args);__inline int __cdecl _swprintf_s_l(wchar_t *const _Buffer, size_t const _BufferCount, wchar_t const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vswprintf_s_l(_Buffer, _BufferCount, _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1511 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl swprintf_s(wchar_t *const _Buffer, size_t const _BufferCount, wchar_t const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vswprintf_s_l(_Buffer, _BufferCount, _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1532 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" #line 1534 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _swprintf_p_l(wchar_t *const _Buffer, size_t const _BufferCount, wchar_t const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vswprintf_p_l(_Buffer, _BufferCount, _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1562 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _swprintf_p(wchar_t *const _Buffer, size_t const _BufferCount, wchar_t const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vswprintf_p_l(_Buffer, _BufferCount, _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1582 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _swprintf_c_l(wchar_t *const _Buffer, size_t const _BufferCount, wchar_t const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vswprintf_c_l(_Buffer, _BufferCount, _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1603 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _swprintf_c(wchar_t *const _Buffer, size_t const _BufferCount, wchar_t const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vswprintf_c_l(_Buffer, _BufferCount, _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1623 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __declspec(deprecated("This function or variable may be unsafe. Consider using " "_snwprintf_s_l" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) __inline int __cdecl _snwprintf_l(wchar_t *const _Buffer, size_t const _BufferCount, wchar_t const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vsnwprintf_l(_Buffer, _BufferCount, _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1646 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _snwprintf(wchar_t *_Buffer, size_t _BufferCount, wchar_t const *_Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vsnwprintf_l(_Buffer, _BufferCount, _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1668 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _snwprintf_s_l(wchar_t *const _Buffer, size_t const _BufferCount, size_t const _MaxCount, wchar_t const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vsnwprintf_s_l(_Buffer, _BufferCount, _MaxCount, _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1690 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _snwprintf_s(wchar_t *const _Buffer, size_t const _BufferCount, size_t const _MaxCount, wchar_t const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vsnwprintf_s_l(_Buffer, _BufferCount, _MaxCount, _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1711 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _scwprintf_l(wchar_t const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vscwprintf_l(_Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1737 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _scwprintf(wchar_t const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vscwprintf_l(_Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1755 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _scwprintf_p_l(wchar_t const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vscwprintf_p_l(_Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1774 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _scwprintf_p(wchar_t const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vscwprintf_p_l(_Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1792 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" #pragma warning(push) #pragma warning(disable:4141 6054) #pragma warning(pop) #line 1856 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" int __cdecl __stdio_common_vswscanf(unsigned __int64 _Options, wchar_t const *_Buffer, size_t _BufferCount, wchar_t const *_Format, _locale_t _Locale, va_list _ArgList);__inline int __cdecl _vswscanf_l(wchar_t const *const _Buffer, wchar_t const *const _Format, _locale_t const _Locale, va_list _ArgList) { return __stdio_common_vswscanf((*__local_stdio_scanf_options()), _Buffer,(size_t) -1, _Format, _Locale, _ArgList);} #line 1897 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl vswscanf(wchar_t const *_Buffer, wchar_t const *_Format, va_list _ArgList) { return _vswscanf_l(_Buffer, _Format,((void *) 0), _ArgList);} #line 1912 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _vswscanf_s_l(wchar_t const *const _Buffer, wchar_t const *const _Format, _locale_t const _Locale, va_list _ArgList) { return __stdio_common_vswscanf((*__local_stdio_scanf_options())|(1ULL<< 0), _Buffer,(size_t) -1, _Format, _Locale, _ArgList);} #line 1930 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl vswscanf_s(wchar_t const *const _Buffer, wchar_t const *const _Format, va_list _ArgList) { return _vswscanf_s_l(_Buffer, _Format,((void *) 0), _ArgList);} #line 1947 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" #line 1949 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __declspec(deprecated("This function or variable may be unsafe. Consider using " "_vsnwscanf_s_l" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) __inline int __cdecl _vsnwscanf_l(wchar_t const *const _Buffer, size_t const _BufferCount, wchar_t const *const _Format, _locale_t const _Locale, va_list _ArgList) { return __stdio_common_vswscanf((*__local_stdio_scanf_options()), _Buffer, _BufferCount, _Format, _Locale, _ArgList);} #line 1976 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _vsnwscanf_s_l(wchar_t const *const _Buffer, size_t const _BufferCount, wchar_t const *const _Format, _locale_t const _Locale, va_list _ArgList) { return __stdio_common_vswscanf((*__local_stdio_scanf_options())|(1ULL<< 0), _Buffer, _BufferCount, _Format, _Locale, _ArgList);} #line 1995 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __declspec(deprecated("This function or variable may be unsafe. Consider using " "_swscanf_s_l" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) __inline int __cdecl _swscanf_l(wchar_t const *const _Buffer, wchar_t const *const _Format, _locale_t _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vswscanf_l(_Buffer, _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 2015 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __declspec(deprecated("This function or variable may be unsafe. Consider using " "swscanf_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) __inline int __cdecl swscanf(wchar_t const *const _Buffer, wchar_t const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vswscanf_l(_Buffer, _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 2034 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _swscanf_s_l(wchar_t const *const _Buffer, wchar_t const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vswscanf_s_l(_Buffer, _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 2054 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl swscanf_s(wchar_t const *const _Buffer, wchar_t const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vswscanf_s_l(_Buffer, _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 2075 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" #line 2077 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __declspec(deprecated("This function or variable may be unsafe. Consider using " "_snwscanf_s_l" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) __inline int __cdecl _snwscanf_l(wchar_t const *const _Buffer, size_t const _BufferCount, wchar_t const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vsnwscanf_l(_Buffer, _BufferCount, _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 2100 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __declspec(deprecated("This function or variable may be unsafe. Consider using " "_snwscanf_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) __inline int __cdecl _snwscanf(wchar_t const *const _Buffer, size_t const _BufferCount, wchar_t const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vsnwscanf_l(_Buffer, _BufferCount, _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 2122 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _snwscanf_s_l(wchar_t const *const _Buffer, size_t const _BufferCount, wchar_t const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vsnwscanf_s_l(_Buffer, _BufferCount, _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 2143 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _snwscanf_s(wchar_t const *const _Buffer, size_t const _BufferCount, wchar_t const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vsnwscanf_s_l(_Buffer, _BufferCount, _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 2163 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __pragma(pack(pop))#pragma warning(pop) #pragma warning(push)#pragma warning(disable:4324 4514 4574 4710 4793 4820 4995 4996 28719 28726 28727) __pragma(pack(push, 8)) typedef __int64 fpos_t;errno_t __cdecl _get_stream_buffer_pointers(FILE *_Stream, char ***_Base, char ***_Pointer, int **_Count);errno_t __cdecl clearerr_s(FILE *_Stream);errno_t __cdecl fopen_s(FILE **_Stream, char const *_FileName, char const *_Mode);size_t __cdecl fread_s(void *_Buffer, size_t _BufferSize, size_t _ElementSize, size_t _ElementCount, FILE *_Stream);errno_t __cdecl freopen_s(FILE **_Stream, char const *_FileName, char const *_Mode, FILE *_OldStream);char *__cdecl gets_s(char *_Buffer, rsize_t _Size);errno_t __cdecl tmpfile_s(FILE **_Stream);errno_t __cdecl tmpnam_s(char *_Buffer, rsize_t _Size);#line 145 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" void __cdecl clearerr(FILE *_Stream);int __cdecl fclose(FILE *_Stream);int __cdecl _fcloseall(void);FILE *__cdecl _fdopen(int _FileHandle, char const *_Mode);int __cdecl feof(FILE *_Stream);int __cdecl ferror(FILE *_Stream);int __cdecl fflush(FILE *_Stream);int __cdecl fgetc(FILE *_Stream);int __cdecl _fgetchar(void);int __cdecl fgetpos(FILE *_Stream, fpos_t *_Position);char *__cdecl fgets(char *_Buffer, int _MaxCount, FILE *_Stream);int __cdecl _fileno(FILE *_Stream);int __cdecl _flushall(void);__declspec(deprecated("This function or variable may be unsafe. Consider using " "fopen_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) FILE *__cdecl fopen(char const *_FileName, char const *_Mode);int __cdecl fputc(int _Character, FILE *_Stream);int __cdecl _fputchar(int _Character);int __cdecl fputs(char const *_Buffer, FILE *_Stream);size_t __cdecl fread(void *_Buffer, size_t _ElementSize, size_t _ElementCount, FILE *_Stream);__declspec(deprecated("This function or variable may be unsafe. Consider using " "freopen_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) FILE *__cdecl freopen(char const *_FileName, char const *_Mode, FILE *_Stream);FILE *__cdecl _fsopen(char const *_FileName, char const *_Mode, int _ShFlag);int __cdecl fsetpos(FILE *_Stream, fpos_t const *_Position);int __cdecl fseek(FILE *_Stream, long _Offset, int _Origin);int __cdecl _fseeki64(FILE *_Stream, __int64 _Offset, int _Origin);long __cdecl ftell(FILE *_Stream);__int64 __cdecl _ftelli64(FILE *_Stream);size_t __cdecl fwrite(void const *_Buffer, size_t _ElementSize, size_t _ElementCount, FILE *_Stream);int __cdecl getc(FILE *_Stream);int __cdecl getchar(void);int __cdecl _getmaxstdio(void);int __cdecl _getw(FILE *_Stream);void __cdecl perror(char const *_ErrorMessage);int __cdecl _pclose(FILE *_Stream);FILE *__cdecl _popen(char const *_Command, char const *_Mode);#line 344 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" int __cdecl putc(int _Character, FILE *_Stream);int __cdecl putchar(int _Character);int __cdecl puts(char const *_Buffer);int __cdecl _putw(int _Word, FILE *_Stream);int __cdecl remove(char const *_FileName);int __cdecl rename(char const *_OldFileName, char const *_NewFileName);int __cdecl _unlink(char const *_FileName);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_unlink" ". See online help for details.")) int __cdecl unlink(char const *_FileName);#line 391 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" void __cdecl rewind(FILE *_Stream);int __cdecl _rmtmp(void);__declspec(deprecated("This function or variable may be unsafe. Consider using " "setvbuf" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) void __cdecl setbuf(FILE *_Stream, char *_Buffer);int __cdecl _setmaxstdio(int _Maximum);int __cdecl setvbuf(FILE *_Stream, char *_Buffer, int _Mode, size_t _Size);__declspec(allocator) char *__cdecl _tempnam(char const *_DirectoryName, char const *_FilePrefix);__declspec(deprecated("This function or variable may be unsafe. Consider using " "tmpfile_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) FILE *__cdecl tmpfile(void);__declspec(deprecated("This function or variable may be unsafe. Consider using " "tmpnam_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) char *__cdecl tmpnam(char *_Buffer);int __cdecl ungetc(int _Character, FILE *_Stream);void __cdecl _lock_file(FILE *_Stream);void __cdecl _unlock_file(FILE *_Stream);int __cdecl _fclose_nolock(FILE *_Stream);int __cdecl _fflush_nolock(FILE *_Stream);int __cdecl _fgetc_nolock(FILE *_Stream);int __cdecl _fputc_nolock(int _Character, FILE *_Stream);size_t __cdecl _fread_nolock(void *_Buffer, size_t _ElementSize, size_t _ElementCount, FILE *_Stream);size_t __cdecl _fread_nolock_s(void *_Buffer, size_t _BufferSize, size_t _ElementSize, size_t _ElementCount, FILE *_Stream);int __cdecl _fseek_nolock(FILE *_Stream, long _Offset, int _Origin);int __cdecl _fseeki64_nolock(FILE *_Stream, __int64 _Offset, int _Origin);long __cdecl _ftell_nolock(FILE *_Stream);__int64 __cdecl _ftelli64_nolock(FILE *_Stream);size_t __cdecl _fwrite_nolock(void const *_Buffer, size_t _ElementSize, size_t _ElementCount, FILE *_Stream);int __cdecl _getc_nolock(FILE *_Stream);int __cdecl _putc_nolock(int _Character, FILE *_Stream);int __cdecl _ungetc_nolock(int _Character, FILE *_Stream);int *__cdecl __p__commode(void);#line 596 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" int __cdecl __stdio_common_vfprintf(unsigned __int64 _Options, FILE *_Stream, char const *_Format, _locale_t _Locale, va_list _ArgList);int __cdecl __stdio_common_vfprintf_s(unsigned __int64 _Options, FILE *_Stream, char const *_Format, _locale_t _Locale, va_list _ArgList);int __cdecl __stdio_common_vfprintf_p(unsigned __int64 _Options, FILE *_Stream, char const *_Format, _locale_t _Locale, va_list _ArgList);__inline int __cdecl _vfprintf_l(FILE *const _Stream, char const *const _Format, _locale_t const _Locale, va_list _ArgList) { return __stdio_common_vfprintf((*__local_stdio_printf_options()), _Stream, _Format, _Locale, _ArgList);} #line 648 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl vfprintf(FILE *const _Stream, char const *const _Format, va_list _ArgList) { return _vfprintf_l(_Stream, _Format,((void *) 0), _ArgList);} #line 662 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _vfprintf_s_l(FILE *const _Stream, char const *const _Format, _locale_t const _Locale, va_list _ArgList) { return __stdio_common_vfprintf_s((*__local_stdio_printf_options()), _Stream, _Format, _Locale, _ArgList);} #line 677 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl vfprintf_s(FILE *const _Stream, char const *const _Format, va_list _ArgList) { return _vfprintf_s_l(_Stream, _Format,((void *) 0), _ArgList);} #line 693 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" #line 695 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _vfprintf_p_l(FILE *const _Stream, char const *const _Format, _locale_t const _Locale, va_list _ArgList) { return __stdio_common_vfprintf_p((*__local_stdio_printf_options()), _Stream, _Format, _Locale, _ArgList);} #line 710 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _vfprintf_p(FILE *const _Stream, char const *const _Format, va_list _ArgList) { return _vfprintf_p_l(_Stream, _Format,((void *) 0), _ArgList);} #line 724 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _vprintf_l(char const *const _Format, _locale_t const _Locale, va_list _ArgList) { return _vfprintf_l((__acrt_iob_func(1)), _Format, _Locale, _ArgList);} #line 738 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl vprintf(char const *const _Format, va_list _ArgList) { return _vfprintf_l((__acrt_iob_func(1)), _Format,((void *) 0), _ArgList);} #line 751 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _vprintf_s_l(char const *const _Format, _locale_t const _Locale, va_list _ArgList) { return _vfprintf_s_l((__acrt_iob_func(1)), _Format, _Locale, _ArgList);} #line 765 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl vprintf_s(char const *const _Format, va_list _ArgList) { return _vfprintf_s_l((__acrt_iob_func(1)), _Format,((void *) 0), _ArgList);} #line 780 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" #line 782 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _vprintf_p_l(char const *const _Format, _locale_t const _Locale, va_list _ArgList) { return _vfprintf_p_l((__acrt_iob_func(1)), _Format, _Locale, _ArgList);} #line 796 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _vprintf_p(char const *const _Format, va_list _ArgList) { return _vfprintf_p_l((__acrt_iob_func(1)), _Format,((void *) 0), _ArgList);} #line 809 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _fprintf_l(FILE *const _Stream, char const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vfprintf_l(_Stream, _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 828 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl fprintf(FILE *const _Stream, char const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vfprintf_l(_Stream, _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 846 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" int __cdecl _set_printf_count_output(int _Value);int __cdecl _get_printf_count_output(void);__inline int __cdecl _fprintf_s_l(FILE *const _Stream, char const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vfprintf_s_l(_Stream, _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 871 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl fprintf_s(FILE *const _Stream, char const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vfprintf_s_l(_Stream, _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 891 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" #line 893 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _fprintf_p_l(FILE *const _Stream, char const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vfprintf_p_l(_Stream, _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 912 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _fprintf_p(FILE *const _Stream, char const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vfprintf_p_l(_Stream, _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 930 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _printf_l(char const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vfprintf_l((__acrt_iob_func(1)), _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 948 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl printf(char const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vfprintf_l((__acrt_iob_func(1)), _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 965 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _printf_s_l(char const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vfprintf_s_l((__acrt_iob_func(1)), _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 983 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl printf_s(char const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vfprintf_s_l((__acrt_iob_func(1)), _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1002 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" #line 1004 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _printf_p_l(char const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vfprintf_p_l((__acrt_iob_func(1)), _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1022 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _printf_p(char const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vfprintf_p_l((__acrt_iob_func(1)), _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1039 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" int __cdecl __stdio_common_vfscanf(unsigned __int64 _Options, FILE *_Stream, char const *_Format, _locale_t _Locale, va_list _Arglist);__inline int __cdecl _vfscanf_l(FILE *const _Stream, char const *const _Format, _locale_t const _Locale, va_list _ArgList) { return __stdio_common_vfscanf((*__local_stdio_scanf_options()), _Stream, _Format, _Locale, _ArgList);} #line 1070 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl vfscanf(FILE *const _Stream, char const *const _Format, va_list _ArgList) { return _vfscanf_l(_Stream, _Format,((void *) 0), _ArgList);} #line 1084 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _vfscanf_s_l(FILE *const _Stream, char const *const _Format, _locale_t const _Locale, va_list _ArgList) { return __stdio_common_vfscanf((*__local_stdio_scanf_options())|(1ULL<< 0), _Stream, _Format, _Locale, _ArgList);} #line 1101 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl vfscanf_s(FILE *const _Stream, char const *const _Format, va_list _ArgList) { return _vfscanf_s_l(_Stream, _Format,((void *) 0), _ArgList);} #line 1118 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" #line 1120 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _vscanf_l(char const *const _Format, _locale_t const _Locale, va_list _ArgList) { return _vfscanf_l((__acrt_iob_func(0)), _Format, _Locale, _ArgList);} #line 1134 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl vscanf(char const *const _Format, va_list _ArgList) { return _vfscanf_l((__acrt_iob_func(0)), _Format,((void *) 0), _ArgList);} #line 1147 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _vscanf_s_l(char const *const _Format, _locale_t const _Locale, va_list _ArgList) { return _vfscanf_s_l((__acrt_iob_func(0)), _Format, _Locale, _ArgList);} #line 1161 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl vscanf_s(char const *const _Format, va_list _ArgList) { return _vfscanf_s_l((__acrt_iob_func(0)), _Format,((void *) 0), _ArgList);} #line 1176 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" #line 1178 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __declspec(deprecated("This function or variable may be unsafe. Consider using " "_fscanf_s_l" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) __inline int __cdecl _fscanf_l(FILE *const _Stream, char const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vfscanf_l(_Stream, _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1197 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __declspec(deprecated("This function or variable may be unsafe. Consider using " "fscanf_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) __inline int __cdecl fscanf(FILE *const _Stream, char const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vfscanf_l(_Stream, _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1215 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _fscanf_s_l(FILE *const _Stream, char const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vfscanf_s_l(_Stream, _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1234 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl fscanf_s(FILE *const _Stream, char const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vfscanf_s_l(_Stream, _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1254 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" #line 1256 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __declspec(deprecated("This function or variable may be unsafe. Consider using " "_scanf_s_l" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) __inline int __cdecl _scanf_l(char const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vfscanf_l((__acrt_iob_func(0)), _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1274 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __declspec(deprecated("This function or variable may be unsafe. Consider using " "scanf_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) __inline int __cdecl scanf(char const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vfscanf_l((__acrt_iob_func(0)), _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1291 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _scanf_s_l(char const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vfscanf_s_l((__acrt_iob_func(0)), _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1309 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl scanf_s(char const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vfscanf_s_l((__acrt_iob_func(0)), _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1328 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" #line 1330 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" int __cdecl __stdio_common_vsprintf(unsigned __int64 _Options, char *_Buffer, size_t _BufferCount, char const *_Format, _locale_t _Locale, va_list _ArgList);int __cdecl __stdio_common_vsprintf_s(unsigned __int64 _Options, char *_Buffer, size_t _BufferCount, char const *_Format, _locale_t _Locale, va_list _ArgList);int __cdecl __stdio_common_vsnprintf_s(unsigned __int64 _Options, char *_Buffer, size_t _BufferCount, size_t _MaxCount, char const *_Format, _locale_t _Locale, va_list _ArgList);int __cdecl __stdio_common_vsprintf_p(unsigned __int64 _Options, char *_Buffer, size_t _BufferCount, char const *_Format, _locale_t _Locale, va_list _ArgList);__declspec(deprecated("This function or variable may be unsafe. Consider using " "_vsnprintf_s_l" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) __inline int __cdecl _vsnprintf_l(char *const _Buffer, size_t const _BufferCount, char const *const _Format, _locale_t const _Locale, va_list _ArgList) { int const _Result=__stdio_common_vsprintf((*__local_stdio_printf_options())|(1ULL<< 0), _Buffer, _BufferCount, _Format, _Locale, _ArgList);return _Result< 0 ? -1 :_Result;} #line 1399 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _vsnprintf(char *const _Buffer, size_t const _BufferCount, char const *const _Format, va_list _ArgList) { return _vsnprintf_l(_Buffer, _BufferCount, _Format,((void *) 0), _ArgList);} #line 1415 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl vsnprintf(char *const _Buffer, size_t const _BufferCount, char const *const _Format, va_list _ArgList) { int const _Result=__stdio_common_vsprintf((*__local_stdio_printf_options())|(1ULL<< 1), _Buffer, _BufferCount, _Format,((void *) 0), _ArgList);return _Result< 0 ? -1 :_Result;} #line 1446 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __declspec(deprecated("This function or variable may be unsafe. Consider using " "_vsprintf_s_l" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) __inline int __cdecl _vsprintf_l(char *const _Buffer, char const *const _Format, _locale_t const _Locale, va_list _ArgList) { return _vsnprintf_l(_Buffer,(size_t) -1, _Format, _Locale, _ArgList);} #line 1462 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __declspec(deprecated("This function or variable may be unsafe. Consider using " "vsprintf_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) __inline int __cdecl vsprintf(char *const _Buffer, char const *const _Format, va_list _ArgList) { return _vsnprintf_l(_Buffer,(size_t) -1, _Format,((void *) 0), _ArgList);} #line 1477 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _vsprintf_s_l(char *const _Buffer, size_t const _BufferCount, char const *const _Format, _locale_t const _Locale, va_list _ArgList) { int const _Result=__stdio_common_vsprintf_s((*__local_stdio_printf_options()), _Buffer, _BufferCount, _Format, _Locale, _ArgList);return _Result< 0 ? -1 :_Result;} #line 1498 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl vsprintf_s(char *const _Buffer, size_t const _BufferCount, char const *const _Format, va_list _ArgList) { return _vsprintf_s_l(_Buffer, _BufferCount, _Format,((void *) 0), _ArgList);} #line 1516 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" #line 1526 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _vsprintf_p_l(char *const _Buffer, size_t const _BufferCount, char const *const _Format, _locale_t const _Locale, va_list _ArgList) { int const _Result=__stdio_common_vsprintf_p((*__local_stdio_printf_options()), _Buffer, _BufferCount, _Format, _Locale, _ArgList);return _Result< 0 ? -1 :_Result;} #line 1547 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _vsprintf_p(char *const _Buffer, size_t const _BufferCount, char const *const _Format, va_list _ArgList) { return _vsprintf_p_l(_Buffer, _BufferCount, _Format,((void *) 0), _ArgList);} #line 1563 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _vsnprintf_s_l(char *const _Buffer, size_t const _BufferCount, size_t const _MaxCount, char const *const _Format, _locale_t const _Locale, va_list _ArgList) { int const _Result=__stdio_common_vsnprintf_s((*__local_stdio_printf_options()), _Buffer, _BufferCount, _MaxCount, _Format, _Locale, _ArgList);return _Result< 0 ? -1 :_Result;} #line 1585 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _vsnprintf_s(char *const _Buffer, size_t const _BufferCount, size_t const _MaxCount, char const *const _Format, va_list _ArgList) { return _vsnprintf_s_l(_Buffer, _BufferCount, _MaxCount, _Format,((void *) 0), _ArgList);} #line 1602 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl vsnprintf_s(char *const _Buffer, size_t const _BufferCount, size_t const _MaxCount, char const *const _Format, va_list _ArgList) { return _vsnprintf_s_l(_Buffer, _BufferCount, _MaxCount, _Format,((void *) 0), _ArgList);} #line 1630 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" #line 1641 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _vscprintf_l(char const *const _Format, _locale_t const _Locale, va_list _ArgList) { int const _Result=__stdio_common_vsprintf((*__local_stdio_printf_options())|(1ULL<< 1),((void *) 0), 0, _Format, _Locale, _ArgList);return _Result< 0 ? -1 :_Result;} #line 1659 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _vscprintf(char const *const _Format, va_list _ArgList) { return _vscprintf_l(_Format,((void *) 0), _ArgList);} #line 1672 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _vscprintf_p_l(char const *const _Format, _locale_t const _Locale, va_list _ArgList) { int const _Result=__stdio_common_vsprintf_p((*__local_stdio_printf_options())|(1ULL<< 1),((void *) 0), 0, _Format, _Locale, _ArgList);return _Result< 0 ? -1 :_Result;} #line 1690 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _vscprintf_p(char const *const _Format, va_list _ArgList) { return _vscprintf_p_l(_Format,((void *) 0), _ArgList);} #line 1703 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _vsnprintf_c_l(char *const _Buffer, size_t const _BufferCount, char const *const _Format, _locale_t const _Locale, va_list _ArgList) { int const _Result=__stdio_common_vsprintf((*__local_stdio_printf_options()), _Buffer, _BufferCount, _Format, _Locale, _ArgList);return _Result< 0 ? -1 :_Result;} #line 1723 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _vsnprintf_c(char *const _Buffer, size_t const _BufferCount, char const *const _Format, va_list _ArgList) { return _vsnprintf_c_l(_Buffer, _BufferCount, _Format,((void *) 0), _ArgList);} #line 1739 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __declspec(deprecated("This function or variable may be unsafe. Consider using " "_sprintf_s_l" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) __inline int __cdecl _sprintf_l(char *const _Buffer, char const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vsprintf_l(_Buffer, _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1761 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl sprintf(char *const _Buffer, char const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vsprintf_l(_Buffer, _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1782 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __declspec(deprecated("This function or variable may be unsafe. Consider using " "sprintf_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) int __cdecl sprintf(char *_Buffer, char const *_Format,...);__declspec(deprecated("This function or variable may be unsafe. Consider using " "vsprintf_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) int __cdecl vsprintf(char *_Buffer, char const *_Format, va_list _Args);__inline int __cdecl _sprintf_s_l(char *const _Buffer, size_t const _BufferCount, char const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vsprintf_s_l(_Buffer, _BufferCount, _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1810 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl sprintf_s(char *const _Buffer, size_t const _BufferCount, char const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vsprintf_s_l(_Buffer, _BufferCount, _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1832 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" #line 1834 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _sprintf_p_l(char *const _Buffer, size_t const _BufferCount, char const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vsprintf_p_l(_Buffer, _BufferCount, _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1862 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _sprintf_p(char *const _Buffer, size_t const _BufferCount, char const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vsprintf_p_l(_Buffer, _BufferCount, _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1882 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __declspec(deprecated("This function or variable may be unsafe. Consider using " "_snprintf_s_l" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) __inline int __cdecl _snprintf_l(char *const _Buffer, size_t const _BufferCount, char const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vsnprintf_l(_Buffer, _BufferCount, _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1905 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl snprintf(char *const _Buffer, size_t const _BufferCount, char const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=vsnprintf(_Buffer, _BufferCount, _Format, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1936 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _snprintf(char *const _Buffer, size_t const _BufferCount, char const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vsnprintf(_Buffer, _BufferCount, _Format, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1956 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __declspec(deprecated("This function or variable may be unsafe. Consider using " "_snprintf_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) int __cdecl _snprintf(char *_Buffer, size_t _BufferCount, char const *_Format,...);__declspec(deprecated("This function or variable may be unsafe. Consider using " "_vsnprintf_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) int __cdecl _vsnprintf(char *_Buffer, size_t _BufferCount, char const *_Format, va_list _Args);__inline int __cdecl _snprintf_c_l(char *const _Buffer, size_t const _BufferCount, char const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vsnprintf_c_l(_Buffer, _BufferCount, _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1986 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _snprintf_c(char *const _Buffer, size_t const _BufferCount, char const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vsnprintf_c_l(_Buffer, _BufferCount, _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 2006 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _snprintf_s_l(char *const _Buffer, size_t const _BufferCount, size_t const _MaxCount, char const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vsnprintf_s_l(_Buffer, _BufferCount, _MaxCount, _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 2028 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _snprintf_s(char *const _Buffer, size_t const _BufferCount, size_t const _MaxCount, char const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vsnprintf_s_l(_Buffer, _BufferCount, _MaxCount, _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 2049 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _scprintf_l(char const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vscprintf_l(_Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 2075 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _scprintf(char const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vscprintf_l(_Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 2092 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _scprintf_p_l(char const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vscprintf_p_l(_Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 2110 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _scprintf_p(char const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vscprintf_p(_Format, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 2127 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" int __cdecl __stdio_common_vsscanf(unsigned __int64 _Options, char const *_Buffer, size_t _BufferCount, char const *_Format, _locale_t _Locale, va_list _ArgList);__inline int __cdecl _vsscanf_l(char const *const _Buffer, char const *const _Format, _locale_t const _Locale, va_list _ArgList) { return __stdio_common_vsscanf((*__local_stdio_scanf_options()), _Buffer,(size_t) -1, _Format, _Locale, _ArgList);} #line 2158 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl vsscanf(char const *const _Buffer, char const *const _Format, va_list _ArgList) { return _vsscanf_l(_Buffer, _Format,((void *) 0), _ArgList);} #line 2172 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _vsscanf_s_l(char const *const _Buffer, char const *const _Format, _locale_t const _Locale, va_list _ArgList) { return __stdio_common_vsscanf((*__local_stdio_scanf_options())|(1ULL<< 0), _Buffer,(size_t) -1, _Format, _Locale, _ArgList);} #line 2189 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" #pragma warning(push) #pragma warning(disable:6530) __inline int __cdecl vsscanf_s(char const *const _Buffer, char const *const _Format, va_list _ArgList) { return _vsscanf_s_l(_Buffer, _Format,((void *) 0), _ArgList);} #line 2208 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" #pragma warning(pop) #line 2219 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __declspec(deprecated("This function or variable may be unsafe. Consider using " "_sscanf_s_l" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) __inline int __cdecl _sscanf_l(char const *const _Buffer, char const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vsscanf_l(_Buffer, _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 2238 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __declspec(deprecated("This function or variable may be unsafe. Consider using " "sscanf_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) __inline int __cdecl sscanf(char const *const _Buffer, char const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vsscanf_l(_Buffer, _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 2256 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _sscanf_s_l(char const *const _Buffer, char const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vsscanf_s_l(_Buffer, _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 2275 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl sscanf_s(char const *const _Buffer, char const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=vsscanf_s(_Buffer, _Format, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 2297 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" #line 2299 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" #pragma warning(push) #pragma warning(disable:6530) __declspec(deprecated("This function or variable may be unsafe. Consider using " "_snscanf_s_l" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) __inline int __cdecl _snscanf_l(char const *const _Buffer, size_t const _BufferCount, char const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=__stdio_common_vsscanf((*__local_stdio_scanf_options()), _Buffer, _BufferCount, _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 2326 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __declspec(deprecated("This function or variable may be unsafe. Consider using " "_snscanf_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) __inline int __cdecl _snscanf(char const *const _Buffer, size_t const _BufferCount, char const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=__stdio_common_vsscanf((*__local_stdio_scanf_options()), _Buffer, _BufferCount, _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 2349 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _snscanf_s_l(char const *const _Buffer, size_t const _BufferCount, char const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=__stdio_common_vsscanf((*__local_stdio_scanf_options())|(1ULL<< 0), _Buffer, _BufferCount, _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 2374 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _snscanf_s(char const *const _Buffer, size_t const _BufferCount, char const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=__stdio_common_vsscanf((*__local_stdio_scanf_options())|(1ULL<< 0), _Buffer, _BufferCount, _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 2397 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" #pragma warning(pop) __declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_tempnam" ". See online help for details.")) char *__cdecl tempnam(char const *_Directory, char const *_FilePrefix);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_fcloseall" ". See online help for details.")) int __cdecl fcloseall(void);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_fdopen" ". See online help for details.")) FILE *__cdecl fdopen(int _FileHandle, char const *_Format);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_fgetchar" ". See online help for details.")) int __cdecl fgetchar(void);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_fileno" ". See online help for details.")) int __cdecl fileno(FILE *_Stream);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_flushall" ". See online help for details.")) int __cdecl flushall(void);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_fputchar" ". See online help for details.")) int __cdecl fputchar(int _Ch);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_getw" ". See online help for details.")) int __cdecl getw(FILE *_Stream);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_putw" ". See online help for details.")) int __cdecl putw(int _Ch, FILE *_Stream);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_rmtmp" ". See online help for details.")) int __cdecl rmtmp(void);#line 2441 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h"__pragma(pack(pop))#pragma warning(pop) #pragma once#pragma once#pragma once#pragma once#pragma warning(push)#pragma warning(disable:4324 4514 4574 4710 4793 4820 4995 4996 28719 28726 28727) __pragma(pack(push, 8)) int *__cdecl _errno(void);errno_t __cdecl _set_errno(int _Value);errno_t __cdecl _get_errno(int *_Value);unsigned long *__cdecl __doserrno(void);errno_t __cdecl _set_doserrno(unsigned long _Value);errno_t __cdecl _get_doserrno(unsigned long *_Value);__pragma(pack(pop))#pragma warning(pop) #pragma once#pragma warning(push)#pragma warning(disable:4514 4820) __pragma(pack(push, 8)) void *__cdecl memchr(void const *_Buf, int _Val, size_t _MaxCount);int __cdecl memcmp(void const *_Buf1, void const *_Buf2, size_t _Size);void *__cdecl memcpy(void *_Dst, void const *_Src, size_t _Size);void *__cdecl memmove(void *_Dst, void const *_Src, size_t _Size);void *__cdecl memset(void *_Dst, int _Val, size_t _Size);char *__cdecl strchr(char const *_Str, int _Val);char *__cdecl strrchr(char const *_Str, int _Ch);char *__cdecl strstr(char const *_Str, char const *_SubStr);wchar_t *__cdecl wcschr(wchar_t const *_Str, wchar_t _Ch);wchar_t *__cdecl wcsrchr(wchar_t const *_Str, wchar_t _Ch);wchar_t *__cdecl wcsstr(wchar_t const *_Str, wchar_t const *_SubStr);__pragma(pack(pop))#pragma warning(pop) #pragma warning(push)#pragma warning(disable:4324 4514 4574 4710 4793 4820 4995 4996 28719 28726 28727) __pragma(pack(push, 8)) static __inline errno_t __cdecl memcpy_s(void *const _Destination, rsize_t const _DestinationSize, void const *const _Source, rsize_t const _SourceSize) { if(_SourceSize==0) { return 0;} { int _Expr_val=!!(_Destination !=((void *) 0));if(!(_Expr_val)) {(*_errno())=22;_invalid_parameter_noinfo();return 22;} } ;if(_Source==((void *) 0)||_DestinationSize< _SourceSize) { memset(_Destination, 0, _DestinationSize);{ int _Expr_val=!!(_Source !=((void *) 0));if(!(_Expr_val)) {(*_errno())=22;_invalid_parameter_noinfo();return 22;} } ;{ int _Expr_val=!!(_DestinationSize >=_SourceSize);if(!(_Expr_val)) {(*_errno())=34;_invalid_parameter_noinfo();return 34;} } ;return 22 ;} memcpy(_Destination, _Source, _SourceSize);return 0;} static __inline errno_t __cdecl memmove_s(void *const _Destination, rsize_t const _DestinationSize, void const *const _Source, rsize_t const _SourceSize) { if(_SourceSize==0) { return 0;} { int _Expr_val=!!(_Destination !=((void *) 0));if(!(_Expr_val)) {(*_errno())=22;_invalid_parameter_noinfo();return 22;} } ;{ int _Expr_val=!!(_Source !=((void *) 0));if(!(_Expr_val)) {(*_errno())=22;_invalid_parameter_noinfo();return 22;} } ;{ int _Expr_val=!!(_DestinationSize >=_SourceSize);if(!(_Expr_val)) {(*_errno())=34;_invalid_parameter_noinfo();return 34;} } ;memmove(_Destination, _Source, _SourceSize);return 0;}#pragma warning(pop) __pragma(pack(pop))#pragma warning(push)#pragma warning(disable:4324 4514 4574 4710 4793 4820 4995 4996 28719 28726 28727) __pragma(pack(push, 8)) int __cdecl _memicmp(void const *_Buf1, void const *_Buf2, size_t _Size);int __cdecl _memicmp_l(void const *_Buf1, void const *_Buf2, size_t _Size, _locale_t _Locale);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_memccpy" ". See online help for details.")) void *__cdecl memccpy(void *_Dst, void const *_Src, int _Val, size_t _Size);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_memicmp" ". See online help for details.")) int __cdecl memicmp(void const *_Buf1, void const *_Buf2, size_t _Size);__pragma(pack(pop))#pragma warning(pop) #pragma once#pragma warning(push)#pragma warning(disable:4324 4514 4574 4710 4793 4820 4995 4996 28719 28726 28727) __pragma(pack(push, 8)) errno_t __cdecl wcscat_s(wchar_t *_Destination, rsize_t _SizeInWords, wchar_t const *_Source);errno_t __cdecl wcscpy_s(wchar_t *_Destination, rsize_t _SizeInWords, wchar_t const *_Source);errno_t __cdecl wcsncat_s(wchar_t *_Destination, rsize_t _SizeInWords, wchar_t const *_Source, rsize_t _MaxCount);errno_t __cdecl wcsncpy_s(wchar_t *_Destination, rsize_t _SizeInWords, wchar_t const *_Source, rsize_t _MaxCount);wchar_t *__cdecl wcstok_s(wchar_t *_String, wchar_t const *_Delimiter, wchar_t **_Context);__declspec(allocator) wchar_t *__cdecl _wcsdup(wchar_t const *_String);__declspec(deprecated("This function or variable may be unsafe. Consider using " "wcscat_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) wchar_t *__cdecl wcscat(wchar_t *_Destination, wchar_t const *_Source);int __cdecl wcscmp(wchar_t const *_String1, wchar_t const *_String2);__declspec(deprecated("This function or variable may be unsafe. Consider using " "wcscpy_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) wchar_t *__cdecl wcscpy(wchar_t *_Destination, wchar_t const *_Source);size_t __cdecl wcscspn(wchar_t const *_String, wchar_t const *_Control);size_t __cdecl wcslen(wchar_t const *_String);size_t __cdecl wcsnlen(wchar_t const *_Source, size_t _MaxCount);static __inline size_t __cdecl wcsnlen_s(wchar_t const *_Source, size_t _MaxCount) { return(_Source==0) ? 0 :wcsnlen(_Source, _MaxCount);}__declspec(deprecated("This function or variable may be unsafe. Consider using " "wcsncat_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) wchar_t *__cdecl wcsncat(wchar_t *_Destination, wchar_t const *_Source, size_t _Count);int __cdecl wcsncmp(wchar_t const *_String1, wchar_t const *_String2, size_t _MaxCount);__declspec(deprecated("This function or variable may be unsafe. Consider using " "wcsncpy_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) wchar_t *__cdecl wcsncpy(wchar_t *_Destination, wchar_t const *_Source, size_t _Count);wchar_t *__cdecl wcspbrk(wchar_t const *_String, wchar_t const *_Control);size_t __cdecl wcsspn(wchar_t const *_String, wchar_t const *_Control);__declspec(deprecated("This function or variable may be unsafe. Consider using " "wcstok_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) wchar_t *__cdecl wcstok(wchar_t *_String, wchar_t const *_Delimiter, wchar_t **_Context);#line 237 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstring.h" __declspec(deprecated("This function or variable may be unsafe. Consider using " "wcstok_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) static __inline wchar_t *__cdecl _wcstok(wchar_t *const _String, wchar_t const *const _Delimiter) { return wcstok(_String, _Delimiter, 0);} __declspec(deprecated("This function or variable may be unsafe. Consider using " "_wcserror_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) wchar_t *__cdecl _wcserror(int _ErrorNumber);errno_t __cdecl _wcserror_s(wchar_t *_Buffer, size_t _SizeInWords, int _ErrorNumber);__declspec(deprecated("This function or variable may be unsafe. Consider using " "__wcserror_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) wchar_t *__cdecl __wcserror(wchar_t const *_String);errno_t __cdecl __wcserror_s(wchar_t *_Buffer, size_t _SizeInWords, wchar_t const *_ErrorMessage);int __cdecl _wcsicmp(wchar_t const *_String1, wchar_t const *_String2);int __cdecl _wcsicmp_l(wchar_t const *_String1, wchar_t const *_String2, _locale_t _Locale);int __cdecl _wcsnicmp(wchar_t const *_String1, wchar_t const *_String2, size_t _MaxCount);int __cdecl _wcsnicmp_l(wchar_t const *_String1, wchar_t const *_String2, size_t _MaxCount, _locale_t _Locale);errno_t __cdecl _wcsnset_s(wchar_t *_Destination, size_t _SizeInWords, wchar_t _Value, size_t _MaxCount);__declspec(deprecated("This function or variable may be unsafe. Consider using " "_wcsnset_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) wchar_t *__cdecl _wcsnset(wchar_t *_String, wchar_t _Value, size_t _MaxCount);wchar_t *__cdecl _wcsrev(wchar_t *_String);errno_t __cdecl _wcsset_s(wchar_t *_Destination, size_t _SizeInWords, wchar_t _Value);__declspec(deprecated("This function or variable may be unsafe. Consider using " "_wcsset_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) wchar_t *__cdecl _wcsset(wchar_t *_String, wchar_t _Value);errno_t __cdecl _wcslwr_s(wchar_t *_String, size_t _SizeInWords);__declspec(deprecated("This function or variable may be unsafe. Consider using " "_wcslwr_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) wchar_t *__cdecl _wcslwr(wchar_t *_String);errno_t __cdecl _wcslwr_s_l(wchar_t *_String, size_t _SizeInWords, _locale_t _Locale);__declspec(deprecated("This function or variable may be unsafe. Consider using " "_wcslwr_s_l" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) wchar_t *__cdecl _wcslwr_l(wchar_t *_String, _locale_t _Locale);errno_t __cdecl _wcsupr_s(wchar_t *_String, size_t _Size);__declspec(deprecated("This function or variable may be unsafe. Consider using " "_wcsupr_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) wchar_t *__cdecl _wcsupr(wchar_t *_String);errno_t __cdecl _wcsupr_s_l(wchar_t *_String, size_t _Size, _locale_t _Locale);__declspec(deprecated("This function or variable may be unsafe. Consider using " "_wcsupr_s_l" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) wchar_t *__cdecl _wcsupr_l(wchar_t *_String, _locale_t _Locale);size_t __cdecl wcsxfrm(wchar_t *_Destination, wchar_t const *_Source, size_t _MaxCount);size_t __cdecl _wcsxfrm_l(wchar_t *_Destination, wchar_t const *_Source, size_t _MaxCount, _locale_t _Locale);int __cdecl wcscoll(wchar_t const *_String1, wchar_t const *_String2);int __cdecl _wcscoll_l(wchar_t const *_String1, wchar_t const *_String2, _locale_t _Locale);int __cdecl _wcsicoll(wchar_t const *_String1, wchar_t const *_String2);int __cdecl _wcsicoll_l(wchar_t const *_String1, wchar_t const *_String2, _locale_t _Locale);int __cdecl _wcsncoll(wchar_t const *_String1, wchar_t const *_String2, size_t _MaxCount);int __cdecl _wcsncoll_l(wchar_t const *_String1, wchar_t const *_String2, size_t _MaxCount, _locale_t _Locale);int __cdecl _wcsnicoll(wchar_t const *_String1, wchar_t const *_String2, size_t _MaxCount);int __cdecl _wcsnicoll_l(wchar_t const *_String1, wchar_t const *_String2, size_t _MaxCount, _locale_t _Locale);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_wcsdup" ". See online help for details.")) wchar_t *__cdecl wcsdup(wchar_t const *_String);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_wcsicmp" ". See online help for details.")) int __cdecl wcsicmp(wchar_t const *_String1, wchar_t const *_String2);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_wcsnicmp" ". See online help for details.")) int __cdecl wcsnicmp(wchar_t const *_String1, wchar_t const *_String2, size_t _MaxCount);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_wcsnset" ". See online help for details.")) wchar_t *__cdecl wcsnset(wchar_t *_String, wchar_t _Value, size_t _MaxCount);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_wcsrev" ". See online help for details.")) wchar_t *__cdecl wcsrev(wchar_t *_String);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_wcsset" ". See online help for details.")) wchar_t *__cdecl wcsset(wchar_t *_String, wchar_t _Value);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_wcslwr" ". See online help for details.")) wchar_t *__cdecl wcslwr(wchar_t *_String);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_wcsupr" ". See online help for details.")) wchar_t *__cdecl wcsupr(wchar_t *_String);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_wcsicoll" ". See online help for details.")) int __cdecl wcsicoll(wchar_t const *_String1, wchar_t const *_String2);__pragma(pack(pop))#pragma warning(pop) #pragma warning(push)#pragma warning(disable:4324 4514 4574 4710 4793 4820 4995 4996 28719 28726 28727) __pragma(pack(push, 8)) errno_t __cdecl strcpy_s(char *_Destination, rsize_t _SizeInBytes, char const *_Source);errno_t __cdecl strcat_s(char *_Destination, rsize_t _SizeInBytes, char const *_Source);errno_t __cdecl strerror_s(char *_Buffer, size_t _SizeInBytes, int _ErrorNumber);errno_t __cdecl strncat_s(char *_Destination, rsize_t _SizeInBytes, char const *_Source, rsize_t _MaxCount);errno_t __cdecl strncpy_s(char *_Destination, rsize_t _SizeInBytes, char const *_Source, rsize_t _MaxCount);char *__cdecl strtok_s(char *_String, char const *_Delimiter, char **_Context);void *__cdecl _memccpy(void *_Dst, void const *_Src, int _Val, size_t _MaxCount);__declspec(deprecated("This function or variable may be unsafe. Consider using " "strcat_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) char *__cdecl strcat(char *_Destination, char const *_Source);int __cdecl strcmp(char const *_Str1, char const *_Str2);int __cdecl _strcmpi(char const *_String1, char const *_String2);int __cdecl strcoll(char const *_String1, char const *_String2);int __cdecl _strcoll_l(char const *_String1, char const *_String2, _locale_t _Locale);__declspec(deprecated("This function or variable may be unsafe. Consider using " "strcpy_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) char *__cdecl strcpy(char *_Destination, char const *_Source);size_t __cdecl strcspn(char const *_Str, char const *_Control);__declspec(allocator) char *__cdecl _strdup(char const *_Source);__declspec(deprecated("This function or variable may be unsafe. Consider using " "_strerror_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) char *__cdecl _strerror(char const *_ErrorMessage);errno_t __cdecl _strerror_s(char *_Buffer, size_t _SizeInBytes, char const *_ErrorMessage);__declspec(deprecated("This function or variable may be unsafe. Consider using " "strerror_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) char *__cdecl strerror(int _ErrorMessage);int __cdecl _stricmp(char const *_String1, char const *_String2);int __cdecl _stricoll(char const *_String1, char const *_String2);int __cdecl _stricoll_l(char const *_String1, char const *_String2, _locale_t _Locale);int __cdecl _stricmp_l(char const *_String1, char const *_String2, _locale_t _Locale);size_t __cdecl strlen(char const *_Str);errno_t __cdecl _strlwr_s(char *_String, size_t _Size);__declspec(deprecated("This function or variable may be unsafe. Consider using " "_strlwr_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) char *__cdecl _strlwr(char *_String);errno_t __cdecl _strlwr_s_l(char *_String, size_t _Size, _locale_t _Locale);__declspec(deprecated("This function or variable may be unsafe. Consider using " "_strlwr_s_l" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) char *__cdecl _strlwr_l(char *_String, _locale_t _Locale);__declspec(deprecated("This function or variable may be unsafe. Consider using " "strncat_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) char *__cdecl strncat(char *_Destination, char const *_Source, size_t _Count);int __cdecl strncmp(char const *_Str1, char const *_Str2, size_t _MaxCount);int __cdecl _strnicmp(char const *_String1, char const *_String2, size_t _MaxCount);int __cdecl _strnicmp_l(char const *_String1, char const *_String2, size_t _MaxCount, _locale_t _Locale);int __cdecl _strnicoll(char const *_String1, char const *_String2, size_t _MaxCount);int __cdecl _strnicoll_l(char const *_String1, char const *_String2, size_t _MaxCount, _locale_t _Locale);int __cdecl _strncoll(char const *_String1, char const *_String2, size_t _MaxCount);int __cdecl _strncoll_l(char const *_String1, char const *_String2, size_t _MaxCount, _locale_t _Locale);size_t __cdecl __strncnt(char const *_String, size_t _Count);__declspec(deprecated("This function or variable may be unsafe. Consider using " "strncpy_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) char *__cdecl strncpy(char *_Destination, char const *_Source, size_t _Count);size_t __cdecl strnlen(char const *_String, size_t _MaxCount);static __inline size_t __cdecl strnlen_s(char const *_String, size_t _MaxCount) { return _String==0 ? 0 :strnlen(_String, _MaxCount);} errno_t __cdecl _strnset_s(char *_String, size_t _SizeInBytes, int _Value, size_t _MaxCount);__declspec(deprecated("This function or variable may be unsafe. Consider using " "_strnset_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) char *__cdecl _strnset(char *_Destination, int _Value, size_t _Count);char *__cdecl strpbrk(char const *_Str, char const *_Control);char *__cdecl _strrev(char *_Str);errno_t __cdecl _strset_s(char *_Destination, size_t _DestinationSize, int _Value);__declspec(deprecated("This function or variable may be unsafe. Consider using " "_strset_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) char *__cdecl _strset(char *_Destination, int _Value);size_t __cdecl strspn(char const *_Str, char const *_Control);__declspec(deprecated("This function or variable may be unsafe. Consider using " "strtok_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) char *__cdecl strtok(char *_String, char const *_Delimiter);errno_t __cdecl _strupr_s(char *_String, size_t _Size);__declspec(deprecated("This function or variable may be unsafe. Consider using " "_strupr_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) char *__cdecl _strupr(char *_String);errno_t __cdecl _strupr_s_l(char *_String, size_t _Size, _locale_t _Locale);__declspec(deprecated("This function or variable may be unsafe. Consider using " "_strupr_s_l" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) char *__cdecl _strupr_l(char *_String, _locale_t _Locale);size_t __cdecl strxfrm(char *_Destination, char const *_Source, size_t _MaxCount);size_t __cdecl _strxfrm_l(char *_Destination, char const *_Source, size_t _MaxCount, _locale_t _Locale);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_strdup" ". See online help for details.")) char *__cdecl strdup(char const *_String);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_strcmpi" ". See online help for details.")) int __cdecl strcmpi(char const *_String1, char const *_String2);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_stricmp" ". See online help for details.")) int __cdecl stricmp(char const *_String1, char const *_String2);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_strlwr" ". See online help for details.")) char *__cdecl strlwr(char *_String);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_strnicmp" ". See online help for details.")) int __cdecl strnicmp(char const *_String1, char const *_String2, size_t _MaxCount);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_strnset" ". See online help for details.")) char *__cdecl strnset(char *_String, int _Value, size_t _MaxCount);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_strrev" ". See online help for details.")) char *__cdecl strrev(char *_String);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_strset" ". See online help for details.")) char *__cdecl strset(char *_String, int _Value);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_strupr" ". See online help for details.")) char *__cdecl strupr(char *_String);__pragma(pack(pop))#pragma warning(pop) #pragma once#pragma warning(push)#pragma warning(disable:4514 4820) __pragma(pack(push, 8)) __pragma(pack(pop))#pragma warning(pop) #pragma once#pragma warning(push)#pragma warning(disable:4324 4514 4574 4710 4793 4820 4995 4996 28719 28726 28727) typedef unsigned short _ino_t;typedef _ino_t ino_t;#line 24 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\sys/types.h" typedef unsigned int _dev_t;typedef _dev_t dev_t;#line 36 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\sys/types.h" typedef long _off_t;typedef _off_t off_t;#line 48 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\sys/types.h"#pragma warning(pop) typedef char *sds;#pragma pack(push, 1) struct sdshdr5 { unsigned char flags;char buf[];};struct sdshdr8 { uint8_t len;uint8_t alloc;unsigned char flags;char buf[];};struct sdshdr16 { uint16_t len;uint16_t alloc;unsigned char flags;char buf[];};struct sdshdr32 { uint32_t len;uint32_t alloc;unsigned char flags;char buf[];};struct sdshdr64 { uint64_t len;uint64_t alloc;unsigned char flags;char buf[];};#pragma pack(pop) static inline size_t sdslen(const sds s) { unsigned char flags=s[-1];switch(flags &7) { case 0 :return((flags) >> 3) ;case 1 :return((struct sdshdr8 *)((s) -(sizeof(struct sdshdr8)))) ->len;case 2 :return((struct sdshdr16 *)((s) -(sizeof(struct sdshdr16)))) ->len;case 3 :return((struct sdshdr32 *)((s) -(sizeof(struct sdshdr32)))) ->len;case 4 :return((struct sdshdr64 *)((s) -(sizeof(struct sdshdr64)))) ->len;} return 0;}static inline size_t sdsavail(const sds s) { unsigned char flags=s[-1];switch(flags &7) { case 0 :{ return 0;} case 1 :{ struct sdshdr8 *sh=(void *)((s) -(sizeof(struct sdshdr8)));;return sh->alloc - sh->len;} case 2 :{ struct sdshdr16 *sh=(void *)((s) -(sizeof(struct sdshdr16)));;return sh->alloc - sh->len;} case 3 :{ struct sdshdr32 *sh=(void *)((s) -(sizeof(struct sdshdr32)));;return sh->alloc - sh->len;} case 4 :{ struct sdshdr64 *sh=(void *)((s) -(sizeof(struct sdshdr64)));;return sh->alloc - sh->len;} } return 0;}static inline void sdssetlen(sds s, size_t newlen) { unsigned char flags=s[-1];switch(flags &7) { case 0 :{ unsigned char *fp=((unsigned char *) s) - 1;*fp=0|(newlen<< 3);} break;case 1 :((struct sdshdr8 *)((s) -(sizeof(struct sdshdr8)))) ->len=(uint8_t) newlen;break;case 2 :((struct sdshdr16 *)((s) -(sizeof(struct sdshdr16)))) ->len=(uint16_t) newlen;break;case 3 :((struct sdshdr32 *)((s) -(sizeof(struct sdshdr32)))) -> len
Definition: CPAL.d:15583
int ptrdiff_t
Definition: CPAL.d:3845
int level
Definition: afm2pl.c:1694
#define name
#define next(a)
Definition: aptex-macros.h:924
int rc
Definition: bmpfont.h:9
#define n
Definition: t4ht.c:1290
mrb_ast_node node
Definition: codegen.c:30
#define b
Definition: jpegint.h:372
long pc
Definition: disdvi.c:114
int v
Definition: dviconv.c:10
int strcmp()
Definition: coll.cpp:143
char * temp
Definition: dvidvi.c:137
#define info
Definition: dviinfo.c:42
#define v2
#define s
Definition: afcover.h:80
#define t
Definition: afcover.h:96
#define lh
Definition: gsftopk.c:500
#define bc
Definition: gsftopk.c:501
int base
Definition: gsftopk.c:1502
#define memcpy(d, s, n)
Definition: gsftopk.c:64
#define reg
Definition: hbf.c:83
#define NULL
Definition: ftobjs.h:61
small capitals from c petite p
Definition: afcover.h:72
small capitals from c petite p scientific i
Definition: afcover.h:80
FT_UInt idx
Definition: cffcmap.c:135
unsigned short uint16_t
Definition: stdint.h:79
signed __int64 int64_t
Definition: stdint.h:89
unsigned int uint32_t
Definition: stdint.h:80
unsigned int uintptr_t
Definition: stdint.h:119
signed int int32_t
Definition: stdint.h:77
unsigned char uint8_t
Definition: stdint.h:78
#define dest
#define loop
Definition: tie.c:8
char args[100]
Definition: fixwrites.c:7
cell * list
Definition: list_routines.h:30
#define target(code, i)
Definition: lpeg.c:1165
static luaL_Reg func[]
Definition: except.c:32
int k
Definition: otp-parser.c:70
static int delta
Definition: pbmtolj.c:36
static int sz
Definition: pdftocairo.cc:114
set set set set set set set set set set set set set set set set set set set set *set set set macro pixldst cond
#define ra
integer nn[24]
Definition: pmxab.c:90
logical islast
Definition: pmxab.c:172
static int32_t first
Definition: ppagelist.c:29
static int offset
Definition: ppmtogif.c:642
char line[1024]
Definition: process_score.c:29
#define flags
#define incr_top(L)
Definition: minilua.c:519
#define LJ_HASFFI
Definition: lj_arch.h:490
#define LJ_52
Definition: lj_arch.h:564
#define LJ_DUALNUM
Definition: lj_arch.h:454
#define LJ_FR2
Definition: lj_arch.h:476
@ FORL_EXT
Definition: lj_bc.h:234
@ FORL_STEP
Definition: lj_bc.h:234
@ FORL_IDX
Definition: lj_bc.h:234
@ FORL_STOP
Definition: lj_bc.h:234
#define bc_d(i)
Definition: lj_bc.h:38
#define setbc_b(p, x)
Definition: lj_bc.h:46
#define BCMAX_B
Definition: lj_bc.h:26
#define BCMAX_C
Definition: lj_bc.h:27
#define bc_op(i)
Definition: lj_bc.h:34
#define BCINS_ABC(o, a, b, c)
Definition: lj_bc.h:53
#define bc_b(i)
Definition: lj_bc.h:36
#define NO_JMP
Definition: lj_bc.h:31
#define bc_j(i)
Definition: lj_bc.h:39
#define setbc_a(p, x)
Definition: lj_bc.h:45
#define BCBIAS_J
Definition: lj_bc.h:29
#define bc_c(i)
Definition: lj_bc.h:37
#define setbc_op(p, x)
Definition: lj_bc.h:44
#define setbc_j(p, x)
Definition: lj_bc.h:50
#define BCINS_AD(o, a, d)
Definition: lj_bc.h:55
#define bc_a(i)
Definition: lj_bc.h:35
#define setbc_d(p, x)
Definition: lj_bc.h:48
#define BCINS_AJ(o, a, j)
Definition: lj_bc.h:57
BCOp
Definition: lj_bc.h:200
@ BC_KCDATA
Definition: lj_bc.h:202
@ BC_ADDVN
Definition: lj_bc.h:202
@ BC_RET
Definition: lj_bc.h:202
@ BC_KNIL
Definition: lj_bc.h:202
@ BC_CALLT
Definition: lj_bc.h:202
@ BC_LEN
Definition: lj_bc.h:202
@ BC_ADDNV
Definition: lj_bc.h:202
@ BC_RETM
Definition: lj_bc.h:202
@ BC_KSTR
Definition: lj_bc.h:202
@ BC_NOT
Definition: lj_bc.h:202
@ BC_CALLMT
Definition: lj_bc.h:202
@ BC_TDUP
Definition: lj_bc.h:202
@ BC_CAT
Definition: lj_bc.h:202
@ BC_MODVV
Definition: lj_bc.h:202
@ BC_ISTC
Definition: lj_bc.h:202
@ BC_SUBVV
Definition: lj_bc.h:202
@ BC_ISGT
Definition: lj_bc.h:202
@ BC_CALLM
Definition: lj_bc.h:202
@ BC_ISFC
Definition: lj_bc.h:202
@ BC_USETP
Definition: lj_bc.h:202
@ BC_DIVVV
Definition: lj_bc.h:202
@ BC_TSETS
Definition: lj_bc.h:202
@ BC_TGETV
Definition: lj_bc.h:202
@ BC_ADDVV
Definition: lj_bc.h:202
@ BC_LOOP
Definition: lj_bc.h:202
@ BC_KPRI
Definition: lj_bc.h:202
@ BC_ISNEV
Definition: lj_bc.h:202
@ BC_KNUM
Definition: lj_bc.h:202
@ BC_FORI
Definition: lj_bc.h:202
@ BC_MULVV
Definition: lj_bc.h:202
@ BC_TGETB
Definition: lj_bc.h:202
@ BC_TSETB
Definition: lj_bc.h:202
@ BC_ISNEXT
Definition: lj_bc.h:202
@ BC_IST
Definition: lj_bc.h:202
@ BC_GGET
Definition: lj_bc.h:202
@ BC_ISEQP
Definition: lj_bc.h:202
@ BC_FNEW
Definition: lj_bc.h:202
@ BC_FORL
Definition: lj_bc.h:202
@ BC_ITERC
Definition: lj_bc.h:202
@ BC_FUNCF
Definition: lj_bc.h:202
@ BC_UNM
Definition: lj_bc.h:202
@ BC_UCLO
Definition: lj_bc.h:202
@ BC_USETS
Definition: lj_bc.h:202
@ BC_ISEQV
Definition: lj_bc.h:202
@ BC_MOV
Definition: lj_bc.h:202
@ BC_TNEW
Definition: lj_bc.h:202
@ BC_USETV
Definition: lj_bc.h:202
@ BC_TSETV
Definition: lj_bc.h:202
@ BC_RET1
Definition: lj_bc.h:202
@ BC_KSHORT
Definition: lj_bc.h:202
@ BC_JMP
Definition: lj_bc.h:202
@ BC_TGETS
Definition: lj_bc.h:202
@ BC_CALL
Definition: lj_bc.h:202
@ BC_ITERN
Definition: lj_bc.h:202
@ BC_GSET
Definition: lj_bc.h:202
@ BC_TSETM
Definition: lj_bc.h:202
@ BC_FUNCV
Definition: lj_bc.h:202
@ BC_ISEQN
Definition: lj_bc.h:202
@ BC_USETN
Definition: lj_bc.h:202
@ BC_ISLT
Definition: lj_bc.h:202
@ BC_UGET
Definition: lj_bc.h:202
@ BC_ITERL
Definition: lj_bc.h:202
@ BC_ISF
Definition: lj_bc.h:202
@ BC_POW
Definition: lj_bc.h:202
@ BC_RET0
Definition: lj_bc.h:202
@ BC_ISGE
Definition: lj_bc.h:202
@ BC_VARG
Definition: lj_bc.h:202
@ BC_ISEQS
Definition: lj_bc.h:202
@ BC_ISLE
Definition: lj_bc.h:202
#define BCMAX_D
Definition: lj_bc.h:28
static LJ_AINLINE char * lj_buf_wmem(char *p, const void *q, MSize len)
Definition: lj_buf.h:73
#define sbuflen(sb)
Definition: lj_buf.h:19
static LJ_AINLINE void lj_buf_putb(SBuf *sb, int c)
Definition: lj_buf.h:78
static LJ_AINLINE char * lj_buf_more(SBuf *sb, MSize sz)
Definition: lj_buf.h:61
#define setsbufP(sb, q)
Definition: lj_buf.h:21
#define sbufB(sb)
Definition: lj_buf.h:14
static LJ_AINLINE void lj_buf_reset(SBuf *sb)
Definition: lj_buf.h:36
@ CTID_COMPLEX_DOUBLE
Definition: lj_ctype.h:303
@ VARNAME_FOR_CTL
Definition: lj_debug.h:60
@ VARNAME_FOR_IDX
Definition: lj_debug.h:60
@ VARNAME_FOR_STATE
Definition: lj_debug.h:60
@ VARNAME_FOR_GEN
Definition: lj_debug.h:60
@ VARNAME_FOR_STOP
Definition: lj_debug.h:60
@ VARNAME__MAX
Definition: lj_debug.h:61
@ VARNAME_FOR_STEP
Definition: lj_debug.h:60
#define U64x(hi, lo)
Definition: lj_def.h:95
#define LJ_NORET
Definition: lj_def.h:317
#define checku8(x)
Definition: lj_def.h:103
#define LJ_STATIC_ASSERT(cond)
Definition: lj_def.h:358
#define LJ_MAX_XLEVEL
Definition: