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)  

sh1.c
Go to the documentation of this file.
1 int _osmajor;
2 int _osminor;
3 int _osmode;
4 
5 /*
6  * MS-DOS SHELL - Main program, memory and variable management
7  *
8  * MS-DOS SHELL - Copyright (c) 1990,4 Data Logic Limited and Charles Forsyth
9  *
10  * This code is based on (in part) the shell program written by Charles
11  * Forsyth and is subject to the following copyright restrictions:
12  *
13  * 1. Redistribution and use in source and binary forms are permitted
14  * provided that the above copyright notice is duplicated in the
15  * source form and the copyright notice in file sh6.c is displayed
16  * on entry to the program.
17  *
18  * 2. The sources (or parts thereof) or objects generated from the sources
19  * (or parts of sources) cannot be sold under any circumstances.
20  *
21  * When parts of the original 2.1 shell were replaced by the Lexical
22  * Analsyer written by Simon J. Gerraty (for his Public Domain Korn Shell,
23  * which is also based on Charles Forsyth original idea), a number of changes
24  * were made to reflect the changes Simon made to the Parse output tree. Some
25  * parts of this code in this module are based on the algorithms/ideas that
26  * he incorporated into his shell, in particular interfaces to the new Lexical
27  * Scanner.
28  *
29  * $Header: /usr/users/istewart/shell/sh2.3/Release/RCS/sh1.c,v 2.19 1994/08/25 20:49:11 istewart Exp $
30  *
31  * $Log: sh1.c,v $
32  * Revision 2.19 1994/08/25 20:49:11 istewart
33  * MS Shell 2.3 Release
34  *
35  * Revision 2.18 1994/02/23 09:23:38 istewart
36  * Beta 233 updates
37  *
38  * Revision 2.17 1994/02/01 10:25:20 istewart
39  * Release 2.3 Beta 2, including first NT port
40  *
41  * Revision 2.16 1994/01/20 14:51:43 istewart
42  * Release 2.3 Beta 1
43  *
44  * Revision 2.15 1994/01/11 17:55:25 istewart
45  * Release 2.3 Beta 0 patches
46  *
47  * Revision 2.14 1993/12/01 11:58:34 istewart
48  * Release 226 beta
49  *
50  * Revision 2.13 1993/11/09 10:39:49 istewart
51  * Beta 226 checking
52  *
53  * Revision 2.12 1993/08/25 16:03:57 istewart
54  * Beta 225 - see Notes file
55  *
56  * Revision 2.11 1993/07/02 10:21:35 istewart
57  * 224 Beta fixes
58  *
59  * Revision 2.10 1993/06/16 12:55:49 istewart
60  * Fix the -s and -t options so they work
61  *
62  * Revision 2.9 1993/06/14 11:00:12 istewart
63  * More changes for 223 beta
64  *
65  * Revision 2.8 1993/06/02 09:52:35 istewart
66  * Beta 223 Updates - see Notes file
67  *
68  * Revision 2.7 1993/02/16 16:03:15 istewart
69  * Beta 2.22 Release
70  *
71  * Revision 2.6 1993/01/26 18:35:09 istewart
72  * Release 2.2 beta 0
73  *
74  * Revision 2.5 1992/12/14 10:54:56 istewart
75  * BETA 215 Fixes and 2.1 Release
76  *
77  * Revision 2.4 1992/11/06 10:03:44 istewart
78  * 214 Beta test updates
79  *
80  * Revision 2.3 1992/09/03 18:54:45 istewart
81  * Beta 213 Updates
82  *
83  * Revision 2.2 1992/07/16 14:33:34 istewart
84  * Beta 212 Baseline
85  *
86  * Revision 2.1 1992/07/10 10:52:48 istewart
87  * 211 Beta updates
88  *
89  * Revision 2.0 1992/04/13 17:39:09 Ian_Stewartson
90  * MS-Shell 2.0 Baseline release
91  */
92 
93 #include <sys/types.h>
94 #include <sys/stat.h>
95 #include <stdio.h>
96 #include <stdlib.h>
97 #include <signal.h>
98 #include <errno.h>
99 #include <setjmp.h>
100 #include <stdarg.h>
101 #include <string.h>
102 #include <unistd.h>
103 #include <ctype.h>
104 #include <fcntl.h>
105 #include <limits.h>
106 #include <dirent.h>
107 #include <time.h>
108 #include "sh.h"
109 
110 /* OS2 or DOS, DEBUG MEMORY or normal malloc */
111 
112 #ifdef OS2_DOSALLOC
113 # ifdef DEBUG_MEMORY
114 # define RELEASE_MEMORY(x) if (DosFreeSeg (SELECTOROF ((x)))) \
115  fprintf(stderr, "Memory Release error\n");
116 # else
117 # define RELEASE_MEMORY(x) DosFreeSeg (SELECTOROF ((x)))
118 # endif
119 
120 #else
121 # define RELEASE_MEMORY(x) free ((x))
122 #endif
123 
124 /*
125  * Structure of Malloced space to allow release of space nolonger required
126  * without having to know about it.
127  */
128 
129 typedef struct region {
130  struct region *next;
131  size_t nbytes;
132  int area;
134 
135 static struct region *MemoryAreaHeader = (s_region *)NULL;
136 
137 /*
138  * default shell, search rules
139  */
140 
141 #if (OS_TYPE == OS_UNIX)
142 static char *shellname = "/bin/pksh";
143 static char search[] = ":/bin:/usr/bin";
144 
145 extern char **environ;
146 #else
147 static char *shellname = "c:/bin/sh.exe";
148 static char search[] = ""; /* changed by --ak 2020/05.03 */
149 #endif
150 static char *ymail = "You have mail";
151 static char *ShellNameLiteral = "sh";
152 static char *ShellOptions = "D:MPRX:abc:defghijklmnopqrtsuvwxyz0";
153 
154 #if (OS_TYPE != OS_DOS)
155 static char DefaultWinTitle[] = "MS Shell";
156 #endif
157 
158 #if (OS_TYPE == OS_OS2)
159 # if (OS_SIZE == OS_32)
160 static HEV SessionQueueSema = 0;
161 static HQUEUE SessionQueueHandler = 0;
162 # else
163 static HSEM SessionQueueSema = 0;
164 static HQUEUE SessionQueueHandler = 0;
165 # endif
166 #endif
167 
168 static char *tilde = "~";
169 static char LIT_OSmode[] = "OSMODE";
170 static char LIT_SHmode[] = "SHMODE";
171 static char LIT_Dollar[] = "$";
172 #if (OS_TYPE == OS_DOS)
173 static char *NOExit = "sh: ignoring attempt to leave lowest level shell";
174 #endif
177 static unsigned int ATOE_GFlags; /* Twalk GLOBAL flags */
178 static unsigned int ATNE_Function; /* Twalk GLOBAL flags */
179 
180 /*
181  * Count value for counting the number entries in an array
182  */
183 
184 static int Count_Array; /* Array size */
185 static char *Count_Name; /* Array name */
186 
187 /* Integer Variables */
188 
189 static struct ShellVariablesInit {
190  char *Name; /* Name of variable */
191  int Status; /* Initial status */
192  char *CValue;
194  { LIT_COLUMNS, STATUS_INTEGER, "80" },
197  { LIT_LINES, STATUS_INTEGER, "25" },
198  { OptIndVariable, STATUS_INTEGER, "1" },
199  { StatusVariable, STATUS_INTEGER, "0" },
201  null },
203  null },
205  STATUS_INTEGER), null },
207  STATUS_INTEGER), null },
209  null },
210 
211  { LastWordVariable, STATUS_EXPORT, null },
213  search },
215  " \t\n" },
217  "%e$ " },
219  "> " },
220  { PS3, STATUS_EXPORT, "#? " },
221  { PS4, STATUS_EXPORT, "+ " },
222  { HomeVariableName, STATUS_EXPORT, null },
223  { ShellVariableName, STATUS_EXPORT, null },
224 
225 #if (OS_TYPE != OS_DOS)
226  { WinTitleVariable, 0, DefaultWinTitle },
227 #endif
228 
229  { (char *)NULL, 0 }
230 };
231 
232 /*
233  * List of Editor variables
234  */
235 
236 #if defined (FLAGS_EMACS) || defined (FLAGS_VI) || defined (FLAGS_GMACS)
237 static char *EditorVariables[] = {
239 };
240 #endif
241 
242  /* Entry directory */
243 static char Start_directory[PATH_MAX + 6] = { 0 };
244 #if _MSC_VER < 1600
245 static time_t ShellStartTime = 0; /* Load time of shell */
246 #else
247 static time_t ShellStartTime = 0LL; /* Load time of shell */
248 #endif
249  /* Original Interrupt 24 address */
250 #if (OS_TYPE == OS_DOS) && !defined (__EMX__)
251 #if defined (__WATCOMC__)
252 # define INTERRUPT_TYPE __interrupt __far
253 # else
254 # define INTERRUPT_TYPE interrupt far
255 # endif
256 static void (INTERRUPT_TYPE *Orig_I24_V) (void);
257 #endif
258 
259 #ifdef SIGQUIT
260 static void (*qflag)(int) = SIG_IGN;
261 #endif
262 
263 /* Functions */
264 
265 static int F_LOCAL RunCommands (Source *);
266 static unsigned char * F_LOCAL CheckClassExpression (unsigned char *, int,
267  bool);
268 static bool F_LOCAL Initialise (int, char **);
269 static void F_LOCAL CheckForMailArriving (void);
270 static void F_LOCAL LoadGlobalVariableList (void);
271 static void F_LOCAL LoadTheProfileFiles (void);
272 static void F_LOCAL ConvertUnixPathToMSDOS (char *);
273 static void F_LOCAL ClearUserPrompts (void);
274 static void F_LOCAL SecondAndRandomEV (char *, long);
275 static void F_LOCAL SetUpParameterEV (int, char **, char *);
277 static void F_LOCAL SetUpANumericValue (VariableList *, long, int);
278 static void F_LOCAL ProcessErrorExit (char *, va_list);
279 static char * F_LOCAL SuppressSpacesZeros (VariableList *, char *);
280 static void AddToNewEnvironment (const void *, VISIT, int);
281 static void AddToOldEnvironment (const void *, VISIT, int);
282 static void DeleteEnvironment (const void *, VISIT, int);
283 static void F_LOCAL CheckOPTIND (char *, long);
284 static void F_LOCAL CreateIntegerVariables (void);
285 static bool F_LOCAL ExecuteShellScript (char *);
286 static void CountEnvironment (const void *, VISIT, int);
287 
288 /*
289  * Process termination
290  */
291 
292 #if (OS_TYPE != OS_DOS)
293 static void F_LOCAL CheckForTerminatedProcess (void);
294 
295 # if (OS_TYPE == OS_NT)
296 static void LookUpJobs (const void *, VISIT, int);
297 # endif
298 
299 #else
300 # define CheckForTerminatedProcess()
301 #endif
302 
303 /*
304  * No real argv interface
305  */
306 
307 #if (OS_TYPE == OS_UNIX)
308 #define Pre_Process_Argv(a,b)
309 #else
310 static void F_LOCAL Pre_Process_Argv (char **, int *);
311 #endif
312 
313 /*
314  * OS/2 Session Queues
315  */
316 
317 #if (OS_TYPE == OS_OS2)
318 static void F_LOCAL CheckForSessionEnd (void);
319 static void F_LOCAL CreateTerminationQueues (void);
320 #else
321 # define CheckForSessionEnd()
322 # define CreateTerminationQueues()
323 #endif
324 
325 #if defined (FLAGS_EMACS) || defined (FLAGS_VI) || defined (FLAGS_GMACS)
326 static void F_LOCAL SetEditorMode (char *);
327 #endif
328 
329 /*
330  * The Program Name and Command Line, set up by stdargv.c
331  */
332 
333 #if (OS_TYPE != OS_UNIX)
334 extern char *_APgmName;
335 extern char *_ACmdLine;
336 #endif
337 
338 
339 #include <windows.h>
340 #include <winbase.h>
341 #include <malloc.h>
342 
343 /* added by Akira Kakuto 1997 07/20 */
345 /* end of additon */
346 
347 /*
348  * The main program starts here
349  */
350 
351 #if _MSC_VER > 1599 /* 1600 for Visual Studio 2010 */
352 /* Invalid parameter handler */
353 static void myInvalidParameterHandler(const wchar_t * expression,
354  const wchar_t * function,
355  const wchar_t * file,
356  unsigned int line,
357  uintptr_t pReserved)
358 {
359 /*
360  I return silently to avoid a crash at i = close (fid) in the line
361  518 of sh8.c in the case of Visual Studio 2010.
362  I hope it is not dangerous.
363 */
364  return;
365 }
366 #endif
367 
368 void main (int argc, char **argv)
369 {
370  int cflag = 0;
371  int sc;
372  char *name = *argv;
373  /* Load up various parts of the */
374  /* system */
375  bool OptionsRflag = Initialise (argc, argv);
376  bool OptionsXflag = FALSE; /* -x option from */
377  /* command line */
378  bool Level0Shell = FALSE; /* Level 0 (read profile)*/
379  jmp_buf ReturnPoint;
380  char *cp;
381  Source *s;
382  int fid;
383  bool TTYInput;
384  bool PIPEInput;
385  bool RootShell = FALSE;
386 /*
387  added by Akira Kakuto 1997/03/08
388 */
389  OSVERSIONINFO *vinfo;
390 
391 #if _MSC_VER > 1599 /* 1600 for Visual Studio 2010 */
392  _set_invalid_parameter_handler(myInvalidParameterHandler);
393 #endif
394 
395  vinfo = (OSVERSIONINFO *)malloc(sizeof(OSVERSIONINFO));
396  vinfo->dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
397  (void)GetVersionEx(vinfo);
398  _osmajor = vinfo->dwMajorVersion;
399  _osminor = vinfo->dwMinorVersion;
400  _osmode = vinfo->dwPlatformId;
401  free(vinfo);
402 /*
403  end of addition
404 */
405  SetWindowName ((char *)NULL);
406 
407 /* Create Parse input */
408 
409  s = pushs (SFILE);
410  s->u.file = stdin;
411 
412 /* Set up start time */
413 
415 
416 /* Preprocess options to convert two character options of the form /x to
417  * -x. Some programs!!
418  */
419 
420  if (argc > 1)
422 
423 /* Save the start directory for when we exit */
424 
426 
427 /* Process the options */
428 
429  while ((sc = GetOptions (argc, argv, ShellOptions, GETOPT_MESSAGE)) != EOF)
430  {
431  switch (sc)
432  {
433  case '?':
434  FinalExitCleanUp (1);
435 
436  case '0': /* Level 0 flag for DOS */
437  Level0Shell = TRUE;
438  break;
439 
440  case 'r': /* Restricted */
441  OptionsRflag = TRUE;
442  break;
443 
444  case 'c': /* Command on line */
445  ClearUserPrompts ();
446  cflag = 1;
447  s->type = SSTRING;
448  s->str = OptionArgument;
450  break;
451 
452  case 'q': /* No quit ints */
453 #ifdef SIGQUIT
454  qflag = SIG_DFL;
455 #endif
456  break;
457 
458 
459  case 'X':
461  {
462  PrintErrorMessage ("%s: bad directory", OptionArgument);
463  FinalExitCleanUp (1);
464  }
465 
466  break;
467 
468  case 'x':
469  OptionsXflag = TRUE;
470  break;
471 
472  case 'M':
474  break;
475 
476  case 'D':
478  break;
479 
480  case 'R':
481  RootShell = TRUE;
482  ChangeInitLoad = TRUE; /* Change load .ini pt. */
483  break;
484 
485 #if (OS_TYPE != OS_DOS)
486  case 'P': /* Use real pipes */
488  break;
489 #endif
490 
491  case 's': /* standard input */
492  if (cflag)
493  PrintErrorMessage ("cannot use -s and -c together");
494 
495  case 'i': /* Set interactive */
497 
498  default:
499  if (islower (sc))
500  FL_SET (sc);
501  }
502 
503 /* If -s, set the argv to point to -s so that the rest of the parameters
504  * get used as parameters ($digit) values.
505  */
506 
507  if (FL_TEST (FLAG_POSITION))
508  {
509  OptionIndex--;
510  break;
511  }
512  }
513 
514 /* Under UNIX, check for login shell */
515 
516 #if (OS_TYPE == OS_UNIX)
517  if (*argv[0] == '-')
518  Level0Shell = TRUE;
519 #endif
520 
521  argv += OptionIndex;
522  argc -= OptionIndex;
523 
524 /* Get configuration info */
525 
526  Configure_Keys ();
527 
528 /*
529  * Check for terminal input. A special case for OS/2. If pipe input and
530  * output and no arguments, set interactive flag.
531  *
532  * Unset the variable after!
533  */
534 
535  TTYInput = C2bool ((IS_TTY (0) && IS_TTY (1)));
536  PIPEInput = C2bool ((IS_Pipe (0) && IS_Pipe (1) &&
537  (GetVariableAsString (LIT_AllowTTY, FALSE) != null)));
538 
540 
541  if ((s->type == SFILE) &&
542  ((FL_TEST (FLAG_INTERACTIVE)) || TTYInput || PIPEInput) &&
543  !cflag &&
544  ((argc == 0) || FL_TEST (FLAG_POSITION)))
545  {
546  s->type = STTY;
550 
551  if (TTYInput)
552  PrintVersionNumber (stderr);
553  }
554 
555 /* Root shell - check only tty devices */
556 
557  if (RootShell)
558  {
559  if ((s->type != STTY) || !TTYInput)
560  PrintErrorMessage ("-R not valid on non-interactive shells");
561 
562 #if (OS_TYPE == OS_DOS) && !defined (__EMX__)
563  Orig_I24_V = (void (INTERRUPT_TYPE *)())NULL;
564 #endif
565  }
566 
567 /*
568  * Execute commands from a file? - disable prompts
569  */
570 
571  if ((s->type == SFILE) && (argc > 0) && !InteractiveFlag)
572  {
573  ClearUserPrompts ();
574  name = *argv;
575 
576  if (((fid = S_open (FALSE, s->file = name, O_RMASK)) < 0) ||
577  ((s->u.file = MyReOpenFile (ReMapIOHandler (fid), sOpenReadMode))
578  == (FILE *)NULL))
579  {
580  PrintErrorMessage (LIT_Emsg, "cannot open script", name,
581  strerror (errno));
582  FinalExitCleanUp (1);
583  }
584 
585 /* Un-map this file descriptor from the current environment so it does not
586  * get closed at the wrong times
587  */
589 
590 
591 #if (OS_TYPE != OS_DOS)
592  SetVariableFromString (WinTitleVariable, name);
593 #endif
594  }
595 
596 /* Setup stderr, stdout buffering */
597 
598  setvbuf (stderr, (char *)NULL, _IONBF, 0);
599 
600  if (InteractiveFlag && !IS_TTY (1))
601  setvbuf (stdout, (char *)NULL, _IOLBF, BUFSIZ);
602 
603 /* Set up the $- variable */
604 
605  SetShellSwitches ();
606 
607 #ifdef SIGQUIT
608  signal (SIGQUIT, qflag);
609 #endif
610 
611 /* Set up signals */
612 
613  if (InteractiveFlag)
614  signal (SIGTERM, TerminateSignalled);
615 
616 /* Load any parameters */
617 
619 
620 /* Return point */
621 
622  if (SetErrorPoint (ReturnPoint))
624 
625 #if (OS_TYPE == OS_NT)
626  SetConsoleCtrlHandler ((PHANDLER_ROUTINE) &CtrlHandler, TRUE);
627 #endif
628  signal (SIGINT, InterruptSignalled);
629 
630 /* Read profile ?. Init EMAC first for binding keys */
631 
632  if (((name != (char *)NULL) && (*name == CHAR_HYPHEN)) || Level0Shell)
633  {
634 #if defined (FLAGS_EMACS) || defined (FLAGS_GMACS)
636 # endif
638  }
639 
640 /*
641  * Load history and configure
642  */
643 
644  if (s->type == STTY)
645  {
647  LoadHistory ();
648  }
649 
650 /*
651  * If the x or r flag was set on the command line, set it now after the
652  * profiles have been executed.
653  */
654 
655  if (OptionsXflag)
657 
658  if (OptionsRflag)
659  {
662  }
663 
664 /*
665  * Execute $ENV
666  *
667  * TOCHECK - substitute (cp, DOTILDE);
668  */
669 
670  if ((cp = GetVariableAsString (ENVVariable, FALSE)) != null)
672 
673 /* If interactive, set up Editor modes */
674 
675 #if defined (FLAGS_EMACS) || defined (FLAGS_VI) || defined (FLAGS_GMACS)
676  if (InteractiveFlag)
677  {
678  char **rep = EditorVariables;
679 
680  while (*rep != (char *)NULL)
681  {
682  if ((cp = GetVariableAsString (*(rep++), FALSE)) != null)
683  {
684  SetEditorMode (cp);
685  break;
686  }
687  }
688  }
689 #endif
690 
691 /*
692  * Execute what ever we have to do!!
693  */
694 
695  while (TRUE)
696  {
697  switch (SetErrorPoint (ReturnPoint))
698  {
699  case TERMINATE_POINT_SET:
700  RunCommands (s); /* Drop to exit */
701 
702  case TERMINATE_COMMAND:
703  default:
705 
706 /* Re-set TTY input. If we reach this point, the shell is a root shell and
707  * the no exit message has been displayed. Reset the shell for input from the
708  * TTY.
709  */
710 
711  case TERMINATE_SHELL:
712  s->type = STTY;
713  break;
714  }
715  }
716 }
717 
718 /*
719  * Process a script file
720  */
721 
722 static bool F_LOCAL ExecuteShellScript (char *name)
723 {
724  FILE *f = stdin;
725  int fp;
726  Source *s;
727 
728  if (strcmp (name, "-") != 0)
729  {
730  if ((fp = OpenForExecution (name, (char **)NULL, (int *)NULL)) < 0)
731  return FALSE;
732 
733  if ((f = MyReOpenFile (fp = ReMapIOHandler (fp),
734  sOpenReadMode)) == (FILE *)NULL)
735  return FALSE;
736  }
737 
738  (s = pushs (SFILE))->u.file = f;
739  s->file = name;
740 
741  RunCommands (s);
742 
743  if (f != stdin)
744  CloseFile (f);
745 
746  return TRUE;
747 }
748 
749 /*
750  * run the commands from the input source, returning status.
751  */
752 
754 {
755  int i;
756  jmp_buf ReturnPoint;
757  C_Op *t = (C_Op *)NULL;
758  bool wastty;
759  int EntryMemoryLevel = MemoryAreaLevel + 1;
760 
764 
765 /*
766  * Run until the end
767  */
768 
769  while (TRUE)
770  {
771 
772 /* Initialise space */
773 
774  MemoryAreaLevel = EntryMemoryLevel;
776  SW_intr = 0;
778 
779  if (src->next == NULL)
780  src->echo = C2bool (FL_TEST (FLAG_ECHO_INPUT));
781 
782 /*
783  * Set up a few things for console input - cursor, mail prompt etc
784  */
785 
786  if ((wastty = C2bool (src->type == STTY)))
787  {
791  CloseAllHandlers (); /* Clean up any open shell files */
792  }
793 
795  FlushStreams (); /* Clear output */
796 
797 /* Set execute function recursive level and the SubShell count to zero */
798 
800 
801 /* Set up Redirection IO (Saved) array and SubShell Environment information */
802 
803  NSave_IO_E = 0; /* Number of entries */
804  MSave_IO_E = 0; /* Max Number of entries */
805  NSubShells = 0; /* Number of entries */
806  MSubShells = 0; /* Max Number of entries */
811  Break_List = (Break_C *)NULL;
812  Return_List = (Break_C *)NULL;
813  SShell_List = (Break_C *)NULL;
815 
816 /* Get the line and process it */
817 
818  if (SetErrorPoint (ReturnPoint) ||
819  ((t = BuildParseTree (src)) == (C_Op *)NULL) || SW_intr)
820  {
821  ScrapHereList ();
822 
825 
826 /* Go round again */
827 
828  src->str = null;
829  SW_intr = 0;
830  continue;
831  }
832 
833 /* Ok - reset some variables and then execute the command tree */
834 
835  SW_intr = 0;
837  FlushHistoryBuffer (); /* Save history */
838 
839 /* Check for exit */
840 
841  if ((t != NULL) && (t->type == TEOF))
842  {
843  if (wastty && (ShellGlobalFlags & FLAGS_IGNOREEOF))
844  {
845  PrintWarningMessage ("Use `exit'");
846  src->type = STTY;
847  continue;
848  }
849 
850  else
851  break;
852  }
853 
854 /* Execute the parse tree */
855 
856  if ((SetErrorPoint (ReturnPoint) == 0) &&
857  ((!FL_TEST (FLAG_NO_EXECUTE)) || (src->type == STTY)))
859 
860 /* Make sure the I/O and environment are back at level 0 and then clear them */
861 
865 
866  if (NSubShells != 0)
868 
869  if (NSave_IO_E)
870  RestoreStandardIO (0, TRUE);
871 
872  if (MSubShells)
873  ReleaseMemoryCell ((void *)SubShells);
874 
875  if (MSave_IO_E)
876  ReleaseMemoryCell ((void *)SSave_IO);
877 
878  /* Check for interrupts */
879 
881  {
884  }
885 
886 /* Run any traps that are required */
887 
888  if ((i = InterruptTrapPending) != 0)
889  {
891  RunTrapCommand (i);
892  }
893  }
894 
895 /*
896  * Terminate the current environment
897  */
898 
900  return ExitStatus;
901 }
902 
903 /*
904  * Set up the value of $-
905  */
906 
907 void SetShellSwitches (void)
908 {
909  char *cp, c;
910  char m['z' - 'a' + 2];
911 
912  for (cp = m, c = 'a'; c <= 'z'; ++c)
913  {
914  if (FL_TEST (c))
915  *(cp++) = c;
916  }
917 
919  *(cp++) = 'M';
920 
921  *cp = 0;
923 }
924 
925 /*
926  * Terminate current environment with an error
927  */
928 
930 {
931  FlushStreams (); /* Clear output */
932 
935 
936  /* NOTREACHED */
937 }
938 
939 /*
940  * Exit the shell
941  */
942 
943 void ExitTheShell (bool ReturnRequired)
944 {
945  FlushStreams (); /* Clear output */
946 
949 
950 #if (OS_TYPE == OS_DOS) && !defined (__EMX__)
951  if (Orig_I24_V == (void (INTERRUPT_TYPE *)())NULL)
952  {
953  feputs (NOExit);
954 
955  if (!ReturnRequired)
957  }
958 #endif
959 
960 /* Clean up */
961 
962  ScrapHereList ();
964 
965 /* Trap zero on exit */
966 
967  RunTrapCommand (0);
968 
969 /* Dump history on exit */
970 
971  DumpHistory ();
972 
973  CloseAllHandlers ();
974 
975 /* Clear swap file if necessary */
976 
977  ClearSwapFile ();
978 
979 /* If this is a command only - restore the directory because DOS doesn't
980  * and the user might expect it
981  */
982 
983  if (*Start_directory)
985 
986 /* If this happens during startup - we restart */
987 
988 #if (OS_TYPE == OS_DOS) && !defined (__EMX__)
989  if (Orig_I24_V == (void (INTERRUPT_TYPE *)())NULL)
990  return;
991 #endif
992 
993 /*
994  * Clean up any Here Document files left in the function tree
995  */
996 
998 
999 /* Exit - hurray */
1000 
1002 
1003 /* NOTREACHED */
1004 }
1005 
1006 /*
1007  * Output warning message
1008  */
1009 
1010 int PrintWarningMessage (char *fmt, ...)
1011 {
1012  va_list ap;
1013 
1014  va_start (ap, fmt);
1015  vfprintf (stderr, fmt, ap);
1017  ExitStatus = -1;
1018 
1019 /* If leave on error - exit */
1020 
1022  ExitTheShell (FALSE);
1023 
1024  va_end (ap);
1025  return 1;
1026 }
1027 
1028 /*
1029  * Shell error message
1030  */
1031 
1032 void ShellErrorMessage (char *fmt, ...)
1033 {
1034  va_list ap;
1035 
1036 /* Error message processing */
1037 
1038  if (source->file == (char *)NULL)
1039  feputs ("sh: ");
1040 
1041  else
1042  fprintf (stderr, "%s: at line %d, ", source->file, source->line);
1043 
1044  va_start (ap, fmt);
1045  ProcessErrorExit (fmt, ap);
1046  va_end (ap);
1047 }
1048 
1049 /*
1050  * Output error message
1051  */
1052 
1053 void PrintErrorMessage (char *fmt, ...)
1054 {
1055  va_list ap;
1056 
1057 /* Error message processing */
1058 
1059  va_start (ap, fmt);
1060  ProcessErrorExit (fmt, ap);
1061  va_end (ap);
1062 }
1063 
1064 /*
1065  * Common processing for PrintErrorMessage and ShellError Message
1066  */
1067 
1068 static void F_LOCAL ProcessErrorExit (char *fmt, va_list ap)
1069 {
1070  vfprintf (stderr, fmt, ap);
1072 
1073  ExitStatus = -1;
1074 
1076  ExitTheShell (FALSE);
1077 
1078 /* Error processing */
1079 
1080  if (FL_TEST (FLAG_NO_EXECUTE))
1081  return;
1082 
1083 /* If not interactive - exit */
1084 
1085  if (!InteractiveFlag)
1086  ExitTheShell (FALSE);
1087 
1090 
1091 /* CloseAllHandlers (); Removed - caused problems. There may be problems
1092  * remaining with files left open?
1093  */
1094 }
1095 
1096 /*
1097  * Create or delete a new environment. If f is set, delete the environment
1098  */
1099 
1101 {
1103 
1104 /* Create a new environment */
1105 
1106  if ((ep = (ShellFileEnvironment *)
1108  == (ShellFileEnvironment *)NULL)
1109  {
1110  while (e.PreviousEnvironment)
1112 
1114  }
1115 
1116  *ep = e;
1117  e.PreviousEnvironment = ep;
1118  e.IOMap = 0L;
1119  e.OpenStreams = (Word_B *)NULL;
1120 }
1121 
1122 /*
1123  * Exit the current environment successfully
1124  */
1125 
1127 {
1129  unsigned long FdMap;
1130  Word_B *wb;
1131  int NEntries;
1132  int i;
1133 
1134 /* Restore old environment, delete the space and close any files opened in
1135  * this environment
1136  */
1137 
1139  {
1140 
1141 /* Close opened streams */
1142 
1143  wb = e.OpenStreams;
1144  NEntries = WordBlockSize (wb);
1145 
1146  for (i = 0; i < NEntries; i++)
1147  {
1148  if (wb->w_words[i] != (char *)NULL)
1149  fclose ((FILE *)wb->w_words[i]);
1150  }
1151 
1152 /* Get the files used in this environment to close */
1153 
1154  FdMap = e.IOMap;
1155  e = *ep;
1156 
1157  ReleaseMemoryCell ((void *)ep);
1158 
1159  for (i = 0; i < 32; i++)
1160  {
1161  if (FdMap & (1L << i))
1162  S_close (i + FDBASE, TRUE);
1163  }
1164  }
1165 }
1166 
1167 /*
1168  * Convert binary to ascii
1169  */
1170 
1171 char *IntegerToString (int n)
1172 {
1173  static char nt[10];
1174 
1175  sprintf (nt, "%u", n);
1176  return nt;
1177 }
1178 
1179 /*
1180  * SIGINT interrupt processing
1181  */
1182 
1183 #if (OS_TYPE == OS_NT)
1184 BOOL CtrlHandler (DWORD CtrlType)
1185 {
1186  if (CtrlType == CTRL_C_EVENT)
1187  {
1188  fprintf (stderr, "Ctrl-C\n"); fflush (stderr);
1189  return TRUE;
1190  }
1191  return FALSE;
1192 }
1193 #endif
1194 
1195 void InterruptSignalled (int signo)
1196 {
1197 /* Restore signal processing and set SIGINT detected flag */
1198 
1199  signal (signo, InterruptSignalled);
1200 
1201 #if SIGNALDEBUG
1202  fprintf (stderr, "Interrupt %d detected\n", signo); fflush (stderr);
1203 #endif
1204 
1205 /* Under OS/2, if the Ignore Interrupts flag is set, ignore them. To do
1206  * with starting OS/2 programs in sh3.c
1207  */
1208 
1209 #if (OS_TYPE != OS_DOS)
1210  if (IgnoreInterrupts)
1211  return;
1212 #endif
1213 
1214 /* Set interrupt detected */
1215 
1216  SW_intr = 1;
1217 
1218 /* Zap the swap file, just in case it got corrupted */
1219 
1220  ClearSwapFile ();
1221 
1222 /* Are we talking to the user? Yes - Abandon processing */
1223 
1224  if (InteractiveFlag)
1226 
1227 /* No - exit */
1228 
1229  else
1230  {
1232  ExitStatus = 1;
1233  ExitTheShell (FALSE);
1234  }
1235 }
1236 
1237 /*
1238  * Grap some space and check for an error
1239  */
1240 
1241 void *GetAllocatedSpace (size_t n)
1242 {
1243  void *cp;
1244 
1245  if ((cp = AllocateMemoryCell (n)) == (void *)NULL)
1247 
1248  return cp;
1249 }
1250 
1251 /*
1252  * Re-allocate some space
1253  */
1254 
1255 void *ReAllocateSpace (void *OldSpace, size_t NewSize)
1256 {
1257  void *NewSpace;
1258 
1259  if ((NewSpace = GetAllocatedSpace (NewSize)) == (void *)NULL)
1260  return NewSpace;
1261 
1262  if (OldSpace != (void *)NULL)
1263  {
1264  size_t OldSize = ((s_region *)((char *)OldSpace -
1265  sizeof (s_region)))->nbytes;
1266 
1267  SetMemoryAreaNumber (NewSpace, GetMemoryAreaNumber (OldSpace));
1268  memcpy (NewSpace, OldSpace, OldSize);
1269  ReleaseMemoryCell (OldSpace);
1270  }
1271 
1272  return NewSpace;
1273 }
1274 
1275 
1276 /*
1277  * Duplicate a memory Area
1278  */
1279 
1281 {
1282  void *new;
1283  size_t len = ((s_region *)((char *)cell - sizeof (s_region)))->nbytes;
1284 
1285  if ((new = AllocateMemoryCell (len)) == (void *)NULL)
1287 
1288  else
1289  memcpy (new, cell, len);
1290 
1291  return new;
1292 }
1293 
1294 
1295 /*
1296  * Get memory Area size
1297  */
1298 
1299 size_t GetMemoryCellSize (void *cell)
1300 {
1301  return ((s_region *)((char *)cell - sizeof (s_region)))->nbytes;
1302 }
1303 
1304 /*
1305  * Save a string in a given area
1306  */
1307 
1308 char *StringSave (char *s)
1309 {
1310  char *cp;
1311 
1312  if ((cp = GetAllocatedSpace (strlen (s) + 1)) != (char *)NULL)
1313  {
1314  SetMemoryAreaNumber ((void *)cp, 0);
1315  return strcpy (cp, s);
1316  }
1317 
1318  return null;
1319 }
1320 
1321 /*
1322  * Duplicate at current Memory level
1323  */
1324 
1325 char *StringCopy (char *s)
1326 {
1327  char *cp;
1328 
1329  if ((cp = GetAllocatedSpace (strlen (s) + 1)) != (char *)NULL)
1330  return strcpy (cp, s);
1331 
1332  return null;
1333 }
1334 
1335 /*
1336  * trap handling - Save signal number and restore signal processing
1337  */
1338 
1340 {
1341  if (i == SIGINT) /* Need this because swapper sets it */
1342  {
1343  SW_intr = 0;
1344 
1345 /* Zap the swap file, just in case it got corrupted */
1346 
1347  ClearSwapFile ();
1348  }
1349 
1352 }
1353 
1354 /*
1355  * Execute a trap command
1356  *
1357  * 0 - exit trap
1358  * -1 - Debug Trap
1359  * -2 - Error Trap
1360  */
1361 
1362 void RunTrapCommand (int i)
1363 {
1364  Source *s;
1365  char *trapstr;
1366  char tval[10];
1367  char *tvalp = tval;
1368 
1369 /* Check for special values and recursion */
1370 
1371  if (i == -1)
1372  {
1373  tvalp = Trap_DEBUG;
1374 
1375  if (ProcessingDEBUGTrap)
1376  return;
1377 
1379  }
1380 
1381 /* Error trap */
1382 
1383  else if (i == -2)
1384  {
1385  tvalp = Trap_ERR;
1386 
1387  if (ProcessingERRORTrap)
1388  return;
1389 
1391  }
1392 
1393  else
1394  sprintf (tval, "~%d", i);
1395 
1396  if ((trapstr = GetVariableAsString (tvalp, FALSE)) == null)
1397  return;
1398 
1399 /* If signal zero, save a copy of the trap value and then delete the trap */
1400 
1401  if (i == 0)
1402  {
1403  trapstr = StringCopy (trapstr);
1404  UnSetVariable (tval, -1, TRUE);
1405  }
1406 
1407  (s = pushs (SSTRING))->str = trapstr;
1408  RunACommand (s, (char **)NULL);
1409 
1412 }
1413 
1414 /*
1415  * Find the given name in the dictionary and return its value. If the name was
1416  * not previously there, enter it now and return a null value.
1417  */
1418 
1419 VariableList *LookUpVariable (char *name, /* Variable name */
1420  int Index, /* Array Index */
1421  bool cflag) /* Create flag */
1422 {
1423  VariableList *vp;
1424  VariableList **vpp;
1425  int c;
1426  static VariableList dummy;
1427  void (*save_signal)(int);
1428 
1429 /* Set up the dummy variable */
1430 
1431  memset (&dummy, 0, sizeof (VariableList));
1432  dummy.name = name;
1433  dummy.status = STATUS_READONLY;
1434  dummy.value = null;
1435 
1436 /* If digit string - use the dummy to return the value */
1437 
1438  if (isdigit (*name))
1439  {
1440  for (c = 0; isdigit (*name) && (c < 1000); name++)
1441  c = c * 10 + *name - '0';
1442 
1443  c += Index;
1444  dummy.value = (c <= ParameterCount) ? ParameterArray[c] : null;
1445  return &dummy;
1446  }
1447 
1448 /* Look up in list */
1449 
1450  dummy.index = Index;
1452 
1453 /* If we found it, return it */
1454 
1455  if (vpp != (VariableList **)NULL)
1456  {
1457  vp = *vpp;
1458 
1459 /* Special processing for SECONDS and RANDOM */
1460 
1461  if (!strcmp (name, SecondsVariable) &&
1463 #if _MSC_VER < 1600
1465 #else
1466  SetUpANumericValue (vp, (long)(time ((time_t *)NULL) - ShellStartTime), 10);
1467 #endif
1468 
1469  else if (!strcmp (name, RandomVariable) &&
1471  SetUpANumericValue (vp, (long)rand(), 10);
1472 
1473  return vp;
1474  }
1475 
1476 /* If we don't want to create it, return a dummy */
1477 
1479 
1480  if (!cflag)
1481  return &dummy;
1482 
1483 /* Create a new variable. If no memory, use the dummy */
1484 
1485  dummy.name = null;
1486 
1487  if ((vp = (VariableList *)GetAllocatedSpace (sizeof (VariableList)))
1488  == (VariableList *)NULL)
1489  return &dummy;
1490 
1491  if ((vp->name = StringCopy (name)) == null)
1492  {
1493  ReleaseMemoryCell ((void *)vp);
1494  return &dummy;
1495  }
1496 
1497 /* Set values */
1498 
1499  vp->value = null;
1500  vp->index = Index;
1501  vp->status = NSubShells ? 0 : STATUS_GLOBAL;
1502 
1503 /* Save signals */
1504 
1505  save_signal = signal (SIGINT, SIG_IGN);
1506 
1507 /* Add to the tree */
1508 
1509  if (tsearch (vp, &VariableTree, SearchVariable) == (void *)NULL)
1510  {
1511  ReleaseMemoryCell ((void *)vp->name);
1512  ReleaseMemoryCell ((void *)vp);
1513  vp = &dummy;
1514  }
1515 
1516 /* OK Added OK - set up memory */
1517 
1518  else
1519  {
1520  SetMemoryAreaNumber ((void *)vp, 0);
1521  SetMemoryAreaNumber ((void *)vp->name, 0);
1522  }
1523 
1524 /* Restore signals */
1525 
1526  signal (SIGINT, save_signal);
1527 
1528  return vp;
1529 }
1530 
1531 /*
1532  * Count the number of entries in an Array Variable
1533  */
1534 
1536 {
1537  if (isdigit (*name))
1538  return ParameterCount;
1539 
1540  Count_Array = 0;
1541  Count_Name = name;
1543  return Count_Array;
1544 }
1545 
1546 /*
1547  * TWALK - Count the Environment Variables in an array
1548  */
1549 
1550 static void CountEnvironment (const void *key, VISIT visit, int level)
1551 {
1552  if (((visit == postorder) || (visit == leaf)) &&
1553  (strcmp (Count_Name, (*(VariableList **)key)->name) == 0))
1554  Count_Array++;
1555 }
1556 
1557 /*
1558  * TFIND & TSEARCH - Search the VARIABLE TREE for an entry
1559  */
1560 
1561 int SearchVariable (const void *key1, const void *key2)
1562 {
1563  int diff;
1564 
1565  if ((diff = strcmp (((VariableList *)key1)->name,
1566  ((VariableList *)key2)->name)) != 0)
1567  return diff;
1568 
1569  return ((VariableList *)key1)->index - ((VariableList *)key2)->index;
1570 }
1571 
1572 /*
1573  * Execute an assignment. If a valid assignment, load it into the variable
1574  * list.
1575  *
1576  * If value is not NULL, assign it. Otherwise don't
1577  */
1578 
1579 bool AssignVariableFromString (char *String, /* The assignment string */
1580  int *Index) /* Index value returned */
1581 {
1582  char *cp;
1583  long value = 0;
1584 
1585 /* Ignore if not valid environment variable - check alpha and equals */
1586 
1587  if (!GetVariableName (String, &value, &cp, (bool*)NULL) ||
1588  (*cp != CHAR_ASSIGN))
1589  {
1590  if (value == -1)
1592 
1593  return FALSE;
1594  }
1595 
1596 /* Change the = to a end of string */
1597 
1598  *(cp++) = 0;
1599 
1600 /* Assign the value */
1601 
1603 
1604 /* Return the index */
1605 
1606  if (Index != (int *)NULL)
1607  *Index = (int)value;
1608 
1609  return TRUE;
1610 }
1611 
1612 /*
1613  * Get variable name and index
1614  *
1615  * String either ends in a null or assignment
1616  */
1617 
1618 bool GetVariableName (char *String, /* The original string */
1619  long *Index, /* Array index value found */
1620  char **Value, /* Pointer to the value */
1621  bool *Array) /* Array detected flag */
1622 {
1623  char *cp, *sp;
1624  char EndName;
1625 
1626  *Index = 0;
1627 
1628 /* Ignore if not valid environment variable - check alpha and equals */
1629 
1630  if (((EndName = IsValidVariableName (String)) != CHAR_ASSIGN) &&
1631  (EndName != CHAR_OPEN_BRACKETS) && EndName)
1632  return FALSE;
1633 
1634  if ((cp = strchr (String, CHAR_ASSIGN)) == (char *)NULL)
1635  cp = &String[strlen (String)];
1636 
1637  if (Array != (bool *)NULL)
1638  *Array = C2bool (EndName == CHAR_OPEN_BRACKETS);
1639 
1640 /* Check for valid array */
1641 
1642  if (EndName == CHAR_OPEN_BRACKETS)
1643  {
1644  if ((Index == (long *)NULL) || (*(cp - 1) != CHAR_CLOSE_BRACKETS))
1645  return FALSE;
1646 
1647 /* Terminate the name and remove the trailing bracket */
1648 
1649  *(sp = strchr (String, CHAR_OPEN_BRACKETS)) = 0;
1650  *(cp - 1) = 0;
1651 
1652  if ((!ConvertNumericValue (sp + 1, Index, 10)) ||
1653  (*Index < 0) || (*Index > INT_MAX))
1654  {
1655  *Index = -1;
1656  return FALSE;
1657  }
1658  }
1659 
1660 /* Return pointer to null or assignment */
1661 
1662  *Value = cp;
1663  return TRUE;
1664 }
1665 /*
1666  * Duplicate the Variable List for a Subshell
1667  *
1668  * Create a new Var_list environment for a Sub Shell
1669  */
1670 
1672 {
1673  int i;
1674  S_SubShell *sp;
1675 
1676  for (sp = SubShells, i = 0; (i < NSubShells) &&
1678  i++);
1679 
1680 /* If depth is greater or equal to the Execute_stack_depth - we should panic
1681  * as this should not happen. However, for the moment, I'll ignore it
1682  */
1683 
1684  if (NSubShells == MSubShells)
1685  {
1686  sp = (S_SubShell *)ReAllocateSpace ((MSubShells == 0) ? (void *)NULL
1687  : SubShells,
1689  sizeof (S_SubShell));
1690 /* Check for error */
1691 
1692  if (sp == (S_SubShell *)NULL)
1693  return -1;
1694 
1695  SetMemoryAreaNumber ((void *)sp, 0);
1696  SubShells = sp;
1698  }
1699 
1700 /* Save the depth and the old Variable Tree value */
1701 
1702  sp = &SubShells[NSubShells++];
1703  sp->OldVariableTree = VariableTree;
1704  sp->depth = Execute_stack_depth;
1705  sp->GFlags = ShellGlobalFlags | Function;
1706  sp->Eflags = flags;
1707  VariableTree = (void *)NULL;
1708 
1709 /* Duplicate the old Variable list */
1710 
1712  twalk (sp->OldVariableTree, AddToNewEnvironment);
1713 
1714 /* Reset global values */
1715 
1717  return 0;
1718 }
1719 
1720 /*
1721  * TWALK - add to new environment
1722  */
1723 
1724 static void AddToNewEnvironment (const void *key, VISIT visit, int level)
1725 {
1726  VariableList *vp = *(VariableList **)key;
1727  VariableList *vp1;
1728 
1729  if ((visit == postorder) || (visit == leaf))
1730  {
1731 
1732 /* For functions, do not copy the traps */
1733 
1734  if (ATNE_Function && (*vp->name == CHAR_TILDE) && vp->name[1])
1735  return;
1736 
1737 /* Create a new entry */
1738 
1739  vp1 = LookUpVariable (vp->name, vp->index, TRUE);
1740 
1741  if ((!(vp->status & STATUS_INTEGER)) && (vp->value != null))
1742  vp1->value = StringSave (vp->value);
1743 
1744 /* Copy some flags */
1745 
1746  vp1->status = vp->status;
1747  vp1->nvalue = vp->nvalue;
1748  vp1->base = vp->base;
1749  vp1->width = vp->width;
1750  }
1751 }
1752 
1753 /*
1754  * Delete a SubShell environment and restore the original
1755  */
1756 
1758 {
1759  int j;
1760  S_SubShell *sp;
1761  VariableList *vp;
1762  void (*save_signal)(int);
1763 
1764  for (j = NSubShells; j > 0; j--)
1765  {
1766  sp = &SubShells[j - 1];
1767 
1768  if (sp->depth < Execute_stack_depth)
1769  break;
1770 
1771 /* Reduce number of entries */
1772 
1773  --NSubShells;
1774 
1775 /* Disable signals */
1776 
1777  save_signal = signal (SIGINT, SIG_IGN);
1778 
1779 /* Restore the previous level information */
1780 
1781  vp = VariableTree;
1782  VariableTree = sp->OldVariableTree;
1783  ShellGlobalFlags = (unsigned int)(sp->GFlags & ~FLAGS_FUNCTION);
1784  flags = sp->Eflags;
1785 
1786 /* Release the space */
1787 
1788  ATOE_GFlags = sp->GFlags;
1789 
1790  twalk (vp, AddToOldEnvironment);
1791  twalk (vp, DeleteEnvironment);
1792 
1793 /* Restore signals */
1794 
1795  signal (SIGINT, save_signal);
1796 
1798  }
1799 }
1800 
1801 /*
1802  * TWALK - delete old environment tree
1803  */
1804 
1805 static void DeleteEnvironment (const void *key, VISIT visit, int level)
1806 {
1807  VariableList *vp = *(VariableList **)key;
1808 
1809  if ((visit == endorder) || (visit == leaf))
1810  {
1811  if (vp->value == null)
1812  ReleaseMemoryCell ((void *)vp->value);
1813 
1814  ReleaseMemoryCell ((void *)vp->name);
1815  ReleaseMemoryCell ((void *)vp);
1816  }
1817 }
1818 
1819 /*
1820  * TWALK - Transfer Current Environment to the Old one
1821  */
1822 
1823 static void AddToOldEnvironment (const void *key, VISIT visit, int level)
1824 {
1825  VariableList *vp = *(VariableList **)key;
1826  VariableList *vp1;
1827 
1828  if ((visit == postorder) || (visit == leaf))
1829  {
1830 
1831 /* Skip local variables and traps */
1832 
1833  if ((ATOE_GFlags & FLAGS_FUNCTION) && (!(vp->status & STATUS_LOCAL)) &&
1834  (((*vp->name != CHAR_TILDE) || !vp->name[1])))
1835  {
1836 
1837 /* Get the entry in the old variable list and update it with the new
1838  * parameters
1839  */
1840  vp1 = LookUpVariable (vp->name, vp->index, TRUE);
1841 
1842  if (vp1->value != null)
1843  ReleaseMemoryCell ((void *)vp1->value);
1844 
1845  vp1->value = vp->value;
1846  vp->value = null; /* Stop releaseing this as its tx */
1847 
1848  vp1->status = vp->status;
1849  vp1->nvalue = vp->nvalue;
1850  vp1->base = vp->base;
1851  vp1->width = vp->width;
1852  }
1853  }
1854 }
1855 
1856 /*
1857  * Load GLobal Var List values
1858  */
1859 
1861 {
1862  VariableList *cifs = LookUpVariable (IFS, 0, TRUE);
1863 
1866  SetCharacterTypes (cifs->value, C_IFS);
1867 }
1868 
1869 /*
1870  * Match a pattern as in sh(1). Enhancement to handle prefix processing
1871  *
1872  * IgnoreCase - ignore case on comparisions.
1873  * end - end of match in 'string'.
1874  * mode - mode for match processing - see GM_ flags in sh.h
1875  *
1876  * pattern character are prefixed with MAGIC by expand.
1877  */
1878 
1879 bool GeneralPatternMatch (char *string, /* String */
1880  unsigned char *pattern, /* Pattern */
1881  bool IgnoreCase, /* Ignorecase */
1882  char **end, /* End of match */
1883  int mode) /* Mode */
1884 {
1885  int string_c, pattern_c;
1886  char *save_end;
1887 
1888  if ((string == (char *)NULL) || (pattern == (unsigned char *)NULL))
1889  return FALSE;
1890 
1891  while ((pattern_c = *(pattern++)) != 0)
1892  {
1893  string_c = *(string++);
1894 
1895  if (pattern_c != CHAR_MAGIC)
1896  {
1897  if (IgnoreCase)
1898  {
1899  string_c = tolower (string_c);
1900  pattern_c = tolower (pattern_c);
1901  }
1902 
1903  if (string_c != pattern_c)
1904  return FALSE;
1905 
1906  continue;
1907  }
1908 
1909 /* Magic characters */
1910 
1911  switch (*(pattern++))
1912  {
1913  case CHAR_OPEN_BRACKETS: /* Class expression */
1914  if ((!string_c) ||
1915  ((pattern = CheckClassExpression (pattern, string_c,
1916  IgnoreCase)) ==
1917  (unsigned char *)NULL))
1918  return FALSE;
1919 
1920  break;
1921 
1922  case CHAR_MATCH_ANY: /* Match any character */
1923  if (string_c == 0)
1924  return FALSE;
1925 
1926  break;
1927 
1928  case CHAR_MATCH_ALL: /* Match as many as possible */
1929  --string;
1930  save_end = (char *)NULL;
1931 
1932  do
1933  {
1934  if (!*pattern ||
1935  GeneralPatternMatch (string, pattern, IgnoreCase, end,
1936  mode))
1937  {
1938  if (mode == GM_LONGEST)
1939  save_end = *end;
1940 
1941  else
1942  return TRUE;
1943  }
1944 
1945  } while (*(string++));
1946 
1947  if (end != (char **)NULL)
1948  *end = save_end;
1949 
1950  return C2bool (save_end != (char *)NULL);
1951 
1952  default: /* Match */
1953  if ((unsigned)string_c != pattern[-1])
1954  return FALSE;
1955 
1956  break;
1957  }
1958  }
1959 
1960  if (end != (char **)NULL)
1961  {
1962  *end = string;
1963  return TRUE;
1964  }
1965 
1966  return C2bool (*string == 0);
1967 }
1968 
1969 /*
1970  * Process a class expression - []
1971  */
1972 
1973 static unsigned char * F_LOCAL CheckClassExpression (
1974  unsigned char *pattern,
1975  int string_c, /* Match char*/
1976  bool IgnoreCase)/* Ic flag */
1977 {
1978  int llimit_c, ulimit_c;
1979  bool not = FALSE;
1980  bool found;
1981 
1982 /* Exclusive or inclusive class */
1983 
1984  if ((*pattern == CHAR_MAGIC) &&
1985  ((*(pattern + 1) == CHAR_NOT) || (*(pattern + 1) == '!')))
1986  {
1987  pattern += 2;
1988  not = TRUE;
1989  }
1990 
1991  found = not;
1992 
1993 /* Process the pattern */
1994 
1995  do
1996  {
1997  if (*pattern == CHAR_MAGIC)
1998  pattern++;
1999 
2000  if (!*pattern)
2001  return (unsigned char *)NULL;
2002 
2003 /* Get the next character in class, converting to lower case if necessary */
2004 
2005  llimit_c = IgnoreCase ? tolower (*pattern) : *pattern;
2006 
2007 /* If this is a range, get the end of range character */
2008 
2009  if ((*(pattern + 1) == CHAR_MATCH_RANGE) &&
2010  (*(pattern + 2) != CHAR_CLOSE_BRACKETS))
2011  {
2012  ulimit_c = IgnoreCase ? tolower (*(pattern + 2)) : *(pattern + 2);
2013  pattern++;
2014  }
2015 
2016  else
2017  ulimit_c = llimit_c;
2018 
2019 /* Is the current character in the class? */
2020 
2021  if ((llimit_c <= string_c) && (string_c <= ulimit_c))
2022  found = C2bool (!not);
2023 
2024  } while (*(++pattern) != CHAR_CLOSE_BRACKETS);
2025 
2026  return found ? pattern + 1 : (unsigned char *)NULL;
2027 }
2028 
2029 /*
2030  * Suffix processing - find the longest/shortest suffix.
2031  */
2032 
2033 bool SuffixPatternMatch (char *string, /* String to match */
2034  char *pattern, /* Pattern to match against */
2035  char **start, /* Start position */
2036  int mode) /* Match mode */
2037 {
2038  char *save_start = (char *)NULL;
2039 
2040 /* Scan the string, looking for a match to the end */
2041 
2042  while (*string)
2043  {
2044  if (GeneralPatternMatch (string, (unsigned char *)pattern, FALSE,
2045  (char **)NULL, GM_ALL))
2046  {
2047 
2048 /* If longest, stop here */
2049 
2050  if (mode == GM_LONGEST)
2051  {
2052  *start = string;
2053  return TRUE;
2054  }
2055 
2056 /* Save the start of the shortest string so far and continue */
2057 
2058  save_start = string;
2059  }
2060 
2061  ++string;
2062  }
2063 
2064  return C2bool ((*start = save_start) != (char *)NULL);
2065 }
2066 
2067 /*
2068  * Get a string in a malloced area
2069  */
2070 
2072 {
2073  s_region *np;
2074  void (*save_signal)(int);
2075 #ifdef OS2_DOSALLOC
2076  SEL sel;
2077 #endif
2078 
2079  if (nbytes == 0)
2080  abort (); /* silly and defeats the algorithm */
2081 
2082 /* Grab some space */
2083 
2084 #ifdef OS2_DOSALLOC
2085  if (DosAllocSeg (nbytes + sizeof (s_region), &sel, SEG_NONSHARED))
2086  {
2087  errno = ENOMEM;
2088  return (char *)NULL;
2089  }
2090 
2091  np = (s_region *)MAKEP (sel, 0);
2092  memset (np, 0, nbytes + sizeof (s_region));
2093 
2094 #else
2095  if ((np = (s_region *)calloc (nbytes + sizeof (s_region), 1))
2096  == (s_region *)NULL)
2097  {
2098  errno = ENOMEM;
2099  return (char *)NULL;
2100  }
2101 #endif
2102 
2103 /* Disable signals */
2104 
2105  save_signal = signal (SIGINT, SIG_IGN);
2106 
2107 /* Link into chain */
2108 
2109  np->next = MemoryAreaHeader;
2110  np->area = MemoryAreaLevel;
2111  np->nbytes = nbytes;
2112 
2113  MemoryAreaHeader = np;
2114 
2115 /* Restore signals */
2116 
2117  signal (SIGINT, save_signal);
2118 
2119  return ((char *)np) + sizeof (s_region);
2120 }
2121 
2122 /*
2123  * Release a array of strings
2124  */
2125 
2126 void ReleaseAList (char **list)
2127 {
2128  char **ap = list;
2129 
2130  while (*ap != (char *)NULL)
2131  ReleaseMemoryCell (*(ap++));
2132 
2134 
2135 }
2136 
2137 /*
2138  * Free a string in a malloced area
2139  */
2140 
2141 void ReleaseMemoryCell (void *s)
2142 {
2144  s_region *lp = (s_region *)NULL;
2145  s_region *sp = (s_region *)((char *)s - sizeof (s_region));
2146  void (*save_signal)(int);
2147 
2148 /* Disable signals */
2149 
2150  save_signal = signal (SIGINT, SIG_IGN);
2151 
2152 /* Find the string in the chain */
2153 
2154  if (s != (char *)NULL)
2155  {
2156  while (cp != (s_region *)NULL)
2157  {
2158  if (cp != sp)
2159  {
2160  lp = cp;
2161  cp = cp->next;
2162  continue;
2163  }
2164 
2165 /* First in chain ? */
2166 
2167  else if (lp == (s_region *)NULL)
2168  MemoryAreaHeader = cp->next;
2169 
2170 /* Delete the current entry and relink */
2171 
2172  else
2173  lp->next = cp->next;
2174 
2175  RELEASE_MEMORY (cp);
2176  break;
2177  }
2178  }
2179 
2180 /* Restore signals */
2181 
2182  signal (SIGINT, save_signal);
2183 }
2184 
2185 /*
2186  * Check for memory leaks with a dump
2187  */
2188 
2189 #ifdef DEBUG_MEMORY
2190 void DumpMemoryCells (int status)
2191 {
2193  size_t i;
2194  char buffer[17];
2195  char *sp;
2196 
2197 /* Find the string in the chain */
2198 
2199  while (cp != (s_region *)NULL)
2200  {
2201  fprintf (stderr, "Segment 0x%.8lx Area %5d Length %5d Link 0x%.8lx\n",
2202  cp, cp->area, cp->nbytes, cp->next);
2203 
2204  memset (buffer, CHAR_SPACE, 17);
2205  buffer[16] = 0;
2206 
2207  sp = ((char *)cp) + sizeof (s_region);
2208 
2209  for (i = 0; i < (((cp->nbytes - 1)/16) + 1) * 16; i++)
2210  {
2211  if (i >= cp->nbytes)
2212  {
2213  feputs (" ");
2214  buffer [i % 16] = CHAR_SPACE;
2215  }
2216 
2217  else
2218  {
2219  fprintf (stderr, "%.2x ", *sp & 0x0ff);
2220  buffer [i % 16] = (char)(isprint (*sp) ? *sp : CHAR_PERIOD);
2221  }
2222 
2223  if (i % 16 == 15)
2224  fprintf (stderr, " [%s]\n", buffer);
2225 
2226  sp++;
2227  }
2228 
2230  cp = cp->next;
2231  }
2232 #undef exit
2233  exit (status);
2234 #define exit(x) DumpMemoryCells (x)
2235 }
2236 #endif
2237 
2238 /*
2239  * Autodelete space nolonger required. Ie. Free all the strings in a malloced
2240  * area
2241  */
2242 
2244 {
2246  s_region *lp = (s_region *)NULL;
2247  void (*save_signal)(int);
2248 
2249 /* Release the Here documents first */
2250 
2252 
2253 /* Disable signals */
2254 
2255  save_signal = signal (SIGINT, SIG_IGN);
2256 
2257  while (cp != (s_region *)NULL)
2258  {
2259 
2260 /* Is the area number less than that specified - yes, continue */
2261 
2262  if (cp->area < a)
2263  {
2264  lp = cp;
2265  cp = cp->next;
2266  }
2267 
2268 /* OK - delete the area. Is it the first in chain ? Yes, delete, relink
2269  * and update start location
2270  */
2271 
2272  else if (lp == (s_region *)NULL)
2273  {
2274  lp = cp;
2275  cp = cp->next;
2276  MemoryAreaHeader = cp;
2277 
2278  RELEASE_MEMORY (lp);
2279  lp = (s_region *)NULL;
2280  }
2281 
2282 /* Not first, delete the current entry and relink */
2283 
2284  else
2285  {
2286  lp->next = cp->next;
2287  RELEASE_MEMORY (cp);
2288  cp = lp->next;
2289  }
2290  }
2291 
2292 /* Restore signals */
2293 
2294  signal (SIGINT, save_signal);
2295 }
2296 
2297 /*
2298  * Set the area number for a malloced string. This allows autodeletion of
2299  * space that is nolonger required.
2300  */
2301 
2302 void SetMemoryAreaNumber (void *cp, int a)
2303 {
2304  s_region *sp = (s_region *)((char *)cp - sizeof (s_region));
2305 
2306  if (cp != (void *)NULL)
2307  sp->area = a;
2308 }
2309 
2310 /*
2311  * Get the area number for a malloced string
2312  */
2313 
2315 {
2316  s_region *sp = (s_region *)((char *)cp - sizeof (s_region));
2317 
2318  return sp->area;
2319 }
2320 
2321 /* Output one of the Prompt. We save the prompt for the history part of
2322  * the program
2323  */
2324 
2325 void OutputUserPrompt (char *s)
2326 {
2327  struct tm *tm;
2328  time_t xtime = time ((time_t *)NULL);
2329  int i;
2330  char buf[PATH_MAX + 4];
2331 
2332  if (LastUserPrompt != (char *)NULL)
2333  {
2334  LastUserPrompt = s; /* Save the Last prompt id */
2335  s = GetVariableAsString (s, TRUE); /* Get the string value */
2336 
2337  if (LastUserPrompt == PS1)
2338  s = substitute (s, 0);
2339  }
2340 
2341  else
2342  s = LastUserPrompt1;
2343 
2344  tm = localtime (&xtime);
2345 
2346  while (*s)
2347  {
2348 
2349 /* If a format character, process it */
2350 
2351  if (*s == CHAR_FORMAT)
2352  {
2353  s++;
2354  *s = (char)tolower(*s);
2355 
2356  if (*s == CHAR_FORMAT)
2357  fputchar (CHAR_FORMAT);
2358 
2359  else
2360  {
2361  *buf = 0;
2362 
2363  switch (*(s++))
2364  {
2365  case 'e': /* Current event number */
2366  if (HistoryEnabled)
2367  sprintf (buf, "%d", Current_Event + 1);
2368 
2369  break;
2370 
2371  case 't': /* time */
2372  sprintf (buf,"%.2d:%.2d", tm->tm_hour, tm->tm_min);
2373  break;
2374 
2375  case 'd': /* date */
2376  sprintf (buf, "%.3s %.2d-%.2d-%.2d",
2377  &"SunMonTueWedThuFriSat"[tm->tm_wday * 3],
2378  tm->tm_mday, tm->tm_mon + 1,
2379  tm->tm_year % 100);
2380  break;
2381 
2382  case 'p': /* directory */
2383  case 'n': /* default drive */
2385 
2386  if (*(s - 1) == 'n')
2387  buf[1] = 0;
2388 
2389  break;
2390 
2391 #if (OS_TYPE != OS_UNIX)
2392  case 'v': /* version */
2393  sprintf (buf, "%s %.2d:%.2d", LIT_OSname,
2394  OS_VERS_N, _osminor);
2395  break;
2396 #endif
2397  }
2398 
2399 /* Output the string */
2400 
2401  foputs (buf);
2402  }
2403  }
2404 
2405 /* Escaped character ? */
2406 
2407  else if (*s == CHAR_META)
2408  {
2409  ++s;
2410  if ((i = ProcessOutputMetaCharacters (&s)) == -1)
2411  i = 0;
2412 
2413  fputchar ((char)i);
2414  }
2415 
2416  else
2417  fputchar (*(s++));
2418  }
2419 
2420  FlushStreams (); /* Clear output */
2421 }
2422 
2423 /*
2424  * Get the current path in UNIX format and save it in the environment
2425  * variable $~
2426  */
2427 
2429 {
2430  char ldir[PATH_MAX + 6];
2431  char *CurrentPWDValue; /* Current directory */
2432 
2433  S_getcwd (ldir, 0);
2434 
2435 /* Save in environment */
2436 
2437  SetVariableFromString (tilde, ldir);
2439 
2440 /* If we have changed directory, set PWD and OLDPWD */
2441 
2442  if (strcmp (CurrentPWDValue = GetVariableAsString (PWDVariable, FALSE),
2443  ldir))
2444  {
2445  SetVariableFromString (OldPWDVariable, CurrentPWDValue);
2447  }
2448 }
2449 
2450 /*
2451  * Initialise the shell and Patch up various parts of the system for the
2452  * shell. At the moment, we modify the ctype table so that _ is an upper
2453  * case character.
2454  */
2455 
2456 static bool F_LOCAL Initialise (int argc, char **argv)
2457 {
2458  char *s, *s1;
2459  char **ap;
2460  char *name = *argv;
2461  bool OptionsRflag = FALSE;
2462 #if (OS_TYPE == OS_NT)
2463  bool Level0 = FALSE;
2464  int sc;
2465 #endif
2466 
2467 /*
2468 add support of "Path" from native Windows
2469 2020/05/03 --ak
2470 */
2471  char *native_val;
2472  char NativePath[] = "Path";
2473 
2474 /*
2475 added by Akira Kakuto (1997/07/20)
2476 ( to support NEC Windows 95 )
2477 */
2478  char *pc98;
2479  if((pc98 = getenv("KSH_NEC_WIN95"))) {
2480  IgnoreScanCode[0] = 0x74;
2481  IgnoreScanCode[1] = 0x73;
2482  IgnoreScanCode[2] = 0x70;
2483  IgnoreScanCode[3] = 0x71;
2484  IgnoreScanCode[4] = 0x71;
2485  IgnoreScanCode[5] = 0x71;
2486  }
2487  else {
2488  IgnoreScanCode[0] = 0x1d;
2489  IgnoreScanCode[1] = 0x38;
2490  IgnoreScanCode[2] = 0x2a;
2491  IgnoreScanCode[3] = 0x36;
2492  IgnoreScanCode[4] = 0x3a;
2493  IgnoreScanCode[5] = 0x45;
2494  }
2495 /*
2496 end of addition
2497 */
2498 
2499 /*
2500  * Determine the base OS if we can!
2501  */
2502 
2503 #if (OS_TYPE == OS_NT)
2504  BaseOS = BASE_OS_NT; /* Default to NT - no other */
2505 #elif (OS_TYPE == OS_UNIX)
2506  BaseOS = BASE_OS_UNIX; /* Default to UNIX - no other */
2507 #elif (OS_TYPE == OS_OS2)
2508  BaseOS = BASE_OS_OS2; /* Default to OS2 - no other */
2509 #elif (OS_TYPE == OS_DOS)
2510 
2511  BaseOS = BASE_OS_DOS; /* Default to DOS */
2512 
2513  if (_osmajor > 10) /* Rather crude check */
2514  BaseOS = BASE_OS_OS2;
2515 
2516 /* Know to stop NT ? */
2517 
2518  else
2519  {
2520  union REGS r;
2521  r.h.ah = 0x16;
2522  r.h.al = 0;
2523 
2524  SystemInterrupt (0x2f, &r, &r);
2525 
2526  if (r.h.al > 0)
2527  BaseOS = BASE_OS_WIN;
2528 
2529  else
2530  {
2531  r.x.REG_AX = 0x3306;
2532  SystemInterrupt (0x21, &r, &r);
2533 
2534  if ((r.x.REG_AX == 0x3306) && (r.x.REG_BX == 0x3205))
2535  BaseOS = BASE_OS_NT;
2536  }
2537  }
2538 #endif
2539 
2540 /*
2541  * For MSDOS: Get original interrupt 24 address and set up our new interrupt
2542  * 24 address.
2543  * For OS/2 : Set noignore interrupts.
2544  */
2545 
2546 #if (OS_TYPE == OS_DOS) && !defined (__EMX__)
2547  Orig_I24_V = GetInterruptVector (0x24);
2548 # if (OS_SIZE == OS_16)
2549  SetInterruptVector (0x24, SW_Int24);
2550 # else
2551  _harderr (HardErrorHandler);
2552 # endif
2553 #elif (OS_TYPE != OS_DOS)
2554  IgnoreInterrupts = FALSE;
2555 #endif
2556 
2557 /* Create terminations queues - OS/2 only */
2558 
2560 
2561 /* Set up character maps */
2562 
2564 
2565 /* Create the integer variables, in case they are loaded from the
2566  * environment
2567  */
2569 
2570 /* Initialise Path Extension lists */
2571 
2573 
2574 /* For NT, we need to know now if this is a level 0 shell because NT has a
2575  * nasty habit of being case in-sensitive! Not only for file names, but
2576  * also environment variables. So scan the command line for the -0 option!
2577  */
2578 
2579 #if (OS_TYPE == OS_NT)
2580  while ((sc = GetOptions (argc, argv, ShellOptions, 0)) != EOF)
2581  {
2582  if (sc == '0')
2583  {
2584  Level0 = TRUE;
2585  break;
2586  }
2587  }
2588 
2589  ResetGetOptions ();
2590 #endif
2591 
2592 /* Load the environment into our structures */
2593 
2594  if ((ap = environ) != NOWORDS)
2595  {
2596  for (ap = environ; *ap != (char *)NULL; ap++)
2597  {
2598 
2599 /* Set up any variables. Note there is an assumption that
2600  * AssignVariableFromString sets the equals sign to 0, hiding the value;
2601  */
2602  if (!strncmp ("SECONDS=", *ap, 8))
2603  continue;
2604 
2605 /* NT is case in-sensitive - what a PAIN! */
2606 
2607 #if (OS_TYPE == OS_NT)
2608  if (Level0)
2609  {
2610  s = *ap;
2611 
2612  while (*s && (*s != CHAR_ASSIGN))
2613  {
2614  *s = toupper (*s);
2615  s++;
2616  }
2617  }
2618 #endif
2619  if (AssignVariableFromString (*ap, (int *)NULL))
2621  }
2622  }
2623 
2624 /* Change COMSPEC to unix format for execution */
2625 
2628 
2629 /* Zap all files */
2630 
2631  CloseAllHandlers ();
2632  MemoryAreaLevel = 1;
2633 
2634 /* Get the current directory */
2635 
2637 
2638 /* Initialise the getopts command */
2639 
2641 
2642 /* Set up SHELL variable. First check for a restricted shell. Check the
2643  * restricted shell
2644  */
2645 
2647 
2648 /* For OS/2, we prefer the full path name and not that in argv[0]. Save a
2649  * copy of the string
2650  */
2651 
2652 #if (OS_TYPE == OS_OS2) || (OS_TYPE == OS_NT)
2654  SetMemoryAreaNumber ((void *)name, 0);
2655  strcpy (name, _APgmName);
2656 #endif
2657 
2658 /* Has the program name got a .exe extension - Yes probably DOS 3+. So
2659  * save it as the Shell name. Under OS/2, make sure we use .exe
2660  */
2661 
2663  {
2664 #if (OS_TYPE == OS_OS2) || (OS_TYPE == OS_NT)
2665  if ((s1 = strrchr (name, CHAR_PERIOD)) == (char *)NULL)
2666  strcat (name, EXEExtension);
2667 
2669 
2671 #elif (OS_TYPE == OS_DOS)
2672  if (((s1 = strrchr (name, CHAR_PERIOD)) != (char *)NULL) &&
2673  (stricmp (s1 + 1, EXEExtension + 1) == 0))
2675 #elif (OS_TYPE == OS_UNIX)
2677  (*name == '-') ? name + 1 : name);
2678 #endif
2679  }
2680 
2681 /* Default if necessary */
2682 
2685 
2687 
2688 /* Check for restricted shell */
2689 
2690  if ((s = FindLastPathCharacter (s1)) == (char *)NULL)
2691  s = s1;
2692 
2693  else
2694  s++;
2695 
2696  if (*s == 'r')
2697  OptionsRflag = TRUE;
2698 
2699 /* Set up home directory */
2700 
2702  {
2703  if ((s = GetVariableAsString ("INIT", FALSE)) == null)
2705 
2707  }
2708 
2709 /* Set up OS Mode */
2710 
2711 #if defined (__TURBOC__)
2713 #elif (__WATCOMC__)
2715 #elif (OS_TYPE == OS_UNIX)
2717 #else
2719 #endif
2720 
2721 #if (OS_SIZE == OS_32)
2723 #else
2725 #endif
2726 
2727 /* Set up history file location */
2728 
2730 
2732  native_val = GetVariableAsString (PathLiteral, FALSE);
2733 
2734  /* if the variable is "Path", and is not "PATH" in Windows
2735  system, native_val is "", because I changed as search[] = "";
2736  2020/05/03 --ak
2737  */
2738  if (!native_val || *native_val == '\0') {
2739  /* Get the value of "Path" and set it to "PATH"
2740  2020/05/03 --ak
2741  */
2742  native_val = GetVariableAsString (NativePath, FALSE);
2743  PATH_TO_UNIX(native_val);
2744  SetVariableFromString(PathLiteral, native_val);
2745  } else {
2746  PATH_TO_UNIX (native_val);
2747  }
2749 
2750  return OptionsRflag;
2751 }
2752 
2753 /*
2754  * Mail Check processing. Every $MAILCHECK seconds, we check either $MAIL
2755  * or $MAILPATH to see if any file has changed its modification time since
2756  * we last looked. In $MAILCHECK, the files are separated by semi-colon (;).
2757  * If the filename contains a %, the string following the % is the message
2758  * to display if the file has changed.
2759  */
2760 
2761 static void F_LOCAL CheckForMailArriving (void)
2762 {
2764  char *mail = GetVariableAsString ("MAIL", FALSE);
2765  char *mailp = GetVariableAsString ("MAILPATH", FALSE);
2766 #if _MSC_VER < 1600
2767  static time_t last = 0L;
2768 #else
2769  static time_t last = 0LL;
2770 #endif
2771  time_t current = time ((time_t *)NULL);
2772  struct _stat st;
2773  char *cp, *sp, *ap;
2774 
2775 /* Have we waited long enough */
2776 
2777  if (((current - last) < delay) || (DisabledVariables & DISABLE_MAILCHECK))
2778  return;
2779 
2780 /* Yes - Check $MAILPATH. If it is defined, process it. Otherwise, use
2781  * $MAIL
2782  */
2783 
2784  if (mailp != null)
2785  {
2786 
2787 /* Check MAILPATH */
2788 
2789  sp = mailp;
2790 
2791 /* Look for the next separator */
2792 
2793  while ((cp = strchr (sp, CHAR_PATH_SEPARATOR)) != (char *)NULL)
2794  {
2795  *cp = 0;
2796 
2797 /* % in string ? */
2798 
2799  if ((ap = strchr (sp, CHAR_FORMAT)) != (char *)NULL)
2800  *ap = 0;
2801 
2802 /* Check the file name */
2803 
2804  if ((S_stat (sp, &st)) && (st.st_mtime > last) && st.st_size)
2805  {
2806  feputs ((ap != (char *)NULL) ? ap + 1 : ymail);
2808  }
2809 
2810 /* Restore the % */
2811 
2812  if (ap != (char *)NULL)
2813  *ap = CHAR_FORMAT;
2814 
2815 /* Restore the semi-colon and find the next one */
2816 
2818  sp = cp + 1;
2819  }
2820  }
2821 
2822 /* Just check MAIL */
2823 
2824  else if ((mail != null) && (S_stat (mail, &st)) &&
2825  (st.st_mtime > last) && st.st_size)
2826  {
2827  feputs (ymail);
2829  }
2830 
2831 /* Save the last check time */
2832 
2833  last = current;
2834 }
2835 
2836 /*
2837  * Preprocess Argv to get handle of options in the format /x
2838  *
2839  * Some programs invoke the shell using / instead of - to mark the options.
2840  * We need to convert to -. Also /c is a special case. The rest of the
2841  * command line is the command to execute. So, we get the command line
2842  * from the original buffer instead of argv array.
2843  */
2844 
2845 #if (OS_TYPE != OS_UNIX)
2846 static void F_LOCAL Pre_Process_Argv (char **argv, int *argc1)
2847 {
2848  int argc = 1;
2849  char *ocl = _ACmdLine;
2850  int i;
2851 
2852 /* Check for these options */
2853 
2854  while ((*++argv != (char *)NULL) && (strlen (*argv) == 2) &&
2855  (**argv == '/'))
2856  {
2857  argc++;
2858  *strlwr (*argv) = CHAR_SWITCH;
2859 
2860 /* Get the original information from the command line */
2861 
2862  if ((*argv)[1] == 'c')
2863  {
2864 
2865 /*
2866  * In some case under OS/2, we get /c, but with EMX style. So all we need
2867  * to do is change the / to a - and return.
2868  */
2869 
2870 # if (OS_TYPE == OS_OS2)
2871  if (EMXStyleParameters)
2872  return;
2873 # endif
2874 
2875 /*
2876  * Otherwise, parse the command line again, looking for the /c
2877  */
2878 
2879  while ((*ocl != '/') && (*(ocl + 1) != 'c') &&
2880  (*ocl) && (*ocl != CHAR_RETURN))
2881  ++ocl;
2882 
2883  if (*ocl != '/')
2884  continue;
2885 
2886 /* Find the start of the string */
2887 
2888  ocl += 2;
2889 
2890  while (isspace (*ocl) && (*ocl != CHAR_RETURN))
2891  ++ocl;
2892 
2893  if (*ocl == CHAR_RETURN)
2894  continue;
2895 
2896 /* Found the start. Set up next parameter and ignore the rest */
2897 
2898  if (*(argv + 1) == (char *)NULL)
2899  continue;
2900 
2901  argc++;
2902 
2903 /* Remove quotes from string, if they are there */
2904 
2905  if ((*ocl == CHAR_DOUBLE_QUOTE) &&
2906  (ocl[i = (strlen (ocl) - 1)] == CHAR_DOUBLE_QUOTE))
2907  {
2908  ocl[i] = 0;
2909  ocl++;
2910  }
2911 
2912 /* Set up new argument array */
2913 
2914  *(argv + 1) = ocl;
2915  *(argv + 2) = (char *)NULL;
2916  *argc1 = argc;
2917 
2918  if ((ocl = strchr (ocl, CHAR_RETURN)) != (char *)NULL)
2919  *ocl = 0;
2920 
2921  return;
2922  }
2923  }
2924 }
2925 #endif
2926 
2927 /*
2928  * Convert path format to/from UNIX
2929  */
2930 
2931 char *ConvertPathToFormat (char *path, char in, char out)
2932 {
2933 #if (OS_TYPE == OS_UNIX)
2934  return path;
2935 #else
2936  char *s = path;
2937 
2938  while ((path = strchr (path, in)) != (char *)NULL)
2939  *path = out;
2940 
2941  return s;
2942 #endif
2943 }
2944 
2945 /* Load profiles onto I/O Stack */
2946 
2947 static void F_LOCAL LoadTheProfileFiles (void)
2948 {
2949  char *name;
2950  char *Pname;
2951 
2952  if ((Pname = GetVariableAsString ("ETCPROFILE", FALSE)) == null)
2953  {
2954  Pname = GetAllocatedSpace (strlen ("x:/etc/profile") + 1);
2955  strcpy (Pname, "x:/etc/profile");
2956  *Pname = GetDriveLetter (GetRootDiskDrive ());
2957  }
2958 
2960  ExecuteShellScript (Pname);
2961 
2962 /*
2963  * Check $HOME format. If in DOS format, mark and convert to UNIX
2964  */
2965 
2967  CHAR_DOS_PATH) != (char *)NULL)
2968  {
2969  PATH_TO_UNIX (name);
2971  }
2972 
2973  name = BuildFileName ("profile"); /* Set up home profile */
2975  ReleaseMemoryCell ((void *)name);
2976 }
2977 
2978 /*
2979  * Convert Unix PATH to MSDOS PATH
2980  */
2981 
2982 static void F_LOCAL ConvertUnixPathToMSDOS (char *cp)
2983 {
2984  char *scp = cp;
2985  int colon = 0;
2986 
2987 /* If there is a semi-colon or a backslash, we assume this is a DOS format
2988  * path
2989  */
2990 
2991  if ((strchr (cp, CHAR_PATH_SEPARATOR) != (char *)NULL) ||
2992  (strchr (cp, CHAR_DOS_PATH) != (char *)NULL))
2993  return;
2994 
2995 /* Count the number of colons */
2996 
2997  while ((cp = strchr (cp, CHAR_COLON)) != (char *)NULL)
2998  {
2999  ++colon;
3000  ++cp;
3001  }
3002 
3003 /* If there are no colons or there is one colon as the second character, it
3004  * is probably an MSDOS path
3005  */
3006 
3007  cp = scp;
3008  if ((colon == 0) || ((colon == 1) && (*(cp + 1) == CHAR_COLON)))
3009  return;
3010 
3011 /* Otherwise, convert all colons to semis */
3012 
3013  while ((cp = strchr (cp, CHAR_COLON)) != (char *)NULL)
3014  *(cp++) = CHAR_PATH_SEPARATOR;
3015 }
3016 
3017 /* Generate a file name from a directory and name. Return null if an error
3018  * occurs or some malloced space containing the file name otherwise
3019  */
3020 
3021 char *BuildFileName (char *name)
3022 {
3024  char *cp;
3025 
3026 /* Get some space */
3027 
3028  if ((cp = AllocateMemoryCell (strlen (dir) + strlen (name) + 2))
3029  == (char *)NULL)
3030  return null;
3031 
3032 /* Addend the directory and a / if the directory does not end in one */
3033 
3034  strcpy (cp, dir);
3035 
3036  if (!IsPathCharacter (cp[strlen (cp) - 1]))
3037  strcat (cp, DirectorySeparator);
3038 
3039 /* Append the file name */
3040 
3041  return strcat (cp, name);
3042 }
3043 
3044 /* Clear prompts */
3045 
3046 static void F_LOCAL ClearUserPrompts (void)
3047 {
3051  SetVariableFromString (PS1, null);
3052  SetVariableFromString (PS2, null);
3053  SetVariableFromString (PS3, null);
3054 }
3055 
3056 /* Process setting of SECONDS and RANDOM environment variables */
3057 
3058 static void F_LOCAL SecondAndRandomEV (char *name, long val)
3059 {
3060  if (!strcmp (name, SecondsVariable) &&
3062  ShellStartTime = time ((time_t *)NULL) - val;
3063 
3064  else if (!strcmp (name, RandomVariable) &&
3066  srand ((int)val);
3067 }
3068 
3069 /*
3070  * Set up the Window name. Give up if it does not work.
3071  */
3072 
3073 #if (OS_TYPE == OS_OS2)
3074 void SetWindowName (char *title)
3075 {
3076  HSWITCH hswitch;
3077  SWCNTRL swctl;
3078  char *cp;
3079 
3080  if ((!(hswitch = WinQuerySwitchHandle (0, getpid ()))) ||
3081  (WinQuerySwitchEntry (hswitch, &swctl)))
3082  return;
3083 
3084  if (title != (char *)NULL)
3085  cp = title;
3086 
3087  else if ((DisabledVariables & DISABLE_WINTITLE) ||
3088  ((cp = GetVariableAsString (WinTitleVariable, FALSE)) == null))
3089  cp = DefaultWinTitle;
3090 
3091  strncpy (swctl.szSwtitle, cp, sizeof (swctl.szSwtitle));
3092  swctl.szSwtitle[sizeof (swctl.szSwtitle) - 1] = 0;
3093  WinChangeSwitchEntry (hswitch, &swctl);
3094 }
3095 #endif
3096 
3097 /* NT Version */
3098 
3099 #if (OS_TYPE == OS_NT)
3100 void SetWindowName (char *title)
3101 {
3102  char *cp;
3103 
3104  if (title != (char *)NULL)
3105  cp = title;
3106 
3107  else if ((DisabledVariables & DISABLE_WINTITLE) ||
3108  ((cp = GetVariableAsString (WinTitleVariable, FALSE)) == null))
3109  cp = DefaultWinTitle;
3110 
3111  SetConsoleTitle (cp);
3112 }
3113 #endif
3114 
3115 /*
3116  * In OS/2, check for terminated processes
3117  */
3118 
3119 #if (OS_TYPE == OS_OS2)
3120 static void F_LOCAL CheckForTerminatedProcess (void)
3121 {
3122  RESULTCODES rescResults;
3123  PID pidProcess;
3124  char *s;
3125  OSCALL_RET rc;
3126 
3127 # if (OS_TYPE == OS_OS2)
3128  CheckForSessionEnd ();
3129 # endif
3130 
3131 /* Check for tasks terminating */
3132 
3133  while (TRUE)
3134  {
3135  while ((rc = DosCwait (DCWA_PROCESSTREE, DCWW_NOWAIT, &rescResults,
3136  &pidProcess, 0)) == ERROR_INTERRUPT)
3137  continue;
3138 
3139 /* Ignore errors */
3140 
3141  if (rc)
3142  return;
3143 
3144 /* Remove the job */
3145 
3146  DeleteJob (pidProcess);
3147 
3148  switch (rescResults.codeTerminate)
3149  {
3150  case TC_EXIT:
3151  s = "Normal Exit";
3152  break;
3153 
3154  case TC_HARDERROR:
3155  s = "Hard error";
3156  break;
3157 
3158  case TC_TRAP:
3159  s = "Trapped";
3160  break;
3161 
3162  case TC_KILLPROCESS:
3163  s = "Killed";
3164  break;
3165 
3166  default:
3167  s = "Unknown";
3168  break;
3169 
3170  }
3171 
3172  fprintf (stderr, "Process %d terminated - %s (%d)\n", pidProcess, s,
3173  rescResults.codeTerminate);
3174  }
3175 }
3176 #endif
3177 
3178 /* NT Version */
3179 
3180 #if (OS_TYPE == OS_NT)
3181 static void F_LOCAL CheckForTerminatedProcess (void)
3182 {
3183  twalk (JobTree, LookUpJobs);
3184 }
3185 
3186 /*
3187  * Walk the NT job tree looking for terminated processes
3188  */
3189 
3190 static void LookUpJobs (const void *key, VISIT visit, int level)
3191 {
3192  JobList *job = *(JobList **)key;
3193  HANDLE hp;
3194  DWORD res;
3195  DWORD ExitCode;
3196 
3197  if ((visit == postorder) || (visit == leaf))
3198  {
3199  if ((hp = OpenProcess (PROCESS_ALL_ACCESS, (BOOL)TRUE,
3200  job->pid)) == NULL)
3201  {
3202 /*
3203  PrintWarningMessage ("sh: Cannot open process %d\n%s", job->pid,
3204  GetOSSystemErrorMessage (GetLastError ()));
3205 */
3206  DeleteJob (job->pid);
3207  }
3208 
3209 /* Wait for the object to exit */
3210 
3211  else if ((res = WaitForSingleObject (hp, 0)) == WAIT_OBJECT_0)
3212  {
3213  DeleteJob (job->pid);
3214 
3215  if (!GetExitCodeProcess (hp, &ExitCode))
3217  "sh: Cannot get termination code for process %d\n%s",
3218  job->pid, GetOSSystemErrorMessage (GetLastError ()));
3219  else
3220  fprintf (stderr, "Process %d terminated (%ld)\n", job->pid,
3221  ExitCode);
3222  }
3223 
3224 /* Failed? - error */
3225 
3226  else if (res == WAIT_FAILED)
3227  {
3228  PrintWarningMessage ("sh: Cannot wait for process %d\n%s",
3229  job->pid,
3230  "Failed to wait process\n");
3231 
3232  DeleteJob (job->pid);
3233  }
3234 
3235  CloseHandle (hp);
3236  }
3237 }
3238 #endif
3239 
3240 /* UNIX version */
3241 
3242 #if (OS_TYPE == OS_UNIX)
3243 static void F_LOCAL CheckForTerminatedProcess (void)
3244 {
3245  fputs ("UNIX: CheckForTerminatedProcess NI\n", stderr);
3246 }
3247 #endif
3248 
3249 
3250 /*
3251  * Check for end of a Session
3252  */
3253 
3254 #if (OS_TYPE == OS_OS2)
3255 static void F_LOCAL CheckForSessionEnd (void)
3256 {
3257  OSCALL_PARAM DataLength;
3258  OSCALL_RET rc;
3259  BYTE bElemPriority;
3260  struct SessionEnd
3261  {
3262  unsigned short SessionId;
3263  unsigned short ExitCode;
3264  } *DataAddress;
3265 
3266 # if (OS_SIZE == OS_32)
3267  REQUESTDATA Request;
3268 # else
3269  QUEUERESULT Request;
3270 # endif
3271 
3272 /* Check for sessions terminating */
3273 
3274  while ((rc = DosReadQueue (SessionQueueHandler, &Request, &DataLength,
3275  (PVOID *)&DataAddress,
3276  0, DCWW_NOWAIT, &bElemPriority,
3277  SessionQueueSema)) == NO_ERROR)
3278  {
3279  DeleteJobBySession (DataAddress->SessionId);
3280 
3281  fprintf (stderr, "Session %d terminated - Normal Exit (%d)\n",
3282  DataAddress->SessionId, DataAddress->ExitCode);
3283 
3284 # if (OS_SIZE == OS_32)
3285  DosFreeMem (DataAddress);
3286 # else
3287  DosFreeSeg (SELECTOROF ((DataAddress)));
3288 # endif
3289  }
3290 }
3291 #endif
3292 
3293 /*
3294  * Set up the Parameter Environment variables
3295  */
3296 
3297 static void F_LOCAL SetUpParameterEV (int argc, char **argv, char *name)
3298 {
3299  Word_B *wb = (Word_B *)NULL;
3300  char *Value;
3301  int i;
3302 
3303  if ((Value = StringSave (name)) == null)
3304  {
3306  return;
3307  }
3308 
3309  wb = AddParameter (Value, wb, ShellNameLiteral);
3310 
3311  for (i = 1; i < argc; ++i)
3312  {
3313  if ((!AssignVariableFromString (argv[i], (int *)NULL)) &&
3314  (wb != (Word_B *)NULL))
3315  {
3316  if ((Value = StringSave (argv[i])) != null)
3317  wb = AddParameter (Value, wb, ShellNameLiteral);
3318 
3319  else
3320  {
3322  Outofmemory1);
3323  return;
3324  }
3325  }
3326  }
3327 
3328  if (wb != (Word_B *)NULL)
3329  wb = AddParameter ((char *)NULL, wb, ShellNameLiteral);
3330 }
3331 
3332 /*
3333  * Update the Seconds and Random variables
3334  */
3335 
3337 {
3340 
3343 }
3344 
3345 /*
3346  * Set the status of an environment variable
3347  */
3348 
3349 void SetVariableStatus (char *name, /* Variable name */
3350  int flag) /* New status */
3351 {
3352  VariableList *vp = LookUpVariable (name, 0, TRUE);
3353 
3354  if (IS_VariableFC ((int)*vp->name)) /* not an internal symbol ($# etc) */
3355  vp->status |= flag;
3356 }
3357 
3358 /*
3359  * Array version - only 0 is exported
3360  */
3361 
3362 void SetVariableArrayStatus (char *name, /* Variable name */
3363  int index, /* Array index */
3364  int flag) /* New status */
3365 {
3367 
3368  if (IS_VariableFC ((int)*vp->name)) /* not an internal symbol ($# etc) */
3369  {
3370  vp->status |= flag;
3371 
3372  if (index)
3373  vp->status &= ~~STATUS_EXPORT;
3374  }
3375 }
3376 
3377 /*
3378  * Set the status of an environment variable
3379  */
3380 
3381 void ClearVariableStatus (char *name, int flag)
3382 {
3383  VariableList *vp = LookUpVariable (name, 0, TRUE);
3384 
3385  if (IS_VariableFC ((int)*vp->name)) /* not an internal symbol ($# etc) */
3386  vp->status &= ~~flag;
3387 }
3388 
3389 /*
3390  * Check allowed to set variable
3391  */
3392 
3394 {
3395  if (vp->status & STATUS_READONLY)
3396  {
3398  return FALSE;
3399  }
3400 
3401 /* Check for $PATH, $SHELL or $ENV reset in restricted shell */
3402 
3403  if ((!strcmp (vp->name, PathLiteral) || !strcmp (vp->name, ENVVariable) ||
3404  !strcmp (vp->name, ShellVariableName)) &&
3406  return FALSE;
3407 
3408  return TRUE;
3409 }
3410 
3411 /*
3412  * Set up a variable from a string
3413  */
3414 
3415 void SetVariableFromString (char *name, char *val)
3416 {
3418 }
3419 
3420 /*
3421  * Array index version
3422  */
3423 
3424 void SetVariableArrayFromString (char *name, int Index, char *val)
3425 {
3426  VariableList *vp = LookUpVariable (name, Index, TRUE);
3427  char *xp = null;
3428  long nval;
3429 
3430 /* Check if allowed to set variable */
3431 
3432  if (!AllowedToSetVariable (vp))
3433  return;
3434 
3435 /* If we change the PATH to a new value, we need to untrack some aliases */
3436 
3437  if (!strcmp (name, PathLiteral) && strcmp (vp->value, val))
3438  UnTrackAllAliases ();
3439 
3440  CheckOPTIND (name, atol (val));
3441 
3442 /* Save the new value */
3443 
3444  if ((!(vp->status & STATUS_INTEGER)) && (val != null) && strlen (val) &&
3445  ((xp = StringSave (val = SuppressSpacesZeros (vp, val))) == null))
3446  return;
3447 
3448 /* Free the old value if appropriate */
3449 
3450  if (vp->value != null)
3451  ReleaseMemoryCell ((void *)vp->value);
3452 
3453  vp->value = null;
3454 
3455 /* String value? */
3456 
3457  if (!(vp->status & STATUS_INTEGER))
3458  {
3459  vp->value = xp;
3460 
3461  if (!vp->width)
3462  vp->width = strlen (val);
3463  }
3464 
3465 /* No - Number value */
3466 
3467  else if (!ValidMathsExpression (val, &nval))
3468  {
3469  SecondAndRandomEV (name, nval);
3470  SetUpANumericValue (vp, nval, -1);
3471  }
3472 
3473 
3474 /* Check to see if it should be exported */
3475 
3476  if (FL_TEST (FLAG_ALL_EXPORT))
3477  vp->status |= STATUS_EXPORT;
3478 
3479 /* Convert UNIX to DOS for PATH variable */
3480 
3481  if (!strcmp (name, PathLiteral))
3483 
3484  else if (!strcmp (name, CDPathLiteral))
3486 
3487  else if (!strcmp (name, PathExtsLiteral))
3489 
3490 /* Set up IFS characters */
3491 
3492  else if (!strcmp (name, IFS))
3494 
3495 /* Check for title change */
3496 
3497 #if defined (FLAGS_EMACS) || defined (FLAGS_VI) || defined (FLAGS_GMACS)
3498  else if (!strcmp (name, FCEditVariable))
3499  SetEditorMode (val);
3500 
3501  else if (!strcmp (name, EditorVariable))
3502  SetEditorMode (val);
3503 
3504  else if (!strcmp (name, VisualVariable))
3505  SetEditorMode (val);
3506 #endif
3507 
3508 #if (OS_TYPE != OS_DOS)
3509  else if ((!(DisabledVariables & DISABLE_WINTITLE)) &&
3510  (!strcmp (name, WinTitleVariable)))
3511  SetWindowName ((char *)NULL);
3512 #endif
3513 }
3514 
3515 /*
3516  * Set a variable from a numeric
3517  */
3518 
3520 {
3522 }
3523 
3524 /* Array version */
3525 
3526 void SetVariableArrayFromNumeric (char *name, int Index, long value)
3527 {
3528  VariableList *vp = LookUpVariable (name, Index, TRUE);
3529  char NumericBuffer[20];
3530 
3531 /* Check if allowed to set variable */
3532 
3533  if (!AllowedToSetVariable (vp))
3534  return;
3535 
3536  CheckOPTIND (name, value);
3537 
3538  if (!(vp->status & STATUS_INTEGER))
3539  {
3540  sprintf (NumericBuffer, "%ld", value);
3541  SetVariableFromString (name, NumericBuffer);
3542  }
3543 
3544 /* Save the integer value */
3545 
3546  else
3547  SetUpANumericValue (vp, value, -1);
3548 
3550 }
3551 
3552 /*
3553  * Get variable as a numeric
3554  */
3555 
3557 {
3558  return GetVariableArrayAsNumeric (name, 0);
3559 }
3560 
3561 /* Array version */
3562 
3563 long GetVariableArrayAsNumeric (char *name, int Index)
3564 {
3565  VariableList *vp = LookUpVariable (name, Index, FALSE);
3566 
3567  if (vp->status & STATUS_INTEGER)
3568  return vp->nvalue;
3569 
3570  else
3571  return atol (vp->value);
3572 }
3573 
3574 /*
3575  * Get variable as a formatted string
3576  */
3577 
3578 char *GetVariableAsString (char *name, bool Format)
3579 {
3580  return GetVariableArrayAsString (name, 0, Format);
3581 }
3582 
3583 /*
3584  * Indexed version
3585  */
3586 
3587 char *GetVariableArrayAsString (char *name, int Index, bool Format)
3588 {
3589  VariableList *vp = LookUpVariable (name, Index, FALSE);
3590  char *Value = vp->value;
3591  char *xp;
3592  size_t len;
3593  char *NumericBuffer;
3594 
3595  if (vp->status & STATUS_INTEGER)
3596  {
3597  if ((NumericBuffer = GetAllocatedSpace (40)) == (char *)NULL)
3598  return null;
3599 
3600  if (vp->base != 10)
3601  {
3602  sprintf (NumericBuffer, LIT_BNumber, vp->base);
3603  xp = NumericBuffer + strlen (NumericBuffer);
3604  }
3605 
3606  else
3607  xp = NumericBuffer;
3608 
3609  ltoa (vp->nvalue, xp, vp->base);
3610  return NumericBuffer;
3611  }
3612 
3613 /* Handle a string variable, if no formating required, return it */
3614 
3615  if (!Format)
3616  return vp->value;
3617 
3618 /* Left justify ? */
3619 
3620  if (vp->status & STATUS_LEFT_JUSTIFY)
3621  {
3622  xp = SuppressSpacesZeros (vp, Value);
3623 
3624  if ((Value = GetAllocatedSpace (vp->width + 1)) == (char *)NULL)
3625  return null;
3626 
3627  memset (Value, CHAR_SPACE, vp->width);
3628  Value[vp->width] = 0;
3629 
3630  if ((len = strlen (xp)) > vp->width)
3631  len = vp->width;
3632 
3633  memcpy (Value, xp, len);
3634  }
3635 
3636 /* Right justify ? */
3637 
3638  else if (vp->status & (STATUS_RIGHT_JUSTIFY | STATUS_ZERO_FILL))
3639  {
3640  if ((xp = GetAllocatedSpace (vp->width + 1)) == (char *)NULL)
3641  return null;
3642 
3643  if ((len = strlen (Value)) < vp->width)
3644  {
3645  memset (xp, ((vp->status & STATUS_ZERO_FILL) &&
3646  (isdigit (*Value))) ? '0' : CHAR_SPACE, vp->width);
3647 
3648  memcpy (xp + (vp->width - len), Value, len);
3649  }
3650 
3651  else
3652  memcpy (xp, Value + vp->width - len, vp->width);
3653 
3654  *(xp + vp->width) = 0;
3655  Value = xp;
3656  }
3657 
3658 /* Handle upper and lower case conversions */
3659 
3660  if (vp->status & STATUS_LOWER_CASE)
3661  Value = strlwr (StringCopy (Value));
3662 
3663  if (vp->status & STATUS_UPPER_CASE)
3664  Value = strupr (StringCopy (Value));
3665 
3666  return Value;
3667 }
3668 
3669 /*
3670  * Set up a numeric value
3671  */
3672 
3673 static void F_LOCAL SetUpANumericValue (VariableList *vp, long value, int base)
3674 {
3675  vp->nvalue = value;
3676  vp->status |= STATUS_INTEGER;
3677 
3678  if (vp->base == 0)
3679  vp->base = (base > 1) ? base
3680  : ((LastNumberBase != -1) ? LastNumberBase
3681  : 10);
3682 
3683  if (vp->value != null)
3684  ReleaseMemoryCell ((void *)vp->value);
3685 
3686  vp->value = null;
3687 }
3688 
3689 /*
3690  * Suppress leading spaces and zeros
3691  */
3692 
3693 static char * F_LOCAL SuppressSpacesZeros (VariableList *vp, char *value)
3694 {
3695  if (vp->status & STATUS_LEFT_JUSTIFY)
3696  {
3697  while (*value == CHAR_SPACE)
3698  value++;
3699 
3700  if (vp->status & STATUS_ZERO_FILL)
3701  {
3702  while (*value == '0')
3703  value++;
3704  }
3705  }
3706 
3707  return value;
3708 }
3709 
3710 /*
3711  * Check to see if a reset of CheckOPTIND has occured
3712  */
3713 
3714 static void F_LOCAL CheckOPTIND (char *name, long value)
3715 {
3716  if ((value == 1) && (!(DisabledVariables & DISABLE_OPTIND)) &&
3717  (strcmp (OptIndVariable, name) == 0))
3719 }
3720 
3721 /*
3722  * Initialise the Integer variables by creating them
3723  */
3724 
3726 {
3728 
3729  while (wp->Name != (char *)NULL)
3730  {
3731  SetVariableStatus (wp->Name, wp->Status);
3732 
3733  if (wp->CValue != null)
3734  SetVariableFromString (wp->Name, wp->CValue);
3735 
3736  wp++;
3737  }
3738 }
3739 
3740 /*
3741  * Close up and exit
3742  */
3743 
3745 {
3746 #if (OS_TYPE == OS_OS)
3747 # if (OS_SIZE == OS_32)
3748  DosCloseEventSem (SessionQueueSema);
3749  DosCloseQueue (SessionQueueHandler);
3750 # else
3751  DosCloseSem (SessionQueueSema);
3752  DosCloseQueue (SessionQueueHandler);
3753 # endif
3754 #endif
3755 
3756  exit (status);
3757 }
3758 
3759 /*
3760  * Create Session termination semaphores and queues. Also get the number
3761  * file handlers.
3762  */
3763 
3764 #if (OS_TYPE == OS_OS2)
3765 static void F_LOCAL CreateTerminationQueues (void)
3766 {
3767  int count = 0;
3768  static char Name[25];
3769  OSCALL_RET rc;
3770 # if (OS_SIZE == OS_32)
3771  LONG ReqCount = 0; /* Increment */
3772  ULONG CurMaxFH; /* Available File handlers */
3773 
3774  DosSetRelMaxFH (&ReqCount, &CurMaxFH);
3775  MaxNumberofFDs = min (CurMaxFH, 32 + FDBASE);
3776 # endif
3777 
3778 /* Create semaphore for queue */
3779 
3780  while (TRUE)
3781  {
3782 # if (OS_SIZE == OS_32)
3783  sprintf (Name, "\\SEM32\\SHELL\\%.5d", count++);
3784 # else
3785  sprintf (Name, "\\SEM\\SHELL\\%.5d", count++);
3786 # endif
3787 
3788 # if (OS_SIZE == OS_32)
3789  if ((rc = DosCreateEventSem (Name, &SessionQueueSema,
3790  DC_SEM_SHARED, TRUE)) == NO_ERROR)
3791  break;
3792 # else
3793  if ((rc = DosCreateSem (CSEM_PUBLIC, &SessionQueueSema,
3794  Name)) == NO_ERROR)
3795  {
3796  DosSemClear (SessionQueueSema);
3797  break;
3798  }
3799 # endif
3800 
3801 /* Check for error */
3802 
3803 # if (OS_SIZE == OS_32)
3804  if (rc != ERROR_DUPLICATE_NAME)
3805 # else
3806  if (rc != ERROR_ALREADY_EXISTS)
3807 # endif
3808  {
3809  SessionQueueSema = 0;
3810  PrintErrorMessage ("DosCreateSem: Cannot create semaphore\n%s",
3811  GetOSSystemErrorMessage (rc));
3812  }
3813  }
3814 
3815 /* Create the queue */
3816 
3817  count = 0;
3818 
3819  while (TRUE)
3820  {
3821 # if (OS_SIZE == OS_32)
3822  sprintf (Name, "\\QUEUES\\SHELL\\%.5d", count++);
3823 # else
3824  sprintf (Name, "\\QUEUES\\SHQ%.5d", count++);
3825 # endif
3826 
3827  if ((rc = DosCreateQueue (&SessionQueueHandler,
3828 #ifdef QUE_CONVERT_ADDRESS
3829  QUE_FIFO | QUE_CONVERT_ADDRESS,
3830 #else
3831  QUE_FIFO,
3832 #endif
3833 
3834  Name)) == NO_ERROR)
3835  break;
3836 
3837 /* Check for error */
3838 
3839  if (rc != ERROR_QUE_DUPLICATE)
3840  {
3841  SessionQueueHandler = 0;
3842  PrintErrorMessage ("DosCreateQueue: Cannot create queue\n%s",
3843  GetOSSystemErrorMessage (rc));
3844  }
3845  }
3846 
3847  SessionEndQName = Name;
3848 }
3849 #endif
3850 
3851 /*
3852  * Set up Edit mode
3853  */
3854 
3855 #if defined (FLAGS_EMACS) || defined (FLAGS_VI) || defined (FLAGS_GMACS)
3856 static void F_LOCAL SetEditorMode (char *ed)
3857 {
3858  char *rcp;
3859 
3860  if ((rcp = strrchr (ed, '/')) != (char *)NULL)
3861  ed = rcp + 1;
3862 
3863 # ifdef FLAGS_EMACS
3864  if (strstr (ed, "emacs"))
3865  {
3866  ShellGlobalFlags &= ~~FLAGS_EDITORS;
3868  }
3869 # endif
3870 
3871 # ifdef FLAGS_VI
3872  if (strstr (ed, "vi"))
3873  {
3874  ShellGlobalFlags &= ~~FLAGS_EDITORS;
3876  }
3877 # endif
3878 
3879 # ifdef FLAGS_GMACS
3880  if (strstr (ed, "gmacs"))
3881  {
3882  ShellGlobalFlags &= ~~FLAGS_EDITORS;
3884  }
3885 # endif
3886 }
3887 #endif
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
use _CRT_SECURE_NO_WARNINGS.See online help for details.char *__cdecl ltoa(long _Value, char *_Buffer, int _Radix)
_invalid_parameter_handler __cdecl _set_invalid_parameter_handler(_invalid_parameter_handler _Handler)
#define strlwr
Definition: Utility.h:162
cp
Definition: action.c:1035
int level
Definition: afm2pl.c:1694
#define sc
Definition: aptex-macros.h:57
#define depth(a)
Definition: aptex-macros.h:199
#define count(a)
Definition: aptex-macros.h:781
#define name
#define mode
Definition: aptex-macros.h:510
int rc
Definition: bmpfont.h:9
static int GetLastError(void)
Definition: call.c:26
Definition: Array.h:29
@ SSTRING
Definition: cmscgats.c:55
#define n
Definition: t4ht.c:1290
#define ap
BOOL
Definition: dd.h:100
@ FALSE
Definition: dd.h:101
@ TRUE
Definition: dd.h:102
#define free(a)
Definition: decNumber.cpp:310
#define strrchr
Definition: detex.c:67
#define dummy
Definition: devnag.c:313
int dummy
Definition: dummy.c:29
#define fflush
Definition: xxstdio.h:24
static int np
Definition: bifont.c:64
char * strncpy()
int strcmp()
Definition: coll.cpp:143
char * strcpy()
long int flag
Definition: f2c.h:53
char pattern[8]
Definition: gemtopnm.c:50
mpz_t * f
Definition: gen-fib.c:34
#define xp
#define s
Definition: afcover.h:80
#define colon
Definition: globals.h:58
#define c(n)
Definition: gpos-common.c:150
#define a(n)
Definition: gpos-common.c:148
int base
Definition: gsftopk.c:1502
#define strchr
Definition: gsftopk.c:59
#define memcpy(d, s, n)
Definition: gsftopk.c:64
FILE * out
Definition: hbf2gf.c:286
unsigned nbytes
Definition: in_pcx.cpp:355
#define PATH_MAX
Definition: ftmac.c:91
#define NULL
Definition: ftobjs.h:61
small capitals from c petite p scientific f u
Definition: afcover.h:88
small capitals from c petite p scientific i
Definition: afcover.h:80
sizeof(AF_ModuleRec)
void exit()
#define EOF
Definition: afmparse.c:59
struct NameRec_ * Name
unsigned int uintptr_t
Definition: stdint.h:119
char * getenv()
voidp calloc()
long atol(const char *)
int errno
#define buf
#define NO_ERROR
Definition: error.h:34
#define srand(x)
Definition: mem.h:48
#define rand()
Definition: mem.h:49
unsigned char BYTE
Definition: sfnt.h:34
char * strstr()
#define INT_MAX
Definition: c-minmax.h:53
#define fclose
Definition: debug.h:100
char ** environ
#define fileno
Definition: win32lib.h:72
#define stricmp
Definition: win32lib.h:93
#define getpid
Definition: win32lib.h:76
#define fputs
Definition: mendex.h:67
#define fprintf
Definition: mendex.h:64
static char * strerror(int errnum)
Definition: error.c:56
#define string
Definition: ctangleboot.c:111
#define malloc
Definition: alloca.c:91
long time_t
Definition: types.h:18
void abort()
int strncmp()
unsigned short WORD
Definition: common.h:143
long LONG
Definition: common.h:146
#define sprintf
Definition: snprintf.c:44
#define isdigit(c)
Definition: snprintf.c:177
cell * list
Definition: list_routines.h:30
struct tm * localtime(const time_t *const timep)
Definition: localtime.c:1332
static struct tm tm
Definition: localtime.c:216
#define LINE_MAX
Definition: mkind.h:326
unsigned int DWORD
Definition: mktexlib.h:49
HBUINT16 Value
constexpr auto visit(Visitor &&visitor, Vs &&... vs) -> decltype((detail::all(lib::array< bool, sizeof...(Vs)>{{!vs.valueless_by_exception()...}}) ?(void) 0 :throw_bad_variant_access()), detail::visitation::variant::visit_value(lib::forward< Visitor >(visitor), lib::forward< Vs >(vs)...))
Definition: variant.hpp:2697
union value value
Definition: obx.h:44
#define min(a, b)
Definition: pbmplus.h:223
unsigned long ULONG
Definition: pdfgen.h:158
#define res(length)
Definition: picttoppm.c:287
static struct Point current
Definition: picttoppm.c:134
set set set set set set set macro pixldst1 abits if abits op else op endif endm macro pixldst2 abits if abits op else op endif endm macro pixldst4 abits if abits op else op endif endm macro pixldst0 abits op endm macro pixldst3 mem_operand op endm macro pixldst30 mem_operand op endm macro pixldst abits if abits elseif abits elseif abits elseif abits elseif abits pixldst0 abits else pixldst0 abits pixldst0 abits pixldst0 abits pixldst0 abits endif elseif abits else pixldst0 abits pixldst0 abits endif elseif abits else error unsupported bpp *numpix else pixst endif endm macro pixld1_s mem_operand if asr adds SRC_WIDTH_FIXED bpl add asl mov asr adds SRC_WIDTH_FIXED bpl add asl mov asr adds SRC_WIDTH_FIXED bpl add asl mov asr adds SRC_WIDTH_FIXED bpl add asl elseif asr adds SRC_WIDTH_FIXED bpl add asl mov asr adds SRC_WIDTH_FIXED bpl add asl else error unsupported endif endm macro pixld2_s mem_operand if mov asr add asl add asl mov asr sub UNIT_X add asl mov asr add asl add asl mov asr add UNIT_X add asl else pixld1_s mem_operand pixld1_s mem_operand endif endm macro pixld0_s mem_operand if asr adds SRC_WIDTH_FIXED bpl add asl elseif asr adds SRC_WIDTH_FIXED bpl add asl endif endm macro pixld_s_internal mem_operand if mem_operand pixld2_s mem_operand pixdeinterleave basereg elseif mem_operand elseif mem_operand elseif mem_operand elseif mem_operand pixld0_s mem_operand else pixld0_s mem_operand pixld0_s mem_operand pixld0_s mem_operand pixld0_s mem_operand endif elseif mem_operand else pixld0_s mem_operand pixld0_s mem_operand endif elseif mem_operand else error unsupported mem_operand if bpp mem_operand endif endm macro vuzp8 reg2 vuzp d d &reg2 endm macro vzip8 reg2 vzip d d &reg2 endm macro pixdeinterleave basereg basereg basereg basereg basereg endif endm macro pixinterleave basereg basereg basereg basereg basereg endif endm macro PF boost_increment endif if endif PF tst PF addne PF subne PF cmp ORIG_W if endif if endif if endif PF subge ORIG_W PF subges if endif if endif if endif endif endm macro cache_preload_simple endif if dst_r_bpp pld[DST_R, #(PREFETCH_DISTANCE_SIMPLE *dst_r_bpp/8)] endif if mask_bpp pld endif[MASK, #(PREFETCH_DISTANCE_SIMPLE *mask_bpp/8)] endif endif endm macro fetch_mask_pixblock pixld mask_basereg pixblock_size MASK endm macro ensure_destination_ptr_alignment process_pixblock_tail_head if beq irp skip1 beq endif SRC MASK if dst_r_bpp DST_R else add endif PF add sub src_basereg pixdeinterleave mask_basereg pixdeinterleave dst_r_basereg process_pixblock_head pixblock_size cache_preload_simple process_pixblock_tail pixinterleave dst_w_basereg irp beq endif process_pixblock_tail_head tst beq irp if pixblock_size chunk_size tst beq pixld_src SRC pixld MASK if DST_R else pixld DST_R endif if
#define fp
static int32_t last
Definition: ppagelist.c:29
int r
Definition: ppmqvga.c:68
type_C toupper(type_C)
bstring c int memset(void *s, int c, int length)
time_t time()
#define dir
#define status
#define flags
static uint8_t xtime(uint8_t x)
Definition: utilcrypt.c:465
#define tolower(ch)
Definition: utype.h:137
#define isspace(ch)
Definition: utype.h:87
#define islower(ch)
Definition: utype.h:79
#define LL(x)
Definition: lobject.c:479
#define flag
Definition: round_prec.c:45
mp_ptr hp
Definition: sec_pi1_div.c:86
int _osminor
Definition: sh1.c:2
char * GetVariableAsString(char *name, bool Format)
Definition: sh1.c:3578
static void near ProcessErrorExit(char *, va_list)
Definition: sh1.c:1068
void DeleteGlobalVariableList(void)
Definition: sh1.c:1757
long GetVariableAsNumeric(char *name)
Definition: sh1.c:3556
void SetShellSwitches(void)
Definition: sh1.c:907
size_t GetMemoryCellSize(void *cell)
Definition: sh1.c:1299
void SetVariableFromString(char *name, char *val)
Definition: sh1.c:3415
static struct ShellVariablesInit InitialiseShellVariables[]
void RunTrapCommand(int i)
Definition: sh1.c:1362
static char * ShellOptions
Definition: sh1.c:152
static int near RunCommands(Source *)
Definition: sh1.c:753
static char * ShellNameLiteral
Definition: sh1.c:151
void TerminateCurrentEnvironment(int TValue)
Definition: sh1.c:929
#define CheckForSessionEnd()
Definition: sh1.c:321
char * ConvertPathToFormat(char *path, char in, char out)
Definition: sh1.c:2931
void ShellErrorMessage(char *fmt,...)
Definition: sh1.c:1032
static char *near SuppressSpacesZeros(VariableList *, char *)
Definition: sh1.c:3693
static void near LoadTheProfileFiles(void)
Definition: sh1.c:2947
void TerminateSignalled(int i)
Definition: sh1.c:1339
void InterruptSignalled(int signo)
Definition: sh1.c:1195
static unsigned int ATOE_GFlags
Definition: sh1.c:177
static void near SetUpParameterEV(int, char **, char *)
Definition: sh1.c:3297
static bool ProcessingDEBUGTrap
Definition: sh1.c:175
static int Count_Array
Definition: sh1.c:184
#define CheckForTerminatedProcess()
Definition: sh1.c:300
static char Start_directory[1024+6]
Definition: sh1.c:243
void ReleaseMemoryCell(void *s)
Definition: sh1.c:2141
void QuitCurrentEnvironment(void)
Definition: sh1.c:1126
long GetVariableArrayAsNumeric(char *name, int Index)
Definition: sh1.c:3563
static void near ConvertUnixPathToMSDOS(char *)
Definition: sh1.c:2982
static void near CheckOPTIND(char *, long)
Definition: sh1.c:3714
static char * ymail
Definition: sh1.c:150
int _osmode
Definition: sh1.c:3
void * GetAllocatedSpace(size_t n)
Definition: sh1.c:1241
#define INTERRUPT_TYPE
Definition: sh1.c:254
bool AssignVariableFromString(char *String, int *Index)
Definition: sh1.c:1579
#define CreateTerminationQueues()
Definition: sh1.c:322
static char * NOExit
Definition: sh1.c:173
static void AddToOldEnvironment(const void *, VISIT, int)
Definition: sh1.c:1823
void PrintErrorMessage(char *fmt,...)
Definition: sh1.c:1053
static void near ClearUserPrompts(void)
Definition: sh1.c:3046
static char * EditorVariables[]
Definition: sh1.c:237
static void CountEnvironment(const void *, VISIT, int)
Definition: sh1.c:1550
int CreateGlobalVariableList(unsigned int Function)
Definition: sh1.c:1671
void SetVariableArrayFromString(char *name, int Index, char *val)
Definition: sh1.c:3424
void ReleaseAList(char **list)
Definition: sh1.c:2126
void ExitTheShell(bool ReturnRequired)
Definition: sh1.c:943
static void near CreateIntegerVariables(void)
Definition: sh1.c:3725
bool GeneralPatternMatch(char *string, unsigned char *pattern, bool IgnoreCase, char **end, int mode)
Definition: sh1.c:1879
void main(int argc, char **argv)
Definition: sh1.c:368
static void DeleteEnvironment(const void *, VISIT, int)
Definition: sh1.c:1805
bool SuffixPatternMatch(char *string, char *pattern, char **start, int mode)
Definition: sh1.c:2033
void ReleaseMemoryArea(int a)
Definition: sh1.c:2243
int CountVariableArraySize(char *name)
Definition: sh1.c:1535
char * _ACmdLine
Definition: sh8.c:232
static struct region * MemoryAreaHeader
Definition: sh1.c:135
static time_t ShellStartTime
Definition: sh1.c:245
char * IntegerToString(int n)
Definition: sh1.c:1171
static bool ProcessingERRORTrap
Definition: sh1.c:176
void * DuplicateMemoryCell(void *cell)
Definition: sh1.c:1280
WORD IgnoreScanCode[6]
Definition: sh1.c:344
char * BuildFileName(char *name)
Definition: sh1.c:3021
static void near SecondAndRandomEV(char *, long)
Definition: sh1.c:3058
static unsigned int ATNE_Function
Definition: sh1.c:178
static void(interrupt far *Orig_I24_V)(void)
char * _APgmName
Definition: sh8.c:233
static void near CheckForMailArriving(void)
Definition: sh1.c:2761
void SetVariableStatus(char *name, int flag)
Definition: sh1.c:3349
static char * shellname
Definition: sh1.c:147
void GetCurrentDirectoryPath(void)
Definition: sh1.c:2428
void CreateNewEnvironment(void)
Definition: sh1.c:1100
void HandleSECONDandRANDOM(void)
Definition: sh1.c:3336
void SetMemoryAreaNumber(void *cp, int a)
Definition: sh1.c:2302
char * GetVariableArrayAsString(char *name, int Index, bool Format)
Definition: sh1.c:3587
int _osmajor
Definition: sh1.c:1
static bool near ExecuteShellScript(char *)
Definition: sh1.c:722
static void near SetUpANumericValue(VariableList *, long, int)
Definition: sh1.c:3673
struct region s_region
int SearchVariable(const void *key1, const void *key2)
Definition: sh1.c:1561
static char LIT_OSmode[]
Definition: sh1.c:169
void SetVariableFromNumeric(char *name, long value)
Definition: sh1.c:3519
bool GetVariableName(char *String, long *Index, char **Value, bool *Array)
Definition: sh1.c:1618
void * ReAllocateSpace(void *OldSpace, size_t NewSize)
Definition: sh1.c:1255
static char LIT_SHmode[]
Definition: sh1.c:170
static bool near AllowedToSetVariable(VariableList *)
Definition: sh1.c:3393
static bool near Initialise(int, char **)
Definition: sh1.c:2456
static unsigned char *near CheckClassExpression(unsigned char *, int, bool)
Definition: sh1.c:1973
void SetVariableArrayFromNumeric(char *name, int Index, long value)
Definition: sh1.c:3526
char * AllocateMemoryCell(size_t nbytes)
Definition: sh1.c:2071
void FinalExitCleanUp(int status)
Definition: sh1.c:3744
int GetMemoryAreaNumber(void *cp)
Definition: sh1.c:2314
char * StringCopy(char *s)
Definition: sh1.c:1325
static void AddToNewEnvironment(const void *, VISIT, int)
Definition: sh1.c:1724
static void near SetEditorMode(char *)
Definition: sh1.c:3856
#define RELEASE_MEMORY(x)
Definition: sh1.c:121
int PrintWarningMessage(char *fmt,...)
Definition: sh1.c:1010
VariableList * LookUpVariable(char *name, int Index, bool cflag)
Definition: sh1.c:1419
static void near LoadGlobalVariableList(void)
Definition: sh1.c:1860
static char * Count_Name
Definition: sh1.c:185
char * StringSave(char *s)
Definition: sh1.c:1308
static char LIT_Dollar[]
Definition: sh1.c:171
void SetVariableArrayStatus(char *name, int index, int flag)
Definition: sh1.c:3362
void ClearVariableStatus(char *name, int flag)
Definition: sh1.c:3381
void OutputUserPrompt(char *s)
Definition: sh1.c:2325
static char * tilde
Definition: sh1.c:168
static void near Pre_Process_Argv(char **, int *)
Definition: sh1.c:2846
#define str(s)
Definition: sh6.c:399
#define STATUS_LOCAL
Definition: sh.h:1803
void RestoreCurrentDirectory(char *)
Definition: sh3.c:840
struct subshell S_SubShell
Break_C * Break_List
Definition: sh6.c:144
void ClearSwapFile(void)
Definition: system.c:2165
char ** ParameterArray
Definition: sh6.c:117
#define F_LOCAL
Definition: sh.h:121
int MemoryAreaLevel
Definition: sh6.c:379
void CloseAllHandlers(void)
Definition: sh5.c:1161
char LastWordVariable[]
Definition: sh6.c:244
void SetCharacterTypes(char *, int)
Definition: sh8.c:1391
#define BASE_OS_WIN
Definition: sh.h:543
#define CHAR_TILDE
Definition: sh.h:1025
void EMACS_Initialisation(void)
Definition: sh13.c:4649
#define CHAR_NEW_LINE
Definition: sh.h:1007
char RandomVariable[]
Definition: sh6.c:213
char ShellVariableName[]
Definition: sh6.c:205
int GetRootDiskDrive(void)
Definition: sh9.c:2788
#define CHAR_MATCH_RANGE
Definition: sh.h:1039
int S_close(int, bool)
Definition: sh8.c:448
#define FLAG_NO_EXECUTE
Definition: sh.h:1723
char * LastUserPrompt1
Definition: sh6.c:193
char LIT_COLUMNS[]
Definition: sh6.c:263
#define STATUS_CONVERT_MSDOS
Definition: sh.h:1795
#define TERMINATE_SHELL
Definition: sh.h:1684
void * tfind(void *, void **, int(*)(const void *, const void *))
int RunACommand(Source *, char **)
Definition: sh3.c:4123
#define CHAR_FORMAT
Definition: sh.h:1032
int OpenForExecution(char *, char **, int *)
Definition: sh8.c:778
#define FL_TEST(x)
Definition: sh.h:1705
void * VariableTree
Definition: sh6.c:190
char Trap_ERR[]
Definition: sh6.c:252
#define IsPathCharacter(a)
Definition: sh.h:1140
char LIT_LINES[]
Definition: sh6.c:262
#define FLAGS_VI
Definition: sh.h:1761
#define CHAR_HYPHEN
Definition: sh.h:1038
#define CHAR_PERIOD
Definition: sh.h:1042
void InitialiseCharacterTypes(void)
Definition: sh8.c:1421
void FlushStreams(void)
Definition: sh8.c:1646
void BuildExtensionLists(void)
Definition: sh3.c:2527
void twalk(const void *, void(*)(const void *, VISIT, int))
#define GM_ALL
Definition: sh.h:1774
#define FDBASE
Definition: sh.h:1000
bool ConvertNumericValue(char *, long *, int)
Definition: system.c:1922
int Execute_stack_depth
Definition: sh6.c:188
char PS3[]
Definition: sh6.c:197
#define FL_SET(x)
Definition: sh.h:1706
int RestoreStandardIO(int, bool)
Definition: sh8.c:692
char * ShellOptionsVariable
Definition: sh6.c:210
#define TERMINATE_POINT_SET
Definition: sh.h:1682
int MSubShells
Definition: sh6.c:184
char PS1[]
Definition: sh6.c:195
char * LIT_AllowTTY
Definition: sh6.c:274
int InterruptTrapPending
Definition: sh6.c:187
#define STTY
Definition: sh.h:1363
char * LIT_BNumber
Definition: sh6.c:272
unsigned int GetCurrentDrive(void)
Definition: sh8.c:1060
unsigned int ShellGlobalFlags
Definition: sh6.c:130
#define SetWindowName(a)
Definition: sh.h:1907
#define C2bool(c)
Definition: sh.h:1476
bool RestrictedShellFlag
Definition: sh6.c:147
int ExecuteParseTree(C_Op *, int, int, int)
Definition: sh3.c:265
char PS4[]
Definition: sh6.c:198
#define C_IFS
Definition: sh.h:1071
#define FLAGS_MSDOS_FORMAT
Definition: sh.h:1752
#define CHAR_META
Definition: sh.h:1058
#define FLAG_ONE_COMMAND
Definition: sh.h:1726
int ParameterCount
Definition: sh6.c:118
char SecondsVariable[]
Definition: sh6.c:212
#define FLAGS_REALPIPES
Definition: sh.h:1747
#define FLAGS_EMACS
Definition: sh.h:1762
int CloseFile(FILE *)
Definition: sh8.c:1626
char StatusVariable[]
Definition: sh6.c:211
#define O_RMASK
Definition: sh.h:1106
char HomeVariableName[]
Definition: sh6.c:204
int DisabledVariables
Definition: sh6.c:133
#define CHAR_ASSIGN
Definition: sh.h:1054
char PS2[]
Definition: sh6.c:196
#define DISABLE_WINTITLE
Definition: sh.h:1164
#define BASE_OS_UNIX
Definition: sh.h:546
#define FLAG_POSITION
Definition: sh.h:1725
char * ComspecVariable
Definition: sh6.c:208
#define OSCALL_PARAM
Definition: sh.h:651
void interrupt far SW_Int24(void)
bool HistoryEnabled
Definition: sh6.c:149
void ClearExtendedLineFile(void)
Definition: system.c:946
char * LIT_OSname
Definition: sh6.c:97
#define DISABLE_RANDOM
Definition: sh.h:1161
int ExitStatus
Definition: sh6.c:119
void DeleteAllFunctions(void)
Definition: sh10.c:1009
bool ProcessingEXECCommand
Definition: sh6.c:123
void ResetGetoptsValues(bool)
Definition: sh7.c:802
char * LastUserPrompt
Definition: sh6.c:192
#define GetInterruptVector(x)
Definition: sh.h:2380
char PathExtsLiteral[]
Definition: sh6.c:203
#define CHAR_COLON
Definition: sh.h:1043
#define BASE_OS_DOS
Definition: sh.h:542
#define FLAG_ALL_EXPORT
Definition: sh.h:1715
int BaseOS
Definition: sh6.c:116
char * PWDVariable
Definition: sh6.c:222
void * tsearch(void *, void **, int(*)(const void *, const void *))
int GetOptions(int, char **, char *, int)
Definition: sh7.c:4450
S_SubShell * SubShells
Definition: sh6.c:182
void LoadHistory(void)
Definition: sh9.c:1345
char MailCheckVariable[]
Definition: sh6.c:247
void UnTrackAllAliases(void)
Definition: sh10.c:1433
char EXEExtension[]
Definition: sh6.c:238
#define CHAR_DOUBLE_QUOTE
Definition: sh.h:1009
#define GETOPT_MESSAGE
Definition: sh.h:2431
#define FLAG_ECHO_INPUT
Definition: sh.h:1728
bool GotoDirectory(char *, unsigned int)
Definition: sh8.c:3521
Word_B * AddParameter(char *, Word_B *, char *)
Definition: sh8.c:1512
int NSave_IO_E
Definition: sh6.c:180
char * OptionArgument
Definition: sh6.c:370
char * Outofmemory1
Definition: sh6.c:265
char * sOpenReadMode
Definition: sh6.c:290
#define STATUS_LOWER_CASE
Definition: sh.h:1799
void PrintVersionNumber(FILE *)
Definition: sh6.c:406
#define CHAR_MATCH_ANY
Definition: sh.h:1056
C_Op * BuildParseTree(Source *)
Definition: sh2.c:886
#define STATUS_UPPER_CASE
Definition: sh.h:1800
#define STATUS_RIGHT_JUSTIFY
Definition: sh.h:1797
char LineCountVariable[]
Definition: sh6.c:214
#define FLAG_INTERACTIVE
Definition: sh.h:1720
#define IS_Pipe(a)
Definition: sh.h:1178
#define FLAG_PRINT_EXECUTE
Definition: sh.h:1730
#define FLAG_EXIT_ON_ERROR
Definition: sh.h:1717
char EditorVariable[]
Definition: sh6.c:249
char CDPathLiteral[]
Definition: sh6.c:200
char * LIT_IsReadonly
Definition: sh6.c:275
ShellFileEnvironment e
Definition: sh6.c:388
#define OS_VERS_N
Definition: sh.h:537
#define CHAR_OPEN_BRACKETS
Definition: sh.h:1023
void FlushHistoryBuffer(void)
Definition: sh9.c:2544
void ResetGetOptions(void)
Definition: sh7.c:4444
#define ExitErrorPoint(a)
Definition: sh.h:1679
bool ValidMathsExpression(char *, long *)
Definition: sh11.c:970
char * LIT_2Strings
Definition: sh6.c:267
int WordBlockSize(Word_B *)
Definition: system.c:1779
VariableList * CurrentDirectory
Definition: sh6.c:191
Save_IO * SSave_IO
Definition: sh6.c:179
int S_open(bool, char *, int)
Definition: sh8.c:253
#define BASE_OS_NT
Definition: sh.h:545
#define SetErrorPoint(a)
Definition: sh.h:1678
char Trap_DEBUG[]
Definition: sh6.c:251
#define CHAR_MATCH_ALL
Definition: sh.h:1036
#define FLAGS_FUNCTION
Definition: sh.h:1742
#define STATUS_ZERO_FILL
Definition: sh.h:1798
#define NOWORDS
Definition: sh.h:1150
#define STATUS_CANNOT_UNSET
Definition: sh.h:1794
#define FindLastPathCharacter(a)
Definition: sh.h:1141
#define IS_VariableFC(c)
Definition: sh.h:1083
char HistorySizeVariable[]
Definition: sh6.c:207
#define ErrorPoint
Definition: sh.h:1677
char FCEditVariable[]
Definition: sh6.c:248
#define STATUS_READONLY
Definition: sh.h:1792
#define CHAR_SWITCH
Definition: sh.h:1041
#define DISABLE_MAILCHECK
Definition: sh.h:1157
FunctionList * CurrentFunction
Definition: sh6.c:152
#define FLAGS_GMACS
Definition: sh.h:1763
unsigned int far SW_intr
#define STATUS_INTEGER
Definition: sh.h:1801
void FreeAllHereDocuments(int)
Definition: sh5.c:1438
int MaxNumberofFDs
Definition: sh6.c:131
void DumpHistory(void)
Definition: sh9.c:1568
Break_C * Return_List
Definition: sh6.c:145
char * DirectorySeparator
Definition: sh6.c:243
char PathLiteral[]
Definition: sh6.c:199
#define SFILE
Definition: sh.h:1364
#define CHAR_MAGIC
Definition: sh.h:1060
int feputs(char *)
Definition: sh8.c:3385
int ReMapIOHandler(int)
Definition: sh5.c:1216
bool ChangeInitLoad
Definition: sh6.c:129
#define OS_TYPE
Definition: sh.h:113
#define CHAR_NOT
Definition: sh.h:1013
void UnSetVariable(char *, int, bool)
Definition: sh7.c:1239
bool S_stat(char *, struct _stat *)
Definition: sh8.c:1679
char IsValidVariableName(char *)
Definition: system.c:1935
#define NOPIPE
Definition: sh.h:1151
#define STATUS_NOEXISTANT
Definition: sh.h:1805
#define SetInterruptVector(x, y)
Definition: sh.h:2381
char VisualVariable[]
Definition: sh6.c:250
char * OldPWDVariable
Definition: sh6.c:221
#define SystemInterrupt(a, b, c)
Definition: sh.h:585
bool InteractiveFlag
Definition: sh6.c:122
FILE * MyReOpenFile(int, char *)
Definition: sh8.c:1609
Source * pushs(int)
Definition: sh5.c:1018
char OptIndVariable[]
Definition: sh6.c:246
#define CHAR_RETURN
Definition: sh.h:1011
#define CHAR_DOS_PATH
Definition: sh.h:1059
void PositionCursorInColumnZero(void)
Definition: sh9.c:1991
int feputc(int)
Definition: sh8.c:3380
#define IS_TTY(a)
Definition: sh.h:1180
#define CHAR_CLOSE_BRACKETS
Definition: sh.h:1024
char * LIT_BadArray
Definition: sh6.c:270
#define FLAG_READONLY_SHELL
Definition: sh.h:1724
#define PATH_TO_UNIX(x)
Definition: sh.h:1112
#define STATUS_GLOBAL
Definition: sh.h:1804
int Current_Event
Definition: sh6.c:128
int MSave_IO_E
Definition: sh6.c:181
VISIT
Definition: sh.h:2439
@ postorder
Definition: sh.h:2439
@ leaf
Definition: sh.h:2439
@ endorder
Definition: sh.h:2439
int foputs(char *)
Definition: sh8.c:3390
#define SSAVE_IO_SIZE
Definition: sh.h:995
int NSubShells
Definition: sh6.c:183
#define BASE_OS_OS2
Definition: sh.h:544
#define CHAR_SPACE
Definition: sh.h:1012
#define FLAGS_IGNOREEOF
Definition: sh.h:1739
int OptionIndex
Definition: sh6.c:368
#define OSCALL_RET
Definition: sh.h:650
Break_C * SShell_List
Definition: sh6.c:146
char * ENVVariable
Definition: sh6.c:223
int LastNumberBase
Definition: sh6.c:185
#define STATUS_EXPORT
Definition: sh.h:1793
int ProcessOutputMetaCharacters(char **)
Definition: sh8.c:3455
#define DISABLE_SECONDS
Definition: sh.h:1160
void ScrapHereList(void)
Definition: sh5.c:1419
#define STATUS_LEFT_JUSTIFY
Definition: sh.h:1796
#define TERMINATE_COMMAND
Definition: sh.h:1683
char GetDriveLetter(unsigned int)
Definition: sh8.c:3405
#define CHAR_PATH_SEPARATOR
Definition: sh.h:1050
void Configure_Keys(void)
Definition: sh9.c:1851
char IFS[]
Definition: sh6.c:194
#define GM_LONGEST
Definition: sh.h:1776
#define DISABLE_OPTIND
Definition: sh.h:1159
void ChangeFileDescriptorStatus(int, bool)
Definition: sh8.c:3415
bool S_getcwd(char *, int)
Definition: system.c:2320
bool CheckForRestrictedShell(char *)
Definition: sh8.c:761
#define TEOF
Definition: sh.h:1240
char * BasicErrorMessage
Definition: sh6.c:242
char * LIT_Emsg
Definition: sh6.c:266
static FILE * in
Definition: squeeze.c:36
char * CValue
Definition: sh1.c:192
char * Name
Definition: sh1.c:190
A string of characters.
Definition: t1part.c:49
Definition: sh.h:1540
Definition: utils.c:300
Definition: sh.h:1689
int * ErrorReturnPoint
Definition: sh.h:1690
unsigned long IOMap
Definition: sh.h:1691
struct env * PreviousEnvironment
Definition: sh.h:1695
Word_B * OpenStreams
Definition: sh.h:1696
char * line
Definition: sh.h:1693
Definition: filedef.h:30
Definition: mendex.h:20
Definition: bdf.c:133
Definition: sh.h:1226
Definition: tpic.c:45
Definition: regions.h:31
size_t nbytes
Definition: sh1.c:131
struct region * next
Definition: sh1.c:130
int area
Definition: sh1.c:132
Definition: sh2.c:920
Definition: search.h:25
Definition: sh.h:1345
FILE * file
Definition: sh.h:1350
int line
Definition: sh.h:1354
Definition: stemdb.c:56
Definition: sh.h:1929
Definition: dvips.h:235
Definition: strexpr.c:21
Definition: sh.h:1782
char * name
Definition: sh.h:1783
char * value
Definition: sh.h:1784
unsigned int width
Definition: sh.h:1788
unsigned long nvalue
Definition: sh.h:1786
unsigned int status
Definition: sh.h:1789
int index
Definition: sh.h:1785
unsigned int base
Definition: sh.h:1787
Definition: sh.h:1559
char * w_words[1]
Definition: sh.h:1562
pointer path
Definition: t1imager.h:36
#define FILE
Definition: t1stdio.h:34
int j
Definition: t4ht.c:1589
s1
Definition: t4ht.c:1059
void signal(SIGFPE, sig_err)
*job_name strlen((char *) job_name) - 4)
#define key
Definition: tex2xindy.c:753
char fmt[256]
Definition: tex4ht.c:3925
val
Definition: tex4ht.c:3227
int diff
Definition: tex4ht.c:3815
found
Definition: tex4ht.c:5000
m
Definition: tex4ht.c:3990
job
Definition: tex4ht.c:3916
return() int(((double) *(font_tbl[cur_fnt].wtbl+(int)(*(font_tbl[cur_fnt].char_wi+(int)(ch - font_tbl[cur_fnt].char_f)% 256)))/(double)(1L<< 20)) *(double) font_tbl[cur_fnt].scale)
void substitute(char *str, char *patterns,...)
Definition: psearch.c:298
#define sp
Definition: stack.c:11
#define vinfo(a)
Definition: texnodes.h:46
int nt
Definition: tfmread.c:8
unsigned int * lp
Definition: ttf.c:84
@ L
Definition: ubidiimp.h:45
Definition: lobject.h:100
Definition: obx.h:51
#define BUFSIZ
Definition: ps.c:61
@ start
Definition: preamble.c:52
@ title
Definition: preamble.c:50
#define va_start(pvar)
Definition: varargs.h:30
#define va_end(pvar)
Definition: varargs.h:38
char * va_list
Definition: varargs.h:22
#define argv
Definition: xmain.c:270
#define argc
Definition: xmain.c:269
#define end(cp)
Definition: zic.c:71