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)  

function.c
Go to the documentation of this file.
1 /* Builtin function expansion for GNU Make.
2 Copyright (C) 1988-2020 Free Software Foundation, Inc.
3 This file is part of GNU Make.
4 
5 GNU Make is free software; you can redistribute it and/or modify it under the
6 terms of the GNU General Public License as published by the Free Software
7 Foundation; either version 3 of the License, or (at your option) any later
8 version.
9 
10 GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY
11 WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
12 A PARTICULAR PURPOSE. See the GNU General Public License for more details.
13 
14 You should have received a copy of the GNU General Public License along with
15 this program. If not, see <http://www.gnu.org/licenses/>. */
16 
17 #include "makeint.h"
18 #include "filedef.h"
19 #include "variable.h"
20 #include "dep.h"
21 #include "job.h"
22 #include "os.h"
23 #include "commands.h"
24 #include "debug.h"
25 
26 #ifdef _AMIGA
27 #include "amiga.h"
28 #endif
29 
30 
32  {
33  union {
34  char *(*func_ptr) (char *output, char **argv, const char *fname);
36  } fptr;
37  const char *name;
38  unsigned char len;
39  unsigned char minimum_args;
40  unsigned char maximum_args;
41  unsigned int expand_args:1;
42  unsigned int alloc_fn:1;
43  };
44 
45 static unsigned long
46 function_table_entry_hash_1 (const void *keyv)
47 {
48  const struct function_table_entry *key = keyv;
49  return_STRING_N_HASH_1 (key->name, key->len);
50 }
51 
52 static unsigned long
53 function_table_entry_hash_2 (const void *keyv)
54 {
55  const struct function_table_entry *key = keyv;
56  return_STRING_N_HASH_2 (key->name, key->len);
57 }
58 
59 static int
60 function_table_entry_hash_cmp (const void *xv, const void *yv)
61 {
62  const struct function_table_entry *x = xv;
63  const struct function_table_entry *y = yv;
64  int result = x->len - y->len;
65  if (result)
66  return result;
67  return_STRING_N_COMPARE (x->name, y->name, x->len);
68 }
69 
70 static struct hash_table function_table;
71 ␌
72 
73 /* Store into VARIABLE_BUFFER at O the result of scanning TEXT and replacing
74  each occurrence of SUBST with REPLACE. TEXT is null-terminated. SLEN is
75  the length of SUBST and RLEN is the length of REPLACE. If BY_WORD is
76  nonzero, substitutions are done only on matches which are complete
77  whitespace-delimited words. */
78 
79 char *
80 subst_expand (char *o, const char *text, const char *subst, const char *replace,
81  size_t slen, size_t rlen, int by_word)
82 {
83  const char *t = text;
84  const char *p;
85 
86  if (slen == 0 && !by_word)
87  {
88  /* The first occurrence of "" in any string is its end. */
89  o = variable_buffer_output (o, t, strlen (t));
90  if (rlen > 0)
91  o = variable_buffer_output (o, replace, rlen);
92  return o;
93  }
94 
95  do
96  {
97  if (by_word && slen == 0)
98  /* When matching by words, the empty string should match
99  the end of each word, rather than the end of the whole text. */
100  p = end_of_token (next_token (t));
101  else
102  {
103  p = strstr (t, subst);
104  if (p == 0)
105  {
106  /* No more matches. Output everything left on the end. */
107  o = variable_buffer_output (o, t, strlen (t));
108  return o;
109  }
110  }
111 
112  /* Output everything before this occurrence of the string to replace. */
113  if (p > t)
114  o = variable_buffer_output (o, t, p - t);
115 
116  /* If we're substituting only by fully matched words,
117  or only at the ends of words, check that this case qualifies. */
118  if (by_word
119  && ((p > text && !ISSPACE (p[-1]))
120  || ! STOP_SET (p[slen], MAP_SPACE|MAP_NUL)))
121  /* Struck out. Output the rest of the string that is
122  no longer to be replaced. */
124  else if (rlen > 0)
125  /* Output the replacement string. */
126  o = variable_buffer_output (o, replace, rlen);
127 
128  /* Advance T past the string to be replaced. */
129  t = p + slen;
130  } while (*t != '\0');
131 
132  return o;
133 }
134 ␌
135 
136 /* Store into VARIABLE_BUFFER at O the result of scanning TEXT
137  and replacing strings matching PATTERN with REPLACE.
138  If PATTERN_PERCENT is not nil, PATTERN has already been
139  run through find_percent, and PATTERN_PERCENT is the result.
140  If REPLACE_PERCENT is not nil, REPLACE has already been
141  run through find_percent, and REPLACE_PERCENT is the result.
142  Note that we expect PATTERN_PERCENT and REPLACE_PERCENT to point to the
143  character _AFTER_ the %, not to the % itself.
144 */
145 
146 char *
147 patsubst_expand_pat (char *o, const char *text,
148  const char *pattern, const char *replace,
149  const char *pattern_percent, const char *replace_percent)
150 {
151  size_t pattern_prepercent_len, pattern_postpercent_len;
152  size_t replace_prepercent_len, replace_postpercent_len;
153  const char *t;
154  size_t len;
155  int doneany = 0;
156 
157  /* Record the length of REPLACE before and after the % so we don't have to
158  compute these lengths more than once. */
159  if (replace_percent)
160  {
161  replace_prepercent_len = replace_percent - replace - 1;
162  replace_postpercent_len = strlen (replace_percent);
163  }
164  else
165  {
166  replace_prepercent_len = strlen (replace);
167  replace_postpercent_len = 0;
168  }
169 
170  if (!pattern_percent)
171  /* With no % in the pattern, this is just a simple substitution. */
172  return subst_expand (o, text, pattern, replace,
173  strlen (pattern), strlen (replace), 1);
174 
175  /* Record the length of PATTERN before and after the %
176  so we don't have to compute it more than once. */
177  pattern_prepercent_len = pattern_percent - pattern - 1;
178  pattern_postpercent_len = strlen (pattern_percent);
179 
180  while ((t = find_next_token (&text, &len)) != 0)
181  {
182  int fail = 0;
183 
184  /* Is it big enough to match? */
185  if (len < pattern_prepercent_len + pattern_postpercent_len)
186  fail = 1;
187 
188  /* Does the prefix match? */
189  if (!fail && pattern_prepercent_len > 0
190  && (*t != *pattern
191  || t[pattern_prepercent_len - 1] != pattern_percent[-2]
192  || !strneq (t + 1, pattern + 1, pattern_prepercent_len - 1)))
193  fail = 1;
194 
195  /* Does the suffix match? */
196  if (!fail && pattern_postpercent_len > 0
197  && (t[len - 1] != pattern_percent[pattern_postpercent_len - 1]
198  || t[len - pattern_postpercent_len] != *pattern_percent
199  || !strneq (&t[len - pattern_postpercent_len],
200  pattern_percent, pattern_postpercent_len - 1)))
201  fail = 1;
202 
203  if (fail)
204  /* It didn't match. Output the string. */
205  o = variable_buffer_output (o, t, len);
206  else
207  {
208  /* It matched. Output the replacement. */
209 
210  /* Output the part of the replacement before the %. */
211  o = variable_buffer_output (o, replace, replace_prepercent_len);
212 
213  if (replace_percent != 0)
214  {
215  /* Output the part of the matched string that
216  matched the % in the pattern. */
217  o = variable_buffer_output (o, t + pattern_prepercent_len,
218  len - (pattern_prepercent_len
219  + pattern_postpercent_len));
220  /* Output the part of the replacement after the %. */
221  o = variable_buffer_output (o, replace_percent,
222  replace_postpercent_len);
223  }
224  }
225 
226  /* Output a space, but not if the replacement is "". */
227  if (fail || replace_prepercent_len > 0
228  || (replace_percent != 0 && len + replace_postpercent_len > 0))
229  {
230  o = variable_buffer_output (o, " ", 1);
231  doneany = 1;
232  }
233  }
234  if (doneany)
235  /* Kill the last space. */
236  --o;
237 
238  return o;
239 }
240 
241 /* Store into VARIABLE_BUFFER at O the result of scanning TEXT
242  and replacing strings matching PATTERN with REPLACE.
243  If PATTERN_PERCENT is not nil, PATTERN has already been
244  run through find_percent, and PATTERN_PERCENT is the result.
245  If REPLACE_PERCENT is not nil, REPLACE has already been
246  run through find_percent, and REPLACE_PERCENT is the result.
247  Note that we expect PATTERN_PERCENT and REPLACE_PERCENT to point to the
248  character _AFTER_ the %, not to the % itself.
249 */
250 
251 char *
252 patsubst_expand (char *o, const char *text, char *pattern, char *replace)
253 {
254  const char *pattern_percent = find_percent (pattern);
255  const char *replace_percent = find_percent (replace);
256 
257  /* If there's a percent in the pattern or replacement skip it. */
258  if (replace_percent)
259  ++replace_percent;
260  if (pattern_percent)
261  ++pattern_percent;
262 
264  pattern_percent, replace_percent);
265 }
266 ␌
267 
268 /* Look up a function by name. */
269 
270 static const struct function_table_entry *
271 lookup_function (const char *s)
272 {
273  struct function_table_entry function_table_entry_key;
274  const char *e = s;
275 
276  while (STOP_SET (*e, MAP_USERFUNC))
277  e++;
278 
279  if (e == s || !STOP_SET(*e, MAP_NUL|MAP_SPACE))
280  return NULL;
281 
282  function_table_entry_key.name = s;
283  function_table_entry_key.len = (unsigned char) (e - s);
284 
285  return hash_find_item (&function_table, &function_table_entry_key);
286 }
287 ␌
288 
289 /* Return 1 if PATTERN matches STR, 0 if not. */
290 
291 int
292 pattern_matches (const char *pattern, const char *percent, const char *str)
293 {
294  size_t sfxlen, strlength;
295 
296  if (percent == 0)
297  {
298  size_t len = strlen (pattern) + 1;
299  char *new_chars = alloca (len);
300  memcpy (new_chars, pattern, len);
301  percent = find_percent (new_chars);
302  if (percent == 0)
303  return streq (new_chars, str);
304  pattern = new_chars;
305  }
306 
307  sfxlen = strlen (percent + 1);
308  strlength = strlen (str);
309 
310  if (strlength < (percent - pattern) + sfxlen
311  || !strneq (pattern, str, percent - pattern))
312  return 0;
313 
314  return !strcmp (percent + 1, str + (strlength - sfxlen));
315 }
316 ␌
317 
318 /* Find the next comma or ENDPAREN (counting nested STARTPAREN and
319  ENDPARENtheses), starting at PTR before END. Return a pointer to
320  next character.
321 
322  If no next argument is found, return NULL.
323 */
324 
325 static char *
326 find_next_argument (char startparen, char endparen,
327  const char *ptr, const char *end)
328 {
329  int count = 0;
330 
331  for (; ptr < end; ++ptr)
332  if (!STOP_SET (*ptr, MAP_VARSEP|MAP_COMMA))
333  continue;
334 
335  else if (*ptr == startparen)
336  ++count;
337 
338  else if (*ptr == endparen)
339  {
340  --count;
341  if (count < 0)
342  return NULL;
343  }
344 
345  else if (*ptr == ',' && !count)
346  return (char *)ptr;
347 
348  /* We didn't find anything. */
349  return NULL;
350 }
351 ␌
352 
353 /* Glob-expand LINE. The returned pointer is
354  only good until the next call to string_glob. */
355 
356 static char *
358 {
359  static char *result = 0;
360  static size_t length;
361  struct nameseq *chain;
362  size_t idx;
363 
365  /* We do not want parse_file_seq to strip './'s.
366  That would break examples like:
367  $(patsubst ./%.c,obj/%.o,$(wildcard ./?*.c)). */
369 
370  if (result == 0)
371  {
372  length = 100;
373  result = xmalloc (100);
374  }
375 
376  idx = 0;
377  while (chain != 0)
378  {
379  struct nameseq *next = chain->next;
380  size_t len = strlen (chain->name);
381 
382  if (idx + len + 1 > length)
383  {
384  length += (len + 1) * 2;
386  }
387  memcpy (&result[idx], chain->name, len);
388  idx += len;
389  result[idx++] = ' ';
390 
391  /* Because we used PARSEFS_NOCACHE above, we have to free() NAME. */
392  free ((char *)chain->name);
393  free (chain);
394  chain = next;
395  }
396 
397  /* Kill the last space and terminate the string. */
398  if (idx == 0)
399  result[0] = '\0';
400  else
401  result[idx - 1] = '\0';
402 
403  return result;
404 }
405 ␌
406 /*
407  Builtin functions
408  */
409 
410 static char *
411 func_patsubst (char *o, char **argv, const char *funcname UNUSED)
412 {
413  o = patsubst_expand (o, argv[2], argv[0], argv[1]);
414  return o;
415 }
416 
417 
418 static char *
419 func_join (char *o, char **argv, const char *funcname UNUSED)
420 {
421  int doneany = 0;
422 
423  /* Write each word of the first argument directly followed
424  by the corresponding word of the second argument.
425  If the two arguments have a different number of words,
426  the excess words are just output separated by blanks. */
427  const char *tp;
428  const char *pp;
429  const char *list1_iterator = argv[0];
430  const char *list2_iterator = argv[1];
431  do
432  {
433  size_t len1, len2;
434 
435  tp = find_next_token (&list1_iterator, &len1);
436  if (tp != 0)
437  o = variable_buffer_output (o, tp, len1);
438 
439  pp = find_next_token (&list2_iterator, &len2);
440  if (pp != 0)
441  o = variable_buffer_output (o, pp, len2);
442 
443  if (tp != 0 || pp != 0)
444  {
445  o = variable_buffer_output (o, " ", 1);
446  doneany = 1;
447  }
448  }
449  while (tp != 0 || pp != 0);
450  if (doneany)
451  /* Kill the last blank. */
452  --o;
453 
454  return o;
455 }
456 
457 
458 static char *
459 func_origin (char *o, char **argv, const char *funcname UNUSED)
460 {
461  /* Expand the argument. */
462  struct variable *v = lookup_variable (argv[0], strlen (argv[0]));
463  if (v == 0)
464  o = variable_buffer_output (o, "undefined", 9);
465  else
466  switch (v->origin)
467  {
468  default:
469  case o_invalid:
470  abort ();
471  break;
472  case o_default:
473  o = variable_buffer_output (o, "default", 7);
474  break;
475  case o_env:
476  o = variable_buffer_output (o, "environment", 11);
477  break;
478  case o_file:
479  o = variable_buffer_output (o, "file", 4);
480  break;
481  case o_env_override:
482  o = variable_buffer_output (o, "environment override", 20);
483  break;
484  case o_command:
485  o = variable_buffer_output (o, "command line", 12);
486  break;
487  case o_override:
488  o = variable_buffer_output (o, "override", 8);
489  break;
490  case o_automatic:
491  o = variable_buffer_output (o, "automatic", 9);
492  break;
493  }
494 
495  return o;
496 }
497 
498 static char *
499 func_flavor (char *o, char **argv, const char *funcname UNUSED)
500 {
501  struct variable *v = lookup_variable (argv[0], strlen (argv[0]));
502 
503  if (v == 0)
504  o = variable_buffer_output (o, "undefined", 9);
505  else
506  if (v->recursive)
507  o = variable_buffer_output (o, "recursive", 9);
508  else
509  o = variable_buffer_output (o, "simple", 6);
510 
511  return o;
512 }
513 
514 
515 static char *
516 func_notdir_suffix (char *o, char **argv, const char *funcname)
517 {
518  /* Expand the argument. */
519  const char *list_iterator = argv[0];
520  const char *p2;
521  int doneany =0;
522  size_t len=0;
523 
524  int is_suffix = funcname[0] == 's';
525  int is_notdir = !is_suffix;
526  int stop = MAP_DIRSEP | (is_suffix ? MAP_DOT : 0);
527 #ifdef VMS
528  /* For VMS list_iterator points to a comma separated list. To use the common
529  [find_]next_token, create a local copy and replace the commas with
530  spaces. Obviously, there is a problem if there is a ',' in the VMS filename
531  (can only happen on ODS5), the same problem as with spaces in filenames,
532  which seems to be present in make on all platforms. */
533  char *vms_list_iterator = alloca(strlen(list_iterator) + 1);
534  int i;
535  for (i = 0; list_iterator[i]; i++)
536  if (list_iterator[i] == ',')
537  vms_list_iterator[i] = ' ';
538  else
539  vms_list_iterator[i] = list_iterator[i];
540  vms_list_iterator[i] = list_iterator[i];
541  while ((p2 = find_next_token((const char**) &vms_list_iterator, &len)) != 0)
542 #else
543  while ((p2 = find_next_token (&list_iterator, &len)) != 0)
544 #endif
545  {
546  const char *p = p2 + len - 1;
547 
548  while (p >= p2 && ! STOP_SET (*p, stop))
549  --p;
550 
551  if (p >= p2)
552  {
553  if (is_notdir)
554  ++p;
555  else if (*p != '.')
556  continue;
557  o = variable_buffer_output (o, p, len - (p - p2));
558  }
559 #ifdef HAVE_DOS_PATHS
560  /* Handle the case of "d:foo/bar". */
561  else if (is_notdir && p2[0] && p2[1] == ':')
562  {
563  p = p2 + 2;
564  o = variable_buffer_output (o, p, len - (p - p2));
565  }
566 #endif
567  else if (is_notdir)
568  o = variable_buffer_output (o, p2, len);
569 
570  if (is_notdir || p >= p2)
571  {
572 #ifdef VMS
573  if (vms_comma_separator)
574  o = variable_buffer_output (o, ",", 1);
575  else
576 #endif
577  o = variable_buffer_output (o, " ", 1);
578 
579  doneany = 1;
580  }
581  }
582 
583  if (doneany)
584  /* Kill last space. */
585  --o;
586 
587  return o;
588 }
589 
590 
591 static char *
592 func_basename_dir (char *o, char **argv, const char *funcname)
593 {
594  /* Expand the argument. */
595  const char *p3 = argv[0];
596  const char *p2;
597  int doneany = 0;
598  size_t len = 0;
599 
600  int is_basename = funcname[0] == 'b';
601  int is_dir = !is_basename;
602  int stop = MAP_DIRSEP | (is_basename ? MAP_DOT : 0) | MAP_NUL;
603 #ifdef VMS
604  /* As in func_notdir_suffix ... */
605  char *vms_p3 = alloca (strlen(p3) + 1);
606  int i;
607  for (i = 0; p3[i]; i++)
608  if (p3[i] == ',')
609  vms_p3[i] = ' ';
610  else
611  vms_p3[i] = p3[i];
612  vms_p3[i] = p3[i];
613  while ((p2 = find_next_token((const char**) &vms_p3, &len)) != 0)
614 #else
615  while ((p2 = find_next_token (&p3, &len)) != 0)
616 #endif
617  {
618  const char *p = p2 + len - 1;
619  while (p >= p2 && ! STOP_SET (*p, stop))
620  --p;
621 
622  if (p >= p2 && (is_dir))
623  o = variable_buffer_output (o, p2, ++p - p2);
624  else if (p >= p2 && (*p == '.'))
625  o = variable_buffer_output (o, p2, p - p2);
626 #ifdef HAVE_DOS_PATHS
627  /* Handle the "d:foobar" case */
628  else if (p2[0] && p2[1] == ':' && is_dir)
629  o = variable_buffer_output (o, p2, 2);
630 #endif
631  else if (is_dir)
632 #ifdef VMS
633  {
634  extern int vms_report_unix_paths;
635  if (vms_report_unix_paths)
636  o = variable_buffer_output (o, "./", 2);
637  else
638  o = variable_buffer_output (o, "[]", 2);
639  }
640 #else
641 #ifndef _AMIGA
642  o = variable_buffer_output (o, "./", 2);
643 #else
644  ; /* Just a nop... */
645 #endif /* AMIGA */
646 #endif /* !VMS */
647  else
648  /* The entire name is the basename. */
649  o = variable_buffer_output (o, p2, len);
650 
651 #ifdef VMS
652  if (vms_comma_separator)
653  o = variable_buffer_output (o, ",", 1);
654  else
655 #endif
656  o = variable_buffer_output (o, " ", 1);
657 
658  doneany = 1;
659  }
660 
661  if (doneany)
662  /* Kill last space. */
663  --o;
664 
665  return o;
666 }
667 
668 static char *
669 func_addsuffix_addprefix (char *o, char **argv, const char *funcname)
670 {
671  size_t fixlen = strlen (argv[0]);
672  const char *list_iterator = argv[1];
673  int is_addprefix = funcname[3] == 'p';
674  int is_addsuffix = !is_addprefix;
675 
676  int doneany = 0;
677  const char *p;
678  size_t len;
679 
680  while ((p = find_next_token (&list_iterator, &len)) != 0)
681  {
682  if (is_addprefix)
683  o = variable_buffer_output (o, argv[0], fixlen);
684  o = variable_buffer_output (o, p, len);
685  if (is_addsuffix)
686  o = variable_buffer_output (o, argv[0], fixlen);
687  o = variable_buffer_output (o, " ", 1);
688  doneany = 1;
689  }
690 
691  if (doneany)
692  /* Kill last space. */
693  --o;
694 
695  return o;
696 }
697 
698 static char *
699 func_subst (char *o, char **argv, const char *funcname UNUSED)
700 {
701  o = subst_expand (o, argv[2], argv[0], argv[1], strlen (argv[0]),
702  strlen (argv[1]), 0);
703 
704  return o;
705 }
706 
707 
708 static char *
709 func_firstword (char *o, char **argv, const char *funcname UNUSED)
710 {
711  size_t i;
712  const char *words = argv[0]; /* Use a temp variable for find_next_token */
713  const char *p = find_next_token (&words, &i);
714 
715  if (p != 0)
716  o = variable_buffer_output (o, p, i);
717 
718  return o;
719 }
720 
721 static char *
722 func_lastword (char *o, char **argv, const char *funcname UNUSED)
723 {
724  size_t i;
725  const char *words = argv[0]; /* Use a temp variable for find_next_token */
726  const char *p = NULL;
727  const char *t;
728 
729  while ((t = find_next_token (&words, &i)) != NULL)
730  p = t;
731 
732  if (p != 0)
733  o = variable_buffer_output (o, p, i);
734 
735  return o;
736 }
737 
738 static char *
739 func_words (char *o, char **argv, const char *funcname UNUSED)
740 {
741  int i = 0;
742  const char *word_iterator = argv[0];
743  char buf[20];
744 
745  while (find_next_token (&word_iterator, NULL) != 0)
746  ++i;
747 
748  sprintf (buf, "%d", i);
749  o = variable_buffer_output (o, buf, strlen (buf));
750 
751  return o;
752 }
753 
754 /* Set begpp to point to the first non-whitespace character of the string,
755  * and endpp to point to the last non-whitespace character of the string.
756  * If the string is empty or contains nothing but whitespace, endpp will be
757  * begpp-1.
758  */
759 char *
760 strip_whitespace (const char **begpp, const char **endpp)
761 {
762  while (*begpp <= *endpp && ISSPACE (**begpp))
763  (*begpp) ++;
764  while (*endpp >= *begpp && ISSPACE (**endpp))
765  (*endpp) --;
766  return (char *)*begpp;
767 }
768 
769 static void
770 check_numeric (const char *s, const char *msg)
771 {
772  const char *end = s + strlen (s) - 1;
773  const char *beg = s;
774  strip_whitespace (&s, &end);
775 
776  for (; s <= end; ++s)
777  if (!ISDIGIT (*s)) /* ISDIGIT only evals its arg once: see makeint.h. */
778  break;
779 
780  if (s <= end || end - beg < 0)
781  OSS (fatal, *expanding_var, "%s: '%s'", msg, beg);
782 }
783 
784 
785 
786 static char *
787 func_word (char *o, char **argv, const char *funcname UNUSED)
788 {
789  const char *end_p;
790  const char *p;
791  int i;
792 
793  /* Check the first argument. */
794  check_numeric (argv[0], _("non-numeric first argument to 'word' function"));
795  i = atoi (argv[0]);
796 
797  if (i == 0)
798  O (fatal, *expanding_var,
799  _("first argument to 'word' function must be greater than 0"));
800 
801  end_p = argv[1];
802  while ((p = find_next_token (&end_p, 0)) != 0)
803  if (--i == 0)
804  break;
805 
806  if (i == 0)
807  o = variable_buffer_output (o, p, end_p - p);
808 
809  return o;
810 }
811 
812 static char *
813 func_wordlist (char *o, char **argv, const char *funcname UNUSED)
814 {
815  int start, count;
816 
817  /* Check the arguments. */
818  check_numeric (argv[0],
819  _("non-numeric first argument to 'wordlist' function"));
820  check_numeric (argv[1],
821  _("non-numeric second argument to 'wordlist' function"));
822 
823  start = atoi (argv[0]);
824  if (start < 1)
826  "invalid first argument to 'wordlist' function: '%d'", start);
827 
828  count = atoi (argv[1]) - start + 1;
829 
830  if (count > 0)
831  {
832  const char *p;
833  const char *end_p = argv[2];
834 
835  /* Find the beginning of the "start"th word. */
836  while (((p = find_next_token (&end_p, 0)) != 0) && --start)
837  ;
838 
839  if (p)
840  {
841  /* Find the end of the "count"th word from start. */
842  while (--count && (find_next_token (&end_p, 0) != 0))
843  ;
844 
845  /* Return the stuff in the middle. */
846  o = variable_buffer_output (o, p, end_p - p);
847  }
848  }
849 
850  return o;
851 }
852 
853 static char *
854 func_findstring (char *o, char **argv, const char *funcname UNUSED)
855 {
856  /* Find the first occurrence of the first string in the second. */
857  if (strstr (argv[1], argv[0]) != 0)
858  o = variable_buffer_output (o, argv[0], strlen (argv[0]));
859 
860  return o;
861 }
862 
863 static char *
864 func_foreach (char *o, char **argv, const char *funcname UNUSED)
865 {
866  /* expand only the first two. */
867  char *varname = expand_argument (argv[0], NULL);
868  char *list = expand_argument (argv[1], NULL);
869  const char *body = argv[2];
870 
871  int doneany = 0;
872  const char *list_iterator = list;
873  const char *p;
874  size_t len;
875  struct variable *var;
876 
877  /* Clean up the variable name by removing whitespace. */
878  char *vp = next_token (varname);
879  end_of_token (vp)[0] = '\0';
880 
882  var = define_variable (vp, strlen (vp), "", o_automatic, 0);
883 
884  /* loop through LIST, put the value in VAR and expand BODY */
885  while ((p = find_next_token (&list_iterator, &len)) != 0)
886  {
887  char *result = 0;
888 
889  free (var->value);
890  var->value = xstrndup (p, len);
891 
893 
895  o = variable_buffer_output (o, " ", 1);
896  doneany = 1;
897  free (result);
898  }
899 
900  if (doneany)
901  /* Kill the last space. */
902  --o;
903 
905  free (varname);
906  free (list);
907 
908  return o;
909 }
910 
911 struct a_word
912 {
913  struct a_word *next;
914  struct a_word *chain;
915  char *str;
916  size_t length;
917  int matched;
918 };
919 
920 static unsigned long
921 a_word_hash_1 (const void *key)
922 {
923  return_STRING_HASH_1 (((struct a_word const *) key)->str);
924 }
925 
926 static unsigned long
927 a_word_hash_2 (const void *key)
928 {
929  return_STRING_HASH_2 (((struct a_word const *) key)->str);
930 }
931 
932 static int
933 a_word_hash_cmp (const void *x, const void *y)
934 {
935  int result = (int) ((struct a_word const *) x)->length - ((struct a_word const *) y)->length;
936  if (result)
937  return result;
938  return_STRING_COMPARE (((struct a_word const *) x)->str,
939  ((struct a_word const *) y)->str);
940 }
941 
942 struct a_pattern
943 {
944  struct a_pattern *next;
945  char *str;
946  char *percent;
947  size_t length;
948 };
949 
950 static char *
951 func_filter_filterout (char *o, char **argv, const char *funcname)
952 {
953  struct a_word *wordhead;
954  struct a_word **wordtail;
955  struct a_word *wp;
956  struct a_pattern *pathead;
957  struct a_pattern **pattail;
958  struct a_pattern *pp;
959 
960  struct hash_table a_word_table;
961  int is_filter = funcname[CSTRLEN ("filter")] == '\0';
962  const char *pat_iterator = argv[0];
963  const char *word_iterator = argv[1];
964  int literals = 0;
965  int words = 0;
966  int hashing = 0;
967  char *p;
968  size_t len;
969 
970  /* Chop ARGV[0] up into patterns to match against the words.
971  We don't need to preserve it because our caller frees all the
972  argument memory anyway. */
973 
974  pattail = &pathead;
975  while ((p = find_next_token (&pat_iterator, &len)) != 0)
976  {
977  struct a_pattern *pat = alloca (sizeof (struct a_pattern));
978 
979  *pattail = pat;
980  pattail = &pat->next;
981 
982  if (*pat_iterator != '\0')
983  ++pat_iterator;
984 
985  pat->str = p;
986  p[len] = '\0';
987  pat->percent = find_percent (p);
988  if (pat->percent == 0)
989  literals++;
990 
991  /* find_percent() might shorten the string so LEN is wrong. */
992  pat->length = strlen (pat->str);
993  }
994  *pattail = 0;
995 
996  /* Chop ARGV[1] up into words to match against the patterns. */
997 
998  wordtail = &wordhead;
999  while ((p = find_next_token (&word_iterator, &len)) != 0)
1000  {
1001  struct a_word *word = alloca (sizeof (struct a_word));
1002 
1003  *wordtail = word;
1004  wordtail = &word->next;
1005 
1006  if (*word_iterator != '\0')
1007  ++word_iterator;
1008 
1009  p[len] = '\0';
1010  word->str = p;
1011  word->length = len;
1012  word->matched = 0;
1013  word->chain = 0;
1014  words++;
1015  }
1016  *wordtail = 0;
1017 
1018  /* Only use a hash table if arg list lengths justifies the cost. */
1019  hashing = (literals >= 2 && (literals * words) >= 10);
1020  if (hashing)
1021  {
1022  hash_init (&a_word_table, words, a_word_hash_1, a_word_hash_2,
1023  a_word_hash_cmp);
1024  for (wp = wordhead; wp != 0; wp = wp->next)
1025  {
1026  struct a_word *owp = hash_insert (&a_word_table, wp);
1027  if (owp)
1028  wp->chain = owp;
1029  }
1030  }
1031 
1032  if (words)
1033  {
1034  int doneany = 0;
1035 
1036  /* Run each pattern through the words, killing words. */
1037  for (pp = pathead; pp != 0; pp = pp->next)
1038  {
1039  if (pp->percent)
1040  for (wp = wordhead; wp != 0; wp = wp->next)
1041  wp->matched |= pattern_matches (pp->str, pp->percent, wp->str);
1042  else if (hashing)
1043  {
1044  struct a_word a_word_key;
1045  a_word_key.str = pp->str;
1046  a_word_key.length = pp->length;
1047  wp = hash_find_item (&a_word_table, &a_word_key);
1048  while (wp)
1049  {
1050  wp->matched |= 1;
1051  wp = wp->chain;
1052  }
1053  }
1054  else
1055  for (wp = wordhead; wp != 0; wp = wp->next)
1056  wp->matched |= (wp->length == pp->length
1057  && strneq (pp->str, wp->str, wp->length));
1058  }
1059 
1060  /* Output the words that matched (or didn't, for filter-out). */
1061  for (wp = wordhead; wp != 0; wp = wp->next)
1062  if (is_filter ? wp->matched : !wp->matched)
1063  {
1064  o = variable_buffer_output (o, wp->str, strlen (wp->str));
1065  o = variable_buffer_output (o, " ", 1);
1066  doneany = 1;
1067  }
1068 
1069  if (doneany)
1070  /* Kill the last space. */
1071  --o;
1072  }
1073 
1074  if (hashing)
1075  hash_free (&a_word_table, 0);
1076 
1077  return o;
1078 }
1079 
1080 
1081 static char *
1082 func_strip (char *o, char **argv, const char *funcname UNUSED)
1083 {
1084  const char *p = argv[0];
1085  int doneany = 0;
1086 
1087  while (*p != '\0')
1088  {
1089  int i=0;
1090  const char *word_start;
1091 
1092  NEXT_TOKEN (p);
1093  word_start = p;
1094  for (i=0; *p != '\0' && !ISSPACE (*p); ++p, ++i)
1095  {}
1096  if (!i)
1097  break;
1098  o = variable_buffer_output (o, word_start, i);
1099  o = variable_buffer_output (o, " ", 1);
1100  doneany = 1;
1101  }
1102 
1103  if (doneany)
1104  /* Kill the last space. */
1105  --o;
1106 
1107  return o;
1108 }
1109 
1110 /*
1111  Print a warning or fatal message.
1112 */
1113 static char *
1114 func_error (char *o, char **argv, const char *funcname)
1115 {
1116  char **argvp;
1117  char *msg, *p;
1118  size_t len;
1119 
1120  /* The arguments will be broken on commas. Rather than create yet
1121  another special case where function arguments aren't broken up,
1122  just create a format string that puts them back together. */
1123  for (len=0, argvp=argv; *argvp != 0; ++argvp)
1124  len += strlen (*argvp) + 2;
1125 
1126  p = msg = alloca (len + 1);
1127  msg[0] = '\0';
1128 
1129  for (argvp=argv; argvp[1] != 0; ++argvp)
1130  {
1131  strcpy (p, *argvp);
1132  p += strlen (*argvp);
1133  *(p++) = ',';
1134  *(p++) = ' ';
1135  }
1136  strcpy (p, *argvp);
1137 
1138  switch (*funcname)
1139  {
1140  case 'e':
1141  OS (fatal, reading_file, "%s", msg);
1142 
1143  case 'w':
1144  OS (error, reading_file, "%s", msg);
1145  break;
1146 
1147  case 'i':
1148  outputs (0, msg);
1149  outputs (0, "\n");
1150  break;
1151 
1152  default:
1153  OS (fatal, *expanding_var, "Internal error: func_error: '%s'", funcname);
1154  }
1155 
1156  /* The warning function expands to the empty string. */
1157  return o;
1158 }
1159 
1160 
1161 /*
1162  chop argv[0] into words, and sort them.
1163  */
1164 static char *
1165 func_sort (char *o, char **argv, const char *funcname UNUSED)
1166 {
1167  const char *t;
1168  char **words;
1169  int wordi;
1170  char *p;
1171  size_t len;
1172 
1173  /* Find the maximum number of words we'll have. */
1174  t = argv[0];
1175  wordi = 0;
1176  while ((p = find_next_token (&t, NULL)) != 0)
1177  {
1178  ++t;
1179  ++wordi;
1180  }
1181 
1182  words = xmalloc ((wordi == 0 ? 1 : wordi) * sizeof (char *));
1183 
1184  /* Now assign pointers to each string in the array. */
1185  t = argv[0];
1186  wordi = 0;
1187  while ((p = find_next_token (&t, &len)) != 0)
1188  {
1189  ++t;
1190  p[len] = '\0';
1191  words[wordi++] = p;
1192  }
1193 
1194  if (wordi)
1195  {
1196  int i;
1197 
1198  /* Now sort the list of words. */
1199  qsort (words, wordi, sizeof (char *), alpha_compare);
1200 
1201  /* Now write the sorted list, uniquified. */
1202  for (i = 0; i < wordi; ++i)
1203  {
1204  len = strlen (words[i]);
1205  if (i == wordi - 1 || strlen (words[i + 1]) != len
1206  || strcmp (words[i], words[i + 1]))
1207  {
1208  o = variable_buffer_output (o, words[i], len);
1209  o = variable_buffer_output (o, " ", 1);
1210  }
1211  }
1212 
1213  /* Kill the last space. */
1214  --o;
1215  }
1216 
1217  free (words);
1218 
1219  return o;
1220 }
1221 
1222 /*
1223  $(if condition,true-part[,false-part])
1224 
1225  CONDITION is false iff it evaluates to an empty string. White
1226  space before and after condition are stripped before evaluation.
1227 
1228  If CONDITION is true, then TRUE-PART is evaluated, otherwise FALSE-PART is
1229  evaluated (if it exists). Because only one of the two PARTs is evaluated,
1230  you can use $(if ...) to create side-effects (with $(shell ...), for
1231  example).
1232 */
1233 
1234 static char *
1235 func_if (char *o, char **argv, const char *funcname UNUSED)
1236 {
1237  const char *begp = argv[0];
1238  const char *endp = begp + strlen (argv[0]) - 1;
1239  int result = 0;
1240 
1241  /* Find the result of the condition: if we have a value, and it's not
1242  empty, the condition is true. If we don't have a value, or it's the
1243  empty string, then it's false. */
1244 
1245  strip_whitespace (&begp, &endp);
1246 
1247  if (begp <= endp)
1248  {
1249  char *expansion = expand_argument (begp, endp+1);
1250 
1251  result = expansion[0] != '\0';
1252  free (expansion);
1253  }
1254 
1255  /* If the result is true (1) we want to eval the first argument, and if
1256  it's false (0) we want to eval the second. If the argument doesn't
1257  exist we do nothing, otherwise expand it and add to the buffer. */
1258 
1259  argv += 1 + !result;
1260 
1261  if (*argv)
1262  {
1263  char *expansion = expand_argument (*argv, NULL);
1264 
1265  o = variable_buffer_output (o, expansion, strlen (expansion));
1266 
1267  free (expansion);
1268  }
1269 
1270  return o;
1271 }
1272 
1273 /*
1274  $(or condition1[,condition2[,condition3[...]]])
1275 
1276  A CONDITION is false iff it evaluates to an empty string. White
1277  space before and after CONDITION are stripped before evaluation.
1278 
1279  CONDITION1 is evaluated. If it's true, then this is the result of
1280  expansion. If it's false, CONDITION2 is evaluated, and so on. If none of
1281  the conditions are true, the expansion is the empty string.
1282 
1283  Once a CONDITION is true no further conditions are evaluated
1284  (short-circuiting).
1285 */
1286 
1287 static char *
1288 func_or (char *o, char **argv, const char *funcname UNUSED)
1289 {
1290  for ( ; *argv ; ++argv)
1291  {
1292  const char *begp = *argv;
1293  const char *endp = begp + strlen (*argv) - 1;
1294  char *expansion;
1295  size_t result = 0;
1296 
1297  /* Find the result of the condition: if it's false keep going. */
1298 
1299  strip_whitespace (&begp, &endp);
1300 
1301  if (begp > endp)
1302  continue;
1303 
1304  expansion = expand_argument (begp, endp+1);
1305  result = strlen (expansion);
1306 
1307  /* If the result is false keep going. */
1308  if (!result)
1309  {
1310  free (expansion);
1311  continue;
1312  }
1313 
1314  /* It's true! Keep this result and return. */
1315  o = variable_buffer_output (o, expansion, result);
1316  free (expansion);
1317  break;
1318  }
1319 
1320  return o;
1321 }
1322 
1323 /*
1324  $(and condition1[,condition2[,condition3[...]]])
1325 
1326  A CONDITION is false iff it evaluates to an empty string. White
1327  space before and after CONDITION are stripped before evaluation.
1328 
1329  CONDITION1 is evaluated. If it's false, then this is the result of
1330  expansion. If it's true, CONDITION2 is evaluated, and so on. If all of
1331  the conditions are true, the expansion is the result of the last condition.
1332 
1333  Once a CONDITION is false no further conditions are evaluated
1334  (short-circuiting).
1335 */
1336 
1337 static char *
1338 func_and (char *o, char **argv, const char *funcname UNUSED)
1339 {
1340  char *expansion;
1341 
1342  while (1)
1343  {
1344  const char *begp = *argv;
1345  const char *endp = begp + strlen (*argv) - 1;
1346  size_t result;
1347 
1348  /* An empty condition is always false. */
1349  strip_whitespace (&begp, &endp);
1350  if (begp > endp)
1351  return o;
1352 
1353  expansion = expand_argument (begp, endp+1);
1354  result = strlen (expansion);
1355 
1356  /* If the result is false, stop here: we're done. */
1357  if (!result)
1358  break;
1359 
1360  /* Otherwise the result is true. If this is the last one, keep this
1361  result and quit. Otherwise go on to the next one! */
1362 
1363  if (*(++argv))
1364  free (expansion);
1365  else
1366  {
1367  o = variable_buffer_output (o, expansion, result);
1368  break;
1369  }
1370  }
1371 
1372  free (expansion);
1373 
1374  return o;
1375 }
1376 
1377 static char *
1378 func_wildcard (char *o, char **argv, const char *funcname UNUSED)
1379 {
1380 #ifdef _AMIGA
1381  o = wildcard_expansion (argv[0], o);
1382 #else
1383  char *p = string_glob (argv[0]);
1384  o = variable_buffer_output (o, p, strlen (p));
1385 #endif
1386  return o;
1387 }
1388 
1389 /*
1390  $(eval <makefile string>)
1391 
1392  Always resolves to the empty string.
1393 
1394  Treat the arguments as a segment of makefile, and parse them.
1395 */
1396 
1397 static char *
1398 func_eval (char *o, char **argv, const char *funcname UNUSED)
1399 {
1400  char *buf;
1401  size_t len;
1402 
1403  /* Eval the buffer. Pop the current variable buffer setting so that the
1404  eval'd code can use its own without conflicting. */
1405 
1407 
1408  eval_buffer (argv[0], NULL);
1409 
1411 
1412  return o;
1413 }
1414 
1415 
1416 static char *
1417 func_value (char *o, char **argv, const char *funcname UNUSED)
1418 {
1419  /* Look up the variable. */
1420  struct variable *v = lookup_variable (argv[0], strlen (argv[0]));
1421 
1422  /* Copy its value into the output buffer without expanding it. */
1423  if (v)
1424  o = variable_buffer_output (o, v->value, strlen (v->value));
1425 
1426  return o;
1427 }
1428 
1429 /*
1430  \r is replaced on UNIX as well. Is this desirable?
1431  */
1432 static void
1433 fold_newlines (char *buffer, size_t *length, int trim_newlines)
1434 {
1435  char *dst = buffer;
1436  char *src = buffer;
1437  char *last_nonnl = buffer - 1;
1438  src[*length] = 0;
1439  for (; *src != '\0'; ++src)
1440  {
1441  if (src[0] == '\r' && src[1] == '\n')
1442  continue;
1443  if (*src == '\n')
1444  {
1445  *dst++ = ' ';
1446  }
1447  else
1448  {
1449  last_nonnl = dst;
1450  *dst++ = *src;
1451  }
1452  }
1453 
1454  if (!trim_newlines && (last_nonnl < (dst - 2)))
1455  last_nonnl = dst - 2;
1456 
1457  *(++last_nonnl) = '\0';
1458  *length = last_nonnl - buffer;
1459 }
1460 
1463 
1464 void
1465 shell_completed (int exit_code, int exit_sig)
1466 {
1467  char buf[256];
1468 
1469  shell_function_pid = 0;
1470  if (exit_sig == 0 && exit_code == 127)
1472  else
1474 
1475  if (exit_code == 0 && exit_sig > 0)
1476  exit_code = 128 + exit_sig;
1477 
1478  sprintf (buf, "%d", exit_code);
1479  define_variable_cname (".SHELLSTATUS", buf, o_override, 0);
1480 }
1481 
1482 #ifdef WINDOWS32
1483 /*untested*/
1484 
1485 #include <windows.h>
1486 #include <io.h>
1487 #include "sub_proc.h"
1488 
1489 
1490 int
1491 windows32_openpipe (int *pipedes, int errfd, pid_t *pid_p, char **command_argv, char **envp)
1492 {
1493  SECURITY_ATTRIBUTES saAttr;
1494  HANDLE hIn = INVALID_HANDLE_VALUE;
1495  HANDLE hErr = INVALID_HANDLE_VALUE;
1496  HANDLE hChildOutRd;
1497  HANDLE hChildOutWr;
1498  HANDLE hProcess, tmpIn, tmpErr;
1499  DWORD e;
1500 
1501  /* Set status for return. */
1502  pipedes[0] = pipedes[1] = -1;
1503  *pid_p = (pid_t)-1;
1504 
1505  saAttr.nLength = sizeof (SECURITY_ATTRIBUTES);
1506  saAttr.bInheritHandle = TRUE;
1507  saAttr.lpSecurityDescriptor = NULL;
1508 
1509  /* Standard handles returned by GetStdHandle can be NULL or
1510  INVALID_HANDLE_VALUE if the parent process closed them. If that
1511  happens, we open the null device and pass its handle to
1512  process_begin below as the corresponding handle to inherit. */
1513  tmpIn = GetStdHandle (STD_INPUT_HANDLE);
1514  if (DuplicateHandle (GetCurrentProcess (), tmpIn,
1515  GetCurrentProcess (), &hIn,
1516  0, TRUE, DUPLICATE_SAME_ACCESS) == FALSE)
1517  {
1518  e = GetLastError ();
1519  if (e == ERROR_INVALID_HANDLE)
1520  {
1521  tmpIn = CreateFile ("NUL", GENERIC_READ,
1522  FILE_SHARE_READ | FILE_SHARE_WRITE, NULL,
1523  OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
1524  if (tmpIn != INVALID_HANDLE_VALUE
1525  && DuplicateHandle (GetCurrentProcess (), tmpIn,
1526  GetCurrentProcess (), &hIn,
1527  0, TRUE, DUPLICATE_SAME_ACCESS) == FALSE)
1528  CloseHandle (tmpIn);
1529  }
1530  if (hIn == INVALID_HANDLE_VALUE)
1531  {
1532  ON (error, NILF,
1533  _("windows32_openpipe: DuplicateHandle(In) failed (e=%ld)\n"), e);
1534  return -1;
1535  }
1536  }
1537  tmpErr = (HANDLE)_get_osfhandle (errfd);
1538  if (DuplicateHandle (GetCurrentProcess (), tmpErr,
1539  GetCurrentProcess (), &hErr,
1540  0, TRUE, DUPLICATE_SAME_ACCESS) == FALSE)
1541  {
1542  e = GetLastError ();
1543  if (e == ERROR_INVALID_HANDLE)
1544  {
1545  tmpErr = CreateFile ("NUL", GENERIC_WRITE,
1546  FILE_SHARE_READ | FILE_SHARE_WRITE, NULL,
1547  OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
1548  if (tmpErr != INVALID_HANDLE_VALUE
1549  && DuplicateHandle (GetCurrentProcess (), tmpErr,
1550  GetCurrentProcess (), &hErr,
1551  0, TRUE, DUPLICATE_SAME_ACCESS) == FALSE)
1552  CloseHandle (tmpErr);
1553  }
1554  if (hErr == INVALID_HANDLE_VALUE)
1555  {
1556  ON (error, NILF,
1557  _("windows32_openpipe: DuplicateHandle(Err) failed (e=%ld)\n"), e);
1558  return -1;
1559  }
1560  }
1561 
1562  if (! CreatePipe (&hChildOutRd, &hChildOutWr, &saAttr, 0))
1563  {
1564  ON (error, NILF, _("CreatePipe() failed (e=%ld)\n"), GetLastError());
1565  return -1;
1566  }
1567 
1568  hProcess = process_init_fd (hIn, hChildOutWr, hErr);
1569 
1570  if (!hProcess)
1571  {
1572  O (error, NILF, _("windows32_openpipe(): process_init_fd() failed\n"));
1573  return -1;
1574  }
1575 
1576  /* make sure that CreateProcess() has Path it needs */
1577  sync_Path_environment ();
1578  /* 'sync_Path_environment' may realloc 'environ', so take note of
1579  the new value. */
1580  envp = environ;
1581 
1582  if (! process_begin (hProcess, command_argv, envp, command_argv[0], NULL))
1583  {
1584  /* register process for wait */
1585  process_register (hProcess);
1586 
1587  /* set the pid for returning to caller */
1588  *pid_p = (pid_t) hProcess;
1589 
1590  /* set up to read data from child */
1591  pipedes[0] = _open_osfhandle ((intptr_t) hChildOutRd, O_RDONLY);
1592 
1593  /* this will be closed almost right away */
1594  pipedes[1] = _open_osfhandle ((intptr_t) hChildOutWr, O_APPEND);
1595  return 0;
1596  }
1597  else
1598  {
1599  /* reap/cleanup the failed process */
1600  process_cleanup (hProcess);
1601 
1602  /* close handles which were duplicated, they weren't used */
1603  if (hIn != INVALID_HANDLE_VALUE)
1604  CloseHandle (hIn);
1605  if (hErr != INVALID_HANDLE_VALUE)
1606  CloseHandle (hErr);
1607 
1608  /* close pipe handles, they won't be used */
1609  CloseHandle (hChildOutRd);
1610  CloseHandle (hChildOutWr);
1611 
1612  return -1;
1613  }
1614 }
1615 #endif
1616 
1617 
1618 #ifdef __MSDOS__
1619 FILE *
1620 msdos_openpipe (int* pipedes, int *pidp, char *text)
1621 {
1622  FILE *fpipe=0;
1623  /* MSDOS can't fork, but it has 'popen'. */
1624  struct variable *sh = lookup_variable ("SHELL", 5);
1625  int e;
1626  extern int dos_command_running, dos_status;
1627 
1628  /* Make sure not to bother processing an empty line. */
1629  NEXT_TOKEN (text);
1630  if (*text == '\0')
1631  return 0;
1632 
1633  if (sh)
1634  {
1635  char buf[PATH_MAX + 7];
1636  /* This makes sure $SHELL value is used by $(shell), even
1637  though the target environment is not passed to it. */
1638  sprintf (buf, "SHELL=%s", sh->value);
1639  putenv (buf);
1640  }
1641 
1642  e = errno;
1643  errno = 0;
1644  dos_command_running = 1;
1645  dos_status = 0;
1646  /* If dos_status becomes non-zero, it means the child process
1647  was interrupted by a signal, like SIGINT or SIGQUIT. See
1648  fatal_error_signal in commands.c. */
1649  fpipe = popen (text, "rt");
1650  dos_command_running = 0;
1651  if (!fpipe || dos_status)
1652  {
1653  pipedes[0] = -1;
1654  *pidp = -1;
1655  if (dos_status)
1656  errno = EINTR;
1657  else if (errno == 0)
1658  errno = ENOMEM;
1659  if (fpipe)
1660  pclose (fpipe);
1661  shell_completed (127, 0);
1662  }
1663  else
1664  {
1665  pipedes[0] = fileno (fpipe);
1666  *pidp = 42; /* Yes, the Meaning of Life, the Universe, and Everything! */
1667  errno = e;
1668  }
1669  return fpipe;
1670 }
1671 #endif
1672 
1673 /*
1674  Do shell spawning, with the naughty bits for different OSes.
1675  */
1676 
1677 #ifdef VMS
1678 
1679 /* VMS can't do $(shell ...) */
1680 
1681 char *
1682 func_shell_base (char *o, char **argv, int trim_newlines)
1683 {
1684  fprintf (stderr, "This platform does not support shell\n");
1685  die (MAKE_TROUBLE);
1686  return NULL;
1687 }
1688 
1689 #define func_shell 0
1690 
1691 #else
1692 #ifndef _AMIGA
1693 char *
1694 func_shell_base (char *o, char **argv, int trim_newlines)
1695 {
1696  char *batch_filename = NULL;
1697  int errfd;
1698 #ifdef __MSDOS__
1699  FILE *fpipe;
1700 #endif
1701  char **command_argv = NULL;
1702  char **envp;
1703  int pipedes[2];
1704  pid_t pid;
1705 
1706 #ifndef __MSDOS__
1707 #ifdef WINDOWS32
1708  /* Reset just_print_flag. This is needed on Windows when batch files
1709  are used to run the commands, because we normally refrain from
1710  creating batch files under -n. */
1711  int j_p_f = just_print_flag;
1712  just_print_flag = 0;
1713 #endif
1714 
1715  /* Construct the argument list. */
1716  command_argv = construct_command_argv (argv[0], NULL, NULL, 0,
1717  &batch_filename);
1718  if (command_argv == 0)
1719  {
1720 #ifdef WINDOWS32
1721  just_print_flag = j_p_f;
1722 #endif
1723  return o;
1724  }
1725 #endif /* !__MSDOS__ */
1726 
1727  /* Using a target environment for 'shell' loses in cases like:
1728  export var = $(shell echo foobie)
1729  bad := $(var)
1730  because target_environment hits a loop trying to expand $(var) to put it
1731  in the environment. This is even more confusing when 'var' was not
1732  explicitly exported, but just appeared in the calling environment.
1733 
1734  See Savannah bug #10593.
1735 
1736  envp = target_environment (NULL);
1737  */
1738 
1739  envp = environ;
1740 
1741  /* Set up the output in case the shell writes something. */
1742  output_start ();
1743 
1744  errfd = (output_context && output_context->err >= 0
1746 
1747 #if defined(__MSDOS__)
1748  fpipe = msdos_openpipe (pipedes, &pid, argv[0]);
1749  if (pipedes[0] < 0)
1750  {
1751  OS (error, reading_file, "pipe: %s", strerror (errno));
1752  pid = -1;
1753  goto done;
1754  }
1755 
1756 #elif defined(WINDOWS32)
1757  windows32_openpipe (pipedes, errfd, &pid, command_argv, envp);
1758  /* Restore the value of just_print_flag. */
1759  just_print_flag = j_p_f;
1760 
1761  if (pipedes[0] < 0)
1762  {
1763  /* Open of the pipe failed, mark as failed execution. */
1764  shell_completed (127, 0);
1765  OS (error, reading_file, "pipe: %s", strerror (errno));
1766  pid = -1;
1767  goto done;
1768  }
1769 
1770 #else
1771  if (pipe (pipedes) < 0)
1772  {
1773  OS (error, reading_file, "pipe: %s", strerror (errno));
1774  pid = -1;
1775  goto done;
1776  }
1777 
1778  /* Close handles that are unnecessary for the child process. */
1779  fd_noinherit (pipedes[1]);
1780  fd_noinherit (pipedes[0]);
1781 
1782  {
1783  struct childbase child;
1784  child.cmd_name = NULL;
1785  child.output.syncout = 1;
1786  child.output.out = pipedes[1];
1787  child.output.err = errfd;
1788  child.environment = envp;
1789 
1790  pid = child_execute_job (&child, 1, command_argv);
1791 
1792  free (child.cmd_name);
1793  }
1794 
1795  if (pid < 0)
1796  {
1797  shell_completed (127, 0);
1798  goto done;
1799  }
1800 #endif
1801 
1802  {
1803  char *buffer;
1804  size_t maxlen, i;
1805  int cc;
1806 
1807  /* Record the PID for reap_children. */
1809 #ifndef __MSDOS__
1811 
1812  /* Close the write side of the pipe. We test for -1, since
1813  pipedes[1] is -1 on MS-Windows, and some versions of MS
1814  libraries barf when 'close' is called with -1. */
1815  if (pipedes[1] >= 0)
1816  close (pipedes[1]);
1817 #endif
1818 
1819  /* Set up and read from the pipe. */
1820 
1821  maxlen = 200;
1822  buffer = xmalloc (maxlen + 1);
1823 
1824  /* Read from the pipe until it gets EOF. */
1825  for (i = 0; ; i += cc)
1826  {
1827  if (i == maxlen)
1828  {
1829  maxlen += 512;
1830  buffer = xrealloc (buffer, maxlen + 1);
1831  }
1832 
1833  EINTRLOOP (cc, read (pipedes[0], &buffer[i], maxlen - i));
1834  if (cc <= 0)
1835  break;
1836  }
1837  buffer[i] = '\0';
1838 
1839  /* Close the read side of the pipe. */
1840 #ifdef __MSDOS__
1841  if (fpipe)
1842  {
1843  int st = pclose (fpipe);
1844  shell_completed (st, 0);
1845  }
1846 #else
1847  (void) close (pipedes[0]);
1848 #endif
1849 
1850  /* Loop until child_handler or reap_children() sets
1851  shell_function_completed to the status of our child shell. */
1852  while (shell_function_completed == 0)
1853  reap_children (1, 0);
1854 
1855  if (batch_filename)
1856  {
1857  DB (DB_VERBOSE, (_("Cleaning up temporary batch file %s\n"),
1858  batch_filename));
1859  remove (batch_filename);
1860  free (batch_filename);
1861  }
1862  shell_function_pid = 0;
1863 
1864  /* shell_completed() will set shell_function_completed to 1 when the
1865  child dies normally, or to -1 if it dies with status 127, which is
1866  most likely an exec fail. */
1867 
1868  if (shell_function_completed == -1)
1869  {
1870  /* This likely means that the execvp failed, so we should just
1871  write the error message in the pipe from the child. */
1872  fputs (buffer, stderr);
1873  fflush (stderr);
1874  }
1875  else
1876  {
1877  /* The child finished normally. Replace all newlines in its output
1878  with spaces, and put that in the variable output buffer. */
1879  fold_newlines (buffer, &i, trim_newlines);
1880  o = variable_buffer_output (o, buffer, i);
1881  }
1882 
1883  free (buffer);
1884  }
1885 
1886  done:
1887  if (command_argv)
1888  {
1889  /* Free the storage only the child needed. */
1890  free (command_argv[0]);
1891  free (command_argv);
1892  }
1893 
1894  return o;
1895 }
1896 
1897 #else /* _AMIGA */
1898 
1899 /* Do the Amiga version of func_shell. */
1900 
1901 char *
1902 func_shell_base (char *o, char **argv, int trim_newlines)
1903 {
1904  /* Amiga can't fork nor spawn, but I can start a program with
1905  redirection of my choice. However, this means that we
1906  don't have an opportunity to reopen stdout to trap it. Thus,
1907  we save our own stdout onto a new descriptor and dup a temp
1908  file's descriptor onto our stdout temporarily. After we
1909  spawn the shell program, we dup our own stdout back to the
1910  stdout descriptor. The buffer reading is the same as above,
1911  except that we're now reading from a file. */
1912 
1913 #include <dos/dos.h>
1914 #include <proto/dos.h>
1915 
1916  BPTR child_stdout;
1917  char tmp_output[FILENAME_MAX];
1918  size_t maxlen = 200, i;
1919  int cc;
1920  char * buffer, * ptr;
1921  char ** aptr;
1922  size_t len = 0;
1923  char* batch_filename = NULL;
1924 
1925  /* Construct the argument list. */
1926  command_argv = construct_command_argv (argv[0], NULL, NULL, 0,
1927  &batch_filename);
1928  if (command_argv == 0)
1929  return o;
1930 
1931  /* Note the mktemp() is a security hole, but this only runs on Amiga.
1932  Ideally we would use get_tmpfile(), but this uses a special Open(), not
1933  fopen(), and I'm not familiar enough with the code to mess with it. */
1934  strcpy (tmp_output, "t:MakeshXXXXXXXX");
1935  mktemp (tmp_output);
1936  child_stdout = Open (tmp_output, MODE_NEWFILE);
1937 
1938  for (aptr=command_argv; *aptr; aptr++)
1939  len += strlen (*aptr) + 1;
1940 
1941  buffer = xmalloc (len + 1);
1942  ptr = buffer;
1943 
1944  for (aptr=command_argv; *aptr; aptr++)
1945  {
1946  strcpy (ptr, *aptr);
1947  ptr += strlen (ptr) + 1;
1948  *ptr ++ = ' ';
1949  *ptr = 0;
1950  }
1951 
1952  ptr[-1] = '\n';
1953 
1954  Execute (buffer, NULL, child_stdout);
1955  free (buffer);
1956 
1957  Close (child_stdout);
1958 
1959  child_stdout = Open (tmp_output, MODE_OLDFILE);
1960 
1961  buffer = xmalloc (maxlen);
1962  i = 0;
1963  do
1964  {
1965  if (i == maxlen)
1966  {
1967  maxlen += 512;
1968  buffer = xrealloc (buffer, maxlen + 1);
1969  }
1970 
1971  cc = Read (child_stdout, &buffer[i], maxlen - i);
1972  if (cc > 0)
1973  i += cc;
1974  } while (cc > 0);
1975 
1976  Close (child_stdout);
1977 
1978  fold_newlines (buffer, &i, trim_newlines);
1979  o = variable_buffer_output (o, buffer, i);
1980  free (buffer);
1981  return o;
1982 }
1983 #endif /* _AMIGA */
1984 
1985 static char *
1986 func_shell (char *o, char **argv, const char *funcname UNUSED)
1987 {
1988  return func_shell_base (o, argv, 1);
1989 }
1990 #endif /* !VMS */
1991 
1992 #ifdef EXPERIMENTAL
1993 
1994 /*
1995  equality. Return is string-boolean, i.e., the empty string is false.
1996  */
1997 static char *
1998 func_eq (char *o, char **argv, char *funcname UNUSED)
1999 {
2000  int result = ! strcmp (argv[0], argv[1]);
2001  o = variable_buffer_output (o, result ? "1" : "", result);
2002  return o;
2003 }
2004 
2005 
2006 /*
2007  string-boolean not operator.
2008  */
2009 static char *
2010 func_not (char *o, char **argv, char *funcname UNUSED)
2011 {
2012  const char *s = argv[0];
2013  int result = 0;
2014  NEXT_TOKEN (s);
2015  result = ! (*s);
2016  o = variable_buffer_output (o, result ? "1" : "", result);
2017  return o;
2018 }
2019 #endif
2020 ␌
2021 
2022 #ifdef HAVE_DOS_PATHS
2023 # ifdef __CYGWIN__
2024 # define IS_ABSOLUTE(n) ((n[0] && n[1] == ':') || STOP_SET (n[0], MAP_DIRSEP))
2025 # else
2026 # define IS_ABSOLUTE(n) (n[0] && n[1] == ':')
2027 # endif
2028 # define ROOT_LEN 3
2029 #else
2030 # define IS_ABSOLUTE(n) (n[0] == '/')
2031 # define ROOT_LEN 1
2032 #endif
2033 
2034 /* Return the absolute name of file NAME which does not contain any '.',
2035  '..' components nor any repeated path separators ('/'). */
2036 
2037 static char *
2038 abspath (const char *name, char *apath)
2039 {
2040  char *dest;
2041  const char *start, *end, *apath_limit;
2042  unsigned long root_len = ROOT_LEN;
2043 
2044  if (name[0] == '\0')
2045  return NULL;
2046 
2047  apath_limit = apath + GET_PATH_MAX;
2048 
2049  if (!IS_ABSOLUTE(name))
2050  {
2051  /* It is unlikely we would make it until here but just to make sure. */
2052  if (!starting_directory)
2053  return NULL;
2054 
2055  strcpy (apath, starting_directory);
2056 
2057 #ifdef HAVE_DOS_PATHS
2058  if (STOP_SET (name[0], MAP_DIRSEP))
2059  {
2060  if (STOP_SET (name[1], MAP_DIRSEP))
2061  {
2062  /* A UNC. Don't prepend a drive letter. */
2063  apath[0] = name[0];
2064  apath[1] = name[1];
2065  root_len = 2;
2066  }
2067  /* We have /foo, an absolute file name except for the drive
2068  letter. Assume the missing drive letter is the current
2069  drive, which we can get if we remove from starting_directory
2070  everything past the root directory. */
2071  apath[root_len] = '\0';
2072  }
2073 #endif
2074 
2075  dest = strchr (apath, '\0');
2076  }
2077  else
2078  {
2079 #if defined(__CYGWIN__) && defined(HAVE_DOS_PATHS)
2080  if (STOP_SET (name[0], MAP_DIRSEP))
2081  root_len = 1;
2082 #endif
2083  memcpy (apath, name, root_len);
2084  apath[root_len] = '\0';
2085  dest = apath + root_len;
2086  /* Get past the root, since we already copied it. */
2087  name += root_len;
2088 #ifdef HAVE_DOS_PATHS
2089  if (! STOP_SET (apath[root_len - 1], MAP_DIRSEP))
2090  {
2091  /* Convert d:foo into d:./foo and increase root_len. */
2092  apath[2] = '.';
2093  apath[3] = '/';
2094  dest++;
2095  root_len++;
2096  /* strncpy above copied one character too many. */
2097  name--;
2098  }
2099  else
2100  apath[root_len - 1] = '/'; /* make sure it's a forward slash */
2101 #endif
2102  }
2103 
2104  for (start = end = name; *start != '\0'; start = end)
2105  {
2106  size_t len;
2107 
2108  /* Skip sequence of multiple path-separators. */
2109  while (STOP_SET (*start, MAP_DIRSEP))
2110  ++start;
2111 
2112  /* Find end of path component. */
2113  for (end = start; ! STOP_SET (*end, MAP_DIRSEP|MAP_NUL); ++end)
2114  ;
2115 
2116  len = end - start;
2117 
2118  if (len == 0)
2119  break;
2120  else if (len == 1 && start[0] == '.')
2121  /* nothing */;
2122  else if (len == 2 && start[0] == '.' && start[1] == '.')
2123  {
2124  /* Back up to previous component, ignore if at root already. */
2125  if (dest > apath + root_len)
2126  for (--dest; ! STOP_SET (dest[-1], MAP_DIRSEP); --dest)
2127  ;
2128  }
2129  else
2130  {
2131  if (! STOP_SET (dest[-1], MAP_DIRSEP))
2132  *dest++ = '/';
2133 
2134  if (dest + len >= apath_limit)
2135  return NULL;
2136 
2137  dest = memcpy (dest, start, len);
2138  dest += len;
2139  *dest = '\0';
2140  }
2141  }
2142 
2143  /* Unless it is root strip trailing separator. */
2144  if (dest > apath + root_len && STOP_SET (dest[-1], MAP_DIRSEP))
2145  --dest;
2146 
2147  *dest = '\0';
2148 
2149  return apath;
2150 }
2151 
2152 
2153 static char *
2154 func_realpath (char *o, char **argv, const char *funcname UNUSED)
2155 {
2156  /* Expand the argument. */
2157  const char *p = argv[0];
2158  const char *path = 0;
2159  int doneany = 0;
2160  size_t len = 0;
2161 
2162  while ((path = find_next_token (&p, &len)) != 0)
2163  {
2164  if (len < GET_PATH_MAX)
2165  {
2166  char *rp;
2167  struct stat st;
2168  PATH_VAR (in);
2169  PATH_VAR (out);
2170 
2171  strncpy (in, path, len);
2172  in[len] = '\0';
2173 
2174 #ifdef HAVE_REALPATH
2175  ENULLLOOP (rp, realpath (in, out));
2176 # if defined _AIX
2177  /* AIX realpath() doesn't remove trailing slashes correctly. */
2178  if (rp)
2179  {
2180  char *ep = rp + strlen (rp) - 1;
2181  while (ep > rp && ep[0] == '/')
2182  *(ep--) = '\0';
2183  }
2184 # endif
2185 #else
2186  rp = abspath (in, out);
2187 #endif
2188 
2189  if (rp)
2190  {
2191  int r;
2192  EINTRLOOP (r, stat (out, &st));
2193  if (r == 0)
2194  {
2195  o = variable_buffer_output (o, out, strlen (out));
2196  o = variable_buffer_output (o, " ", 1);
2197  doneany = 1;
2198  }
2199  }
2200  }
2201  }
2202 
2203  /* Kill last space. */
2204  if (doneany)
2205  --o;
2206 
2207  return o;
2208 }
2209 
2210 static char *
2211 func_file (char *o, char **argv, const char *funcname UNUSED)
2212 {
2213  char *fn = argv[0];
2214 
2215  if (fn[0] == '>')
2216  {
2217  FILE *fp;
2218  const char *mode = "w";
2219 
2220  /* We are writing a file. */
2221  ++fn;
2222  if (fn[0] == '>')
2223  {
2224  mode = "a";
2225  ++fn;
2226  }
2227  NEXT_TOKEN (fn);
2228 
2229  if (fn[0] == '\0')
2230  O (fatal, *expanding_var, _("file: missing filename"));
2231 
2232  ENULLLOOP (fp, fopen (fn, mode));
2233  if (fp == NULL)
2234  OSS (fatal, reading_file, _("open: %s: %s"), fn, strerror (errno));
2235 
2236  if (argv[1])
2237  {
2238  size_t l = strlen (argv[1]);
2239  int nl = l == 0 || argv[1][l-1] != '\n';
2240 
2241  if (fputs (argv[1], fp) == EOF || (nl && fputc ('\n', fp) == EOF))
2242  OSS (fatal, reading_file, _("write: %s: %s"), fn, strerror (errno));
2243  }
2244  if (fclose (fp))
2245  OSS (fatal, reading_file, _("close: %s: %s"), fn, strerror (errno));
2246  }
2247  else if (fn[0] == '<')
2248  {
2249  char *preo = o;
2250  FILE *fp;
2251 
2252  ++fn;
2253  NEXT_TOKEN (fn);
2254  if (fn[0] == '\0')
2255  O (fatal, *expanding_var, _("file: missing filename"));
2256 
2257  if (argv[1])
2258  O (fatal, *expanding_var, _("file: too many arguments"));
2259 
2260  ENULLLOOP (fp, fopen (fn, "r"));
2261  if (fp == NULL)
2262  {
2263  if (errno == ENOENT)
2264  return o;
2265  OSS (fatal, reading_file, _("open: %s: %s"), fn, strerror (errno));
2266  }
2267 
2268  while (1)
2269  {
2270  char buf[1024];
2271  size_t l = fread (buf, 1, sizeof (buf), fp);
2272  if (l > 0)
2273  o = variable_buffer_output (o, buf, l);
2274 
2275  if (ferror (fp))
2276  if (errno != EINTR)
2277  OSS (fatal, reading_file, _("read: %s: %s"), fn, strerror (errno));
2278  if (feof (fp))
2279  break;
2280  }
2281  if (fclose (fp))
2282  OSS (fatal, reading_file, _("close: %s: %s"), fn, strerror (errno));
2283 
2284  /* Remove trailing newline. */
2285  if (o > preo && o[-1] == '\n')
2286  if (--o > preo && o[-1] == '\r')
2287  --o;
2288  }
2289  else
2290  OS (fatal, *expanding_var, _("file: invalid file operation: %s"), fn);
2291 
2292  return o;
2293 }
2294 
2295 static char *
2296 func_abspath (char *o, char **argv, const char *funcname UNUSED)
2297 {
2298  /* Expand the argument. */
2299  const char *p = argv[0];
2300  const char *path = 0;
2301  int doneany = 0;
2302  size_t len = 0;
2303 
2304  while ((path = find_next_token (&p, &len)) != 0)
2305  {
2306  if (len < GET_PATH_MAX)
2307  {
2308  PATH_VAR (in);
2309  PATH_VAR (out);
2310 
2311  strncpy (in, path, len);
2312  in[len] = '\0';
2313 
2314  if (abspath (in, out))
2315  {
2316  o = variable_buffer_output (o, out, strlen (out));
2317  o = variable_buffer_output (o, " ", 1);
2318  doneany = 1;
2319  }
2320  }
2321  }
2322 
2323  /* Kill last space. */
2324  if (doneany)
2325  --o;
2326 
2327  return o;
2328 }
2329 
2330 /* Lookup table for builtin functions.
2331 
2332  This doesn't have to be sorted; we use a straight lookup. We might gain
2333  some efficiency by moving most often used functions to the start of the
2334  table.
2335 
2336  If MAXIMUM_ARGS is 0, that means there is no maximum and all
2337  comma-separated values are treated as arguments.
2338 
2339  EXPAND_ARGS means that all arguments should be expanded before invocation.
2340  Functions that do namespace tricks (foreach) don't automatically expand. */
2341 
2342 static char *func_call (char *o, char **argv, const char *funcname);
2343 
2344 #define FT_ENTRY(_name, _min, _max, _exp, _func) \
2345  { { (_func) }, STRING_SIZE_TUPLE(_name), (_min), (_max), (_exp), 0 }
2346 
2347 static struct function_table_entry function_table_init[] =
2348 {
2349  /* Name MIN MAX EXP? Function */
2350  FT_ENTRY ("abspath", 0, 1, 1, func_abspath),
2351  FT_ENTRY ("addprefix", 2, 2, 1, func_addsuffix_addprefix),
2352  FT_ENTRY ("addsuffix", 2, 2, 1, func_addsuffix_addprefix),
2353  FT_ENTRY ("basename", 0, 1, 1, func_basename_dir),
2354  FT_ENTRY ("dir", 0, 1, 1, func_basename_dir),
2355  FT_ENTRY ("notdir", 0, 1, 1, func_notdir_suffix),
2356  FT_ENTRY ("subst", 3, 3, 1, func_subst),
2357  FT_ENTRY ("suffix", 0, 1, 1, func_notdir_suffix),
2358  FT_ENTRY ("filter", 2, 2, 1, func_filter_filterout),
2359  FT_ENTRY ("filter-out", 2, 2, 1, func_filter_filterout),
2360  FT_ENTRY ("findstring", 2, 2, 1, func_findstring),
2361  FT_ENTRY ("firstword", 0, 1, 1, func_firstword),
2362  FT_ENTRY ("flavor", 0, 1, 1, func_flavor),
2363  FT_ENTRY ("join", 2, 2, 1, func_join),
2364  FT_ENTRY ("lastword", 0, 1, 1, func_lastword),
2365  FT_ENTRY ("patsubst", 3, 3, 1, func_patsubst),
2366  FT_ENTRY ("realpath", 0, 1, 1, func_realpath),
2367  FT_ENTRY ("shell", 0, 1, 1, func_shell),
2368  FT_ENTRY ("sort", 0, 1, 1, func_sort),
2369  FT_ENTRY ("strip", 0, 1, 1, func_strip),
2370  FT_ENTRY ("wildcard", 0, 1, 1, func_wildcard),
2371  FT_ENTRY ("word", 2, 2, 1, func_word),
2372  FT_ENTRY ("wordlist", 3, 3, 1, func_wordlist),
2373  FT_ENTRY ("words", 0, 1, 1, func_words),
2374  FT_ENTRY ("origin", 0, 1, 1, func_origin),
2375  FT_ENTRY ("foreach", 3, 3, 0, func_foreach),
2376  FT_ENTRY ("call", 1, 0, 1, func_call),
2377  FT_ENTRY ("info", 0, 1, 1, func_error),
2378  FT_ENTRY ("error", 0, 1, 1, func_error),
2379  FT_ENTRY ("warning", 0, 1, 1, func_error),
2380  FT_ENTRY ("if", 2, 3, 0, func_if),
2381  FT_ENTRY ("or", 1, 0, 0, func_or),
2382  FT_ENTRY ("and", 1, 0, 0, func_and),
2383  FT_ENTRY ("value", 0, 1, 1, func_value),
2384  FT_ENTRY ("eval", 0, 1, 1, func_eval),
2385  FT_ENTRY ("file", 1, 2, 1, func_file),
2386 #ifdef EXPERIMENTAL
2387  FT_ENTRY ("eq", 2, 2, 1, func_eq),
2388  FT_ENTRY ("not", 0, 1, 1, func_not),
2389 #endif
2390 };
2391 
2392 #define FUNCTION_TABLE_ENTRIES (sizeof (function_table_init) / sizeof (struct function_table_entry))
2393 ␌
2394 
2395 /* These must come after the definition of function_table. */
2396 
2397 static char *
2398 expand_builtin_function (char *o, int argc, char **argv,
2399  const struct function_table_entry *entry_p)
2400 {
2401  char *p;
2402 
2403  if (argc < (int)entry_p->minimum_args)
2404  fatal (*expanding_var, strlen (entry_p->name),
2405  _("insufficient number of arguments (%d) to function '%s'"),
2406  argc, entry_p->name);
2407 
2408  /* I suppose technically some function could do something with no arguments,
2409  but so far no internal ones do, so just test it for all functions here
2410  rather than in each one. We can change it later if necessary. */
2411 
2412  if (!argc && !entry_p->alloc_fn)
2413  return o;
2414 
2415  if (!entry_p->fptr.func_ptr)
2416  OS (fatal, *expanding_var,
2417  _("unimplemented on this platform: function '%s'"), entry_p->name);
2418 
2419  if (!entry_p->alloc_fn)
2420  return entry_p->fptr.func_ptr (o, argv, entry_p->name);
2421 
2422  /* This function allocates memory and returns it to us.
2423  Write it to the variable buffer, then free it. */
2424 
2425  p = entry_p->fptr.alloc_func_ptr (entry_p->name, argc, argv);
2426  if (p)
2427  {
2428  o = variable_buffer_output (o, p, strlen (p));
2429  free (p);
2430  }
2431 
2432  return o;
2433 }
2434 
2435 /* Check for a function invocation in *STRINGP. *STRINGP points at the
2436  opening ( or { and is not null-terminated. If a function invocation
2437  is found, expand it into the buffer at *OP, updating *OP, incrementing
2438  *STRINGP past the reference and returning nonzero. If not, return zero. */
2439 
2440 int
2441 handle_function (char **op, const char **stringp)
2442 {
2443  const struct function_table_entry *entry_p;
2444  char openparen = (*stringp)[0];
2445  char closeparen = openparen == '(' ? ')' : '}';
2446  const char *beg;
2447  const char *end;
2448  int count = 0;
2449  char *abeg = NULL;
2450  char **argv, **argvp;
2451  int nargs;
2452 
2453  beg = *stringp + 1;
2454 
2455  entry_p = lookup_function (beg);
2456 
2457  if (!entry_p)
2458  return 0;
2459 
2460  /* We found a builtin function. Find the beginning of its arguments (skip
2461  whitespace after the name). */
2462 
2463  beg += entry_p->len;
2464  NEXT_TOKEN (beg);
2465 
2466  /* Find the end of the function invocation, counting nested use of
2467  whichever kind of parens we use. Since we're looking, count commas
2468  to get a rough estimate of how many arguments we might have. The
2469  count might be high, but it'll never be low. */
2470 
2471  for (nargs=1, end=beg; *end != '\0'; ++end)
2472  if (!STOP_SET (*end, MAP_VARSEP|MAP_COMMA))
2473  continue;
2474  else if (*end == ',')
2475  ++nargs;
2476  else if (*end == openparen)
2477  ++count;
2478  else if (*end == closeparen && --count < 0)
2479  break;
2480 
2481  if (count >= 0)
2482  fatal (*expanding_var, strlen (entry_p->name),
2483  _("unterminated call to function '%s': missing '%c'"),
2484  entry_p->name, closeparen);
2485 
2486  *stringp = end;
2487 
2488  /* Get some memory to store the arg pointers. */
2489  argvp = argv = alloca (sizeof (char *) * (nargs + 2));
2490 
2491  /* Chop the string into arguments, then a nul. As soon as we hit
2492  MAXIMUM_ARGS (if it's >0) assume the rest of the string is part of the
2493  last argument.
2494 
2495  If we're expanding, store pointers to the expansion of each one. If
2496  not, make a duplicate of the string and point into that, nul-terminating
2497  each argument. */
2498 
2499  if (entry_p->expand_args)
2500  {
2501  const char *p;
2502  for (p=beg, nargs=0; p <= end; ++argvp)
2503  {
2504  const char *next;
2505 
2506  ++nargs;
2507 
2508  if (nargs == entry_p->maximum_args
2509  || ((next = find_next_argument (openparen, closeparen, p, end)) == NULL))
2510  next = end;
2511 
2512  *argvp = expand_argument (p, next);
2513  p = next + 1;
2514  }
2515  }
2516  else
2517  {
2518  size_t len = end - beg;
2519  char *p, *aend;
2520 
2521  abeg = xmalloc (len+1);
2522  memcpy (abeg, beg, len);
2523  abeg[len] = '\0';
2524  aend = abeg + len;
2525 
2526  for (p=abeg, nargs=0; p <= aend; ++argvp)
2527  {
2528  char *next;
2529 
2530  ++nargs;
2531 
2532  if (nargs == entry_p->maximum_args
2533  || ((next = find_next_argument (openparen, closeparen, p, aend)) == NULL))
2534  next = aend;
2535 
2536  *argvp = p;
2537  *next = '\0';
2538  p = next + 1;
2539  }
2540  }
2541  *argvp = NULL;
2542 
2543  /* Finally! Run the function... */
2544  *op = expand_builtin_function (*op, nargs, argv, entry_p);
2545 
2546  /* Free memory. */
2547  if (entry_p->expand_args)
2548  for (argvp=argv; *argvp != 0; ++argvp)
2549  free (*argvp);
2550  else
2551  free (abeg);
2552 
2553  return 1;
2554 }
2555 ␌
2556 
2557 /* User-defined functions. Expand the first argument as either a builtin
2558  function or a make variable, in the context of the rest of the arguments
2559  assigned to $1, $2, ... $N. $0 is the name of the function. */
2560 
2561 static char *
2562 func_call (char *o, char **argv, const char *funcname UNUSED)
2563 {
2564  static int max_args = 0;
2565  char *fname;
2566  char *body;
2567  size_t flen;
2568  int i;
2569  int saved_args;
2570  const struct function_table_entry *entry_p;
2571  struct variable *v;
2572 
2573  /* Clean up the name of the variable to be invoked. */
2574  fname = next_token (argv[0]);
2575  end_of_token (fname)[0] = '\0';
2576 
2577  /* Calling nothing is a no-op */
2578  if (*fname == '\0')
2579  return o;
2580 
2581  /* Are we invoking a builtin function? */
2582 
2583  entry_p = lookup_function (fname);
2584  if (entry_p)
2585  {
2586  /* How many arguments do we have? */
2587  for (i=0; argv[i+1]; ++i)
2588  ;
2589  return expand_builtin_function (o, i, argv+1, entry_p);
2590  }
2591 
2592  /* Not a builtin, so the first argument is the name of a variable to be
2593  expanded and interpreted as a function. Find it. */
2594  flen = strlen (fname);
2595 
2596  v = lookup_variable (fname, flen);
2597 
2598  if (v == 0)
2599  warn_undefined (fname, flen);
2600 
2601  if (v == 0 || *v->value == '\0')
2602  return o;
2603 
2604  body = alloca (flen + 4);
2605  body[0] = '$';
2606  body[1] = '(';
2607  memcpy (body + 2, fname, flen);
2608  body[flen+2] = ')';
2609  body[flen+3] = '\0';
2610 
2611  /* Set up arguments $(1) .. $(N). $(0) is the function name. */
2612 
2614 
2615  for (i=0; *argv; ++i, ++argv)
2616  {
2617  char num[11];
2618 
2619  sprintf (num, "%d", i);
2621  }
2622 
2623  /* If the number of arguments we have is < max_args, it means we're inside
2624  a recursive invocation of $(call ...). Fill in the remaining arguments
2625  in the new scope with the empty value, to hide them from this
2626  invocation. */
2627 
2628  for (; i < max_args; ++i)
2629  {
2630  char num[11];
2631 
2632  sprintf (num, "%d", i);
2633  define_variable (num, strlen (num), "", o_automatic, 0);
2634  }
2635 
2636  /* Expand the body in the context of the arguments, adding the result to
2637  the variable buffer. */
2638 
2639  v->exp_count = EXP_COUNT_MAX;
2640 
2641  saved_args = max_args;
2642  max_args = i;
2643  o = variable_expand_string (o, body, flen+3);
2644  max_args = saved_args;
2645 
2646  v->exp_count = 0;
2647 
2648  pop_variable_scope ();
2649 
2650  return o + strlen (o);
2651 }
2652 
2653 void
2654 define_new_function (const floc *flocp, const char *name,
2655  unsigned int min, unsigned int max, unsigned int flags,
2657 {
2658  const char *e = name;
2659  struct function_table_entry *ent;
2660  size_t len;
2661 
2662  while (STOP_SET (*e, MAP_USERFUNC))
2663  e++;
2664  len = e - name;
2665 
2666  if (len == 0)
2667  O (fatal, flocp, _("Empty function name"));
2668  if (*name == '.' || *e != '\0')
2669  OS (fatal, flocp, _("Invalid function name: %s"), name);
2670  if (len > 255)
2671  OS (fatal, flocp, _("Function name too long: %s"), name);
2672  if (min > 255)
2673  ONS (fatal, flocp,
2674  _("Invalid minimum argument count (%u) for function %s"), min, name);
2675  if (max > 255 || (max && max < min))
2676  ONS (fatal, flocp,
2677  _("Invalid maximum argument count (%u) for function %s"), max, name);
2678 
2679  ent = xmalloc (sizeof (struct function_table_entry));
2680  ent->name = name;
2681  ent->len = (unsigned char) len;
2682  ent->minimum_args = (unsigned char) min;
2683  ent->maximum_args = (unsigned char) max;
2684  ent->expand_args = ANY_SET(flags, GMK_FUNC_NOEXPAND) ? 0 : 1;
2685  ent->alloc_fn = 1;
2686  ent->fptr.alloc_func_ptr = func;
2687 
2688  hash_insert (&function_table, ent);
2689 }
2690 
2691 void
2693 {
2698  FUNCTION_TABLE_ENTRIES, sizeof (struct function_table_entry));
2699 }
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
rp
Definition: action.c:992
int nl
Definition: afm2tfm.c:885
#define count(a)
Definition: aptex-macros.h:781
#define name
#define text(a)
Definition: aptex-macros.h:925
#define next(a)
Definition: aptex-macros.h:924
#define stop
Definition: aptex-macros.h:362
#define mode
Definition: aptex-macros.h:510
static boolean chain
Definition: aptex.h:592
char * p2
Definition: bmpfont.h:62
static double percent(cairo_time_t a, cairo_time_t b)
static int GetLastError(void)
Definition: call.c:26
@ FALSE
Definition: dd.h:101
@ TRUE
Definition: dd.h:102
#define free(a)
Definition: decNumber.cpp:310
void eval_buffer(char *buffer, const floc *floc)
#define PARSEFS_NOSTRIP
Definition: dep.h:73
#define PARSE_FILE_SEQ(_s, _t, _c, _p, _f)
Definition: dep.h:80
#define PARSEFS_EXISTS
Definition: dep.h:76
#define PARSEFS_NOCACHE
Definition: dep.h:77
int is_dir(char *buff)
Definition: dirutil.c:24
int v
Definition: dviconv.c:10
#define fopen
Definition: xxstdio.h:21
#define fread
Definition: xxstdio.h:25
#define fflush
Definition: xxstdio.h:24
#define mktemp
Definition: dvi2xx.c:3706
char * strncpy()
int strcmp()
Definition: coll.cpp:143
char * strcpy()
#define error(a)
Definition: dviinfo.c:48
void replace(char *, char *)
Definition: dvispc.c:2100
static void
Definition: fpif.c:118
#define _(String)
Definition: ftxerr18.c:64
char * patsubst_expand_pat(char *o, const char *text, const char *pattern, const char *replace, const char *pattern_percent, const char *replace_percent)
Definition: function.c:147
pid_t shell_function_pid
Definition: function.c:1461
static int shell_function_completed
Definition: function.c:1462
static char * func_error(char *o, char **argv, const char *funcname)
Definition: function.c:1114
void shell_completed(int exit_code, int exit_sig)
Definition: function.c:1465
#define IS_ABSOLUTE(n)
Definition: function.c:2030
static char * func_subst(char *o, char **argv, const char *funcname)
Definition: function.c:699
static char * string_glob(char *line)
Definition: function.c:357
static char * func_strip(char *o, char **argv, const char *funcname)
Definition: function.c:1082
static char * func_shell(char *o, char **argv, const char *funcname)
Definition: function.c:1986
static char * func_flavor(char *o, char **argv, const char *funcname)
Definition: function.c:499
static struct function_table_entry function_table_init[]
Definition: function.c:2347
static char * func_addsuffix_addprefix(char *o, char **argv, const char *funcname)
Definition: function.c:669
static char * func_origin(char *o, char **argv, const char *funcname)
Definition: function.c:459
static const struct function_table_entry * lookup_function(const char *s)
Definition: function.c:271
static char * func_and(char *o, char **argv, const char *funcname)
Definition: function.c:1338
static char * func_sort(char *o, char **argv, const char *funcname)
Definition: function.c:1165
static char * find_next_argument(char startparen, char endparen, const char *ptr, const char *end)
Definition: function.c:326
static char * func_notdir_suffix(char *o, char **argv, const char *funcname)
Definition: function.c:516
static struct hash_table function_table
Definition: function.c:70
static char * func_or(char *o, char **argv, const char *funcname)
Definition: function.c:1288
static char * func_wildcard(char *o, char **argv, const char *funcname)
Definition: function.c:1378
static char * func_foreach(char *o, char **argv, const char *funcname)
Definition: function.c:864
char * strip_whitespace(const char **begpp, const char **endpp)
Definition: function.c:760
static void fold_newlines(char *buffer, size_t *length, int trim_newlines)
Definition: function.c:1433
static char * func_word(char *o, char **argv, const char *funcname)
Definition: function.c:787
static char * func_realpath(char *o, char **argv, const char *funcname)
Definition: function.c:2154
void hash_init_function_table(void)
Definition: function.c:2692
static char * func_if(char *o, char **argv, const char *funcname)
Definition: function.c:1235
static char * func_words(char *o, char **argv, const char *funcname)
Definition: function.c:739
static char * func_findstring(char *o, char **argv, const char *funcname)
Definition: function.c:854
static char * func_firstword(char *o, char **argv, const char *funcname)
Definition: function.c:709
static char * func_filter_filterout(char *o, char **argv, const char *funcname)
Definition: function.c:951
char * func_shell_base(char *o, char **argv, int trim_newlines)
Definition: function.c:1694
void define_new_function(const floc *flocp, const char *name, unsigned int min, unsigned int max, unsigned int flags, gmk_func_ptr func)
Definition: function.c:2654
#define FUNCTION_TABLE_ENTRIES
Definition: function.c:2392
static char * func_basename_dir(char *o, char **argv, const char *funcname)
Definition: function.c:592
char * patsubst_expand(char *o, const char *text, char *pattern, char *replace)
Definition: function.c:252
static unsigned long a_word_hash_1(const void *key)
Definition: function.c:921
int pattern_matches(const char *pattern, const char *percent, const char *str)
Definition: function.c:292
static char * func_patsubst(char *o, char **argv, const char *funcname)
Definition: function.c:411
static int a_word_hash_cmp(const void *x, const void *y)
Definition: function.c:933
static char * func_eval(char *o, char **argv, const char *funcname)
Definition: function.c:1398
static char * func_value(char *o, char **argv, const char *funcname)
Definition: function.c:1417
#define ROOT_LEN
Definition: function.c:2031
static int function_table_entry_hash_cmp(const void *xv, const void *yv)
Definition: function.c:60
static char * func_call(char *o, char **argv, const char *funcname)
Definition: function.c:2562
#define FT_ENTRY(_name, _min, _max, _exp, _func)
Definition: function.c:2344
static char * abspath(const char *name, char *apath)
Definition: function.c:2038
static void check_numeric(const char *s, const char *msg)
Definition: function.c:770
static char * func_lastword(char *o, char **argv, const char *funcname)
Definition: function.c:722
static char * func_abspath(char *o, char **argv, const char *funcname)
Definition: function.c:2296
int handle_function(char **op, const char **stringp)
Definition: function.c:2441
static unsigned long function_table_entry_hash_2(const void *keyv)
Definition: function.c:53
static char * expand_builtin_function(char *o, int argc, char **argv, const struct function_table_entry *entry_p)
Definition: function.c:2398
char * subst_expand(char *o, const char *text, const char *subst, const char *replace, size_t slen, size_t rlen, int by_word)
Definition: function.c:80
static unsigned long function_table_entry_hash_1(const void *keyv)
Definition: function.c:46
static char * func_file(char *o, char **argv, const char *funcname)
Definition: function.c:2211
static unsigned long a_word_hash_2(const void *key)
Definition: function.c:927
static char * func_join(char *o, char **argv, const char *funcname)
Definition: function.c:419
static char * func_wordlist(char *o, char **argv, const char *funcname)
Definition: function.c:813
mpz_t pp
Definition: gen-psqr.c:108
#define tp
#define s
Definition: afcover.h:80
#define t
Definition: afcover.h:96
#define GMK_FUNC_NOEXPAND
Definition: gnumake.h:77
char *(* gmk_func_ptr)(const char *nm, unsigned int argc, char **argv)
Definition: gnumake.h:29
static void * xrealloc(char *oldp, unsigned size)
Definition: gsftopk.c:643
#define strchr
Definition: gsftopk.c:59
#define memcpy(d, s, n)
Definition: gsftopk.c:64
FILE * out
Definition: hbf2gf.c:286
#define slen
Definition: hpcdtoppm.c:1329
pid_t child_execute_job(struct childbase *child, int good_stdin, char **argv)
Definition: job.c:2274
void reap_children(int block, int err)
Definition: job.c:621
char ** construct_command_argv(char *line, char **restp, struct file *file, int cmd_flags, char **batch_filename)
Definition: job.c:3631
#define PATH_MAX
Definition: ftmac.c:91
#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
static FT_Error hash_insert(FT_Hashkey key, size_t data, FT_Hash hash, FT_Memory memory)
Definition: fthash.c:233
static FT_Error hash_init(FT_Hash hash, FT_Bool is_num, FT_Memory memory)
Definition: fthash.c:165
static const void * body(MD5_CTX *ctx, const void *data, unsigned long size)
Definition: md5.c:100
FT_UInt idx
Definition: cffcmap.c:135
#define EOF
Definition: afmparse.c:59
kerning y
Definition: ttdriver.c:212
signed int intptr_t
Definition: stdint.h:118
int atoi(const char *)
int errno
int num
Definition: disdvi.c:621
static unsigned char pat[8]
Definition: pkfont.c:194
#define xmalloc(size)
Definition: writet1.c:33
#define buf
#define ISDIGIT(c)
Definition: c-ctype.h:35
#define ISSPACE(c)
Definition: c-ctype.h:40
char * strstr()
#define fclose
Definition: debug.h:100
#define popen(cmd, mode)
Definition: mingw32.h:91
char ** environ
#define fileno
Definition: win32lib.h:72
#define pclose(file)
Definition: win32lib.h:271
#define alloca
Definition: win32lib.h:60
#define read
Definition: win32lib.h:88
#define O_RDONLY
Definition: win32lib.h:176
#define putenv
Definition: win32lib.h:87
#define close
Definition: win32lib.h:63
#define O_APPEND
Definition: win32lib.h:182
#define fputs
Definition: mendex.h:67
#define fprintf
Definition: mendex.h:64
static char * strerror(int errnum)
Definition: error.c:56
#define output
Definition: cpascal.h:54
#define length(c)
Definition: ctangleboot.c:65
#define dest
#define fatal
Definition: tie.c:14
int pid_t
Definition: types.h:81
int pipe()
void abort()
int remove()
char * wildcard_expansion(char *wc, char *o)
Definition: amiga.c:91
#define DB(_l, _x)
Definition: debug.h:39
#define DB_VERBOSE
Definition: debug.h:19
char * variable_buffer_output(char *ptr, const char *string, size_t length)
Definition: expand.c:56
const floc ** expanding_var
Definition: expand.c:29
void restore_variable_buffer(char *buf, size_t len)
Definition: expand.c:591
void install_variable_buffer(char **bufp, size_t *lenp)
Definition: expand.c:578
char * expand_argument(const char *str, const char *end)
Definition: expand.c:427
char * variable_expand_string(char *line, const char *string, size_t length)
Definition: expand.c:194
void hash_free(struct hash_table *ht, int free_items)
Definition: hash.c:208
void * hash_find_item(struct hash_table *ht, void *key)
Definition: hash.c:120
void hash_load(struct hash_table *ht, void *item_table, unsigned long cardinality, unsigned long size)
Definition: hash.c:68
#define return_STRING_N_HASH_2(KEY, N)
Definition: hash.h:137
#define return_STRING_N_COMPARE(X, Y, N)
Definition: hash.h:146
#define return_STRING_N_HASH_1(KEY, N)
Definition: hash.h:123
#define return_STRING_HASH_2(KEY)
Definition: hash.h:104
#define return_STRING_HASH_1(KEY)
Definition: hash.h:92
#define return_STRING_COMPARE(X, Y)
Definition: hash.h:113
char * starting_directory
Definition: main.c:509
int just_print_flag
Definition: main.c:182
#define FD_STDERR
Definition: output.h:29
void pop_variable_scope(void)
Definition: variable.c:710
struct variable * lookup_variable(char *name, size_t length)
Definition: variable.c:455
struct variable_set_list * push_new_variable_scope(void)
Definition: variable.c:691
@ o_file
Definition: variable.h:25
@ o_automatic
Definition: variable.h:29
@ o_default
Definition: variable.h:23
@ o_invalid
Definition: variable.h:30
@ o_env
Definition: variable.h:24
@ o_command
Definition: variable.h:27
@ o_env_override
Definition: variable.h:26
@ o_override
Definition: variable.h:28
#define EXP_COUNT_MAX
Definition: variable.h:49
#define define_variable(n, l, v, o, r)
Definition: variable.h:189
#define warn_undefined(n, l)
Definition: variable.h:226
#define allocated_variable_expand(line)
Definition: variable.h:125
#define define_variable_cname(n, v, o, r)
Definition: variable.h:195
#define sprintf
Definition: snprintf.c:44
#define streq(a, b)
Definition: mkg3states.c:42
#define qsort
Definition: includes.h:72
cell * list
Definition: list_routines.h:30
static luaL_Reg func[]
Definition: except.c:32
#define NILF
Definition: makeint.h:465
#define OSS(_t, _a, _f, _s1, _s2)
Definition: makeint.h:503
#define MAKE_TROUBLE
Definition: makeint.h:750
#define MAP_USERFUNC
Definition: makeint.h:407
#define ENULLLOOP(_v, _c)
Definition: makeint.h:807
#define ONS(_t, _a, _f, _n, _s)
Definition: makeint.h:512
char * next_token(char *)
Definition: misc.c:318
#define strneq(a, b, l)
Definition: makeint.h:331
#define MAP_SPACE
Definition: makeint.h:419
char * xstrndup(char *, size_t)
Definition: misc.c:247
#define STOP_SET(_v, _m)
Definition: makeint.h:447
#define MAP_NUL
Definition: makeint.h:394
char * end_of_token(char *)
Definition: misc.c:309
#define MAP_VARSEP
Definition: makeint.h:401
#define OS(_t, _a, _f, _s)
Definition: makeint.h:502
#define MAP_DOT
Definition: makeint.h:403
floc * reading_file
Definition: read.c:130
#define CSTRLEN(_s)
Definition: makeint.h:467
#define GET_PATH_MAX
Definition: makeint.h:159
#define MAP_DIRSEP
Definition: makeint.h:411
int alpha_compare(void *, void *)
Definition: misc.c:42
#define O(_t, _a, _f)
Definition: makeint.h:501
#define NEXT_TOKEN(s)
Definition: makeint.h:451
char * find_next_token(char **, size_t *)
Definition: misc.c:329
#define MAP_COMMA
Definition: makeint.h:404
char * find_percent(char *)
Definition: read.c:2463
#define ANY_SET(_v, _m)
Definition: makeint.h:391
#define UNUSED
Definition: makeint.h:237
#define EINTRLOOP(_v, _c)
Definition: makeint.h:798
#define PATH_VAR(var)
Definition: makeint.h:160
unsigned int DWORD
Definition: mktexlib.h:49
float x
Definition: cordic.py:15
string fn
Definition: fc-lang.py:335
char msg[512]
Definition: nsfix.c:80
void fd_noinherit(int)
Definition: posixos.c:479
#define min(a, b)
Definition: pbmplus.h:223
#define max(a, b)
Definition: pbmto4425.c:11
unsigned short word
Definition: picttoppm.c:64
set set set set set set set set set set set set set set set set set set set set *set set set macro pixldst op &r &cond WK op &r &cond WK op &r &cond WK else op &m &cond &ia op &r &cond WK else op &m &cond &ia elseif elseif else error unsupported base if elseif elseif else error unsupported unaligned pixldst unaligned endm macro pixst base base else pixldst base endif endm macro PF ptr
#define fp
char * fname
Definition: plain2.c:121
int r
Definition: ppmqvga.c:68
char const * words[127]
Definition: ps_tiny.c:68
void die(const char *format,...)
Definition: psutil.c:58
#define flags
static char funcname[80]
Definition: buildvm_lib.c:17
#define str(s)
Definition: sh6.c:399
ShellFileEnvironment e
Definition: sh6.c:388
static FILE * in
Definition: squeeze.c:36
char * str
Definition: function.c:945
size_t length
Definition: function.c:947
struct a_pattern * next
Definition: function.c:944
char * percent
Definition: function.c:946
struct a_word * chain
Definition: function.c:914
int matched
Definition: function.c:917
size_t length
Definition: function.c:916
char * str
Definition: function.c:915
struct a_word * next
Definition: function.c:913
Definition: utils.c:300
Definition: job.h:44
struct output output
Definition: job.h:45
char * cmd_name
Definition: job.h:45
char ** environment
Definition: job.h:45
Definition: job.h:39
Definition: makeint.h:484
Definition: function.c:32
unsigned int alloc_fn
Definition: function.c:42
unsigned char len
Definition: function.c:38
unsigned char minimum_args
Definition: function.c:39
unsigned char maximum_args
Definition: function.c:40
unsigned int expand_args
Definition: function.c:41
union function_table_entry::@242 fptr
const char * name
Definition: function.c:37
gmk_func_ptr alloc_func_ptr
Definition: function.c:35
char *(* func_ptr)(char *output, char **argv, const char *fname)
Definition: function.c:34
Definition: bdf.c:133
Definition: texview.c:48
Definition: dep.h:25
Definition: sh.h:1226
int err
Definition: output.h:20
int out
Definition: output.h:19
unsigned int syncout
Definition: output.h:21
Definition: tpic.c:45
Definition: stemdb.c:56
Definition: sed.h:100
Definition: dvips.h:235
Definition: sh.h:1782
char * value
Definition: sh.h:1784
char * value
Definition: variable.h:54
void process_register(HANDLE proc)
Definition: sub_proc.c:276
long process_begin(HANDLE proc, char **argv, char **envp, char *exec_path, char *as_user)
Definition: sub_proc.c:558
void process_cleanup(HANDLE proc)
Definition: sub_proc.c:1156
HANDLE process_init_fd(HANDLE stdinh, HANDLE stdouth, HANDLE stderrh)
Definition: sub_proc.c:455
#define FILE
Definition: t1stdio.h:34
#define feof(f)
Definition: t1stdio.h:109
#define ferror(f)
Definition: t1stdio.h:110
*job_name strlen((char *) job_name) - 4)
static signed char outputs
Definition: tex2aspc.c:75
#define key
Definition: tex2xindy.c:753
return() int(((double) *(font_tbl[cur_fnt].wtbl+(int)(*(font_tbl[cur_fnt].char_wi+(int)(ch - font_tbl[cur_fnt].char_f)% 256)))/(double)(1L<< 20)) *(double) font_tbl[cur_fnt].scale)
struct output * output_context
Definition: output.c:43
void output_start(void)
Definition: output.c:508
int pid
Definition: ttf2pfb.c:129
@ ON
Definition: ubidiimp.h:55
@ start
Definition: preamble.c:52
#define argv
Definition: xmain.c:270
#define argc
Definition: xmain.c:269
#define buffer
Definition: xmlparse.c:611
#define end(cp)
Definition: zic.c:71