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)  

texmfmp.c
Go to the documentation of this file.
1 /* texmfmp.c: Hand-coded routines for TeX or Metafont in C. Originally
2  written by Tim Morgan, drawing from other Unix ports of TeX. This is
3  a collection of miscellany, everything that's easier (or only
4  possible) to do in C.
5 
6  This file is public domain. */
7 
8 /* This file is included from, e.g., texextra.c after
9  #define EXTERN
10  #include <texd.h>
11  to instantiate data from texd.h here. The ?d.h file is what
12  #defines TeX or MF, which avoids the need for a special
13  Makefile rule. */
14 
15 #include <kpathsea/config.h>
16 #include <kpathsea/c-ctype.h>
17 #include <kpathsea/cnf.h>
18 #include <kpathsea/line.h>
19 #include <kpathsea/readable.h>
20 #include <kpathsea/variable.h>
21 #include <kpathsea/absolute.h>
22 #ifdef WIN32
23 #include <kpathsea/concatn.h>
24 #endif
25 
26 #if defined (HAVE_SYS_TIME_H)
27 #include <sys/time.h>
28 #elif defined (HAVE_SYS_TIMEB_H)
29 #include <sys/timeb.h>
30 #endif
31 #include <time.h> /* For `struct tm'. Moved here for Visual Studio 2005. */
32 
33 #if defined(__STDC__)
34 #include <locale.h>
35 #endif
36 
37 #include <signal.h> /* Catch interrupts. */
38 
39 #include <texmfmp-help.h>
40 
41 /* {tex,mf}d.h defines TeX, MF, INI, and other such symbols.
42  Unfortunately there's no way to get the banner into this code, so
43  just repeat the text. */
44 /* We also define predicates, e.g., IS_eTeX for all e-TeX like engines, so
45  the rest of this file can remain unchanged when adding a new engine. */
46 #ifdef TeX
47 #if defined(XeTeX)
48 #define IS_eTeX 1
49 #include <xetexdir/xetexextra.h>
50 #elif defined (eTeX)
51 #define IS_eTeX 1
52 #include <etexdir/etexextra.h>
53 #elif defined (pdfTeX)
54 #define IS_eTeX 1
55 #include <pdftexdir/pdftexextra.h>
56 #include <pdftexdir/ptexlib.h>
57 #elif defined (Aleph)
58 #define IS_eTeX 1
59 #include <alephdir/alephextra.h>
60 #elif defined (pTeX)
61 #define IS_pTeX 1
62 #include <ptexdir/ptexextra.h>
63 #elif defined (epTeX)
64 #define IS_eTeX 1
65 #define IS_pTeX 1
66 #include <eptexdir/eptexextra.h>
67 #elif defined (upTeX)
68 #define IS_pTeX 1
69 #define IS_upTeX 1
70 #include <uptexdir/uptexextra.h>
71 #elif defined (eupTeX)
72 #define IS_eTeX 1
73 #define IS_pTeX 1
74 #define IS_upTeX 1
75 #include <euptexdir/euptexextra.h>
76 #else
77 #define BANNER "This is TeX, Version 3.141592653"
78 #define COPYRIGHT_HOLDER "D.E. Knuth"
79 #define AUTHOR NULL
80 #define PROGRAM_HELP TEXHELP
81 #define BUG_ADDRESS "tex-k@tug.org"
82 #define DUMP_VAR TEXformatdefault
83 #define DUMP_LENGTH_VAR formatdefaultlength
84 #define DUMP_OPTION "fmt"
85 #define DUMP_EXT ".fmt"
86 #define INPUT_FORMAT kpse_tex_format
87 #define INI_PROGRAM "initex"
88 #define VIR_PROGRAM "virtex"
89 #endif
90 #define edit_var "TEXEDIT"
91 #endif /* TeX */
92 #ifdef MF
93 #if defined(MFLua)
94 #include <mfluadir/mfluaextra.h>
95 #elif defined(MFLuaJIT)
97 #else
98 #define BANNER "This is Metafont, Version 2.71828182"
99 #define COPYRIGHT_HOLDER "D.E. Knuth"
100 #define AUTHOR NULL
101 #define PROGRAM_HELP MFHELP
102 #define BUG_ADDRESS "tex-k@tug.org"
103 #define DUMP_VAR MFbasedefault
104 #define DUMP_LENGTH_VAR basedefaultlength
105 #define DUMP_OPTION "base"
106 #ifdef DOS
107 #define DUMP_EXT ".bas"
108 #else
109 #define DUMP_EXT ".base"
110 #endif
111 #define INPUT_FORMAT kpse_mf_format
112 #define INI_PROGRAM "inimf"
113 #define VIR_PROGRAM "virmf"
114 #endif
115 #define edit_var "MFEDIT"
116 #endif /* MF */
117 
118 #if !defined(IS_eTeX)
119 # define IS_eTeX 0
120 #endif
121 #if !defined(IS_pTeX)
122 # define IS_pTeX 0
123 #endif
124 #if !defined(IS_upTeX)
125 # define IS_upTeX 0
126 #endif
127 ␌
128 #if defined(__SyncTeX__)
129 /*
130  SyncTeX file name should be full path in the case where
131  --output-directory option is given.
132  Borrowed from LuaTeX.
133 */
134 #if defined(_WIN32)
135 #if defined(pdfTeX) || defined(upTeX) || defined(eupTeX) || defined(XeTeX)
136 #define W32USYNCTEX 1
137 #endif
138 #endif
139 
140 char *
141 generic_synctex_get_current_name (void)
142 {
143  char *pwdbuf, *ret;
144 #if defined(W32USYNCTEX)
145  wchar_t *wpwd;
146 #endif /* W32USYNCTEX */
147  if (!fullnameoffile) {
148  ret = xstrdup("");
149  return ret;
150  }
151  if (kpse_absolute_p(fullnameoffile, false)) {
152  return xstrdup(fullnameoffile);
153  }
154  pwdbuf = xgetcwd();
155 #if defined(W32USYNCTEX)
156  if (file_system_codepage != 0 && file_system_codepage != win32_codepage) {
157  wpwd = get_wstring_from_mbstring(win32_codepage, pwdbuf, wpwd=NULL);
158  free (pwdbuf);
159  pwdbuf = get_mbstring_from_wstring(file_system_codepage, wpwd, pwdbuf=NULL);
160  free (wpwd);
161  }
162 #endif /* W32USYNCTEX */
164  free(pwdbuf) ;
165  return ret;
166 }
167 #endif
168 
169 #ifdef _WIN32
170 #if !IS_pTeX
171 FILE *Poptr;
172 #endif
173 #undef fopen
174 #undef xfopen
175 #define fopen fsyscp_fopen
176 #define xfopen fsyscp_xfopen
177 #include <wchar.h>
178 int
179 fsyscp_stat(const char *path, struct stat *buffer)
180 {
181  wchar_t *wpath;
182  int ret;
183  wpath = get_wstring_from_mbstring(file_system_codepage,
184  path, wpath = NULL);
185  if (wpath == NULL)
186  return -1;
187  ret = _wstat(wpath, buffer);
188  free(wpath);
189  return ret;
190 }
191 #include <sys/stat.h>
192 int
193 fsyscp_dir_p(char *path)
194 {
195  struct stat stats;
196  int ret;
197 
198  ret = fsyscp_stat(path, &stats) == 0 && S_ISDIR (stats.st_mode);
199  return ret;
200 }
201 int
202 fsyscp_access(const char *path, int mode)
203 {
204  wchar_t *wpath;
205  int ret;
206  wpath = get_wstring_from_mbstring(file_system_codepage,
207  path, wpath = NULL);
208  if (wpath == NULL)
209  return -1;
210  ret = _waccess(wpath, mode);
211  free(wpath);
212  return ret;
213 }
214 #endif /* _WIN32 */
215 
216 #if defined(TeX) || (defined(MF) && defined(WIN32))
217 static int
218 Isspace (char c)
219 {
220  return (c == ' ' || c == '\t');
221 }
222 #endif /* TeX || (MF && WIN32) */
223 
224 #ifdef TeX
225 
226 /* Shell escape.
227 
228  If shellenabledp == 0, all shell escapes are forbidden.
229  If (shellenabledp == 1 && restrictedshell == 0), any command
230  is allowed for a shell escape.
231  If (shellenabledp == 1 && restrictedshell == 1), only commands
232  given in the configuration file as
233  shell_escape_commands = kpsewhich,ebb,extractbb,mpost,metafun,...
234  (no spaces between commands) in texmf.cnf are allowed for a shell
235  escape in a restricted form: command name and arguments should be
236  separated by a white space. The first word should be a command
237  name. The quotation character for an argument with spaces,
238  including a pathname, should be ". ' should not be used.
239 
240  Internally, all arguments are quoted by ' (Unix) or " (Windows)
241  before calling the system() function in order to forbid execution
242  of any embedded command.
243 
244  If the --shell-escape option is given, we set
245  shellenabledp = 1 and restrictedshell = 0, i.e., any command is allowed.
246  If the --shell-restricted option is given, we set
247  shellenabledp = 1 and restrictedshell = 1, i.e., only given cmds allowed.
248  If the --no-shell-escape option is given, we set
249  shellenabledp = -1 (and restrictedshell is irrelevant).
250  If none of these option are given, there are three cases:
251  (1) In the case where
252  shell_escape = y or
253  shell_escape = t or
254  shell_escape = 1
255  it becomes shellenabledp = 1 and restrictedshell = 0,
256  that is, any command is allowed.
257  (2) In the case where
258  shell_escape = p
259  it becomes shellenabledp = 1 and restrictedshell = 1,
260  that is, restricted shell escape is allowed.
261  (3) In all other cases, shellenabledp = 0, that is, shell
262  escape is forbidden. The value of restrictedshell is
263  irrelevant if shellenabledp == 0.
264 */
265 
266 /* cmdlist is a list of allowed commands which are given like this:
267  shell_escape_commands = kpsewhich,ebb,extractbb,mpost,metafun
268  in texmf.cnf. */
269 
270 static char **cmdlist = NULL;
271 
272 static void
273 mk_shellcmdlist (char *v)
274 {
275  char **p;
276  char *q, *r;
277  size_t n;
278 
279  q = v;
280  n = 1;
281 
282 /* analyze the variable shell_escape_commands = foo,bar,...
283  spaces before and after (,) are not allowed. */
284 
285  while ((r = strchr (q, ',')) != 0) {
286  n++;
287  q = r + 1;
288  }
289  if (*q)
290  n++;
291  cmdlist = xmalloc (n * sizeof (char *));
292  p = cmdlist;
293  q = v;
294  while ((r = strchr (q, ',')) != 0) {
295  *r = '\0';
296  *p++ = xstrdup (q);
297  q = r + 1;
298  }
299  if (*q)
300  *p++ = xstrdup (q);
301  *p = NULL;
302 }
303 
304 static void
305 init_shell_escape (void)
306 {
307  if (shellenabledp < 0) { /* --no-shell-escape on cmd line */
308  shellenabledp = 0;
309 
310  } else {
311  if (shellenabledp == 0) { /* no shell options on cmd line, check cnf */
312  char *v1 = kpse_var_value ("shell_escape");
313  if (v1) {
314  if (*v1 == 't' || *v1 == 'y' || *v1 == '1') {
315  shellenabledp = 1;
316  } else if (*v1 == 'p') {
317  shellenabledp = 1;
318  restrictedshell = 1;
319  }
320  free (v1);
321  }
322  }
323 
324  /* If shell escapes are restricted, get allowed cmds from cnf. */
325  if (shellenabledp && restrictedshell == 1) {
326  char *v2 = kpse_var_value ("shell_escape_commands");
327  if (v2) {
329  free (v2);
330  }
331  }
332  }
333 }
334 
335 #ifdef WIN32
336 #define QUOTE '"'
337 #else
338 #define QUOTE '\''
339 #endif
340 
341 #if 0
342 #ifdef WIN32
343 static int
344 char_needs_quote (int c)
345 {
346 /* special characters of cmd.exe */
347 
348  return (c == '&' || c == '|' || c == '%' || c == '<' ||
349  c == '>' || c == ';' || c == ',' || c == '(' ||
350  c == ')');
351 }
352 #endif
353 #endif
354 
355 /* return values:
356  -1 : invalid quotation of an argument
357  0 : command is not allowed
358  2 : restricted shell escape, CMD is allowed.
359 
360  We set *SAFECMD to a safely-quoted version of *CMD; this is what
361  should get executed. And we set CMDNAME to its first word; this is
362  what is checked against the shell_escape_commands list. */
363 
364 static int
365 shell_cmd_is_allowed (const char *cmd, char **safecmd, char **cmdname)
366 {
367  char **p;
368  char *buf;
369  char *c, *d;
370  const char *s;
371  int pre, spaces;
372  int allow = 0;
373 
374  /* pre == 1 means that the previous character is a white space
375  pre == 0 means that the previous character is not a white space */
376  buf = xmalloc (strlen (cmd) + 1);
377  strcpy (buf, cmd);
378  c = buf;
379  while (Isspace (*c))
380  c++;
381  d = c;
382  while (!Isspace(*d) && *d)
383  d++;
384  *d = '\0';
385 
386  /* *cmdname is the first word of the command line. For example,
387  *cmdname == "kpsewhich" for
388  \write18{kpsewhich --progname=dvipdfm --format="other text files" config}
389  */
390  *cmdname = xstrdup (c);
391  free (buf);
392 
393  /* Is *cmdname listed in a texmf.cnf vriable as
394  shell_escape_commands = foo,bar,... ? */
395  p = cmdlist;
396  if (p) {
397  while (*p) {
398  if (strcmp (*p, *cmdname) == 0) {
399  /* *cmdname is found in the list, so restricted shell escape
400  is allowed */
401  allow = 2;
402  break;
403  }
404  p++;
405  }
406  }
407  if (allow == 2) {
408  spaces = 0;
409  for (s = cmd; *s; s++) {
410  if (Isspace (*s))
411  spaces++;
412  }
413 
414  /* allocate enough memory (too much?) */
415 #ifdef WIN32
416  *safecmd = xmalloc (2 * strlen (cmd) + 3 + 2 * spaces);
417 #else
418  *safecmd = xmalloc (strlen (cmd) + 3 + 2 * spaces);
419 #endif
420 
421  /* make a safe command line *safecmd */
422  s = cmd;
423  while (Isspace (*s))
424  s++;
425  d = *safecmd;
426  while (!Isspace (*s) && *s)
427  *d++ = *s++;
428 
429  pre = 1;
430  while (*s) {
431  /* Quotation given by a user. " should always be used; we
432  transform it below. If ' is used, simply immediately
433  return a quotation error. */
434  if (*s == '\'') {
435  return -1;
436  }
437 
438  if (*s == '"') {
439  /* All arguments are quoted as 'foo' (Unix) or "foo" (Windows)
440  before calling system(). Therefore closing QUOTE is necessary
441  if the previous character is not a white space.
442  example:
443  --format="other text files" becomes
444  '--format=''other text files' (Unix)
445  "--format"="other text files" (Windows) */
446 
447  if (pre == 0) {
448 #ifdef WIN32
449  if (*(s-1) == '=') {
450  *(d-1) = QUOTE;
451  *d++ = '=';
452  } else {
453  *d++ = QUOTE;
454  }
455 #else
456  *d++ = QUOTE;
457 #endif
458  }
459  pre = 0;
460  /* output the quotation mark for the quoted argument */
461  *d++ = QUOTE;
462  s++;
463 
464  while (*s != '"') {
465  /* Illegal use of ', or closing quotation mark is missing */
466  if (*s == '\'' || *s == '\0')
467  return -1;
468 #if 0
469 /*
470  The following in WIN32 may not be necessary, because
471  all arguments are quoted.
472 */
473 #ifdef WIN32
474  if (char_needs_quote (*s))
475  *d++ = '^';
476 #endif
477 #endif
478  *d++ = *s++;
479  }
480 
481  /* Closing quotation mark will be output afterwards, so
482  we do nothing here */
483  s++;
484 
485  /* The character after the closing quotation mark
486  should be a white space or NULL */
487  if (!Isspace (*s) && *s)
488  return -1;
489 
490  /* Beginning of a usual argument */
491  } else if (pre == 1 && !Isspace (*s)) {
492  pre = 0;
493  *d++ = QUOTE;
494 #if 0
495 /*
496  The following in WIN32 may not be necessary, because
497  all arguments are quoted.
498 */
499 #ifdef WIN32
500  if (char_needs_quote (*s))
501  *d++ = '^';
502 #endif
503 #endif
504  *d++ = *s++;
505  /* Ending of a usual argument */
506 
507  } else if (pre == 0 && Isspace (*s)) {
508  pre = 1;
509  /* Closing quotation mark */
510  *d++ = QUOTE;
511  *d++ = *s++;
512  } else {
513  /* Copy a character from cmd to *safecmd. */
514 #if 0
515 /*
516  The following in WIN32 may not be necessary, because
517  all arguments are quoted.
518 */
519 #ifdef WIN32
520  if (char_needs_quote (*s))
521  *d++ = '^';
522 #endif
523 #endif
524  *d++ = *s++;
525  }
526  }
527  /* End of the command line */
528  if (pre == 0) {
529  *d++ = QUOTE;
530  }
531  *d = '\0';
532 #ifdef WIN32
533  {
534  char *p, *q, *r;
535  p = *safecmd;
536  if (strlen (p) > 2 && p[1] == ':' && !IS_DIR_SEP (p[2])) {
537  q = xmalloc (strlen (p) + 2);
538  q[0] = p[0];
539  q[1] = p[1];
540  q[2] = '/';
541  q[3] = '\0';
542  strcat (q, (p + 2));
543  free (*safecmd);
544  *safecmd = q;
545  } else if (!IS_DIR_SEP (p[0]) && !(p[1] == ':' && IS_DIR_SEP (p[2]))) {
546  p = kpse_var_value ("SELFAUTOLOC");
547  if (p) {
548  r = *safecmd;
549  while (*r && !Isspace(*r))
550  r++;
551  if (*r == '\0')
552  q = concatn ("\"", p, "/", *safecmd, "\"", NULL);
553  else {
554  *r = '\0';
555  r++;
556  while (*r && Isspace(*r))
557  r++;
558  if (*r)
559  q = concatn ("\"", p, "/", *safecmd, "\" ", r, NULL);
560  else
561  q = concatn ("\"", p, "/", *safecmd, "\"", NULL);
562  }
563  free (p);
564  free (*safecmd);
565  *safecmd = q;
566  }
567  }
568  }
569 #endif
570  }
571 
572  return allow;
573 }
574 
575 /* We should only be called with shellenabledp == 1.
576  Return value:
577  -1 if a quotation syntax error.
578  0 if CMD is not allowed; given shellenabledp==1, this is because
579  shell escapes are restricted and CMD is not allowed.
580  1 if shell escapes are not restricted, hence any command is allowed.
581  2 if shell escapes are restricted and CMD is allowed (possibly after
582  quoting). */
583 
584 #ifdef WIN32
585 #undef system
586 #define system fsyscp_system
587 #if ENABLE_PIPES
588 #undef popen
589 #define popen fsyscp_popen
590 #endif /* ENABLE_PIPES */
591 #endif /* WIN32 */
592 
593 int
594 runsystem (const char *cmd)
595 {
596  int allow = 0;
597  char *safecmd = NULL;
598  char *cmdname = NULL;
599  int status = 0;
600 
601  if (shellenabledp <= 0) {
602  return 0;
603  }
604 
605  /* If restrictedshell == 0, any command is allowed. */
606  if (restrictedshell == 0)
607  allow = 1;
608  else
609  allow = shell_cmd_is_allowed (cmd, &safecmd, &cmdname);
610 
611  if (allow == 1)
612  status = system (cmd);
613  else if (allow == 2) {
614 /*
615  command including a character '|' is not allowed in
616  restricted mode for security.
617 */
618  size_t k;
619  for (k = 0; k < strlen (safecmd); k++) {
620  if (safecmd[k] == '|')
621  return 0;
622  }
623  status = system (safecmd);
624  }
625 
626  /* Not really meaningful, but we have to manage the return value of system. */
627  if (status != 0)
628  fprintf(stderr,"system returned with code %d\n", status);
629 
630  if (safecmd)
631  free (safecmd);
632  if (cmdname)
633  free (cmdname);
634 
635  return allow;
636 }
637 #endif /* TeX */
638 
639 #if ENABLE_PIPES
640 /* Like runsystem(), the runpopen() function is called only when
641  shellenabledp == 1. Unlike runsystem(), here we write errors to
642  stderr, since we have nowhere better to use; and of course we return
643  a file handle (or NULL) instead of a status indicator. */
644 
645 static FILE *
646 runpopen (char *cmd, const char *mode)
647 {
648  FILE *f = NULL;
649  char *safecmd = NULL;
650  char *cmdname = NULL;
651  int allow;
652 
653 #ifdef WIN32
654  char *pp;
655 
656  for (pp = cmd; *pp; pp++) {
657  if (*pp == '\'') *pp = '"';
658  }
659 #endif
660 
661  /* If restrictedshell == 0, any command is allowed. */
662  if (restrictedshell == 0)
663  allow = 1;
664  else
665  allow = shell_cmd_is_allowed (cmd, &safecmd, &cmdname);
666 
667  if (allow == 1)
668  f = popen (cmd, mode);
669  else if (allow == 2)
670  f = popen (safecmd, mode);
671  else if (allow == -1)
672  fprintf (stderr, "\nrunpopen quotation error in command line: %s\n",
673  cmd);
674  else
675  fprintf (stderr, "\nrunpopen command not allowed: %s\n", cmdname);
676 
677  if (safecmd)
678  free (safecmd);
679  if (cmdname)
680  free (cmdname);
681  return f;
682 }
683 #endif /* ENABLE_PIPES */
684 ␌
685 /* The main program, etc. */
686 
687 #ifdef XeTeX
688 #include "xetexdir/XeTeX_ext.h"
689 #endif
690 
691 /* What we were invoked as and with. */
692 char **argv;
693 int argc;
694 
695 /* If the user overrides argv[0] with -progname. */
697 
698 /* Array and count of values given with --config-line. */
699 static string *user_cnf_lines = NULL;
700 static unsigned user_cnf_nlines = 0;
701 
702 /* The C version of the jobname, if given. */
704 
705 /* The filename for dynamic character translation, or NULL. */
708 
709 #if defined(TeX)
710 /* Needed for --src-specials option. */
711 static char *last_source_name;
712 static int last_lineno;
713 static boolean srcspecialsoption = false;
714 static void parse_src_specials_option (const_string);
715 #endif
716 
717 /* Parsing a first %&-line in the input file. */
718 static void parse_first_line (const_string);
719 
720 /* Parse option flags. */
721 static void parse_options (int, string *);
722 
723 /* Try to figure out if we have been given a filename. */
724 static string get_input_file_name (void);
725 
726 /* Get a true/false value for a variable from texmf.cnf and the
727  environment. Not static because we call it from tex.ch. */
728 
729 boolean
731 {
732  string value = kpse_var_value (var);
733  return value && (*value == 't' || *value == 'y' || *value == '1');
734 }
735 
736 #ifdef pdfTeX
737 const char *ptexbanner = BANNER;
738 #endif
739 
740 #ifdef WIN32
741 /* forward declaration */
742 static string
744 #endif /* WIN32 */
745 
746 /* maininit, called from main() - this is most of the main routine,
747  including our C-level option handling and concomitant kpse setup.
748  The original TeX/MF code for handling first lines is still live, and
749  we set up for that in `topenin' (which is called from the .web). */
750 
751 void
752 maininit (int ac, string *av)
753 {
754  string main_input_file;
755 #if (IS_upTeX || defined(XeTeX) || defined(pdfTeX)) && defined(WIN32)
756  string enc;
757 #endif
758  /* Save to pass along to topenin. */
759  argc = ac;
760  argv = av;
761 
762  /* Must be initialized before options are parsed. */
763  interactionoption = 4;
764 
765  /* Have things to record as we go along. */
768 
769 #if defined(__SyncTeX__)
770  /* 0 means "disable Synchronize TeXnology".
771  synctexoption is a *.web variable.
772  We initialize it to a weird value to catch the -synctex command line flag.
773  At runtime, if synctexoption is not INT_MAX, then it contains the
774  command line option provided; otherwise, no such option was given
775  by the user. */
776 # define SYNCTEX_NO_OPTION INT_MAX
778 #endif
779 
780 #if IS_pTeX
781  kpse_set_program_name (argv[0], NULL);
782  initkanji ();
783 #endif
784 #if (defined(XeTeX) || defined(pdfTeX)) && defined(WIN32)
785  kpse_set_program_name (argv[0], NULL);
786 #endif
787 #if (IS_upTeX || defined(XeTeX) || defined(pdfTeX)) && defined(WIN32)
788 /*
789  -cnf-line=command_line_encoding=value cannot give effect because
790  command_line_encoding is read here before parsing the command
791  line. So we add the following.
792 */
793  { /* support old compilers which are incompatible with C99 */
794  int n;
795  for (n = 1; n < ac; n++) {
796  if (!strncasecmp (av[n], "-cnf-line=command_line_encoding=", 32)) {
797  putenv (av[n] + 10);
798  break;
799  }
800  if (!strncasecmp (av[n], "--cnf-line=command_line_encoding=", 33)) {
801  putenv (av[n] + 11);
802  break;
803  }
804  if (n < ac - 1 && (!strncasecmp (av[n], "-cnf-line", 9) ||
805  !strncasecmp (av[n], "--cnf-line", 10)) &&
806  !strncasecmp (av[n+1], "command_line_encoding=", 22)) {
807  putenv (av[n+1]);
808  break;
809  }
810  }
811  }
812  enc = kpse_var_value("command_line_encoding");
813  get_command_line_args_utf8(enc, &argc, &argv);
814 #endif
815 #if IS_pTeX && !IS_upTeX && !defined(WIN32)
817 #endif
818 
819  /* If the user says --help or --version, we need to notice early. And
820  since we want the --ini option, have to do it before getting into
821  the web (which would read the base file, etc.). */
822 #if ((IS_upTeX || defined(XeTeX) || defined(pdfTeX)) && defined(WIN32)) || (IS_pTeX && !IS_upTeX && !defined(WIN32))
824 #else
825  parse_options (ac, av);
826 #endif
827 
828 #if IS_pTeX || ((defined(XeTeX) || defined(pdfTeX)) && defined(WIN32))
829  /* In pTeX and friends, or in WIN32, texmf.cnf is not recorded in
830  the case of --recorder, because parse_options() is executed
831  after the start of kpathsea due to special initializations.
832  Therefore we record texmf.cnf here. */
833  if (recorder_enabled) {
834  string *p = kpse_find_file_generic ("texmf.cnf", kpse_cnf_format, 0, 1);
835  if (p && *p) {
836  string *pp = p;
837  while (*p) {
839  free (*p);
840  p++;
841  }
842  free (pp);
843  }
844  }
845 #endif /* IS_pTeX || (...) */
846 
847  /* If -progname was not specified, default to the dump name. */
848  if (!user_progname)
850 
851  /* Do this early so we can inspect kpse_invocation_name and
852  kpse_program_name below, and because we have to do this before
853  any path searching. */
854 #if IS_pTeX || ((defined(XeTeX) || defined(pdfTeX)) && defined(WIN32))
855  if (user_progname)
856  kpse_reset_program_name (user_progname);
857 #else
858  kpse_set_program_name (argv[0], user_progname);
859 #endif
860 
861 #if defined(MF)
862 #if defined(MFLua)
863  /* Reset mf*-nowin program names. */
864  if (strncasecmp (kpse_invocation_name, "mflua-nowin", 11) == 0)
865  kpse_reset_program_name ("mflua");
866 #elif defined(MFLuaJIT)
867  if (strncasecmp (kpse_invocation_name, "mfluajit-nowin", 14) == 0)
868  kpse_reset_program_name ("mfluajit");
869 #else
870  if (strncasecmp (kpse_invocation_name, "mf-nowin", 8) == 0)
871  kpse_reset_program_name ("mf");
872 #endif
873 #endif
874 
875  /* Make the given engine name available in the variable `engine'. */
876  xputenv ("engine", TEXMFENGINENAME);
877 
878  if (user_cnf_lines) {
879  unsigned i;
880  for (i = 0; i < user_cnf_nlines; i++) {
881  /* debug printf ("ucnf%d: %s\n", i, user_cnf_lines[i]); */
883  free (user_cnf_lines[i]);
884  }
885  }
886 
887  /* Were we given a simple filename? */
888  main_input_file = get_input_file_name ();
889 
890 #ifdef WIN32
891  if (main_input_file == NULL) {
892  string name;
893 #ifndef XeTeX
894  boolean quoted;
895 #endif
896 
897  name = argv[argc-1];
898  if (name && name[0] != '-' && name[0] != '&' && name[0] != '\\') {
899  if (strlen (name) > 2 && isalpha (name[0]) && name[1] == ':' &&
900  name[2] == '\\') {
901  string pp;
902  for (pp = name; *pp; pp++) {
903  if (IS_KANJI (pp))
904  pp++;
905  else if (*pp == '\\')
906  *pp = '/';
907  }
908  }
909  name = normalize_quotes(argv[argc-1], "argument");
910 #ifdef XeTeX
911  main_input_file = kpse_find_file(argv[argc-1], INPUT_FORMAT, false);
912  argv[argc-1] = name;
913 #else
914  quoted = (name[0] == '"');
915  if (quoted) {
916  /* Overwrite last quote and skip first quote. */
917  name[strlen(name)-1] = '\0';
918  name++;
919  }
920  main_input_file = kpse_find_file(name, INPUT_FORMAT, false);
921  if (quoted) {
922  /* Undo modifications */
923  name[strlen(name)] = '"';
924  name--;
925  }
926  argv[argc-1] = name;
927 #endif
928  }
929  }
930 #endif /* WIN32 */
931 
932  /* Second chance to activate file:line:error style messages, this
933  time from texmf.cnf. */
934  if (filelineerrorstylep < 0) {
936  } else if (!filelineerrorstylep) {
937  filelineerrorstylep = texmf_yesno ("file_line_error_style");
938  }
939 
940  /* If no dump default yet, and we're not doing anything special on
941  this run, we may want to look at the first line of the main input
942  file for a %&<dumpname> specifier. */
943  if (parsefirstlinep < 0) {
944  parsefirstlinep = 0;
945  } else if (!parsefirstlinep) {
946  parsefirstlinep = texmf_yesno ("parse_first_line");
947  }
949  parse_first_line (main_input_file);
950  }
951  /* Check whether there still is no translate_filename known. If so,
952  use the default_translate_filename. */
953  if (!translate_filename) {
955  }
956  /* If we're preloaded, I guess everything is set up. I don't really
957  know any more, it's been so long since anyone truly preloaded. We
958  still use the word "preloaded" in the messages, though (via the
959  original .web sources), at Knuth's request. */
960  if (readyalready != 314159) {
961  /* The `ini_version' variable is declared/used in the change files. */
962  boolean virversion = false;
964  iniversion = true;
966  virversion = true;
967 #ifdef TeX
968  } else if (FILESTRCASEEQ (kpse_program_name, "initex")) {
969  iniversion = true;
970  } else if (FILESTRCASEEQ (kpse_program_name, "virtex")) {
971  virversion = true;
972 #ifndef Aleph
973  } else if (FILESTRCASEEQ (kpse_program_name, "mltex")) {
974  mltexp = true;
975 #endif /* !Aleph */
976 #endif /* TeX */
977  }
978 
979  /* If run like `tex \&foo', reasonable to guess "foo" as the fmt name. */
980  if (!main_input_file) {
981  if (argv[1] && *argv[1] == '&') {
982  dump_name = argv[1] + 1;
983  }
984  }
985 
986  if (!dump_name) {
987  /* If called as *vir{mf,tex,mpost} use `plain'. Otherwise, use the
988  name we were invoked under as our best guess. */
989  dump_name = (virversion ? "plain" : kpse_program_name);
990  }
991  }
992 
993 #ifdef TeX
994  /* Sanity check: -mltex, -enc, -etex only work in combination with -ini. */
995  if (!iniversion) {
996 #if !defined(Aleph)
997  if (mltexp) {
998  fprintf(stderr, "-mltex only works with -ini\n");
999  }
1000 #if !defined(XeTeX) && !IS_pTeX
1001  if (enctexp) {
1002  fprintf(stderr, "-enc only works with -ini\n");
1003  }
1004 #endif
1005 #endif
1006 #if IS_eTeX
1007  if (etexp) {
1008  fprintf(stderr, "-etex only works with -ini\n");
1009  }
1010 #endif
1011  }
1012 #endif
1013 
1014  /* If we've set up the fmt/base default in any of the various ways
1015  above, also set its length. */
1016  if (dump_name) {
1017  const_string with_ext = NULL;
1018  unsigned name_len = strlen (dump_name);
1019  unsigned ext_len = strlen (DUMP_EXT);
1020 
1021  /* Provide extension if not there already. */
1022  if (name_len > ext_len
1023  && FILESTRCASEEQ (dump_name + name_len - ext_len, DUMP_EXT)) {
1024  with_ext = dump_name;
1025  } else {
1026  with_ext = concat (dump_name, DUMP_EXT);
1027  }
1028  DUMP_VAR = concat (" ", with_ext); /* adjust array for Pascal */
1030  } else {
1031  /* For dump_name to be NULL is a bug. */
1032  abort();
1033  }
1034 
1035  /* Additional initializations. No particular reason for doing them
1036  here instead of first thing in the change file; less symbols to
1037  propagate through Webc, that's all. */
1038 #ifdef MF
1039  kpse_set_program_enabled (kpse_mf_format, MAKE_TEX_MF_BY_DEFAULT,
1041  kpse_set_program_enabled (kpse_base_format, MAKE_TEX_FMT_BY_DEFAULT,
1043 #endif /* MF */
1044 #ifdef TeX
1045 #if defined (Aleph)
1046  kpse_set_program_enabled (kpse_ocp_format, MAKE_OMEGA_OCP_BY_DEFAULT,
1048  kpse_set_program_enabled (kpse_ofm_format, MAKE_OMEGA_OFM_BY_DEFAULT,
1050  kpse_set_program_enabled (kpse_tfm_format, false, kpse_src_compile);
1051 #else /* !Aleph */
1052  kpse_set_program_enabled (kpse_tfm_format, MAKE_TEX_TFM_BY_DEFAULT,
1054 #endif /* !Aleph */
1055  kpse_set_program_enabled (kpse_tex_format, MAKE_TEX_TEX_BY_DEFAULT,
1057  kpse_set_program_enabled (kpse_fmt_format, MAKE_TEX_FMT_BY_DEFAULT,
1059 
1060  init_shell_escape ();
1061 
1062  if (!outputcomment) {
1063  outputcomment = kpse_var_value ("output_comment");
1064  }
1065 #endif /* TeX */
1066 }
1067 
1068 #if defined(_MSC_VER) && _MSC_VER > 1600
1069 #include <crtdbg.h>
1070 void
1071 myInvalidParameterHandler(const wchar_t* expression,
1072  const wchar_t* function,
1073  const wchar_t* file,
1074  unsigned int line,
1075  uintptr_t pReserved)
1076 {
1077 /* After updating a compiler from Visual Studio 2010 to
1078  Visual Studio 2015, XeTeX exits with the code 0xc0000417,
1079  that means "invalid paremeter in CRT detected".
1080  Probably it is safe to ignore the error.
1081  So I use a nandler which smiply return.
1082 */
1083  return;
1084 }
1085 #endif /* defined(_MSC_VER) ... */
1086 
1087 /* main: Set up for reading the command line, which will happen in
1088  `maininit' and `topenin', then call the main body, plus
1089  special Windows/Kanji initializations. */
1090 
1091 int
1092 #if defined(DLLPROC)
1093 DLLPROC (int ac, string *av)
1094 #else
1095 main (int ac, string *av)
1096 #endif
1097 {
1098 #ifdef __EMX__
1099  _wildcard (&ac, &av);
1100  _response (&ac, &av);
1101 #endif
1102 
1103 #if defined(_MSC_VER) && _MSC_VER > 1600
1104  _invalid_parameter_handler oldHandler, newHandler;
1105  newHandler = myInvalidParameterHandler;
1106  oldHandler = _set_invalid_parameter_handler(newHandler);
1107  _CrtSetReportMode(_CRT_ASSERT, 0);
1108 #endif /* defined(_MSC_VER) ... */
1109 
1110 #ifdef WIN32
1111  av[0] = kpse_program_basename (av[0]);
1112  _setmaxstdio(2048);
1113  setmode(fileno(stdin), _O_BINARY);
1114 #endif
1115 
1116  maininit (ac, av);
1117 
1118 #ifdef WIN32
1119  if (ac > 1) {
1120  char *pp;
1121  if ((strlen(av[ac-1]) > 2) &&
1122  isalpha(av[ac-1][0]) &&
1123  (av[ac-1][1] == ':') &&
1124  (av[ac-1][2] == '\\')) {
1125  for (pp=av[ac-1]+2; *pp; pp++) {
1126  if (IS_KANJI(pp)) {
1127  pp++;
1128  continue;
1129  }
1130  if (*pp == '\\')
1131  *pp = '/';
1132  }
1133  }
1134  }
1135 #endif
1136 
1137  /* Call the real main program. */
1138  mainbody ();
1139 
1140  return EXIT_SUCCESS;
1141 }
1142 ␌
1143 /* This is supposed to ``open the terminal for input'', but what we
1144  really do is copy command line arguments into TeX's or Metafont's
1145  buffer, so they can handle them. If nothing is available, or we've
1146  been called already (and hence, argc==0), we return with
1147  `last=first'. */
1148 
1149 void
1150 topenin (void)
1151 {
1152  int i;
1153 
1154 #ifdef XeTeX
1155  static UFILE termin_file;
1156  if (termin == 0) {
1157  termin = &termin_file;
1158  termin->f = stdin;
1159  termin->savedChar = -1;
1160  termin->skipNextLF = 0;
1161  termin->encodingMode = UTF8;
1162  termin->conversionData = 0;
1163  inputfile[0] = termin;
1164  }
1165 #endif
1166 
1167  buffer[first] = 0; /* In case there are no arguments. */
1168 
1169  if (optind < argc) { /* We have command line arguments. */
1170  int k = first;
1171  for (i = optind; i < argc; i++) {
1172 #ifdef XeTeX
1173  unsigned char *ptr = (unsigned char *)&(argv[i][0]);
1174  /* need to interpret UTF8 from the command line */
1175  UInt32 rval;
1176  while ((rval = *(ptr++)) != 0) {
1177  UInt16 extraBytes = bytesFromUTF8[rval];
1178  switch (extraBytes) { /* note: code falls through cases! */
1179  case 5: rval <<= 6; if (*ptr) rval += *(ptr++);
1180  case 4: rval <<= 6; if (*ptr) rval += *(ptr++);
1181  case 3: rval <<= 6; if (*ptr) rval += *(ptr++);
1182  case 2: rval <<= 6; if (*ptr) rval += *(ptr++);
1183  case 1: rval <<= 6; if (*ptr) rval += *(ptr++);
1184  case 0: ;
1185  };
1186  rval -= offsetsFromUTF8[extraBytes];
1187  buffer[k++] = rval;
1188  }
1189 #else
1190  char *ptr = &(argv[i][0]);
1191  /* Don't use strcat, since in Aleph the buffer elements aren't
1192  single bytes. */
1193  while (*ptr) {
1194  buffer[k++] = *(ptr++);
1195  }
1196 #endif
1197  buffer[k++] = ' ';
1198  }
1199  argc = 0; /* Don't do this again. */
1200  buffer[k] = 0;
1201  }
1202 
1203  /* Find the end of the buffer. */
1204  for (last = first; buffer[last]; ++last)
1205  ;
1206 
1207  /* Make `last' be one past the last non-space character in `buffer',
1208  ignoring line terminators (but not, e.g., tabs). This is because
1209  we are supposed to treat this like a line of TeX input. Although
1210  there are pathological cases (SPC CR SPC CR) where this differs
1211  from input_line below, and from previous behavior of removing all
1212  whitespace, the simplicity of removing all trailing line terminators
1213  seems more in keeping with actual command line processing. */
1214 #define IS_SPC_OR_EOL(c) ((c) == ' ' || (c) == '\r' || (c) == '\n')
1215  for (--last; last >= first && IS_SPC_OR_EOL (buffer[last]); --last)
1216  ;
1217  last++;
1218 
1219  /* One more time, this time converting to TeX's internal character
1220  representation. */
1221 #if !defined(Aleph) && !defined(XeTeX)
1222  for (i = first; i < last; i++)
1223  buffer[i] = xord[buffer[i]];
1224 #endif
1225 }
1226 ␌
1227 /* IPC for TeX. By Tom Rokicki for the NeXT; it makes TeX ship out the
1228  DVI file in a pipe to TeXView so that the output can be displayed
1229  incrementally. Shamim Mohamed adapted it for Web2c. */
1230 #if defined (TeX) && defined (IPC)
1231 
1232 #ifdef WIN32
1233 #undef _WINSOCKAPI_
1234 #include <winsock2.h>
1235 #else
1236 #include <sys/socket.h>
1237 #include <fcntl.h>
1238 #ifndef O_NONBLOCK /* POSIX */
1239 #ifdef O_NDELAY /* BSD */
1240 #define O_NONBLOCK O_NDELAY
1241 #elif defined(O_FNDELAY) /* NeXT */
1242 #define O_NONBLOCK O_FNDELAY
1243 #else
1244 what the fcntl? cannot implement IPC without equivalent for O_NONBLOCK.
1245 #endif
1246 #endif /* no O_NONBLOCK */
1247 #endif /* !WIN32 */
1248 
1249 #ifdef WIN32
1250 # define IPC_AF AF_INET
1251 # ifndef IPC_LOCAL_HOST
1252 # define IPC_LOCAL_HOST "127.0.0.1"
1253 # define FIXED_PORT (unsigned short)4242
1254 # endif
1255 #else
1256 # define IPC_AF AF_UNIX
1257 # ifndef IPC_PIPE_NAME /* $HOME is prepended to this. */
1258 # define IPC_PIPE_NAME "/.TeXview_Pipe"
1259 # endif
1260 #endif
1261 #ifndef IPC_SERVER_CMD /* Command to run to start the server. */
1262 # ifdef WIN32
1263 # define IPC_SERVER_CMD "texview.exe"
1264 # else
1265 # define IPC_SERVER_CMD "open `which TeXview`"
1266 # endif
1267 #endif
1268 
1269 struct msg
1270 {
1271  int namelength; /* length of auxiliary data */
1272  int eof; /* new eof for dvi file */
1273 #if 0 /* see usage of struct msg below */
1274  char more_data[0]; /* where the rest of the stuff goes */
1275 #endif
1276 };
1277 
1278 static struct sockaddr *ipc_addr;
1279 static int ipc_addr_len;
1280 
1281 static int
1282 ipc_make_name (void)
1283 {
1284  if (ipc_addr_len == 0) {
1285 #ifdef WIN32
1286  unsigned long remote_addr = inet_addr(IPC_LOCAL_HOST);
1287  if (remote_addr != INADDR_NONE) {
1288  struct sockaddr_in *ipc_sin_addr = xmalloc (sizeof (struct sockaddr_in));
1289  ipc_sin_addr->sin_family = AF_INET;
1290  ipc_sin_addr->sin_addr.s_addr = remote_addr;
1291  ipc_sin_addr->sin_port = htons (FIXED_PORT);
1292  ipc_addr = ((struct sockaddr *) ipc_sin_addr);
1293  ipc_addr_len = sizeof(struct sockaddr_in);
1294  }
1295 #else
1296  string s = getenv ("HOME");
1297  if (s) {
1298  char *ipc_name;
1299  ipc_addr = xmalloc (strlen (s) + 40);
1300  ipc_addr->sa_family = 0;
1301  ipc_name = ipc_addr->sa_data;
1302  strcpy (ipc_name, s);
1303  strcat (ipc_name, IPC_PIPE_NAME);
1304  ipc_addr_len = strlen (ipc_name) + 3;
1305  }
1306 #endif
1307  }
1308  return ipc_addr_len;
1309 }
1310 
1311 static int sock = -1;
1312 
1313 #ifdef WIN32
1314 # define CLOSE_SOCKET(s) closesocket (s); WSACleanup ()
1315 #else
1316 # define CLOSE_SOCKET(s) close (s)
1317 #endif
1318 
1319 static int
1320 ipc_is_open (void)
1321 {
1322  return sock != -1;
1323 }
1324 
1325 static void
1326 ipc_open_out (void) {
1327 #ifdef WIN32
1328  struct WSAData wsaData;
1329  int nCode;
1330  unsigned long mode = 1;
1331 #endif
1332 #ifdef IPC_DEBUG
1333  fputs ("tex: Opening socket for IPC output ...\n", stderr);
1334 #endif
1335  if (sock != -1) {
1336  return;
1337  }
1338 
1339 #ifdef WIN32
1340  if ((nCode = WSAStartup(MAKEWORD(1, 1), &wsaData)) != 0) {
1341  fprintf(stderr,"WSAStartup() returned error code %d.\n", nCode);
1342  return;
1343  }
1344 #endif
1345 
1346  if (ipc_make_name () <= 0)
1347  return;
1348 
1349  sock = socket (IPC_AF, SOCK_STREAM, 0);
1350 #ifdef IPC_DEBUG
1351  if(sock != -1)
1352  fprintf(stderr, "tex: Socket handle is %d\n", sock);
1353  else
1354  fprintf(stderr, "tex: Socket is invalid.\n");
1355 #endif
1356 
1357  if (sock != -1) {
1358  if (connect (sock, ipc_addr, ipc_addr_len) != 0 ||
1359 #ifdef WIN32
1360  ioctlsocket (sock, FIONBIO, &mode) < 0
1361 #else
1362  fcntl (sock, F_SETFL, O_NONBLOCK) < 0
1363 #endif
1364  ) {
1365  CLOSE_SOCKET (sock);
1366  sock = -1;
1367 #ifdef IPC_DEBUG
1368  fputs ("tex: IPC socket cannot be connected.\n", stderr);
1369  fputs ("tex: Socket is closed.\n", stderr);
1370 #endif
1371  return;
1372  }
1373 #ifdef IPC_DEBUG
1374  fputs ("tex: Successfully opened IPC socket.\n", stderr);
1375 #endif
1376  }
1377 }
1378 
1379 static void
1380 ipc_close_out (void)
1381 {
1382 #ifdef IPC_DEBUG
1383  fputs ("tex: Closing output socket ...\n", stderr);
1384 #endif
1385  if (ipc_is_open ()) {
1386  CLOSE_SOCKET (sock);
1387  sock = -1;
1388  }
1389 }
1390 
1391 static void
1392 ipc_snd (int n, int is_eof, char *data)
1393 {
1394  struct
1395  {
1396  struct msg msg;
1397  char more_data[1024];
1398  } ourmsg;
1399 
1400  if (!ipc_is_open ()) {
1401  return;
1402  }
1403 
1404 #ifdef IPC_DEBUG
1405  fprintf(stderr, "%d\t%d\n", ourmsg.msg.namelength, ourmsg.msg.eof);
1406  fputs ("tex: Sending message to socket ...\n", stderr);
1407 #endif
1408  ourmsg.msg.namelength = n;
1409  ourmsg.msg.eof = is_eof;
1410  if (n) {
1411  strcpy (ourmsg.more_data, data);
1412  }
1413  n += sizeof (struct msg);
1414 #ifdef IPC_DEBUG
1415  fprintf(stderr, "%d\t%d\n", ourmsg.msg.namelength, ourmsg.msg.eof);
1416  fputs ("tex: Writing to socket...\n", stderr);
1417 #endif
1418 #if defined(WIN32)
1419  if (send (sock, (char *)&ourmsg, n, 0) != n) {
1420 #else
1421  if (write (sock, &ourmsg, n) != n) {
1422 #endif
1423  ipc_close_out ();
1424  }
1425 #ifdef IPC_DEBUG
1426  fputs ("tex: IPC message sent.\n", stderr);
1427 #endif
1428 }
1429 
1430 /* This routine notifies the server if there is an eof, or the filename
1431  if a new DVI file is starting. This is the routine called by TeX.
1432  Aleph defines str_start(#) as str_start_ar[# - too_big_char], with
1433  too_big_char = biggest_char + 1 = 65536 (omstr.ch). */
1434 
1435 void
1436 ipcpage (int is_eof)
1437 {
1438  static boolean begun = false;
1439  unsigned len = 0;
1440  string p = NULL;
1441 
1442  if (!begun) {
1443  string name; /* Just the filename. */
1444  string cwd = xgetcwd ();
1445 
1446  ipc_open_out ();
1447 #if !defined(Aleph)
1448  len = strstart[outputfilename + 1] - strstart[outputfilename];
1449 #else
1450  len = strstartar[outputfilename + 1 - 65536L] -
1451  strstartar[outputfilename - 65536L];
1452 #endif
1453  name = xmalloc (len + 1);
1454 #if !defined(Aleph)
1455  strncpy (name, (string)&strpool[strstart[outputfilename]], len);
1456 #else
1457  {
1458  unsigned i;
1459  for (i=0; i<len; i++)
1460  name[i] = strpool[i+strstartar[outputfilename - 65536L]];
1461  }
1462 #endif
1463  name[len] = 0;
1464 
1465  /* Have to pass whole filename to the other end, since it may have
1466  been started up and running as a daemon, e.g., as with the NeXT
1467  preview program. */
1469  free (cwd);
1470  free (name);
1471 
1472 #if defined (WIN32)
1473  { char *q;
1474  for (q = p; *q; q++) {
1475  if (*q == '\\')
1476  *q = '/';
1477  else if (IS_KANJI(q))
1478  q++;
1479  }
1480  }
1481 #endif
1482  len = strlen(p);
1483  begun = true;
1484  }
1485  ipc_snd (len, is_eof, p);
1486 
1487  if (p)
1488  free (p);
1489 }
1490 #endif /* TeX && IPC */
1491 ␌
1492 #if defined (TeX) || defined (MF)
1493  /* TCX and Aleph&Co get along like sparks and gunpowder. */
1494 #if !defined(Aleph) && !defined(XeTeX)
1495 
1496 /* Return the next number following START, setting POST to the following
1497  character, as in strtol. Issue a warning and return -1 if no number
1498  can be parsed. */
1499 
1500 static int
1501 tcx_get_num (int upb,
1502  unsigned line_count,
1503  string start,
1504  string *post)
1505 {
1506  int num = strtol (start, post, 0);
1507  assert (post && *post);
1508  if (*post == start) {
1509  /* Could not get a number. If blank line, fine. Else complain. */
1510  string p = start;
1511  while (*p && ISSPACE (*p))
1512  p++;
1513  if (*p != 0)
1514  fprintf (stderr, "%s:%d: Expected numeric constant, not `%s'.\n",
1516  num = -1;
1517  } else if (num < 0 || num > upb) {
1518  fprintf (stderr, "%s:%d: Destination charcode %d <0 or >%d.\n",
1520  num = -1;
1521  }
1522 
1523  return num;
1524 }
1525 
1526 /* Update the xchr, xord, and xprn arrays for TeX, allowing a
1527  translation table specified at runtime via an external file.
1528  Look for the character translation file FNAME along the same path as
1529  tex.pool. If no suffix in FNAME, use .tcx (don't bother trying to
1530  support extension-less names for these files). */
1531 
1532 void
1533 readtcxfile (void)
1534 {
1535  string orig_filename;
1538  }
1539  orig_filename = translate_filename;
1541  = kpse_find_file (translate_filename, kpse_web2c_format, true);
1542  if (translate_filename) {
1543  string line;
1544  unsigned line_count = 0;
1545  FILE *translate_file = xfopen (translate_filename, FOPEN_R_MODE);
1546  while ((line = read_line (translate_file))) {
1547  int first;
1548  string start2;
1549  string comment_loc = strchr (line, '%');
1550  if (comment_loc)
1551  *comment_loc = 0;
1552 
1553  line_count++;
1554 
1555  first = tcx_get_num (255, line_count, line, &start2);
1556  if (first >= 0) {
1557  string start3;
1558  int second;
1559  int printable;
1560 
1561  second = tcx_get_num (255, line_count, start2, &start3);
1562  if (second >= 0) {
1563  /* I suppose we could check for nonempty junk following the
1564  "printable" code, but let's not bother. */
1565  string extra;
1566 
1567  /* If they mention a second code, make that the internal number. */
1568  xord[first] = second;
1569  xchr[second] = first;
1570 
1571  printable = tcx_get_num (1, line_count, start3, &extra);
1572  /* Not-a-number, may be a comment. */
1573  if (printable == -1)
1574  printable = 1;
1575  /* Don't allow the 7bit ASCII set to become unprintable. */
1576  if (32 <= second && second <= 126)
1577  printable = 1;
1578  } else {
1579  second = first; /* else make internal the same as external */
1580  /* If they mention a charcode, call it printable. */
1581  printable = 1;
1582  }
1583 
1584  xprn[second] = printable;
1585  }
1586  free (line);
1587  }
1588  xfclose(translate_file, translate_filename);
1589  } else {
1590  WARNING1 ("Could not open char translation file `%s'", orig_filename);
1591  }
1592 }
1593 #endif /* !Aleph && !XeTeX */
1594 #endif /* TeX || MF [character translation] */
1595 ␌
1596 #ifdef XeTeX /* XeTeX handles this differently, and allows odd quotes within names */
1597 static string
1599 {
1600  int quote_char = 0;
1601  boolean must_quote = false;
1602  int len = strlen(name);
1603  /* Leave room for quotes and NUL. */
1604  string ret;
1605  string p;
1606  const_string q;
1607  for (q = name; *q; q++) {
1608  if (*q == ' ') {
1609  if (!must_quote) {
1610  len += 2;
1611  must_quote = true;
1612  }
1613  }
1614  else if (*q == '\"' || *q == '\'') {
1615  must_quote = true;
1616  if (quote_char == 0)
1617  quote_char = '\"' + '\'' - *q;
1618  len += 2; /* this could sometimes add length we don't need */
1619  }
1620  }
1621  ret = xmalloc(len + 1);
1622  p = ret;
1623  if (must_quote) {
1624  if (quote_char == 0)
1625  quote_char = '\"';
1626  *p++ = quote_char;
1627  }
1628  for (q = name; *q; q++) {
1629  if (*q == quote_char) {
1630  *p++ = quote_char;
1631  quote_char = '\"' + '\'' - quote_char;
1632  *p++ = quote_char;
1633  }
1634  *p++ = *q;
1635  }
1636  if (quote_char != 0)
1637  *p++ = quote_char;
1638  *p = '\0';
1639  return ret;
1640 }
1641 #else
1642 /* Normalize quoting of filename -- that is, only quote if there is a space,
1643  and always use the quote-name-quote style. */
1644 static string
1646 {
1647  boolean quoted = false;
1648  boolean must_quote = (strchr(name, ' ') != NULL);
1649  /* Leave room for quotes and NUL. */
1650  string ret = xmalloc(strlen(name)+3);
1651  string p;
1652  const_string q;
1653  p = ret;
1654  if (must_quote)
1655  *p++ = '"';
1656  for (q = name; *q; q++) {
1657  if (*q == '"')
1658  quoted = !quoted;
1659  else
1660  *p++ = *q;
1661  }
1662  if (must_quote)
1663  *p++ = '"';
1664  *p = '\0';
1665  if (quoted) {
1666  fprintf(stderr, "! Unbalanced quotes in %s %s\n", mesg, name);
1667  uexit(1);
1668  }
1669  return ret;
1670 }
1671 #endif
1672 
1673 /* Getting the input filename. */
1674 string
1676 {
1677  string input_file_name = NULL;
1678 
1679  if (argv[optind] && argv[optind][0] != '&' && argv[optind][0] != '\\') {
1680  /* Not &format, not \input, so assume simple filename. */
1681  string name;
1682 #ifndef XeTeX
1683  boolean quoted;
1684 #endif
1685 
1686 #ifdef WIN32
1687  if (strlen (argv[optind]) > 2 && isalpha (argv[optind][0]) &&
1688  argv[optind][1] == ':' && argv[optind][2] == '\\') {
1689  char *pp;
1690  for (pp = argv[optind]; *pp; pp++) {
1691  if (*pp == '\\')
1692  *pp = '/';
1693  else if (IS_KANJI(pp))
1694  pp++;
1695  }
1696  }
1697 #endif
1698  name = normalize_quotes(argv[optind], "argument");
1699 #ifdef XeTeX
1700  input_file_name = kpse_find_file(argv[optind], INPUT_FORMAT, false);
1701 #else
1702  quoted = (name[0] == '"');
1703  if (quoted) {
1704  /* Overwrite last quote and skip first quote. */
1705  name[strlen(name)-1] = '\0';
1706  name++;
1707  }
1708  input_file_name = kpse_find_file(name, INPUT_FORMAT, false);
1709  if (quoted) {
1710  /* Undo modifications */
1711  name[strlen(name)] = '"';
1712  name--;
1713  }
1714 #endif
1715  argv[optind] = name;
1716  }
1717  return input_file_name;
1718 }
1719 ␌
1720 /* Reading the options. */
1721 
1722 /* Test whether getopt found an option ``A''.
1723  Assumes the option index is in the variable `option_index', and the
1724  option table in a variable `long_options'. */
1725 #define ARGUMENT_IS(a) STREQ (long_options[option_index].name, a)
1726 
1727 /* SunOS cc can't initialize automatic structs, so make this static. */
1728 static struct option long_options[]
1729  = { { DUMP_OPTION, 1, 0, 0 },
1730 #ifdef TeX
1731  /* Obsolete -- for backward compatibility only. */
1732  { "efmt", 1, 0, 0 },
1733 #endif
1734  { "cnf-line", 1, 0, 0 },
1735  { "help", 0, 0, 0 },
1736  { "ini", 0, &iniversion, 1 },
1737  { "interaction", 1, 0, 0 },
1738  { "halt-on-error", 0, &haltonerrorp, 1 },
1739  { "kpathsea-debug", 1, 0, 0 },
1740  { "progname", 1, 0, 0 },
1741  { "recorder", 0, &recorder_enabled, 1 },
1742  { "version", 0, 0, 0 },
1743 #ifdef TeX
1744 #ifdef IPC
1745  { "ipc", 0, &ipcon, 1 },
1746  { "ipc-start", 0, &ipcon, 2 },
1747 #endif /* IPC */
1748 #if !defined(Aleph)
1749  { "mltex", 0, &mltexp, 1 },
1750 #if !defined(XeTeX) && !IS_pTeX
1751  { "enc", 0, &enctexp, 1 },
1752 #endif
1753 #endif /* !Aleph */
1754 #if IS_eTeX
1755  { "etex", 0, &etexp, 1 },
1756 #endif
1757  { "output-comment", 1, 0, 0 },
1758 #if defined(pdfTeX)
1759  { "draftmode", 0, 0, 0 },
1760  { "output-format", 1, 0, 0 },
1761 #endif /* pdfTeX */
1762  { "shell-escape", 0, &shellenabledp, 1 },
1763  { "no-shell-escape", 0, &shellenabledp, -1 },
1764  { "enable-write18", 0, &shellenabledp, 1 },
1765  { "disable-write18", 0, &shellenabledp, -1 },
1766  { "shell-restricted", 0, 0, 0 },
1767  { "debug-format", 0, &debugformatfile, 1 },
1768  { "src-specials", 2, 0, 0 },
1769 #if defined(__SyncTeX__)
1770  /* Synchronization: just like "interaction" above */
1771  { "synctex", 1, 0, 0 },
1772 #endif
1773 #endif /* TeX */
1774 #if defined (TeX) || defined (MF)
1775  { "file-line-error-style", 0, &filelineerrorstylep, 1 },
1776  { "no-file-line-error-style", 0, &filelineerrorstylep, -1 },
1777  /* Shorter option names for the above. */
1778  { "file-line-error", 0, &filelineerrorstylep, 1 },
1779  { "no-file-line-error", 0, &filelineerrorstylep, -1 },
1780  { "jobname", 1, 0, 0 },
1781  { "output-directory", 1, 0, 0 },
1782  { "parse-first-line", 0, &parsefirstlinep, 1 },
1783  { "no-parse-first-line", 0, &parsefirstlinep, -1 },
1784 #if !defined(Aleph)
1785  { "translate-file", 1, 0, 0 },
1786  { "default-translate-file", 1, 0, 0 },
1787  { "8bit", 0, &eightbitp, 1 },
1788 #endif /* !Aleph */
1789 #if defined(XeTeX)
1790  { "no-pdf", 0, &nopdfoutput, 1 },
1791  { "output-driver", 1, 0, 0 },
1792  { "papersize", 1, 0, 0 },
1793 #endif /* XeTeX */
1794  { "mktex", 1, 0, 0 },
1795  { "no-mktex", 1, 0, 0 },
1796 #endif /* TeX or MF */
1797 #if IS_pTeX
1798 #ifdef WIN32
1799  { "guess-input-enc", 0, &infile_enc_auto, 1 },
1800  { "no-guess-input-enc", 0, &infile_enc_auto, 0 },
1801 #endif
1802  { "kanji", 1, 0, 0 },
1803  { "kanji-internal", 1, 0, 0 },
1804 #endif /* IS_pTeX */
1805  { 0, 0, 0, 0 } };
1806 
1807 static void
1808 parse_options (int argc, string *argv)
1809 {
1810  int g; /* `getopt' return code. */
1811  int option_index;
1812 
1813  for (;;) {
1815 
1816  if (g == -1) /* End of arguments, exit the loop. */
1817  break;
1818 
1819  if (g == '?') { /* Unknown option. */
1820  continue;
1821  }
1822 
1823  assert (g == 0); /* We have no short option names. */
1824 
1825  if (ARGUMENT_IS ("kpathsea-debug")) {
1826  kpathsea_debug |= atoi (optarg);
1827 
1828 #ifdef XeTeX
1829  } else if (ARGUMENT_IS ("papersize")) {
1830  papersize = optarg;
1831  } else if (ARGUMENT_IS ("output-driver")) {
1832  outputdriver = optarg;
1833 #endif
1834 
1835  } else if (ARGUMENT_IS ("progname")) {
1837 
1838  } else if (ARGUMENT_IS ("cnf-line")) {
1839  if (user_cnf_lines == NULL) {
1840  user_cnf_nlines = 1;
1841  user_cnf_lines = xmalloc (sizeof (const_string));
1842  } else {
1843  user_cnf_nlines++;
1845  user_cnf_nlines * sizeof (const_string));
1846  }
1848 
1849  } else if (ARGUMENT_IS ("jobname")) {
1850 #ifdef XeTeX
1851  c_job_name = optarg;
1852 #else
1853  c_job_name = normalize_quotes (optarg, "jobname");
1854 #endif
1855 
1856  } else if (ARGUMENT_IS (DUMP_OPTION)) {
1857  dump_name = optarg;
1858  dumpoption = true;
1859 
1860 #ifdef TeX
1861  /* For backward compatibility only. */
1862  } else if (ARGUMENT_IS ("efmt")) {
1863  dump_name = optarg;
1864  dumpoption = true;
1865 #endif
1866 
1867  } else if (ARGUMENT_IS ("output-directory")) {
1869 
1870 #ifdef TeX
1871  } else if (ARGUMENT_IS ("output-comment")) {
1872  unsigned len = strlen (optarg);
1873  if (len < 256) {
1874  outputcomment = optarg;
1875  } else {
1876  WARNING2 ("Comment truncated to 255 characters from %d. (%s)",
1877  len, optarg);
1878  outputcomment = xmalloc (256);
1879  strncpy (outputcomment, optarg, 255);
1880  outputcomment[255] = 0;
1881  }
1882 
1883 #ifdef IPC
1884  } else if (ARGUMENT_IS ("ipc-start")) {
1885  ipc_open_out ();
1886  /* Try to start up the other end if it's not already. */
1887  if (!ipc_is_open ()) {
1888 #ifdef WIN32
1889  if (_spawnlp (_P_NOWAIT, IPC_SERVER_CMD, IPC_SERVER_CMD, NULL) != -1) {
1890 #else
1891  if (system (IPC_SERVER_CMD) == 0) {
1892 #endif
1893  unsigned i;
1894  for (i = 0; i < 20 && !ipc_is_open (); i++) {
1895 #ifdef WIN32
1896  Sleep (100); /* 2000ms is too long for a simple w32 example */
1897 #else
1898  sleep (2);
1899 #endif
1900  ipc_open_out ();
1901  }
1902  }
1903  }
1904 #endif /* IPC */
1905 
1906  } else if (ARGUMENT_IS ("shell-restricted")) {
1907  shellenabledp = 1;
1908  restrictedshell = 1;
1909 
1910  } else if (ARGUMENT_IS ("src-specials")) {
1911  last_source_name = xstrdup("");
1912  /* Option `--src" without any value means `auto' mode. */
1913  if (optarg == NULL) {
1914  insertsrcspecialeverypar = true;
1915  insertsrcspecialauto = true;
1916  srcspecialsoption = true;
1917  srcspecialsp = true;
1918  } else {
1919  parse_src_specials_option(optarg);
1920  }
1921 #endif /* TeX */
1922 #if defined(pdfTeX)
1923  } else if (ARGUMENT_IS ("output-format")) {
1924  pdfoutputoption = 1;
1925  if (strcmp(optarg, "dvi") == 0) {
1926  pdfoutputvalue = 0;
1927  } else if (strcmp(optarg, "pdf") == 0) {
1928  pdfoutputvalue = 2;
1929  } else {
1930  WARNING1 ("Ignoring unknown value `%s' for --output-format", optarg);
1931  pdfoutputoption = 0;
1932  }
1933  } else if (ARGUMENT_IS ("draftmode")) {
1934  pdfdraftmodeoption = 1;
1935  pdfdraftmodevalue = 1;
1936 #endif /* pdfTeX */
1937 #if defined (TeX) || defined (MF)
1938 #if !defined(Aleph)
1939  } else if (ARGUMENT_IS ("translate-file")) {
1941  } else if (ARGUMENT_IS ("default-translate-file")) {
1943 #endif /* !Aleph */
1944  } else if (ARGUMENT_IS ("mktex")) {
1945  kpse_maketex_option (optarg, true);
1946  } else if (ARGUMENT_IS ("no-mktex")) {
1947  kpse_maketex_option (optarg, false);
1948 #endif /* TeX or MF */
1949  } else if (ARGUMENT_IS ("interaction")) {
1950  /* These numbers match @d's in *.ch */
1951  if (STREQ (optarg, "batchmode")) {
1952  interactionoption = 0;
1953  } else if (STREQ (optarg, "nonstopmode")) {
1954  interactionoption = 1;
1955  } else if (STREQ (optarg, "scrollmode")) {
1956  interactionoption = 2;
1957  } else if (STREQ (optarg, "errorstopmode")) {
1958  interactionoption = 3;
1959  } else {
1960  WARNING1 ("Ignoring unknown argument `%s' to --interaction", optarg);
1961  }
1962 #if IS_pTeX
1963  } else if (ARGUMENT_IS ("kanji")) {
1964  if (!set_enc_string (optarg, NULL)) {
1965  WARNING1 ("Ignoring unknown argument `%s' to --kanji", optarg);
1966  }
1967  } else if (ARGUMENT_IS ("kanji-internal")) {
1968  if (!set_enc_string (NULL, optarg)) {
1969  WARNING1 ("Ignoring unknown argument `%s' to --kanji-internal", optarg);
1970  }
1971 #endif
1972 
1973  } else if (ARGUMENT_IS ("help")) {
1975 
1976 #if defined(__SyncTeX__)
1977  } else if (ARGUMENT_IS ("synctex")) {
1978  /* Synchronize TeXnology: catching the command line option as a long */
1979  synctexoption = (int) strtol(optarg, NULL, 0);
1980 #endif
1981 
1982  } else if (ARGUMENT_IS ("version")) {
1983  char *versions;
1984 #if defined (pdfTeX) || defined(XeTeX)
1985  initversionstring(&versions);
1986 #else
1987  versions = NULL;
1988 #endif
1990 
1991  } /* Else it was a flag; getopt has already done the assignment. */
1992  }
1993 }
1994 
1995 #if defined(TeX)
1996 void
1997 parse_src_specials_option (const_string opt_list)
1998 {
1999  char * toklist = xstrdup(opt_list);
2000  char * tok;
2001  insertsrcspecialauto = false;
2002  tok = strtok (toklist, ", ");
2003  while (tok) {
2004  if (strcmp (tok, "everypar") == 0
2005  || strcmp (tok, "par") == 0
2006  || strcmp (tok, "auto") == 0) {
2007  insertsrcspecialauto = true;
2008  insertsrcspecialeverypar = true;
2009  } else if (strcmp (tok, "everyparend") == 0
2010  || strcmp (tok, "parend") == 0)
2011  insertsrcspecialeveryparend = true;
2012  else if (strcmp (tok, "everycr") == 0
2013  || strcmp (tok, "cr") == 0)
2014  insertsrcspecialeverycr = true;
2015  else if (strcmp (tok, "everymath") == 0
2016  || strcmp (tok, "math") == 0)
2017  insertsrcspecialeverymath = true;
2018  else if (strcmp (tok, "everyhbox") == 0
2019  || strcmp (tok, "hbox") == 0)
2020  insertsrcspecialeveryhbox = true;
2021  else if (strcmp (tok, "everyvbox") == 0
2022  || strcmp (tok, "vbox") == 0)
2023  insertsrcspecialeveryvbox = true;
2024  else if (strcmp (tok, "everydisplay") == 0
2025  || strcmp (tok, "display") == 0)
2026  insertsrcspecialeverydisplay = true;
2027  else if (strcmp (tok, "none") == 0) {
2028  /* This one allows to reset an option that could appear in texmf.cnf */
2029  insertsrcspecialauto = insertsrcspecialeverypar =
2030  insertsrcspecialeveryparend = insertsrcspecialeverycr =
2031  insertsrcspecialeverymath = insertsrcspecialeveryhbox =
2032  insertsrcspecialeveryvbox = insertsrcspecialeverydisplay = false;
2033  } else {
2034  WARNING1 ("Ignoring unknown argument `%s' to --src-specials", tok);
2035  }
2036  tok = strtok(0, ", ");
2037  }
2038  free(toklist);
2039  srcspecialsp=insertsrcspecialauto | insertsrcspecialeverypar |
2040  insertsrcspecialeveryparend | insertsrcspecialeverycr |
2041  insertsrcspecialeverymath | insertsrcspecialeveryhbox |
2042  insertsrcspecialeveryvbox | insertsrcspecialeverydisplay;
2043  srcspecialsoption = true;
2044 }
2045 #endif
2046 
2047 /* If the first thing on the command line (we use the globals `argv' and
2048  `optind') is a normal filename (i.e., does not start with `&' or
2049  `\'), and if we can open it, and if its first line is %&FORMAT, and
2050  FORMAT is a readable dump file, then set DUMP_VAR to FORMAT.
2051  Also call kpse_reset_program_name to ensure the correct paths for the
2052  format are used. */
2053 static void
2055 {
2057  if (f) {
2058  string first_line = read_line (f);
2059  xfclose (f, filename);
2060 
2061  /* We deal with the general format "%&fmt --translate-file=tcx" */
2062  /* The idea of using this format came from Wlodzimierz Bzyl
2063  <matwb@monika.univ.gda.pl> */
2064  if (first_line && first_line[0] == '%' && first_line[1] == '&') {
2065  /* Parse the first line into at most three space-separated parts. */
2066  char *s;
2067  char *part[4];
2068  int npart;
2069  char **parse;
2070 
2071  /* Here we use ISBLANK instead of IS_SPC_OR_EOL because we are
2072  parsing the whitespace-delimited %& line, not TeX input. */
2073  for (s = first_line+2; ISBLANK(*s); ++s)
2074  ;
2075  npart = 0;
2076  while (*s && npart != 3) {
2077  part[npart++] = s;
2078  while (*s && *s != ' ') s++;
2079  while (*s == ' ') *s++ = '\0';
2080  }
2081  part[npart] = NULL;
2082  parse = part;
2083  /* Look at what we've got. Very crude! */
2084  if (*parse && **parse != '-') {
2085  /* A format name */
2086  if (dump_name) {
2087  /* format already determined, do nothing. */
2088  } else {
2089  string f_name = concat (part[0], DUMP_EXT);
2090  string d_name = kpse_find_file (f_name, DUMP_FORMAT, false);
2091  if (d_name && kpse_readable_file (d_name)) {
2092  dump_name = xstrdup (part[0]);
2093  kpse_reset_program_name (dump_name);
2094  /* Tell TeX/MF/MP we have a %&name line... */
2095  dumpline = true;
2096  }
2097  free (f_name);
2098  }
2099  parse++;
2100  }
2101  /* The tcx stuff, if any. Should we support the -translate-file
2102  form as well as --translate-file? */
2103  if (*parse) {
2104  s = NULL;
2105  if (translate_filename) {
2106  /* TCX file already set, do nothing. */
2107  } else if (STREQ (*parse, "--translate-file")) {
2108  s = *(parse+1);
2109  } else if (STREQ (*parse, "-translate-file")) {
2110  s = *(parse+1);
2111  } else if (STRNEQ (*parse, "--translate-file=", 17)) {
2112  s = *parse+17;
2113  } else if (STRNEQ (*parse, "-translate-file=", 16)) {
2114  s = *parse+16;
2115  }
2116  /* Just set the name, no sanity checks here. */
2117  if (s && *s) {
2119  }
2120  }
2121  }
2122  if (first_line)
2123  free (first_line);
2124  }
2125 }
2126 ␌
2127 /*
2128  piped I/O
2129  */
2130 
2131 /* The code that implements popen() needs an array for tracking
2132  possible pipe file pointers, because these need to be
2133  closed using pclose().
2134 */
2135 
2136 #if ENABLE_PIPES
2137 
2138 #define NUM_PIPES 16
2139 
2140 static FILE *pipes [NUM_PIPES];
2141 
2142 boolean
2143 open_in_or_pipe (FILE **f_ptr, int filefmt, const_string fopen_mode)
2144 {
2145  string fname = NULL;
2146  int i; /* iterator */
2147 
2148  /* opening a read pipe is straightforward, only have to
2149  skip past the pipe symbol in the file name. filename
2150  quoting is assumed to happen elsewhere (it does :-)) */
2151 
2152  if (shellenabledp && *(nameoffile+1) == '|') {
2153  /* the user requested a pipe */
2154  *f_ptr = NULL;
2157  if (fullnameoffile)
2161  *f_ptr = runpopen(fname+1,"r");
2162  free(fname);
2163  for (i=0; i<NUM_PIPES; i++) {
2164  if (pipes[i]==NULL) {
2165  pipes[i] = *f_ptr;
2166  break;
2167  }
2168  }
2169  if (*f_ptr)
2170  setvbuf (*f_ptr,NULL,_IONBF,0);
2171 #ifdef WIN32
2172  Poptr = *f_ptr;
2173 #endif
2174 
2175  return *f_ptr != NULL;
2176  }
2177 
2178  return open_input(f_ptr,filefmt,fopen_mode) ;
2179 }
2180 
2181 #ifdef XeTeX
2182 boolean
2183 u_open_in_or_pipe(unicodefile* f, integer filefmt, const_string fopen_mode, integer mode, integer encodingData)
2184 {
2185  string fname = NULL;
2186  int i; /* iterator */
2187 
2188  /* opening a read pipe is straightforward, only have to
2189  skip past the pipe symbol in the file name. filename
2190  quoting is assumed to happen elsewhere (it does :-)) */
2191 
2192  if (shellenabledp && *(nameoffile+1) == '|') {
2193  /* the user requested a pipe */
2194  *f = malloc(sizeof(UFILE));
2195  (*f)->encodingMode = (mode == AUTO) ? UTF8 : mode;
2196  (*f)->conversionData = 0;
2197  (*f)->savedChar = -1;
2198  (*f)->skipNextLF = 0;
2199  (*f)->f = NULL;
2202  if (fullnameoffile)
2206  (*f)->f = runpopen(fname+1,"r");
2207  free(fname);
2208  for (i=0; i<NUM_PIPES; i++) {
2209  if (pipes[i]==NULL) {
2210  pipes[i] = (*f)->f;
2211  break;
2212  }
2213  }
2214  if ((*f)->f)
2215  setvbuf ((*f)->f,NULL,_IONBF,0);
2216 #ifdef WIN32
2217  Poptr = (*f)->f;
2218 #endif
2219 
2220  return (*f)->f != NULL;
2221  }
2222 
2223  return u_open_in(f, filefmt, fopen_mode, mode, encodingData);
2224 }
2225 #endif
2226 
2227 boolean
2228 open_out_or_pipe (FILE **f_ptr, const_string fopen_mode)
2229 {
2230  string fname;
2231  int i; /* iterator */
2232 
2233  /* opening a write pipe takes a little bit more work, because TeX
2234  will perhaps have appended ".tex". To avoid user confusion as
2235  much as possible, this extension is stripped only when the command
2236  is a bare word. Some small string trickery is needed to make
2237  sure the correct number of bytes is free()-d afterwards */
2238 
2239  if (shellenabledp && *(nameoffile+1) == '|') {
2240  /* the user requested a pipe */
2243  if (strchr (fname,' ')==NULL && strchr(fname,'>')==NULL) {
2244  /* mp and mf currently do not use this code, but it
2245  is better to be prepared */
2246  if (STREQ((fname+strlen(fname)-4),".tex"))
2247  *(fname+strlen(fname)-4) = 0;
2248  *f_ptr = runpopen(fname+1,"w");
2249  *(fname+strlen(fname)) = '.';
2250  } else {
2251  *f_ptr = runpopen(fname+1,"w");
2252  }
2254  free(fname);
2255 
2256  for (i=0; i<NUM_PIPES; i++) {
2257  if (pipes[i]==NULL) {
2258  pipes[i] = *f_ptr;
2259  break;
2260  }
2261  }
2262 
2263  if (*f_ptr)
2264  setvbuf(*f_ptr,NULL,_IONBF,0);
2265 
2266  return *f_ptr != NULL;
2267  }
2268 
2269  return open_output(f_ptr,fopen_mode);
2270 }
2271 
2272 
2273 void
2275 {
2276  int i; /* iterator */
2277 
2278  if (shellenabledp) {
2279  /* if this file was a pipe, pclose() it and return */
2280  for (i=0; i<NUM_PIPES; i++) {
2281  if (pipes[i] == f) {
2282  if (f) {
2283  pclose (f);
2284 #ifdef WIN32
2285  Poptr = NULL;
2286 #endif
2287  }
2288  pipes[i] = NULL;
2289  return;
2290  }
2291  }
2292  }
2293  close_file(f);
2294 }
2295 
2296 #ifdef XeTeX
2297 
2298 #include <unicode/ucnv.h>
2299 
2300 void
2301 u_close_file_or_pipe (unicodefile* f)
2302 {
2303  int i; /* iterator */
2304 
2305  if (shellenabledp) {
2306  /* if this file was a pipe, pclose() it and return */
2307  for (i=0; i<NUM_PIPES; i++) {
2308  if (pipes[i] == (*f)->f) {
2309  if ((*f)->f) {
2310  pclose ((*f)->f);
2311  if (((*f)->encodingMode == ICUMAPPING) && ((*f)->conversionData != NULL))
2312  ucnv_close((*f)->conversionData);
2313  free(*f);
2314  }
2315  pipes[i] = NULL;
2316  return;
2317  }
2318  }
2319  }
2320  close_file((*f)->f);
2321 }
2322 
2323 #endif
2324 
2325 #endif /* ENABLE_PIPES */
2326 ␌
2327 /* All our interrupt handler has to do is set TeX's or Metafont's global
2328  variable `interrupt'; then they will do everything needed. */
2329 #ifdef WIN32
2330 /* Win32 doesn't set SIGINT ... */
2331 static BOOL WINAPI
2332 catch_interrupt (DWORD arg)
2333 {
2334  switch (arg) {
2335  case CTRL_C_EVENT:
2336  case CTRL_BREAK_EVENT:
2337  interrupt = 1;
2338  return TRUE;
2339  default:
2340  /* No need to set interrupt as we are exiting anyway */
2341  return FALSE;
2342  }
2343 }
2344 #else /* not WIN32 */
2345 static RETSIGTYPE
2347 {
2348  interrupt = 1;
2349 #ifdef OS2
2350  (void) signal (SIGINT, SIG_ACK);
2351 #else
2352  (void) signal (SIGINT, catch_interrupt);
2353 #endif /* not OS2 */
2354 }
2355 #endif /* not WIN32 */
2356 
2357 #if defined(_MSC_VER)
2358 #define strtoull _strtoui64
2359 #endif
2360 
2361 static boolean start_time_set = false;
2362 static time_t start_time = 0;
2363 
2364 static boolean SOURCE_DATE_EPOCH_set = false;
2365 static boolean FORCE_SOURCE_DATE_set = false;
2366 
2368  char *source_date_epoch;
2369  unsigned long long epoch;
2370  char *endptr;
2371  if (!start_time_set) {
2372  start_time_set = true;
2373 #ifndef onlyTeX
2374  source_date_epoch = getenv("SOURCE_DATE_EPOCH");
2375  if (source_date_epoch) {
2376  errno = 0;
2377  epoch = strtoull(source_date_epoch, &endptr, 10);
2378  if (*endptr != '\0' || errno != 0) {
2379 FATAL1 ("invalid epoch-seconds-timezone value for environment variable $SOURCE_DATE_EPOCH: %s",
2380  source_date_epoch);
2381  }
2382 #if defined(_MSC_VER)
2383  if (epoch > 32535291599ULL)
2384  epoch = 32535291599ULL;
2385 #endif
2386  start_time = epoch;
2387  SOURCE_DATE_EPOCH_set = true;
2388  } else
2389 #endif /* not onlyTeX */
2390  {
2391  start_time = time((time_t *) NULL);
2392  }
2393  }
2394 }
2395 
2396 /* Besides getting the date and time here, we also set up the interrupt
2397  handler, for no particularly good reason. It's just that since the
2398  `fix_date_and_time' routine is called early on (section 1337 in TeX,
2399  ``Get the first line of input and prepare to start''), this is as
2400  good a place as any. */
2401 
2402 void
2405 {
2406  struct tm *tmptr;
2407 #ifndef onlyTeX
2408  string sde_texprim = getenv ("FORCE_SOURCE_DATE");
2409  if (sde_texprim && STREQ (sde_texprim, "1")) {
2410  init_start_time ();
2411  tmptr = gmtime (&start_time);
2412  FORCE_SOURCE_DATE_set = true;
2413  } else
2414 #endif /* not onlyTeX */
2415  {
2416  /* whether the envvar was not set (usual case) or invalid,
2417  use current time. */
2418  time_t myclock = time ((time_t *) 0);
2419  tmptr = localtime (&myclock);
2420 
2421 #ifndef onlyTeX
2422  /* warn if they gave an invalid value, empty (null string) ok. */
2423  if (sde_texprim && strlen (sde_texprim) > 0
2424  && !STREQ (sde_texprim, "0")) {
2425 WARNING1 ("invalid value (expected 0 or 1) for environment variable $FORCE_SOURCE_DATE: %s",
2426  sde_texprim);
2427  }
2428 #endif /* not onlyTeX */
2429  }
2430 
2431  *minutes = tmptr->tm_hour * 60 + tmptr->tm_min;
2432  *day = tmptr->tm_mday;
2433  *month = tmptr->tm_mon + 1;
2434  *year = tmptr->tm_year + 1900;
2435 
2436  {
2437 #ifdef SA_INTERRUPT
2438  /* Under SunOS 4.1.x, the default action after return from the
2439  signal handler is to restart the I/O if nothing has been
2440  transferred. The effect on TeX is that interrupts are ignored if
2441  we are waiting for input. The following tells the system to
2442  return EINTR from read() in this case. From ken@cs.toronto.edu. */
2443 
2444  struct sigaction a, oa;
2445 
2446  a.sa_handler = catch_interrupt;
2447  sigemptyset (&a.sa_mask);
2448  sigaddset (&a.sa_mask, SIGINT);
2449  a.sa_flags = SA_INTERRUPT;
2450  sigaction (SIGINT, &a, &oa);
2451  if (oa.sa_handler != SIG_DFL)
2452  sigaction (SIGINT, &oa, (struct sigaction *) 0);
2453 #else /* no SA_INTERRUPT */
2454 #ifdef WIN32
2455  SetConsoleCtrlHandler(catch_interrupt, TRUE);
2456 #else /* not WIN32 */
2457  RETSIGTYPE (*old_handler)(int);
2458 
2459  old_handler = signal (SIGINT, catch_interrupt);
2460  if (old_handler != SIG_DFL)
2461  signal (SIGINT, old_handler);
2462 #endif /* not WIN32 */
2463 #endif /* no SA_INTERRUPT */
2464  }
2465 }
2466 ␌
2467 #if defined(pdfTeX) || defined(epTeX) || defined(eupTeX) || defined(XeTeX)
2468 /*
2469  Getting a high resolution time.
2470  */
2471 void
2473 {
2474 #if defined (HAVE_GETTIMEOFDAY)
2475  struct timeval tv;
2476  gettimeofday(&tv, NULL);
2477  *seconds = tv.tv_sec;
2478  *micros = tv.tv_usec;
2479 #elif defined (HAVE_FTIME)
2480  struct timeb tb;
2481  ftime(&tb);
2482  *seconds = tb.time;
2483  *micros = tb.millitm*1000;
2484 #else
2485  time_t myclock = time((time_t*)NULL);
2486  *seconds = myclock;
2487  *micros = 0;
2488 #endif
2489 }
2490 #endif
2491 ␌
2492 /* Read a line of input as efficiently as possible while still looking
2493  like Pascal. We set `last' to `first' and return `false' if we get
2494  to eof. Otherwise, we return `true' and set last = first +
2495  length(line except trailing whitespace). */
2496 
2497 #ifndef XeTeX /* for XeTeX, we have a replacement function in XeTeX_ext.c */
2498 boolean
2500 {
2501  int i = EOF;
2502 
2503  /* Recognize either LF or CR as a line terminator. */
2504 #if IS_pTeX
2505  last = input_line2(f, (unsigned char *)buffer, first, bufsize, &i);
2506 #else
2507 #ifdef WIN32
2508  if (f != Poptr && fileno (f) != fileno (stdin)) {
2509  long position = ftell (f);
2510 
2511  if (position == 0L) { /* Detect and skip Byte order marks. */
2512  int k1, k2, k3, k4;
2513  k1 = getc (f);
2514 
2515  if (k1 != 0xff && k1 != 0xfe && k1 != 0xef)
2516  rewind (f);
2517  else {
2518  k2 = getc (f);
2519 
2520  if (k2 != 0xff && k2 != 0xfe && k2 != 0xbb)
2521  rewind (f);
2522  else if ((k1 == 0xff && k2 == 0xfe) || /* UTF-16(LE) */
2523  (k1 == 0xfe && k2 == 0xff)) /* UTF-16(BE) */
2524  ;
2525  else {
2526  k3 = getc (f);
2527  k4 = getc (f);
2528  if (k1 == 0xef && k2 == 0xbb && k3 == 0xbf &&
2529  k4 >= 0 && k4 <= 0x7e) /* UTF-8 */
2530  ungetc (k4, f);
2531  else
2532  rewind (f);
2533  }
2534  }
2535  }
2536  }
2537 #endif /* WIN32 */
2538  last = first;
2539  do {
2540  errno = 0; /* otherwise EINTR might wrongly persist */
2541  while (last < bufsize && (i = getc (f)) != EOF && i != '\n' && i != '\r')
2542  buffer[last++] = i;
2543 
2544  /* The story on EINTR: because we tell libc to pass interrupts
2545  through (see SA_INTERRUPT above), we have to make sure that we
2546  check for and ignore EINTR when getc reads an EOF; hence the
2547  outer do..while loop here (and a similar loop below).
2548 
2549  On the other hand, we have to make sure that we detect a real
2550  EOF. Otherwise, for example, typing CTRL-C and then CTRL-D to the
2551  ** prompt results in an infinite loop, because we
2552  (input_line) would never return false. On glibc 2.28-10 (Debian
2553  10/buster), and probably other versions, errno is evidently not
2554  cleared as a side effect of getc (and this is allowed).
2555  Therefore we clear errno before calling getc above.
2556 
2557  Original report (thread following has many irrelevant diversions):
2558  https://tug.org/pipermail/tex-k/2020-August/003297.html */
2559 
2560  } while (i == EOF && errno == EINTR);
2561 #endif /* not IS_pTeX */
2562 
2563  if (i == EOF && last == first)
2564  return false;
2565 
2566  /* We didn't get the whole line because our buffer was too small. */
2567  if (i != EOF && i != '\n' && i != '\r') {
2568  fprintf (stderr, "! Unable to read an entire line---bufsize=%u.\n",
2569  (unsigned) bufsize);
2570  fputs ("Please increase buf_size in texmf.cnf.\n", stderr);
2571  uexit (1);
2572  }
2573 
2574  buffer[last] = ' ';
2575  if (last >= maxbufstack)
2576  maxbufstack = last;
2577 
2578  /* If next char is LF of a CRLF, read it. */
2579  if (i == '\r') {
2580  while ((i = getc (f)) == EOF && errno == EINTR)
2581  ;
2582  if (i != '\n')
2583  ungetc (i, f);
2584  }
2585 
2586  /* Trim trailing space character (but not, e.g., tabs). We can't have
2587  line terminators because we stopped reading at the first \r or \n.
2588  TeX's rule is to strip only trailing spaces (and eols). David
2589  Fuchs mentions that this stripping was done to ensure portability
2590  of TeX documents given the padding with spaces on fixed-record
2591  "lines" on some systems of the time, e.g., IBM VM/CMS and OS/360. */
2592  while (last > first && buffer[last - 1] == ' ')
2593  --last;
2594 
2595  /* Don't bother using xord if we don't need to. */
2596 #if !defined(Aleph)
2597  for (i = first; i <= last; i++)
2598  buffer[i] = xord[buffer[i]];
2599 #endif
2600 
2601 #if IS_pTeX
2602  for (i = last+1; (i < last + 5 && i < bufsize) ; i++)
2603  buffer[i] = '\0';
2604 #endif
2605 
2606  return true;
2607 }
2608 #endif /* !XeTeX */
2609 ␌
2610 /* This string specifies what the `e' option does in response to an
2611  error message. */
2613 
2614 /* This procedure originally due to sjc@s1-c. TeX & Metafont call it when
2615  the user types `e' in response to an error, invoking a text editor on
2616  the erroneous source file. FNSTART is how far into FILENAME the
2617  actual filename starts; FNLENGTH is how long the filename is. */
2618 
2619 void
2621  poolpointer fnstart,
2622  integer fnlength,
2624 {
2625  char *temp, *command, *fullcmd;
2626  char c;
2627  int sdone, ddone;
2628 
2629 #ifdef WIN32
2630  char *fp, *ffp, *env, editorname[256], buffer[256];
2631  int cnt = 0;
2632  int dontchange = 0;
2633 #endif
2634 
2635  sdone = ddone = 0;
2636  filename += fnstart;
2637 
2638  /* Close any open input files, since we're going to kill the job and
2639  the editor might well want to open them for writing. On Windows,
2640  at least, that would not be allowed when the file is still open.
2641 
2642  Unfortunately, the input_file array contains both the open files
2643  that we want to close, and junk references to non-files for
2644  terminal interaction that we must not try to close. For example,
2645  consider this input sequence:
2646  \input test % contains a single line \bla, that is, any undefined cs
2647  i\bum x % insert another undefined control sequence
2648  e % invoke the editor
2649  At this point input_file will have an open file for test.tex,
2650  and a non-file for the insert. https://tex.stackexchange.com/q/552113
2651 
2652  Therefore, we have to traverse down input_stack (not input_file),
2653  looking for name_field values >17, which correspond to open
2654  files, and then the index_field value of that entry tells us the
2655  corresponding element of input_file, which is what we need to close.
2656 
2657  We test for >17 because name_field=0 means the terminal,
2658  name_field=1..16 means \openin stream n - 1,
2659  name_field=17 means an invalid stream number (for read_toks).
2660  Although ... seems like we should close any opened \openin files also.
2661  Whoever is reading this, please implement that? Sigh.
2662 
2663  Description in modules 300--304 of tex.web: "Input stacks and states."
2664 
2665  Here, we do not have to look at cur_input, the global variable
2666  which is effectively the top of input_stack, because it will always
2667  be a terminal (non-file) interaction -- the one where the user
2668  typed "e" to start the edit. */
2669  {
2670  int is_ptr; /* element of input_stack, 0 < input_ptr */
2671  for (is_ptr = 0; is_ptr < inputptr; is_ptr++) {
2672  if (inputstack[is_ptr].namefield <= 17) {
2673  ; /* fprintf (stderr, "calledit: skipped input_stack[%d], ", is_ptr);
2674  fprintf (stderr, "namefield=%d <= 17\n",
2675  inputstack[is_ptr].namefield); */
2676  } else {
2677  FILE *f;
2678  /* when name_field > 17, index_field specifies the element of
2679  the input_file array, 1 <= in_open */
2680  int if_ptr = inputstack[is_ptr].indexfield;
2681  if (if_ptr < 1 || if_ptr > inopen) {
2682  fprintf (stderr, "%s:calledit: unexpected if_ptr=%d not in range 1..%d,",
2683  argv[0], if_ptr, inopen);
2684  fprintf (stderr, "from input_stack[%d].namefield=%d\n",
2685  is_ptr, inputstack[is_ptr].namefield);
2686  exit (1);
2687  }
2688 
2689 #ifdef XeTeX
2690  f = inputfile[if_ptr]->f;
2691 #else
2692  f = inputfile[if_ptr];
2693 #endif
2694  /* fprintf (stderr,"calledit: input_stack #%d -> input_file #%d = %x\n",
2695  is_ptr, if_ptr, f); */
2696  /* Although it should never happen, if the file value happens to
2697  be zero, let's not gratuitously abort. */
2698  if (f) {
2699  xfclose (f, "inputfile");
2700  } else {
2701  fprintf (stderr, "%s:calledit: not closing unexpected zero", argv[0]);
2702  fprintf (stderr, " input_file[%d] from input_stack[%d].namefield=%d\n",
2703  if_ptr, is_ptr, inputstack[is_ptr].namefield);
2704  }
2705  } /* end name_field > 17 */
2706  } /* end for loop for input_stack */
2707  } /* end block for variable declarations */
2708 
2709  /* Replace the default with the value of the appropriate environment
2710  variable or config file value, if it's set. */
2711  temp = kpse_var_value (edit_var);
2712  if (temp != NULL)
2713  edit_value = temp;
2714 
2715  /* Construct the command string. The `11' is the maximum length an
2716  integer might be (64 bits). */
2717  command = xmalloc (strlen (edit_value) + fnlength + 11);
2718 
2719  /* So we can construct it as we go. */
2720  temp = command;
2721 
2722 #ifdef WIN32
2723  fp = editorname;
2724  if ((isalpha(*edit_value) && *(edit_value + 1) == ':'
2725  && IS_DIR_SEP (*(edit_value + 2)))
2726  || (*edit_value == '"' && isalpha(*(edit_value + 1))
2727  && *(edit_value + 2) == ':'
2728  && IS_DIR_SEP (*(edit_value + 3)))
2729  )
2730  dontchange = 1;
2731 #endif
2732 
2733  while ((c = *edit_value++) != 0)
2734  {
2735  if (c == '%')
2736  {
2737  int i;
2738  switch (c = *edit_value++)
2739  {
2740  case 'd':
2741  if (ddone)
2742  FATAL ("call_edit: `%%d' appears twice in editor command");
2743  sprintf (temp, "%ld", (long int)linenumber);
2744  while (*temp != '\0')
2745  temp++;
2746  ddone = 1;
2747  break;
2748 
2749  case 's':
2750  if (sdone)
2751  FATAL ("call_edit: `%%s' appears twice in editor command");
2752  for (i =0; i < fnlength; i++)
2753  *temp++ = Xchr (filename[i]);
2754  sdone = 1;
2755  break;
2756 
2757  case '\0':
2758  *temp++ = '%';
2759  /* Back up to the null to force termination. */
2760  edit_value--;
2761  break;
2762 
2763  default:
2764  *temp++ = '%';
2765  *temp++ = c;
2766  break;
2767  }
2768  }
2769  else {
2770 #ifdef WIN32
2771  if (dontchange)
2772  *temp++ = c;
2773  else { if(Isspace(c) && cnt == 0) {
2774  cnt++;
2775  temp = command;
2776  *temp++ = c;
2777  *fp = '\0';
2778  } else if(!Isspace(c) && cnt == 0) {
2779  *fp++ = c;
2780  } else {
2781  *temp++ = c;
2782  }
2783  }
2784 #else
2785  *temp++ = c;
2786 #endif
2787  }
2788  }
2789 
2790  *temp = 0;
2791 
2792 #ifdef WIN32
2793  if (dontchange == 0) {
2794  if(editorname[0] == '.' ||
2795  editorname[0] == '/' ||
2796  editorname[0] == '\\') {
2797  fprintf(stderr, "%s is not allowed to execute.\n", editorname);
2798  uexit(1);
2799  }
2800  env = (char *)getenv("PATH");
2801  if(SearchPath(env, editorname, ".exe", 256, buffer, &ffp)==0) {
2802  if(SearchPath(env, editorname, ".bat", 256, buffer, &ffp)==0) {
2803  fprintf(stderr, "I cannot find %s in the PATH.\n", editorname);
2804  uexit(1);
2805  }
2806  }
2807  fullcmd = (char *)xmalloc(strlen(buffer)+strlen(command)+5);
2808  strcpy(fullcmd, "\"");
2809  strcat(fullcmd, buffer);
2810  strcat(fullcmd, "\"");
2811  strcat(fullcmd, command);
2812  } else
2813 #endif
2814  fullcmd = command;
2815 
2816  /* Execute the command. */
2817  if (system (fullcmd) != 0)
2818  fprintf (stderr, "! Trouble executing `%s'.\n", command);
2819 
2820  /* Quit, since we found an error. */
2821  uexit (1);
2822 }
2823 ␌
2824 /* Read and write dump files. As distributed, these files are
2825  architecture dependent; specifically, BigEndian and LittleEndian
2826  architectures produce different files. These routines always output
2827  BigEndian files. This still does not guarantee them to be
2828  architecture-independent, because it is possible to make a format
2829  that dumps a glue ratio, i.e., a floating-point number. Fortunately,
2830  none of the standard formats do that. */
2831 
2832 #if !defined (WORDS_BIGENDIAN) && !defined (NO_DUMP_SHARE) /* this fn */
2833 
2834 /* This macro is always invoked as a statement. It assumes a variable
2835  `temp'. */
2836 
2837 #define SWAP(x, y) temp = (x); (x) = (y); (y) = temp
2838 
2839 
2840 /* Make the NITEMS items pointed at by P, each of size SIZE, be the
2841  opposite-endianness of whatever they are now. */
2842 
2843 static void
2844 swap_items (char *p, int nitems, int size)
2845 {
2846  char temp;
2847 
2848  /* Since `size' does not change, we can write a while loop for each
2849  case, and avoid testing `size' for each time. */
2850  switch (size)
2851  {
2852  /* 16-byte items happen on the DEC Alpha machine when we are not
2853  doing sharable memory dumps. */
2854  case 16:
2855  while (nitems--)
2856  {
2857  SWAP (p[0], p[15]);
2858  SWAP (p[1], p[14]);
2859  SWAP (p[2], p[13]);
2860  SWAP (p[3], p[12]);
2861  SWAP (p[4], p[11]);
2862  SWAP (p[5], p[10]);
2863  SWAP (p[6], p[9]);
2864  SWAP (p[7], p[8]);
2865  p += size;
2866  }
2867  break;
2868 
2869  case 8:
2870  while (nitems--)
2871  {
2872  SWAP (p[0], p[7]);
2873  SWAP (p[1], p[6]);
2874  SWAP (p[2], p[5]);
2875  SWAP (p[3], p[4]);
2876  p += size;
2877  }
2878  break;
2879 
2880  case 4:
2881  while (nitems--)
2882  {
2883  SWAP (p[0], p[3]);
2884  SWAP (p[1], p[2]);
2885  p += size;
2886  }
2887  break;
2888 
2889  case 2:
2890  while (nitems--)
2891  {
2892  SWAP (p[0], p[1]);
2893  p += size;
2894  }
2895  break;
2896 
2897  case 1:
2898  /* Nothing to do. */
2899  break;
2900 
2901  default:
2902  FATAL1 ("Can't swap a %d-byte item for (un)dumping", size);
2903  }
2904 }
2905 #endif /* not WORDS_BIGENDIAN and not NO_DUMP_SHARE */
2906 
2907 
2908 /* Here we write NITEMS items, each item being ITEM_SIZE bytes long.
2909  The pointer to the stuff to write is P, and we write to the file
2910  OUT_FILE. */
2911 
2912 void
2913 #ifdef FMT_COMPRESS
2914 do_dump (char *p, int item_size, int nitems, gzFile out_file)
2915 #else
2916 do_dump (char *p, int item_size, int nitems, FILE *out_file)
2917 #endif
2918 {
2919 #if !defined (WORDS_BIGENDIAN) && !defined (NO_DUMP_SHARE)
2920  swap_items (p, nitems, item_size);
2921 #endif
2922 
2923 #ifdef FMT_COMPRESS
2924  if (gzwrite (out_file, p, item_size * nitems) != item_size * nitems)
2925 #else
2926  if (fwrite (p, item_size, nitems, out_file) != nitems)
2927 #endif
2928  {
2929  fprintf (stderr, "! Could not write %d %d-byte item(s) to %s.\n",
2930  nitems, item_size, nameoffile+1);
2931  uexit (1);
2932  }
2933 
2934  /* Have to restore the old contents of memory, since some of it might
2935  get used again. */
2936 #if !defined (WORDS_BIGENDIAN) && !defined (NO_DUMP_SHARE)
2937  swap_items (p, nitems, item_size);
2938 #endif
2939 }
2940 
2941 
2942 /* Here is the dual of the writing routine. */
2943 
2944 void
2945 #ifdef FMT_COMPRESS
2946 do_undump (char *p, int item_size, int nitems, gzFile in_file)
2947 #else
2948 do_undump (char *p, int item_size, int nitems, FILE *in_file)
2949 #endif
2950 {
2951 #ifdef FMT_COMPRESS
2952  if (gzread (in_file, p, item_size * nitems) != item_size * nitems)
2953 #else
2954  if (fread (p, item_size, nitems, in_file) != (size_t) nitems)
2955 #endif
2956  FATAL3 ("Could not undump %d %d-byte item(s) from %s",
2957  nitems, item_size, nameoffile+1);
2958 
2959 #if !defined (WORDS_BIGENDIAN) && !defined (NO_DUMP_SHARE)
2960  swap_items (p, nitems, item_size);
2961 #endif
2962 }
2963 ␌
2964 /* Some (most?) of this could be moved to the WEB side, but oh well. */
2965 #if defined(TeX) || defined(MF)
2966 #if !defined(pdfTeX)
2967 static void
2968 checkpoolpointer (poolpointer poolptr, size_t len)
2969 {
2970  if (poolptr + len >= poolsize) {
2971  fprintf (stderr, "\nstring pool overflow [%i bytes]\n",
2972  (int)poolsize); /* fixme */
2973  exit(1);
2974  }
2975 }
2976 
2977 #ifndef XeTeX /* XeTeX uses this from XeTeX_ext.c */
2978 static
2979 #endif
2980 int
2982 {
2983  size_t len;
2984 #ifdef XeTeX
2985  UInt32 rval;
2986  const unsigned char *cp = (const unsigned char *)s;
2987 #endif
2988 #if defined(TeX)
2989  if (s == NULL || *s == 0)
2990  return getnullstr();
2991 #else
2992  assert (s != 0);
2993 #endif
2994  len = strlen(s);
2995  checkpoolpointer (poolptr, len); /* in the XeTeX case, this may be more than enough */
2996 #ifdef XeTeX
2997  while ((rval = *(cp++)) != 0) {
2998  UInt16 extraBytes = bytesFromUTF8[rval];
2999  switch (extraBytes) { /* note: code falls through cases! */
3000  case 5: rval <<= 6; if (*cp) rval += *(cp++);
3001  case 4: rval <<= 6; if (*cp) rval += *(cp++);
3002  case 3: rval <<= 6; if (*cp) rval += *(cp++);
3003  case 2: rval <<= 6; if (*cp) rval += *(cp++);
3004  case 1: rval <<= 6; if (*cp) rval += *(cp++);
3005  case 0: ;
3006  };
3007  rval -= offsetsFromUTF8[extraBytes];
3008  if (rval > 0xffff) {
3009  rval -= 0x10000;
3010  strpool[poolptr++] = 0xd800 + rval / 0x0400;
3011  strpool[poolptr++] = 0xdc00 + rval % 0x0400;
3012  }
3013  else
3014  strpool[poolptr++] = rval;
3015  }
3016 #else /* ! XeTeX */
3017  while (len-- > 0)
3018  strpool[poolptr++] = *s++;
3019 #endif /* ! XeTeX */
3020 
3021  return makestring();
3022 }
3023 #endif /* !pdfTeX */
3024 
3025 strnumber
3026 makefullnamestring(void)
3027 {
3028  return maketexstring(fullnameoffile);
3029 }
3030 
3031 /* Get the job name to be used, which may have been set from the
3032  command line. */
3033 strnumber
3035 {
3036  strnumber ret = name;
3037  if (c_job_name != NULL)
3039  return ret;
3040 }
3041 #endif
3042 
3043 #if defined(TeX)
3044 static int
3045 compare_paths (const_string p1, const_string p2)
3046 {
3047  int ret;
3048  while (
3049 #ifdef MONOCASE_FILENAMES
3050  (((ret = (toupper(*p1) - toupper(*p2))) == 0) && (*p2 != 0))
3051 #else
3052  (((ret = (*p1 - *p2)) == 0) && (*p2 != 0))
3053 #endif
3054  || (IS_DIR_SEP(*p1) && IS_DIR_SEP(*p2))) {
3055  p1++, p2++;
3056  }
3057  ret = (ret < 0 ? -1 : (ret > 0 ? 1 : 0));
3058  return ret;
3059 }
3060 
3061 #ifdef XeTeX /* the string pool is UTF-16 but we want a UTF-8 string */
3062 
3063 string
3064 gettexstring (strnumber s)
3065 {
3066  unsigned bytesToWrite = 0;
3067  poolpointer len, i, j;
3068  string name;
3069  if (s >= 65536L)
3070  len = strstart[s + 1 - 65536L] - strstart[s - 65536L];
3071  else
3072  len = 0;
3073  name = xmalloc(len * 3 + 1); /* max UTF16->UTF8 expansion
3074  (code units, not bytes) */
3075  for (i = 0, j = 0; i < len; i++) {
3076  unsigned c = strpool[i + strstart[s - 65536L]];
3077  if (c >= 0xD800 && c <= 0xDBFF) {
3078  unsigned lo = strpool[++i + strstart[s - 65536L]];
3079  if (lo >= 0xDC00 && lo <= 0xDFFF)
3080  c = (c - 0xD800) * 0x0400 + lo - 0xDC00;
3081  else
3082  c = 0xFFFD;
3083  }
3084  if (c < 0x80)
3085  bytesToWrite = 1;
3086  else if (c < 0x800)
3087  bytesToWrite = 2;
3088  else if (c < 0x10000)
3089  bytesToWrite = 3;
3090  else if (c < 0x110000)
3091  bytesToWrite = 4;
3092  else {
3093  bytesToWrite = 3;
3094  c = 0xFFFD;
3095  }
3096 
3097  j += bytesToWrite;
3098  switch (bytesToWrite) { /* note: everything falls through. */
3099  case 4: name[--j] = ((c | 0x80) & 0xBF); c >>= 6;
3100  case 3: name[--j] = ((c | 0x80) & 0xBF); c >>= 6;
3101  case 2: name[--j] = ((c | 0x80) & 0xBF); c >>= 6;
3102  case 1: name[--j] = (c | firstByteMark[bytesToWrite]);
3103  }
3104  j += bytesToWrite;
3105  }
3106  name[j] = 0;
3107  return name;
3108 }
3109 
3110 #else
3111 
3112 string
3113 gettexstring (strnumber s)
3114 {
3115  poolpointer len;
3116  string name;
3117 #if !defined(Aleph)
3118  len = strstart[s + 1] - strstart[s];
3119 #else
3120  len = strstartar[s + 1 - 65536L] - strstartar[s - 65536L];
3121 #endif
3122  name = (string)xmalloc (len + 1);
3123 #if !defined(Aleph)
3124  strncpy (name, (string)&strpool[strstart[s]], len);
3125 #else
3126  {
3127  poolpointer i;
3128  /* Don't use strncpy. The strpool is not made up of chars. */
3129  for (i=0; i<len; i++) name[i] = strpool[i+strstartar[s - 65536L]];
3130  }
3131 #endif
3132  name[len] = 0;
3133  return name;
3134 }
3135 
3136 #endif /* not XeTeX */
3137 
3138 boolean
3139 isnewsource (strnumber srcfilename, int lineno)
3140 {
3141  char *name = gettexstring(srcfilename);
3142  return (compare_paths(name, last_source_name) != 0 || lineno != last_lineno);
3143 }
3144 
3145 void
3146 remembersourceinfo (strnumber srcfilename, int lineno)
3147 {
3148  if (last_source_name)
3150  last_source_name = gettexstring(srcfilename);
3151  last_lineno = lineno;
3152 }
3153 
3155 makesrcspecial (strnumber srcfilename, int lineno)
3156 {
3157  poolpointer oldpoolptr = poolptr;
3158  char *filename = gettexstring(srcfilename);
3159  /* FIXME: Magic number. */
3160  char buf[40];
3161  char *s = buf;
3162 
3163  /* Always put a space after the number, which makes things easier
3164  * to parse.
3165  */
3166  sprintf (buf, "src:%d ", lineno);
3167 
3168  if (poolptr + strlen(buf) + strlen(filename) >= (size_t)poolsize) {
3169  fprintf (stderr, "\nstring pool overflow\n"); /* fixme */
3170  exit (1);
3171  }
3172  s = buf;
3173  while (*s)
3174  strpool[poolptr++] = *s++;
3175 
3176  s = filename;
3177  while (*s)
3178  strpool[poolptr++] = *s++;
3179 
3180  return (oldpoolptr);
3181 }
3182 ␌
3183 /* pdfTeX routines also used for e-pTeX, e-upTeX, and XeTeX */
3184 #if defined (pdfTeX) || defined (epTeX) || defined (eupTeX) || defined(XeTeX)
3185 
3186 #include <kpathsea/c-stat.h>
3187 #include "md5.h"
3188 
3189 #define check_nprintf(size_get, size_want) \
3190  if ((unsigned)(size_get) >= (unsigned)(size_want)) \
3191  pdftex_fail ("snprintf failed: file %s, line %d", __FILE__, __LINE__);
3192 # define check_buf(size, buf_size) \
3193  if ((unsigned)(size) > (unsigned)(buf_size)) \
3194  pdftex_fail("buffer overflow at file %s, line %d", __FILE__, __LINE__ )
3195 # define xfree(p) do { if (p != NULL) free(p); p = NULL; } while (0)
3196 # define MAX_CSTRING_LEN 1024 * 1024
3197 
3198 #if !defined (pdfTeX)
3199 # define PRINTF_BUF_SIZE 1024
3200 static char print_buf[PRINTF_BUF_SIZE];
3201 
3202 /* Helper for pdftex_fail. */
3203 static void
3204 safe_print(const char *str)
3205 {
3206  const char *c;
3207  for (c = str; *c; ++c)
3208  print(*c);
3209 }
3210 /* pdftex_fail may be called when a buffer overflow has happened/is
3211  happening, therefore may not call mktexstring. However, with the
3212  current implementation it appears that error messages are misleading,
3213  possibly because pool overflows are detected too late.
3214 
3215  The output format of this fuction must be the same as pdf_error in
3216  pdftex.web! */
3217 __attribute__ ((noreturn, format(printf, 1, 2)))
3218 void pdftex_fail(const char *fmt, ...)
3219 {
3220  va_list args;
3221  va_start(args, fmt);
3222  println();
3223  safe_print("!error: ");
3226  va_end(args);
3227  println();
3228  safe_print(" ==> Fatal error occurred, output file will be damaged!");
3229  println();
3230  if (kpathsea_debug) {
3231  safe_print("kpathsea_debug enabled, calling abort()...");
3232  println();
3233  abort();
3234  } else {
3235  exit(EXIT_FAILURE);
3236  }
3237 }
3238 #endif /* not pdfTeX */
3239 
3240 #define TIME_STR_SIZE 30
3242 static char time_str[TIME_STR_SIZE];
3243  /* minimum size for time_str is 24: "D:YYYYmmddHHMMSS+HH'MM'" */
3244 
3245 static void
3246 makepdftime(time_t t, char *time_str, boolean utc)
3247 {
3248  struct tm lt, gmt;
3249  size_t size;
3250  int i, off, off_hours, off_mins;
3251 
3252  /* get the time */
3253  if (utc) {
3254  lt = *gmtime(&t);
3255  }
3256  else {
3257  lt = *localtime(&t);
3258  }
3259  size = strftime(time_str, TIME_STR_SIZE, "D:%Y%m%d%H%M%S", &lt);
3260  /* expected format: "YYYYmmddHHMMSS" */
3261  if (size == 0) {
3262  /* unexpected, contents of time_str is undefined */
3263  time_str[0] = '\0';
3264  return;
3265  }
3266 
3267  /* correction for seconds: %S can be in range 00..61,
3268  the PDF reference expects 00..59,
3269  therefore we map "60" and "61" to "59" */
3270  if (time_str[14] == '6') {
3271  time_str[14] = '5';
3272  time_str[15] = '9';
3273  time_str[16] = '\0'; /* for safety */
3274  }
3275 
3276  /* get the time zone offset */
3277  gmt = *gmtime(&t);
3278 
3279  /* this calculation method was found in exim's tod.c */
3280  off = 60 * (lt.tm_hour - gmt.tm_hour) + lt.tm_min - gmt.tm_min;
3281  if (lt.tm_year != gmt.tm_year) {
3282  off += (lt.tm_year > gmt.tm_year) ? 1440 : -1440;
3283  } else if (lt.tm_yday != gmt.tm_yday) {
3284  off += (lt.tm_yday > gmt.tm_yday) ? 1440 : -1440;
3285  }
3286 
3287  if (off == 0) {
3288  time_str[size++] = 'Z';
3289  time_str[size] = 0;
3290  } else {
3291  off_hours = off / 60;
3292  off_mins = abs(off - off_hours * 60);
3293  i = snprintf(&time_str[size], 9, "%+03d'%02d'", off_hours, off_mins);
3294  check_nprintf(i, 9);
3295  }
3296 }
3297 
3298 void
3299 initstarttime(void)
3300 {
3301  if (!start_time_set) {
3302  init_start_time ();
3303  if (getenv ("SOURCE_DATE_EPOCH")) {
3304  makepdftime (start_time, start_time_str, /* utc= */true);
3305  } else {
3306  makepdftime (start_time, start_time_str, /* utc= */false);
3307  }
3308  }
3309 }
3310 
3311 #if defined(_WIN32)
3312 #undef access
3313 #undef dir_p
3314 #define access fsyscp_access
3315 #define dir_p fsyscp_dir_p
3316 #endif /* _WIN32 */
3317 
3318 /* Search for an input file. If -output-directory is specified look
3319  there first. If that fails, do the regular kpse search. */
3320 string
3321 find_input_file(integer s)
3322 {
3323  string filename;
3324 
3325 #if defined(XeTeX)
3326  filename = gettexstring(s);
3327 #else
3328  filename = makecfilename(s);
3329 #endif
3330  /* Look in -output-directory first, if the filename is not
3331  absolute. This is because we want the pdf* functions to
3332  be able to find the same files as \openin */
3333  if (output_directory && !kpse_absolute_p (filename, false)) {
3334  string pathname;
3335 
3337  if (!access(pathname, R_OK) && !dir_p (pathname)) {
3338  return pathname;
3339  }
3340  xfree (pathname);
3341  }
3342  if (! kpse_in_name_ok(filename)) {
3343  return NULL; /* no permission */
3344  }
3345  return kpse_find_tex(filename);
3346 }
3347 
3348 #if !defined(XeTeX)
3349 char *
3351 {
3352  static char *cstrbuf = NULL;
3353  char *p;
3354  static int allocsize;
3355  int allocgrow, i, l = strstart[s + 1] - strstart[s];
3356  check_buf(l + 1, MAX_CSTRING_LEN);
3357  if (cstrbuf == NULL) {
3358  allocsize = l + 1;
3359  cstrbuf = xmallocarray(char, allocsize);
3360  } else if (l + 1 > allocsize) {
3361  allocgrow = allocsize * 0.2;
3362  if (l + 1 - allocgrow > allocsize)
3363  allocsize = l + 1;
3364  else if (allocsize < MAX_CSTRING_LEN - allocgrow)
3365  allocsize += allocgrow;
3366  else
3367  allocsize = MAX_CSTRING_LEN;
3368  cstrbuf = xreallocarray(cstrbuf, char, allocsize);
3369  }
3370  p = cstrbuf;
3371  for (i = 0; i < l; i++)
3372  *p++ = strpool[i + strstart[s]];
3373  *p = 0;
3374  return cstrbuf;
3375 }
3376 
3377 /* makecfilename
3378  input/ouput same as makecstring:
3379  input: string number
3380  output: C string with quotes removed.
3381  That means, file names that are legal on some operation systems
3382  cannot any more be used since pdfTeX version 1.30.4.
3383 */
3384 char *
3385 makecfilename(integer s)
3386 {
3387  char *name = makecstring(s);
3388  char *p = name;
3389  char *q = name;
3390 
3391  while (*p) {
3392  if (*p != '"')
3393  *q++ = *p;
3394  p++;
3395  }
3396  *q = '\0';
3397  return name;
3398 }
3399 #endif /* !XeTeX */
3400 
3401 void
3402 getcreationdate(void)
3403 {
3404  size_t len;
3405 #if defined(XeTeX)
3406  int i;
3407 #endif
3408  initstarttime();
3409  /* put creation date on top of string pool and update poolptr */
3411 
3412  /* In e-pTeX, "init len => call initstarttime()" (as pdftexdir/utils.c)
3413  yields unintentional output. */
3414 
3415  if ((unsigned) (poolptr + len) >= (unsigned) (poolsize)) {
3416  poolptr = poolsize;
3417  /* error by str_toks that calls str_room(1) */
3418  return;
3419  }
3420 
3421 #if defined(XeTeX)
3422  for (i = 0; i < len; i++)
3424 #else
3426  poolptr += len;
3427 #endif
3428 }
3429 
3430 void
3431 getfilemoddate(integer s)
3432 {
3433  struct stat file_data;
3434 
3435  char *file_name = find_input_file(s);
3436  if (file_name == NULL) {
3437  return; /* empty string */
3438  }
3439 
3441  /* get file status */
3442 #ifdef _WIN32
3443  if (fsyscp_stat(file_name, &file_data) == 0) {
3444 #else
3445  if (stat(file_name, &file_data) == 0) {
3446 #endif
3447  size_t len;
3448  boolean use_utc = FORCE_SOURCE_DATE_set && SOURCE_DATE_EPOCH_set;
3449  makepdftime(file_data.st_mtime, time_str, use_utc);
3450  len = strlen(time_str);
3451  if ((unsigned) (poolptr + len) >= (unsigned) (poolsize)) {
3452  poolptr = poolsize;
3453  /* error by str_toks that calls str_room(1) */
3454  } else {
3455 #if defined(XeTeX)
3456  int i;
3457 
3458  for (i = 0; i < len; i++)
3460 #else
3462  poolptr += len;
3463 #endif
3464  }
3465  }
3466  /* else { errno contains error code } */
3467 
3468  xfree(file_name);
3469 }
3470 
3471 void
3472 getfilesize(integer s)
3473 {
3474  struct stat file_data;
3475  int i;
3476 
3477  char *file_name = find_input_file(s);
3478  if (file_name == NULL) {
3479  return; /* empty string */
3480  }
3481 
3483  /* get file status */
3484 #ifdef _WIN32
3485  if (fsyscp_stat(file_name, &file_data) == 0) {
3486 #else
3487  if (stat(file_name, &file_data) == 0) {
3488 #endif
3489  size_t len;
3490  char buf[20];
3491 
3492  /* st_size has type off_t */
3493  i = snprintf(buf, sizeof(buf),
3494  "%lu", (long unsigned int) file_data.st_size);
3495  check_nprintf(i, sizeof(buf));
3496  len = strlen(buf);
3497  if ((unsigned) (poolptr + len) >= (unsigned) (poolsize)) {
3498  poolptr = poolsize;
3499  /* error by str_toks that calls str_room(1) */
3500  } else {
3501 #if defined(XeTeX)
3502  for (i = 0; i < len; i++)
3503  strpool[poolptr++] = (uint16_t)buf[i];
3504 #else
3505  memcpy(&strpool[poolptr], buf, len);
3506  poolptr += len;
3507 #endif
3508  }
3509  }
3510  /* else { errno contains error code } */
3511 
3512  xfree(file_name);
3513 }
3514 
3515 void
3516 getfiledump(integer s, int offset, int length)
3517 {
3518  FILE *f;
3519  int read, i;
3520 #if defined(XeTeX)
3521  unsigned char *readbuffer;
3522  char strbuf[3];
3523  int j, k;
3524 #else
3525  poolpointer data_ptr;
3527 #endif /* XeTeX */
3528  char *file_name;
3529 
3530  if (length == 0) {
3531  /* empty result string */
3532  return;
3533  }
3534 
3535  if (poolptr + 2 * length + 1 >= poolsize) {
3536  /* no place for result */
3537  poolptr = poolsize;
3538  /* error by str_toks that calls str_room(1) */
3539  return;
3540  }
3541 
3542  file_name = find_input_file(s);
3543  if (file_name == NULL) {
3544  return; /* empty string */
3545  }
3546 
3547  /* read file data */
3549  if (f == NULL) {
3550  xfree(file_name);
3551  return;
3552  }
3554  if (fseek(f, offset, SEEK_SET) != 0) {
3555  xfree(file_name);
3556  return;
3557  }
3558 #if defined(XeTeX)
3559  readbuffer = (unsigned char *)xmalloc (length + 1);
3560  read = fread(readbuffer, sizeof(char), length, f);
3561  fclose(f);
3562  for (j = 0; j < read; j++) {
3563  i = snprintf (strbuf, 3, "%.2X", (unsigned int)readbuffer[j]);
3564  check_nprintf(i, 3);
3565  for (k = 0; k < i; k++)
3566  strpool[poolptr++] = (uint16_t)strbuf[k];
3567  }
3568  xfree (readbuffer);
3569 #else
3570  /* there is enough space in the string pool, the read
3571  data are put in the upper half of the result, thus
3572  the conversion to hex can be done without overwriting
3573  unconverted bytes. */
3574  data_ptr = poolptr + length;
3575  read = fread(&strpool[data_ptr], sizeof(char), length, f);
3576  fclose(f);
3577 
3578  /* convert to hex */
3579  data_end = data_ptr + read;
3580  for (; data_ptr < data_end; data_ptr++) {
3581  i = snprintf((char *) &strpool[poolptr], 3,
3582  "%.2X", (unsigned int) strpool[data_ptr]);
3583  check_nprintf(i, 3);
3584  poolptr += i;
3585  }
3586 #endif /* XeTeX */
3587  xfree(file_name);
3588 }
3589 
3590 /* Converts any given string in into an allowed PDF string which is
3591  * hexadecimal encoded;
3592  * sizeof(out) should be at least lin*2+1.
3593  */
3594 void
3595 convertStringToHexString(const char *in, char *out, int lin)
3596 {
3597  int i, j, k;
3598  char buf[3];
3599  j = 0;
3600  for (i = 0; i < lin; i++) {
3601  k = snprintf(buf, sizeof(buf),
3602  "%02X", (unsigned int) (unsigned char) in[i]);
3603  check_nprintf(k, sizeof(buf));
3604  out[j++] = buf[0];
3605  out[j++] = buf[1];
3606  }
3607  out[j] = '\0';
3608 }
3609 
3610 #define DIGEST_SIZE 16
3611 #define FILE_BUF_SIZE 1024
3612 
3613 void
3614 getmd5sum(strnumber s, boolean file)
3615 {
3617  md5_byte_t digest[DIGEST_SIZE];
3618  char outbuf[2 * DIGEST_SIZE + 1];
3619  int len = 2 * DIGEST_SIZE;
3620 #if defined(XeTeX)
3621  char *xname;
3622  int i;
3623 #endif
3624 
3625  if (file) {
3626  char file_buf[FILE_BUF_SIZE];
3627  int read = 0;
3628  FILE *f;
3629  char *file_name;
3630 
3631  file_name = find_input_file(s);
3632  if (file_name == NULL) {
3633  return; /* empty string */
3634  }
3635 
3636  /* in case of error the empty string is returned,
3637  no need for xfopen that aborts on error.
3638  */
3640  if (f == NULL) {
3641  xfree(file_name);
3642  return;
3643  }
3645  md5_init(&state);
3646  while ((read = fread(&file_buf, sizeof(char), FILE_BUF_SIZE, f)) > 0) {
3647  md5_append(&state, (const md5_byte_t *) file_buf, read);
3648  }
3649  md5_finish(&state, digest);
3650  fclose(f);
3651 
3652  xfree(file_name);
3653  } else {
3654  /* s contains the data */
3655  md5_init(&state);
3656 #if defined(XeTeX)
3657  xname = gettexstring (s);
3658  md5_append(&state,
3659  (md5_byte_t *) xname,
3660  strlen (xname));
3661  xfree (xname);
3662 #else
3663  md5_append(&state,
3664  (md5_byte_t *) &strpool[strstart[s]],
3665  strstart[s + 1] - strstart[s]);
3666 #endif
3667  md5_finish(&state, digest);
3668  }
3669 
3670  if (poolptr + len >= poolsize) {
3671  /* error by str_toks that calls str_room(1) */
3672  return;
3673  }
3674  convertStringToHexString((char *) digest, outbuf, DIGEST_SIZE);
3675 #if defined(XeTeX)
3676  for (i = 0; i < 2 * DIGEST_SIZE; i++)
3677  strpool[poolptr++] = (uint16_t)outbuf[i];
3678 #else
3680  poolptr += len;
3681 #endif
3682 }
3683 
3684 #endif /* pdfTeX or e-pTeX or e-upTeX or XeTeX */
3685 #endif /* TeX */
3686 ␌
3687 /* Metafont/MetaPost fraction routines. Replaced either by assembler or C.
3688  The assembler syntax doesn't work on Solaris/x86. */
3689 #ifndef TeX
3690 #if defined (__sun__) || defined (__cplusplus)
3691 #define NO_MF_ASM
3692 #endif
3693 /* The assembler code is not PIC safe on i?86 so use C code. */
3694 #if defined (__PIC__) && defined (__i386__)
3695 #define NO_MF_ASM
3696 #endif
3697 #if defined(WIN32) && !defined(NO_MF_ASM) && !defined(__MINGW32__)
3698 #include "lib/mfmpw32.c"
3699 #elif defined (__i386__) && defined (__GNUC__) && !defined (NO_MF_ASM)
3700 #include "lib/mfmpi386.asm"
3701 #else
3702 /* Replace fixed-point fraction routines from mf.web and mp.web with
3703  Hobby's floating-point C code. */
3704 
3705 /****************************************************************
3706 Copyright 1990 - 1995 by AT&T Bell Laboratories.
3707 
3708 Permission to use, copy, modify, and distribute this software
3709 and its documentation for any purpose and without fee is hereby
3710 granted, provided that the above copyright notice appear in all
3711 copies and that both that the copyright notice and this
3712 permission notice and warranty disclaimer appear in supporting
3713 documentation, and that the names of AT&T Bell Laboratories or
3714 any of its entities not be used in advertising or publicity
3715 pertaining to distribution of the software without specific,
3716 written prior permission.
3717 
3718 AT&T disclaims all warranties with regard to this software,
3719 including all implied warranties of merchantability and fitness.
3720 In no event shall AT&T be liable for any special, indirect or
3721 consequential damages or any damages whatsoever resulting from
3722 loss of use, data or profits, whether in an action of contract,
3723 negligence or other tortious action, arising out of or in
3724 connection with the use or performance of this software.
3725 ****************************************************************/
3726 
3727 /**********************************************************
3728  The following is by John Hobby
3729  **********************************************************/
3730 
3731 #ifndef FIXPT
3732 
3733 /* These replacements for takefraction, makefraction, takescaled, makescaled
3734  run about 3 to 11 times faster than the standard versions on modern machines
3735  that have fast hardware for double-precision floating point. They should
3736  produce approximately correct results on all machines and agree exactly
3737  with the standard versions on machines that satisfy the following conditions:
3738  1. Doubles must have at least 46 mantissa bits; i.e., numbers expressible
3739  as n*2^k with abs(n)<2^46 should be representable.
3740  2. The following should hold for addition, subtraction, and multiplcation but
3741  not necessarily for division:
3742  A. If the true answer is between two representable numbers, the computed
3743  answer must be one of them.
3744  B. When the true answer is representable, this must be the computed result.
3745  3. Dividing one double by another should always produce a relative error of
3746  at most one part in 2^46. (This is why the mantissa requirement is
3747  46 bits instead of 45 bits.)
3748  3. In the absence of overflow, double-to-integer conversion should truncate
3749  toward zero and do this in an exact fashion.
3750  4. Integer-to-double convesion should produce exact results.
3751  5. Dividing one power of two by another should yield an exact result.
3752  6. ASCII to double conversion should be exact for integer values.
3753  7. Integer arithmetic must be done in the two's-complement system.
3754 */
3755 #define ELGORDO 0x7fffffff
3756 #define TWEXP31 2147483648.0
3757 #define TWEXP28 268435456.0
3758 #define TWEXP16 65536.0
3759 #define TWEXP_16 (1.0/65536.0)
3760 #define TWEXP_28 (1.0/268435456.0)
3761 
3762 integer
3763 ztakefraction (integer p, integer q) /* Approximate p*q/2^28 */
3764 { register double d;
3765  register integer i;
3766  d = (double)p * (double)q * TWEXP_28;
3767  if ((p^q) >= 0) {
3768  d += 0.5;
3769  if (d>=TWEXP31) {
3770  if (d!=TWEXP31 || (((p&077777)*(q&077777))&040000)==0)
3771  aritherror = true;
3772  return ELGORDO;
3773  }
3774  i = (integer) d;
3775  if (d==i && (((p&077777)*(q&077777))&040000)!=0) --i;
3776  } else {
3777  d -= 0.5;
3778  if (d<= -TWEXP31) {
3779  if (d!= -TWEXP31 || ((-(p&077777)*(q&077777))&040000)==0)
3780  aritherror = true;
3781  return -ELGORDO;
3782  }
3783  i = (integer) d;
3784  if (d==i && ((-(p&077777)*(q&077777))&040000)!=0) ++i;
3785  }
3786  return i;
3787 }
3788 
3789 integer
3790 ztakescaled (integer p, integer q) /* Approximate p*q/2^16 */
3791 { register double d;
3792  register integer i;
3793  d = (double)p * (double)q * TWEXP_16;
3794  if ((p^q) >= 0) {
3795  d += 0.5;
3796  if (d>=TWEXP31) {
3797  if (d!=TWEXP31 || (((p&077777)*(q&077777))&040000)==0)
3798  aritherror = true;
3799  return ELGORDO;
3800  }
3801  i = (integer) d;
3802  if (d==i && (((p&077777)*(q&077777))&040000)!=0) --i;
3803  } else {
3804  d -= 0.5;
3805  if (d<= -TWEXP31) {
3806  if (d!= -TWEXP31 || ((-(p&077777)*(q&077777))&040000)==0)
3807  aritherror = true;
3808  return -ELGORDO;
3809  }
3810  i = (integer) d;
3811  if (d==i && ((-(p&077777)*(q&077777))&040000)!=0) ++i;
3812  }
3813  return i;
3814 }
3815 
3816 /* Note that d cannot exactly equal TWEXP31 when the overflow test is made
3817  because the exact value of p/q cannot be strictly between (2^31-1)/2^28
3818  and 8/1. No pair of integers less than 2^31 has such a ratio.
3819 */
3820 integer
3821 zmakefraction (integer p, integer q) /* Approximate 2^28*p/q */
3822 { register double d;
3823  register integer i;
3824 #ifdef DEBUG
3825  if (q==0) confusion(47);
3826 #endif /* DEBUG */
3827  d = TWEXP28 * (double)p /(double)q;
3828  if ((p^q) >= 0) {
3829  d += 0.5;
3830  if (d>=TWEXP31) {aritherror=true; return ELGORDO;}
3831  i = (integer) d;
3832  if (d==i && ( ((q>0 ? -q : q)&077777)
3833  * (((i&037777)<<1)-1) & 04000)!=0) --i;
3834  } else {
3835  d -= 0.5;
3836  if (d<= -TWEXP31) {aritherror=true; return -ELGORDO;}
3837  i = (integer) d;
3838  if (d==i && ( ((q>0 ? q : -q)&077777)
3839  * (((i&037777)<<1)+1) & 04000)!=0) ++i;
3840  }
3841  return i;
3842 }
3843 
3844 /* Note that d cannot exactly equal TWEXP31 when the overflow test is made
3845  because the exact value of p/q cannot be strictly between (2^31-1)/2^16
3846  and 2^15/1. No pair of integers less than 2^31 has such a ratio.
3847 */
3848 integer
3849 zmakescaled (integer p, integer q) /* Approximate 2^16*p/q */
3850 { register double d;
3851  register integer i;
3852 #ifdef DEBUG
3853  if (q==0) confusion(47);
3854 #endif /* DEBUG */
3855  d = TWEXP16 * (double)p /(double)q;
3856  if ((p^q) >= 0) {
3857  d += 0.5;
3858  if (d>=TWEXP31) {aritherror=true; return ELGORDO;}
3859  i = (integer) d;
3860  if (d==i && ( ((q>0 ? -q : q)&077777)
3861  * (((i&037777)<<1)-1) & 04000)!=0) --i;
3862  } else {
3863  d -= 0.5;
3864  if (d<= -TWEXP31) {aritherror=true; return -ELGORDO;}
3865  i = (integer) d;
3866  if (d==i && ( ((q>0 ? q : -q)&077777)
3867  * (((i&037777)<<1)+1) & 04000)!=0) ++i;
3868  }
3869  return i;
3870 }
3871 
3872 #endif /* not FIXPT */
3873 #endif /* not assembler */
3874 #endif /* not TeX, i.e., MF */
3875 ␌
3876 #ifdef MF
3877 /* On-line display routines for Metafont. Here we use a dispatch table
3878  indexed by the MFTERM or TERM environment variable to select the
3879  graphics routines appropriate to the user's terminal. stdout must be
3880  connected to a terminal for us to do any graphics. */
3881 
3882 #ifdef MFNOWIN
3883 #undef AMIGAWIN
3884 #undef EPSFWIN
3885 #undef HP2627WIN
3886 #undef MFTALKWIN
3887 #undef NEXTWIN
3888 #undef REGISWIN
3889 #undef SUNWIN
3890 #undef TEKTRONIXWIN
3891 #undef UNITERMWIN
3892 #undef WIN32WIN
3893 #undef X11WIN
3894 #endif
3895 
3896 /* Prototypes for Metafont display routines: mf_XXX_initscreen,
3897  mf_XXX_updatescreen, mf_XXX_blankrectangle, and mf_XXX_paintrow. */
3898 #include <window/mfdisplay.h>
3899 
3900 /* This variable, `mfwsw', contains the dispatch tables for each
3901  terminal. We map the Pascal calls to the routines `init_screen',
3902  `update_screen', `blank_rectangle', and `paint_row' into the
3903  appropriate entry point for the specific terminal that MF is being
3904  run on. */
3905 
3906 struct mfwin_sw
3907 {
3908  const char *mfwsw_type; /* Name of terminal a la TERMCAP. */
3909  int (*mfwsw_initscreen) (void);
3910  void (*mfwsw_updatescrn) (void);
3911  void (*mfwsw_blankrect) (screencol, screencol, screenrow, screenrow);
3912  void (*mfwsw_paintrow) (screenrow, pixelcolor, transspec, screencol);
3913 } mfwsw[] =
3914 {
3915 #ifdef AMIGAWIN
3918 #endif
3919 #ifdef EPSFWIN
3922 #endif
3923 #ifdef HP2627WIN
3926 #endif
3927 #ifdef MFTALKWIN
3930 #endif
3931 #ifdef NEXTWIN
3934 #endif
3935 #ifdef REGISWIN
3938 #endif
3939 #ifdef SUNWIN
3942 #endif
3943 #ifdef TEKTRONIXWIN
3946 #endif
3947 #ifdef UNITERMWIN
3950 #endif
3951 #ifdef WIN32WIN
3952  { "win32term", mf_win32_initscreen, mf_win32_updatescreen,
3954 #endif
3955 #ifdef X11WIN
3958 #endif
3959 
3960  /* Always support this. */
3963 
3964 /* Finally, we must have an entry with a terminal type of NULL. */
3965  { NULL, NULL, NULL, NULL, NULL }
3966 
3967 }; /* End of the array initialization. */
3968 
3969 
3970 /* This is a pointer to the mfwsw[] entry that we find. */
3971 static struct mfwin_sw *mfwp;
3972 
3973 
3974 /* The following are routines that just jump to the correct
3975  terminal-specific graphics code. If none of the routines in the
3976  dispatch table exist, or they fail, we produce trap-compatible
3977  output, i.e., the same words and punctuation that the unchanged
3978  mf.web would produce. */
3979 
3980 
3981 /* This returns true if we can do window operations, else false. */
3982 
3983 boolean
3984 initscreen (void)
3985 {
3986  int retval;
3987  /* If MFTERM is set, use it. */
3988  const_string tty_type = kpse_var_value ("MFTERM");
3989 
3990  if (tty_type == NULL)
3991  {
3992 #if defined (AMIGA)
3993  tty_type = "amiterm";
3994 #elif defined (WIN32)
3995  tty_type = "win32term";
3996 #elif defined (OS2) || defined (__DJGPP__) /* not AMIGA nor WIN32 */
3997  tty_type = "mftalk";
3998 #else /* not (OS2 or WIN32 or __DJGPP__ or AMIGA) */
3999  /* If DISPLAY is set, we are X11; otherwise, who knows. */
4000  boolean have_display = getenv ("DISPLAY") != NULL;
4001  tty_type = have_display ? "xterm" : getenv ("TERM");
4002 
4003  /* If we don't know what kind of terminal this is, or if Metafont
4004  isn't being run interactively, don't do any online output. */
4005  if (tty_type == NULL
4006  || (!STREQ (tty_type, "trap") && !isatty (fileno (stdout))))
4007  return 0;
4008 #endif /* not (OS2 or WIN32 or __DJGPP__ or AMIGA) */
4009  }
4010 
4011  /* Test each of the terminals given in `mfwsw' against the terminal
4012  type, and take the first one that matches, or if the user is running
4013  under Emacs, the first one. */
4014  for (mfwp = mfwsw; mfwp->mfwsw_type != NULL; mfwp++) {
4015  if (!strncmp (mfwp->mfwsw_type, tty_type, strlen (mfwp->mfwsw_type))
4016  || STREQ (tty_type, "emacs")) {
4017  if (mfwp->mfwsw_initscreen) {
4018  retval = (*mfwp->mfwsw_initscreen) ();
4019 #ifdef WIN32
4020  Sleep(1000); /* Wait for opening a window */
4021 #endif
4022  return retval;
4023  }
4024  else {
4025  fprintf (stderr, "mf: Couldn't initialize online display for `%s'.\n",
4026  tty_type);
4027  break;
4028  }
4029  }
4030  }
4031 
4032  /* The current terminal type wasn't found in any of the entries, or
4033  initalization failed, so silently give up, assuming that the user
4034  isn't on a terminal that supports graphic output. */
4035  return 0;
4036 }
4037 
4038 
4039 /* Make sure everything is visible. */
4040 
4041 void
4042 updatescreen (void)
4043 {
4044  if (mfwp->mfwsw_updatescrn)
4045  (*mfwp->mfwsw_updatescrn) ();
4046 }
4047 
4048 
4049 /* This sets the rectangle bounded by ([left,right], [top,bottom]) to
4050  the background color. */
4051 
4052 void
4053 blankrectangle (screencol left, screencol right,
4054  screenrow top, screenrow bottom)
4055 {
4056  if (mfwp->mfwsw_blankrect)
4057  (*mfwp->mfwsw_blankrect) (left, right, top, bottom);
4058 }
4059 
4060 
4061 /* This paints ROW, starting with the color INIT_COLOR.
4062  TRANSITION_VECTOR then specifies the length of the run; then we
4063  switch colors. This goes on for VECTOR_SIZE transitions. */
4064 
4065 void
4066 paintrow (screenrow row, pixelcolor init_color,
4067  transspec transition_vector, screencol vector_size)
4068 {
4069  if (mfwp->mfwsw_paintrow)
4070  (*mfwp->mfwsw_paintrow) (row, init_color, transition_vector, vector_size);
4071 }
4072 #endif /* MF */
long __cdecl strtol(char const *_String, char **_EndPtr, int _Radix)
void(__cdecl * _invalid_parameter_handler)(wchar_t const *, wchar_t const *, wchar_t const *, unsigned int, uintptr_t)
Definition: CPAL.d:7449
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
unsigned long long __cdecl strtoull(char const *_String, char **_EndPtr, int _Radix)
_invalid_parameter_handler __cdecl _set_invalid_parameter_handler(_invalid_parameter_handler _Handler)
static UInt8 firstByteMark[7]
Definition: Compiler.cpp:66
#define QUOTE
Definition: Resource.h:34
#define WINAPI
int u_open_in(unicodefile *f, integer filefmt, const_string fopen_mode, integer mode, integer encodingData)
Definition: XeTeX_ext.c:2579
char * outputdriver
Definition: XeTeX_ext.c:155
char * papersize
Definition: XeTeX_ext.c:154
cp
Definition: action.c:1035
static const char * find_suffix(const char *name)
Definition: afm2pl.c:390
q
Definition: afm2pl.c:2287
static char * concat(const char *s1, const char *s2)
Definition: afm2pl.c:377
static int lineno
Definition: aftopl.c:19
#define COPYRIGHT_HOLDER
Definition: alephextra.h:27
#define INI_PROGRAM
Definition: alephextra.h:36
#define VIR_PROGRAM
Definition: alephextra.h:37
#define DUMP_EXT
Definition: alephextra.h:34
#define DUMP_LENGTH_VAR
Definition: alephextra.h:32
#define DUMP_VAR
Definition: alephextra.h:31
#define INPUT_FORMAT
Definition: alephextra.h:35
#define DUMP_OPTION
Definition: alephextra.h:33
#define PROGRAM_HELP
Definition: alephextra.h:29
#define the
Definition: aptex-macros.h:490
#define year
Definition: aptex-macros.h:808
#define state
Definition: aptex-macros.h:996
#define day
Definition: aptex-macros.h:806
#define name
#define month
Definition: aptex-macros.h:807
#define mode
Definition: aptex-macros.h:510
static char start_time_str[38]
Definition: aptex-utils.c:61
static char time_str[38]
Definition: aptex-utils.c:62
static integer interrupt
Definition: aptex.h:329
void send(char *str)
Definition: axohelp.c:1054
static unsigned int offsetsFromUTF8[6]
Definition: bkmk2uni.c:1508
static unsigned char bytesFromUTF8[256]
Definition: bkmk2uni.c:1518
char * p2
Definition: bmpfont.h:62
char * p1
Definition: bmpfont.h:62
void initscreen(unsigned physx, unsigned physy, unsigned cols, unsigned rows, unsigned xoff, unsigned yoff, unsigned minx, unsigned miny, unsigned maxx, unsigned maxy)
Definition: bzscreen.c:34
#define n
Definition: t4ht.c:1290
@ pre
Definition: ctie-k.c:71
FILE * out_file
Definition: ctie-k.c:185
BOOL
Definition: dd.h:100
@ FALSE
Definition: dd.h:101
@ TRUE
Definition: dd.h:102
#define free(a)
Definition: decNumber.cpp:310
int linenumber
Definition: devnag.c:401
#define R_OK
Definition: defs.h:31
#define STREQ(s, t)
Definition: defs.h:149
int command
Definition: t4ht.c:934
int v
Definition: dviconv.c:10
#define fopen
Definition: xxstdio.h:21
#define fread
Definition: xxstdio.h:25
#define fseek
Definition: xxstdio.h:30
#define ftell
Definition: xxstdio.h:31
#define FOPEN_RBIN_MODE
Definition: dvips.h:86
#define check_buf(size, buf_size)
Definition: ptexmac.h:37
#define xfree(p)
Definition: ptexmac.h:85
#define PRINTF_BUF_SIZE
Definition: ptexmac.h:35
char * strncpy()
int strcmp()
Definition: coll.cpp:143
int printf()
char * strcpy()
#define BANNER
Definition: dvidvi.c:37
char * temp
Definition: dvidvi.c:137
#define BUG_ADDRESS
Definition: dvidvi.c:40
#define IS_DIR_SEP
Definition: dvidvi.c:106
struct rect data
Definition: dvipdfm.c:64
char * strtok()
#define FILESTRCASEEQ
Definition: dvips.h:372
int close_file(FILE *f)
Definition: search.c:351
#define MAX_CSTRING_LEN
Definition: ptexmac.h:60
FILE * inputfile
Definition: ebb.c:324
int interactionoption
Definition: errors.c:55
#define edit_var
Definition: errors.c:25
int synctexoption
Definition: extensions.c:1185
int fcntl(int fd, int action,...)
Definition: fcntl.c:202
#define O_NONBLOCK
Definition: fcntl.in.h:277
static void
Definition: fpif.c:118
#define WIN32
Definition: ft_conf.h:24
ASCIICode_T xord[LAST_TEXT_CHAR+1]
unsigned char xchr[LAST_ASCII_CHAR+1]
mpz_t * f
Definition: gen-fib.c:34
mpz_t pp
Definition: gen-psqr.c:108
#define v1
#define v2
#define s
Definition: afcover.h:80
#define c(n)
Definition: gpos-common.c:150
#define a(n)
Definition: gpos-common.c:148
#define d(n)
Definition: gpos-common.c:151
static void * xrealloc(char *oldp, unsigned size)
Definition: gsftopk.c:643
byte * data_end
Definition: gsftopk.c:484
#define strchr
Definition: gsftopk.c:59
#define memcpy(d, s, n)
Definition: gsftopk.c:64
FILE * out
Definition: hbf2gf.c:286
static void read_line()
#define INADDR_NONE
Definition: in.h:147
assert(pcxLoadImage24((char *)((void *) 0), fp, pinfo, hdr))
void initkanji(void)
Definition: jbib.c:14
void usagehelp(const_string *message, const_string bug_email)
Definition: jlib.c:16
void printversionandexit(const_string banner, const_string copyright_holder, const_string author, char *extra_info)
Definition: jlib.c:30
#define bufsize
#define EXIT_SUCCESS
Definition: cdjpeg.h:175
#define EXIT_FAILURE
Definition: cdjpeg.h:169
#define SEEK_SET
Definition: jmemansi.c:26
unsigned int UInt32
Definition: bzip2.c:165
unsigned short UInt16
Definition: bzip2.c:167
uchar outbuf[(1000000+1000000)]
Definition: unzcrash.c:41
#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
#define const
Definition: ftzconf.h:91
void exit()
#define EOF
Definition: afmparse.c:59
@ right
Definition: annotate.c:15
int int double double double char double char * top
Definition: gdfx.h:19
int int double double double char double char char * bottom
Definition: gdfx.h:20
int optind
Definition: getopt.c:39
char * optarg
Definition: getopt.c:42
unsigned short uint16_t
Definition: stdint.h:79
unsigned int uintptr_t
Definition: stdint.h:119
char * getenv()
int getopt_long_only()
int gzread(gzFile file, voidp buf, unsigned len)
Definition: gzread.c:375
int gzwrite(gzFile file, voidpc buf, unsigned len)
Definition: gzwrite.c:246
int atoi(const char *)
FILE * xfopen(char *filename, int is_binary, char *area_list, char *extension)
int errno
int num
Definition: disdvi.c:621
static char print_buf[1024]
Definition: writet1.c:86
#define xstrdup(s)
Definition: writet1.c:34
#define xmalloc(size)
Definition: writet1.c:33
#define xfclose(f, filename)
Definition: writet1.c:35
#define buf
#define DLLPROC
Definition: dvipdfmx.c:1011
#define ISBLANK(c)
Definition: fontmap.c:215
@ parse
Definition: spc_dvips.c:737
char * concat3(const char *s1, const char *s2, const char *s3)
Definition: utils.c:178
#define RETSIGTYPE
Definition: c-auto.h:14
#define MAKE_OMEGA_OFM_BY_DEFAULT
Definition: c-auto.h:57
#define MAKE_TEX_FMT_BY_DEFAULT
Definition: c-auto.h:56
#define MAKE_TEX_TEX_BY_DEFAULT
Definition: c-auto.h:54
#define MAKE_OMEGA_OCP_BY_DEFAULT
Definition: c-auto.h:58
#define MAKE_TEX_MF_BY_DEFAULT
Definition: c-auto.h:52
#define MAKE_TEX_TFM_BY_DEFAULT
Definition: c-auto.h:55
#define ISSPACE(c)
Definition: c-ctype.h:40
#define DIR_SEP_STRING
Definition: c-pathch.h:56
void kpathsea_cnf_line_env_progname(kpathsea kpse, string line)
Definition: cnf.c:225
string concatn(const_string str1,...)
Definition: concatn.c:28
#define fclose
Definition: debug.h:100
wchar_t * get_wstring_from_mbstring(int cp, const char *mbstr, wchar_t *wstr)
Definition: knj.c:38
char * get_mbstring_from_wstring(int cp, const wchar_t *wstr, char *mbstr)
Definition: knj.c:60
#define FATAL3(str, e1, e2, e3)
Definition: lib.h:67
#define FATAL(str)
Definition: lib.h:61
KPSEDLL string xgetcwd(void)
Definition: xgetcwd.c:42
#define WARNING2(str, e1, e2)
Definition: lib.h:83
#define STRNEQ(s1, s2, n)
Definition: lib.h:104
#define FATAL1(str, e1)
Definition: lib.h:63
#define WARNING1(str, e1)
Definition: lib.h:81
#define getc
Definition: line.c:39
#define popen(cmd, mode)
Definition: mingw32.h:91
string kpse_program_basename(const_string argv0)
Definition: progname.c:737
const char * const_string
Definition: simpletypes.h:59
#define kpse_program_name
Definition: types.h:322
#define kpse_invocation_name
Definition: types.h:333
KPSEDLL kpathsea kpse_def
#define kpathsea_debug
Definition: types.h:321
@ kpse_src_compile
Definition: types.h:171
#define kpse_record_output
Definition: types.h:324
#define kpse_record_input
Definition: types.h:323
@ kpse_web2c_format
Definition: types.h:141
@ kpse_fmt_format
Definition: types.h:113
@ kpse_cnf_format
Definition: types.h:111
@ kpse_ocp_format
Definition: types.h:122
@ kpse_tex_format
Definition: types.h:129
@ kpse_tfm_format
Definition: types.h:106
@ kpse_mf_format
Definition: types.h:116
@ kpse_base_format
Definition: types.h:108
@ kpse_ofm_format
Definition: types.h:123
#define ftime
Definition: win32lib.h:75
#define access
Definition: win32lib.h:59
#define fileno
Definition: win32lib.h:72
#define pclose(file)
Definition: win32lib.h:271
#define read
Definition: win32lib.h:88
#define S_ISDIR(m)
Definition: win32lib.h:203
#define putenv
Definition: win32lib.h:87
#define system(p)
Definition: win32lib.h:269
#define strncasecmp
Definition: win32lib.h:115
#define write
Definition: win32lib.h:103
#define isatty
Definition: win32lib.h:80
#define timeb
Definition: win32lib.h:98
static int ret
Definition: convert.c:72
#define fputs
Definition: mendex.h:67
#define fprintf
Definition: mendex.h:64
static int poolsize
Definition: encoding.c:323
FILE * enc
Definition: encoding.c:64
boolean set_enc_string(const_string file_str, const_string internal_str)
Definition: ptexenc.c:185
static int infile_enc_auto
Definition: ptexenc.c:45
long input_line2(FILE *fp, unsigned char *buff, long pos, const long buffsize, int *lastchar)
Definition: ptexenc.c:748
int ptenc_get_command_line_args(int *p_ac, char ***p_av)
Definition: ptexenc.c:1095
#define EDITOR
Definition: acconfig.h:37
#define xreallocarray(ptr, type, size)
Definition: cpascal.h:171
#define xmallocarray(type, size)
Definition: cpascal.h:169
#define Xchr(x)
Definition: cpascal.h:32
char file_name[][1024]
Definition: cwebboot.c:318
#define string
Definition: ctangleboot.c:111
#define length(c)
Definition: ctangleboot.c:65
#define confusion(s)
Definition: ctangleboot.c:78
Code related to b fwrite(a, sizeof(char), b, stdout) @d C_printf(c
void get_seconds_and_micros(integer *seconds, integer *micros)
Definition: texmfmp.c:1887
void do_dump(char *p, int item_size, int nitems, FILE *out_file)
Definition: texmfmp.c:2238
string translate_filename
Definition: texmfmp.c:557
void init_start_time()
Definition: texmfmp.c:1793
void topenin(void)
Definition: texmfmp.c:818
string default_translate_filename
Definition: texmfmp.c:558
void get_date_and_time(integer *minutes, integer *day, integer *month, integer *year)
Definition: texmfmp.c:1825
void maininit(int ac, string *av)
Definition: texmfmp.c:594
void do_undump(char *p, int item_size, int nitems, FILE *in_file)
Definition: texmfmp.c:2262
int main(int ac, string *av)
Definition: texmfmp.c:791
boolean input_line(FILE *f)
Definition: texmfmp.c:1933
boolean texmf_yesno(const_string var)
Definition: texmfmp.c:579
int argc
Definition: texmfmp.c:544
void calledit(packedASCIIcode *filename, poolpointer fnstart, integer fnlength, integer linenumber)
Definition: texmfmp.c:2009
static int Isspace(char c)
Definition: texmfmp.c:86
char ** argv
Definition: texmfmp.c:543
void readtcxfile(void)
int runsystem(const char *cmd)
#define malloc
Definition: alloca.c:91
void mainbody(void)
boolean recorder_enabled
Definition: openclose.c:79
void recorder_record_output(const_string)
Definition: openclose.c:186
boolean open_input(FILE **, int, const_string fopen_mode)
Definition: openclose.c:197
void recorder_record_input(const_string)
Definition: openclose.c:179
string fullnameoffile
Definition: openclose.c:75
string output_directory
Definition: openclose.c:81
string nameoffile
Definition: texfileio.c:68
integer ztakefraction(integer p, integer q)
Definition: texmfmp.c:3763
integer zmakefraction(integer p, integer q)
Definition: texmfmp.c:3821
integer zmakescaled(integer p, integer q)
Definition: texmfmp.c:3849
integer ztakescaled(integer p, integer q)
Definition: texmfmp.c:3790
void md5_append(md5_state_t *pms, const md5_byte_t *data, int nbytes)
Definition: md5.c:323
void md5_init(md5_state_t *pms)
Definition: md5.c:313
void md5_finish(md5_state_t *pms, md5_byte_t digest[16])
Definition: md5.c:361
unsigned char md5_byte_t
Definition: md5.h:63
strnumber maketexstring(const char *)
Definition: stringpool.c:249
const char * ptexbanner
void initversionstring(char **versions)
Definition: utils.c:976
void getmd5sum(strnumber s, boolean file)
static void safe_print(char *str)
Definition: utils.c:203
#define check_nprintf(size_get, size_want)
Definition: utils.c:44
#define SYNCTEX_NO_OPTION
Definition: synctex.c:164
#define __attribute__(A)
Definition: synctex.c:338
#define IPC
Definition: c-auto.h:46
strnumber makefullnamestring(void)
strnumber getjobname(strnumber)
Definition: luatex.c:953
char args[100]
Definition: fixwrites.c:7
int mf_x11_initscreen(void)
void mf_mftalk_paintrow(screenrow, pixelcolor, transspec, screencol)
int mf_uniterm_initscreen(void)
int mf_mftalk_initscreen(void)
int mf_next_initscreen(void)
void mf_uniterm_updatescreen(void)
void mf_hp2627_paintrow(screenrow, pixelcolor, transspec, screencol)
void mf_sun_blankrectangle(screencol, screencol, screenrow, screenrow)
void mf_epsf_updatescreen(void)
void mf_next_paintrow(screenrow, pixelcolor, transspec, screencol)
void mf_trap_paintrow(screenrow, pixelcolor, transspec, screencol)
Definition: trap.c:37
void mf_tektronix_blankrectangle(screencol, screencol, screenrow, screenrow)
void mf_mftalk_blankrectangle(screencol, screencol, screenrow, screenrow)
void mf_next_blankrectangle(screencol, screencol, screenrow, screenrow)
void mf_x11_blankrectangle(screencol, screencol, screenrow, screenrow)
void mf_hp2627_blankrectangle(screencol, screencol, screenrow, screenrow)
int mf_epsf_initscreen(void)
void mf_sun_updatescreen(void)
void mf_hp2627_updatescreen(void)
void mf_sun_paintrow(screenrow, pixelcolor, transspec, screencol)
void mf_win32_blankrectangle(screencol, screencol, screenrow, screenrow)
void mf_x11_updatescreen(void)
void mf_next_updatescreen(void)
void mf_uniterm_blankrectangle(screencol, screencol, screenrow, screenrow)
void mf_amiga_blankrectangle(screencol, screencol, screenrow, screenrow)
int mf_amiga_initscreen(void)
int mf_hp2627_initscreen(void)
void mf_amiga_paintrow(screenrow, pixelcolor, transspec, screencol)
int mf_sun_initscreen(void)
void mf_win32_updatescreen(void)
void mf_trap_updatescreen(void)
Definition: trap.c:21
void mf_regis_paintrow(screenrow, pixelcolor, transspec, screencol)
void mf_mftalk_updatescreen(void)
int mf_win32_initscreen(void)
void mf_regis_updatescreen(void)
void mf_regis_blankrectangle(screencol, screencol, screenrow, screenrow)
void mf_win32_paintrow(screenrow, pixelcolor, transspec, screencol)
void mf_amiga_updatescreen(void)
int mf_tektronix_initscreen(void)
void mf_tektronix_paintrow(screenrow, pixelcolor, transspec, screencol)
void mf_epsf_blankrectangle(screencol, screencol, screenrow, screenrow)
void mf_trap_blankrectangle(screencol, screencol, screenrow, screenrow)
Definition: trap.c:27
int mf_trap_initscreen(void)
Definition: trap.c:15
void mf_tektronix_updatescreen(void)
int mf_regis_initscreen(void)
void mf_x11_paintrow(screenrow, pixelcolor, transspec, screencol)
void mf_uniterm_paintrow(screenrow, pixelcolor, transspec, screencol)
void mf_epsf_paintrow(screenrow, pixelcolor, transspec, screencol)
long time_t
Definition: types.h:18
int setmode()
unsigned int sleep()
void abort()
int stat(const char *path, struct stat *sbuf)
int strncmp()
int option_index
Definition: getopt.c:147
#define vsnprintf
Definition: snprintf.c:40
#define sprintf
Definition: