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)  

pkgdata.cpp
Go to the documentation of this file.
1 // © 2016 and later: Unicode, Inc. and others.
2 // License & terms of use: http://www.unicode.org/copyright.html
3 /******************************************************************************
4  * Copyright (C) 2000-2016, International Business Machines
5  * Corporation and others. All Rights Reserved.
6  *******************************************************************************
7  * file name: pkgdata.cpp
8  * encoding: ANSI X3.4 (1968)
9  * tab size: 8 (not used)
10  * indentation:4
11  *
12  * created on: 2000may15
13  * created by: Steven \u24C7 Loomis
14  *
15  * This program packages the ICU data into different forms
16  * (DLL, common data, etc.)
17  */
18 
19 // Defines _XOPEN_SOURCE for access to POSIX functions.
20 // Must be before any other #includes.
21 #include "uposixdefs.h"
22 
23 #include "unicode/utypes.h"
24 
25 #include "unicode/putil.h"
26 #include "putilimp.h"
27 
28 #if U_HAVE_POPEN
29 #if (U_PF_MINGW <= U_PLATFORM && U_PLATFORM <= U_PF_CYGWIN) && defined(__STRICT_ANSI__)
30 /* popen/pclose aren't defined in strict ANSI on Cygwin and MinGW */
31 #undef __STRICT_ANSI__
32 #endif
33 #endif
34 
35 #include "cmemory.h"
36 #include "cstring.h"
37 #include "filestrm.h"
38 #include "toolutil.h"
39 #include "unicode/uclean.h"
40 #include "unewdata.h"
41 #include "uoptions.h"
42 #include "package.h"
43 #include "pkg_icu.h"
44 #include "pkg_genc.h"
45 #include "pkg_gencmn.h"
46 #include "flagparser.h"
47 #include "filetools.h"
48 #include "charstr.h"
49 #include "uassert.h"
50 
51 #if U_HAVE_POPEN
52 # include <unistd.h>
53 #endif
54 
55 #include <stdio.h>
56 #include <stdlib.h>
57 
59 #include "pkgtypes.h"
61 
62 #if U_HAVE_POPEN
63 
64 using icu::LocalPointerBase;
65 
66 U_DEFINE_LOCAL_OPEN_POINTER(LocalPipeFilePointer, FILE, pclose);
67 
68 #endif
69 
70 using icu::LocalMemory;
71 
72 static void loadLists(UPKGOptions *o, UErrorCode *status);
73 
75 
76 #ifdef WINDOWS_WITH_MSVC
77 static int32_t pkg_createWindowsDLL(const char mode, const char *gencFilePath, UPKGOptions *o);
78 #endif
79 static int32_t pkg_createSymLinks(const char *targetDir, UBool specialHandling=FALSE);
80 static int32_t pkg_installLibrary(const char *installDir, const char *dir, UBool noVersion);
81 static int32_t pkg_installFileMode(const char *installDir, const char *srcDir, const char *fileListName);
82 static int32_t pkg_installCommonMode(const char *installDir, const char *fileName);
83 
84 #ifdef BUILD_DATA_WITHOUT_ASSEMBLY
85 static int32_t pkg_createWithoutAssemblyCode(UPKGOptions *o, const char *targetDir, const char mode);
86 #endif
87 
88 #ifdef CAN_WRITE_OBJ_CODE
89 static void pkg_createOptMatchArch(char *optMatchArch);
90 static void pkg_destroyOptMatchArch(char *optMatchArch);
91 #endif
92 
93 static int32_t pkg_createWithAssemblyCode(const char *targetDir, const char mode, const char *gencFilePath);
94 static int32_t pkg_generateLibraryFile(const char *targetDir, const char mode, const char *objectFile, char *command = NULL, UBool specialHandling=FALSE);
95 static int32_t pkg_archiveLibrary(const char *targetDir, const char *version, UBool reverseExt);
96 static void createFileNames(UPKGOptions *o, const char mode, const char *version_major, const char *version, const char *libName, const UBool reverseExt, UBool noVersion);
98 
100 static int runCommand(const char* command, UBool specialHandling=FALSE);
101 
102 #define IN_COMMON_MODE(mode) (mode == 'a' || mode == 'c')
103 #define IN_DLL_MODE(mode) (mode == 'd' || mode == 'l')
104 #define IN_STATIC_MODE(mode) (mode == 's')
105 #define IN_FILES_MODE(mode) (mode == 'f')
106 
107 enum {
131 };
132 
133 /* This sets the modes that are available */
134 static struct {
135  const char *name, *alt_name;
136  const char *desc;
137 } modes[] = {
138  { "files", 0, "Uses raw data files (no effect). Installation copies all files to the target location." },
139 #if U_PLATFORM_HAS_WIN32_API
140  { "dll", "library", "Generates one common data file and one shared library, <package>.dll"},
141  { "common", "archive", "Generates just the common file, <package>.dat"},
142  { "static", "static", "Generates one statically linked library, " LIB_PREFIX "<package>" UDATA_LIB_SUFFIX }
143 #else
144 #ifdef UDATA_SO_SUFFIX
145  { "dll", "library", "Generates one shared library, <package>" UDATA_SO_SUFFIX },
146 #endif
147  { "common", "archive", "Generates one common data file, <package>.dat" },
148  { "static", "static", "Generates one statically linked library, " LIB_PREFIX "<package>" UDATA_LIB_SUFFIX }
149 #endif
150 };
151 
152 static UOption options[]={
153  /*00*/ UOPTION_DEF( "name", 'p', UOPT_REQUIRES_ARG),
154  /*01*/ UOPTION_DEF( "bldopt", 'O', UOPT_REQUIRES_ARG), /* on Win32 it is release or debug */
155  /*02*/ UOPTION_DEF( "mode", 'm', UOPT_REQUIRES_ARG),
156  /*03*/ UOPTION_HELP_H, /* -h */
157  /*04*/ UOPTION_HELP_QUESTION_MARK, /* -? */
158  /*05*/ UOPTION_VERBOSE, /* -v */
159  /*06*/ UOPTION_COPYRIGHT, /* -c */
160  /*07*/ UOPTION_DEF( "comment", 'C', UOPT_REQUIRES_ARG),
161  /*08*/ UOPTION_DESTDIR, /* -d */
162  /*11*/ UOPTION_DEF( "rebuild", 'F', UOPT_NO_ARG),
163  /*12*/ UOPTION_DEF( "tempdir", 'T', UOPT_REQUIRES_ARG),
164  /*13*/ UOPTION_DEF( "install", 'I', UOPT_REQUIRES_ARG),
165  /*14*/ UOPTION_SOURCEDIR ,
166  /*15*/ UOPTION_DEF( "entrypoint", 'e', UOPT_REQUIRES_ARG),
167  /*16*/ UOPTION_DEF( "revision", 'r', UOPT_REQUIRES_ARG),
168  /*17*/ UOPTION_DEF( "force-prefix", 'f', UOPT_NO_ARG),
169  /*18*/ UOPTION_DEF( "libname", 'L', UOPT_REQUIRES_ARG),
170  /*19*/ UOPTION_DEF( "quiet", 'q', UOPT_NO_ARG),
171  /*20*/ UOPTION_DEF( "without-assembly", 'w', UOPT_NO_ARG),
172  /*21*/ UOPTION_DEF("zos-pds-build", 'z', UOPT_NO_ARG),
173  /*22*/ UOPTION_DEF("windows-uwp-build", 'u', UOPT_NO_ARG),
174  /*23*/ UOPTION_DEF("windows-DLL-arch", 'a', UOPT_REQUIRES_ARG),
175  /*24*/ UOPTION_DEF("windows-dynamicbase", 'b', UOPT_NO_ARG),
176 };
177 
178 /* This enum and the following char array should be kept in sync. */
179 enum {
193  AR,
198 };
199 static const char* FLAG_NAMES[PKGDATA_FLAGS_SIZE] = {
200  "GENCCODE_ASSEMBLY_TYPE",
201  "SO",
202  "SOBJ",
203  "A",
204  "LIBPREFIX",
205  "LIB_EXT_ORDER",
206  "COMPILE",
207  "LIBFLAGS",
208  "GENLIB",
209  "LDICUDTFLAGS",
210  "LD_SONAME",
211  "RPATH_FLAGS",
212  "BIR_LDFLAGS",
213  "AR",
214  "ARFLAGS",
215  "RANLIB",
216  "INSTALL_CMD"
217 };
218 static char **pkgDataFlags = NULL;
219 
220 enum {
225 #if U_PLATFORM == U_PF_CYGWIN
226  LIB_FILE_CYGWIN,
227  LIB_FILE_CYGWIN_VERSION,
228 #elif U_PLATFORM == U_PF_MINGW
229  LIB_FILE_MINGW,
230 #elif U_PLATFORM == U_PF_OS390
231  LIB_FILE_OS390BATCH_MAJOR,
232  LIB_FILE_OS390BATCH_VERSION,
233 #endif
235 };
237 
239 
240 const char options_help[][320]={
241  "Set the data name",
242 #ifdef U_MAKE_IS_NMAKE
243  "The directory where the ICU is located (e.g. <ICUROOT> which contains the bin directory)",
244 #else
245  "Specify options for the builder.",
246 #endif
247  "Specify the mode of building (see below; default: common)",
248  "This usage text",
249  "This usage text",
250  "Make the output verbose",
251  "Use the standard ICU copyright",
252  "Use a custom comment (instead of the copyright)",
253  "Specify the destination directory for files",
254  "Force rebuilding of all data",
255  "Specify temporary dir (default: output dir)",
256  "Install the data (specify target)",
257  "Specify a custom source directory",
258  "Specify a custom entrypoint name (default: short name)",
259  "Specify a version when packaging in dll or static mode",
260  "Add package to all file names if not present",
261  "Library name to build (if different than package name)",
262  "Quiet mode. (e.g. Do not output a readme file for static libraries)",
263  "Build the data without assembly code",
264  "Build PDS dataset (zOS build only)",
265  "Build for Universal Windows Platform (Windows build only)",
266  "Specify the DLL machine architecture for LINK.exe (Windows build only)",
267  "Ignored. Enable DYNAMICBASE on the DLL. This is now the default. (Windows build only)",
268 };
269 
270 const char *progname = "PKGDATA";
271 
272 int
273 main(int argc, char* argv[]) {
274  int result = 0;
275  /* FileStream *out; */
276  UPKGOptions o;
277  CharList *tail;
278  UBool needsHelp = FALSE;
280  /* char tmp[1024]; */
281  uint32_t i;
282  int32_t n;
283 
285 
286  progname = argv[0];
287 
288  options[MODE].value = "common";
289 
290  /* read command line options */
292 
293  /* error handling, printing usage message */
294  /* I've decided to simply print an error and quit. This tool has too
295  many options to just display them all of the time. */
296 
297  if(options[HELP].doesOccur || options[HELP_QUESTION_MARK].doesOccur) {
298  needsHelp = TRUE;
299  }
300  else {
301  if(!needsHelp && argc<0) {
302  fprintf(stderr,
303  "%s: error in command line argument \"%s\"\n",
304  progname,
305  argv[-argc]);
306  fprintf(stderr, "Run '%s --help' for help.\n", progname);
307  return 1;
308  }
309 
310 
311 #if !defined(WINDOWS_WITH_MSVC) || defined(USING_CYGWIN)
312  if(!options[BLDOPT].doesOccur && uprv_strcmp(options[MODE].value, "common") != 0) {
313  if (pkg_getPkgDataPath(options[VERBOSE].doesOccur, &options[BLDOPT]) != 0) {
314  fprintf(stderr, " required parameter is missing: -O is required for static and shared builds.\n");
315  fprintf(stderr, "Run '%s --help' for help.\n", progname);
316  return 1;
317  }
318  }
319 #else
320  if(options[BLDOPT].doesOccur) {
321  fprintf(stdout, "Warning: You are using the -O option which is not needed for MSVC build on Windows.\n");
322  }
323 #endif
324 
325  if(!options[NAME].doesOccur) /* -O we already have - don't report it. */
326  {
327  fprintf(stderr, " required parameter -p is missing \n");
328  fprintf(stderr, "Run '%s --help' for help.\n", progname);
329  return 1;
330  }
331 
332  if(argc == 1) {
333  fprintf(stderr,
334  "No input files specified.\n"
335  "Run '%s --help' for help.\n", progname);
336  return 1;
337  }
338  } /* end !needsHelp */
339 
340  if(argc<0 || needsHelp ) {
341  fprintf(stderr,
342  "usage: %s [-options] [-] [packageFile] \n"
343  "\tProduce packaged ICU data from the given list(s) of files.\n"
344  "\t'-' by itself means to read from stdin.\n"
345  "\tpackageFile is a text file containing the list of files to package.\n",
346  progname);
347 
348  fprintf(stderr, "\n options:\n");
349  for(i=0;i<UPRV_LENGTHOF(options);i++) {
350  fprintf(stderr, "%-5s -%c %s%-10s %s\n",
351  (i<1?"[REQ]":""),
352  options[i].shortName,
353  options[i].longName ? "or --" : " ",
354  options[i].longName ? options[i].longName : "",
355  options_help[i]);
356  }
357 
358  fprintf(stderr, "modes: (-m option)\n");
359  for(i=0;i<UPRV_LENGTHOF(modes);i++) {
360  fprintf(stderr, " %-9s ", modes[i].name);
361  if (modes[i].alt_name) {
362  fprintf(stderr, "/ %-9s", modes[i].alt_name);
363  } else {
364  fprintf(stderr, " ");
365  }
366  fprintf(stderr, " %s\n", modes[i].desc);
367  }
368  return 1;
369  }
370 
371  /* OK, fill in the options struct */
372  uprv_memset(&o, 0, sizeof(o));
373 
374  o.mode = options[MODE].value;
375  o.version = options[REVISION].doesOccur ? options[REVISION].value : 0;
376 
378  {
380  char *csname, *cp;
381  const char *sp;
382 
383  cp = csname = (char *) uprv_malloc((len + 1 + 1) * sizeof(*o.cShortName));
384  if (*(sp = o.shortName)) {
385  *cp++ = isalpha(*sp) ? * sp : '_';
386  for (++sp; *sp; ++sp) {
387  *cp++ = isalnum(*sp) ? *sp : '_';
388  }
389  }
390  *cp = 0;
391 
392  o.cShortName = csname;
393  }
394 
395  if(options[LIBNAME].doesOccur) { /* get libname from shortname, or explicit -L parameter */
397  } else {
398  o.libName = o.shortName;
399  }
400 
401  if(options[QUIET].doesOccur) {
402  o.quiet = TRUE;
403  } else {
404  o.quiet = FALSE;
405  }
406 
407  if(options[PDS_BUILD].doesOccur) {
408 #if U_PLATFORM == U_PF_OS390
409  o.pdsbuild = TRUE;
410 #else
411  o.pdsbuild = FALSE;
412  fprintf(stdout, "Warning: You are using the -z option which only works on z/OS.\n");
413 
414 #endif
415  } else {
416  o.pdsbuild = FALSE;
417  }
418 
419  o.verbose = options[VERBOSE].doesOccur;
420 
421 
422 #if !defined(WINDOWS_WITH_MSVC) || defined(USING_CYGWIN) /* on UNIX, we'll just include the file... */
423  if (options[BLDOPT].doesOccur) {
425  } else {
426  o.options = NULL;
427  }
428 #endif
429  if(options[COPYRIGHT].doesOccur) {
431  } else if (options[COMMENT].doesOccur) {
433  }
434 
435  if( options[DESTDIR].doesOccur ) {
437  } else {
438  o.targetDir = "."; /* cwd */
439  }
440 
441  o.rebuild = options[REBUILD].doesOccur;
442 
443  if( options[TEMPDIR].doesOccur ) {
445  } else {
446  o.tmpDir = o.targetDir;
447  }
448 
449  if( options[INSTALL].doesOccur ) {
451  } else {
452  o.install = NULL;
453  }
454 
455  if( options[SOURCEDIR].doesOccur ) {
457  } else {
458  o.srcDir = ".";
459  }
460 
461  if( options[ENTRYPOINT].doesOccur ) {
463  } else {
464  o.entryName = o.cShortName;
465  }
466 
468  if (options[WITHOUT_ASSEMBLY].doesOccur) {
469 #ifndef BUILD_DATA_WITHOUT_ASSEMBLY
470  fprintf(stdout, "Warning: You are using the option to build without assembly code which is not supported on this platform.\n");
471  fprintf(stdout, "Warning: This option will be ignored.\n");
472 #else
473  o.withoutAssembly = TRUE;
474 #endif
475  }
476 
477  if (options[WIN_DYNAMICBASE].doesOccur) {
478  fprintf(stdout, "Note: Ignoring option -b (windows-dynamicbase).\n");
479  }
480 
481  /* OK options are set up. Now the file lists. */
482  tail = NULL;
483  for( n=1; n<argc; n++) {
485  }
486 
487  /* load the files */
488  loadLists(&o, &status);
489  if( U_FAILURE(status) ) {
490  fprintf(stderr, "error loading input file lists: %s\n", u_errorName(status));
491  return 2;
492  }
493 
495 
496  if (pkgDataFlags != NULL) {
497  for (n = 0; n < PKGDATA_FLAGS_SIZE; n++) {
498  if (pkgDataFlags[n] != NULL) {
500  }
501  }
503  }
504 
505  if (o.cShortName != NULL) {
506  uprv_free((char *)o.cShortName);
507  }
508  if (o.fileListFiles != NULL) {
510  }
511  if (o.filePaths != NULL) {
513  }
514  if (o.files != NULL) {
516  }
517  return result;
518 }
519 
520 static int runCommand(const char* command, UBool specialHandling) {
521  char *cmd = NULL;
522  char cmdBuffer[SMALL_BUFFER_MAX_SIZE];
523  int32_t len = static_cast<int32_t>(strlen(command));
524 
525  if (len == 0) {
526  return 0;
527  }
528 
529  if (!specialHandling) {
530 #if defined(USING_CYGWIN) || U_PLATFORM == U_PF_MINGW || U_PLATFORM == U_PF_OS400
532  cmd = (char *)uprv_malloc(len + BUFFER_PADDING_SIZE);
533  } else {
534  cmd = cmdBuffer;
535  }
536 #if defined(USING_CYGWIN) || U_PLATFORM == U_PF_MINGW
537  sprintf(cmd, "bash -c \"%s\"", command);
538 
539 #elif U_PLATFORM == U_PF_OS400
540  sprintf(cmd, "QSH CMD('%s')", command);
541 #endif
542 #else
543  goto normal_command_mode;
544 #endif
545  } else {
546 #if !(defined(USING_CYGWIN) || U_PLATFORM == U_PF_MINGW || U_PLATFORM == U_PF_OS400)
547 normal_command_mode:
548 #endif
549  cmd = (char *)command;
550  }
551 
552  printf("pkgdata: %s\n", cmd);
553  int result = system(cmd);
554  if (result != 0) {
555  fprintf(stderr, "-- return status = %d\n", result);
556  result = 1; // system() result code is platform specific.
557  }
558 
559  if (cmd != cmdBuffer && cmd != command) {
560  uprv_free(cmd);
561  }
562 
563  return result;
564 }
565 
566 #define LN_CMD "ln -s"
567 #define RM_CMD "rm -f"
568 
570  int32_t result = 0;
571 
572  const char mode = o->mode[0];
573  char targetDir[SMALL_BUFFER_MAX_SIZE] = "";
574  char tmpDir[SMALL_BUFFER_MAX_SIZE] = "";
575  char datFileName[SMALL_BUFFER_MAX_SIZE] = "";
576  char datFileNamePath[LARGE_BUFFER_MAX_SIZE] = "";
577  char checkLibFile[LARGE_BUFFER_MAX_SIZE] = "";
578 
580 
581  if (IN_FILES_MODE(mode)) {
582  /* Copy the raw data to the installation directory. */
583  if (o->install != NULL) {
584  uprv_strcpy(targetDir, o->install);
585  if (o->shortName != NULL) {
587  uprv_strcat(targetDir, o->shortName);
588  }
589 
590  if(o->verbose) {
591  fprintf(stdout, "# Install: Files mode, copying files to %s..\n", targetDir);
592  }
593  result = pkg_installFileMode(targetDir, o->srcDir, o->fileListFiles->str);
594  }
595  return result;
596  } else /* if (IN_COMMON_MODE(mode) || IN_DLL_MODE(mode) || IN_STATIC_MODE(mode)) */ {
597  UBool noVersion = FALSE;
598 
599  uprv_strcpy(targetDir, o->targetDir);
601 
602  uprv_strcpy(tmpDir, o->tmpDir);
604 
605  uprv_strcpy(datFileNamePath, tmpDir);
606 
607  uprv_strcpy(datFileName, o->shortName);
608  uprv_strcat(datFileName, UDATA_CMN_SUFFIX);
609 
610  uprv_strcat(datFileNamePath, datFileName);
611 
612  if(o->verbose) {
613  fprintf(stdout, "# Writing package file %s ..\n", datFileNamePath);
614  }
615  result = writePackageDatFile(datFileNamePath, o->comment, o->srcDir, o->fileListFiles->str, NULL, U_CHARSET_FAMILY ? 'e' : U_IS_BIG_ENDIAN ? 'b' : 'l');
616  if (result != 0) {
617  fprintf(stderr,"Error writing package dat file.\n");
618  return result;
619  }
620 
621  if (IN_COMMON_MODE(mode)) {
622  char targetFileNamePath[LARGE_BUFFER_MAX_SIZE] = "";
623 
624  uprv_strcpy(targetFileNamePath, targetDir);
625  uprv_strcat(targetFileNamePath, datFileName);
626 
627  /* Move the dat file created to the target directory. */
628  if (uprv_strcmp(datFileNamePath, targetFileNamePath) != 0) {
629  if (T_FileStream_file_exists(targetFileNamePath)) {
630  if ((result = remove(targetFileNamePath)) != 0) {
631  fprintf(stderr, "Unable to remove old dat file: %s\n",
632  targetFileNamePath);
633  return result;
634  }
635  }
636 
637  result = rename(datFileNamePath, targetFileNamePath);
638 
639  if (o->verbose) {
640  fprintf(stdout, "# Moving package file to %s ..\n",
641  targetFileNamePath);
642  }
643  if (result != 0) {
644  fprintf(
645  stderr,
646  "Unable to move dat file (%s) to target location (%s).\n",
647  datFileNamePath, targetFileNamePath);
648  return result;
649  }
650  }
651 
652  if (o->install != NULL) {
653  result = pkg_installCommonMode(o->install, targetFileNamePath);
654  }
655 
656  return result;
657  } else /* if (IN_STATIC_MODE(mode) || IN_DLL_MODE(mode)) */ {
658  char gencFilePath[SMALL_BUFFER_MAX_SIZE] = "";
659  char version_major[10] = "";
660  UBool reverseExt = FALSE;
661 
662 #if !defined(WINDOWS_WITH_MSVC) || defined(USING_CYGWIN)
663  /* Get the version major number. */
664  if (o->version != NULL) {
665  for (uint32_t i = 0;i < sizeof(version_major);i++) {
666  if (o->version[i] == '.') {
667  version_major[i] = 0;
668  break;
669  }
670  version_major[i] = o->version[i];
671  }
672  } else {
673  noVersion = TRUE;
674  if (IN_DLL_MODE(mode)) {
675  fprintf(stdout, "Warning: Providing a revision number with the -r option is recommended when packaging data in the current mode.\n");
676  }
677  }
678 
679 #if U_PLATFORM != U_PF_OS400
680  /* Certain platforms have different library extension ordering. (e.g. libicudata.##.so vs libicudata.so.##)
681  * reverseExt is FALSE if the suffix should be the version number.
682  */
684  reverseExt = TRUE;
685  }
686 #endif
687  /* Using the base libName and version number, generate the library file names. */
688  createFileNames(o, mode, version_major, o->version == NULL ? "" : o->version, o->libName, reverseExt, noVersion);
689 
690  if ((o->version!=NULL || IN_STATIC_MODE(mode)) && o->rebuild == FALSE && o->pdsbuild == FALSE) {
691  /* Check to see if a previous built data library file exists and check if it is the latest. */
692  sprintf(checkLibFile, "%s%s", targetDir, libFileNames[LIB_FILE_VERSION]);
693  if (T_FileStream_file_exists(checkLibFile)) {
694  if (isFileModTimeLater(checkLibFile, o->srcDir, TRUE) && isFileModTimeLater(checkLibFile, o->options)) {
695  if (o->install != NULL) {
696  if(o->verbose) {
697  fprintf(stdout, "# Installing already-built library into %s\n", o->install);
698  }
699  result = pkg_installLibrary(o->install, targetDir, noVersion);
700  } else {
701  if(o->verbose) {
702  printf("# Not rebuilding %s - up to date.\n", checkLibFile);
703  }
704  }
705  return result;
706  } else if (o->verbose && (o->install!=NULL)) {
707  fprintf(stdout, "# Not installing up-to-date library %s into %s\n", checkLibFile, o->install);
708  }
709  } else if(o->verbose && (o->install!=NULL)) {
710  fprintf(stdout, "# Not installing missing %s into %s\n", checkLibFile, o->install);
711  }
712  }
713 
714  if (pkg_checkFlag(o) == NULL) {
715  /* Error occurred. */
716  return result;
717  }
718 #endif
719 
721  const char* genccodeAssembly = pkgDataFlags[GENCCODE_ASSEMBLY_TYPE];
722 
723  if(o->verbose) {
724  fprintf(stdout, "# Generating assembly code %s of type %s ..\n", gencFilePath, genccodeAssembly);
725  }
726 
727  /* Offset genccodeAssembly by 3 because "-a " */
728  if (genccodeAssembly &&
729  (uprv_strlen(genccodeAssembly)>3) &&
730  checkAssemblyHeaderName(genccodeAssembly+3)) {
732  datFileNamePath,
733  o->tmpDir,
734  o->entryName,
735  NULL,
736  gencFilePath,
737  sizeof(gencFilePath));
738 
739  result = pkg_createWithAssemblyCode(targetDir, mode, gencFilePath);
740  if (result != 0) {
741  fprintf(stderr, "Error generating assembly code for data.\n");
742  return result;
743  } else if (IN_STATIC_MODE(mode)) {
744  if(o->install != NULL) {
745  if(o->verbose) {
746  fprintf(stdout, "# Installing static library into %s\n", o->install);
747  }
748  result = pkg_installLibrary(o->install, targetDir, noVersion);
749  }
750  return result;
751  }
752  } else {
753  fprintf(stderr,"Assembly type \"%s\" is unknown.\n", genccodeAssembly);
754  return -1;
755  }
756  } else {
757  if(o->verbose) {
758  fprintf(stdout, "# Writing object code to %s ..\n", gencFilePath);
759  }
760  if (o->withoutAssembly) {
761 #ifdef BUILD_DATA_WITHOUT_ASSEMBLY
762  result = pkg_createWithoutAssemblyCode(o, targetDir, mode);
763 #else
764  /* This error should not occur. */
765  fprintf(stderr, "Error- BUILD_DATA_WITHOUT_ASSEMBLY is not defined. Internal error.\n");
766 #endif
767  } else {
768 #ifdef CAN_WRITE_OBJ_CODE
769  /* Try to detect the arch type, use NULL if unsuccessful */
770  char optMatchArch[10] = { 0 };
771  pkg_createOptMatchArch(optMatchArch);
773  datFileNamePath,
774  o->tmpDir,
775  o->entryName,
776  (optMatchArch[0] == 0 ? NULL : optMatchArch),
777  NULL,
778  gencFilePath,
779  sizeof(gencFilePath),
780  TRUE);
781  pkg_destroyOptMatchArch(optMatchArch);
782 #if U_PLATFORM_IS_LINUX_BASED
783  result = pkg_generateLibraryFile(targetDir, mode, gencFilePath);
784 #elif defined(WINDOWS_WITH_MSVC)
785  result = pkg_createWindowsDLL(mode, gencFilePath, o);
786 #endif
787 #elif defined(BUILD_DATA_WITHOUT_ASSEMBLY)
788  result = pkg_createWithoutAssemblyCode(o, targetDir, mode);
789 #else
790  fprintf(stderr, "Error- neither CAN_WRITE_OBJ_CODE nor BUILD_DATA_WITHOUT_ASSEMBLY are defined. Internal error.\n");
791  return 1;
792 #endif
793  }
794 
795  if (result != 0) {
796  fprintf(stderr, "Error generating package data.\n");
797  return result;
798  }
799  }
800 #if !U_PLATFORM_USES_ONLY_WIN32_API
801  if(!IN_STATIC_MODE(mode)) {
802  /* Certain platforms uses archive library. (e.g. AIX) */
803  if(o->verbose) {
804  fprintf(stdout, "# Creating data archive library file ..\n");
805  }
806  result = pkg_archiveLibrary(targetDir, o->version, reverseExt);
807  if (result != 0) {
808  fprintf(stderr, "Error creating data archive library file.\n");
809  return result;
810  }
811 #if U_PLATFORM != U_PF_OS400
812  if (!noVersion) {
813  /* Create symbolic links for the final library file. */
814 #if U_PLATFORM == U_PF_OS390
815  result = pkg_createSymLinks(targetDir, o->pdsbuild);
816 #else
817  result = pkg_createSymLinks(targetDir, noVersion);
818 #endif
819  if (result != 0) {
820  fprintf(stderr, "Error creating symbolic links of the data library file.\n");
821  return result;
822  }
823  }
824 #endif
825  } /* !IN_STATIC_MODE */
826 #endif
827 
828 #if !U_PLATFORM_USES_ONLY_WIN32_API
829  /* Install the libraries if option was set. */
830  if (o->install != NULL) {
831  if(o->verbose) {
832  fprintf(stdout, "# Installing library file to %s ..\n", o->install);
833  }
834  result = pkg_installLibrary(o->install, targetDir, noVersion);
835  if (result != 0) {
836  fprintf(stderr, "Error installing the data library.\n");
837  return result;
838  }
839  }
840 #endif
841  }
842  }
843  return result;
844 }
845 
846 /* Initialize the pkgDataFlags with the option file given. */
849  int32_t result = 0;
851  int32_t tmpResult = 0;
852 
853  /* Initialize pkgdataFlags */
854  pkgDataFlags = (char**)uprv_malloc(sizeof(char*) * PKGDATA_FLAGS_SIZE);
855 
856  /* If we run out of space, allocate more */
857 #if !defined(WINDOWS_WITH_MSVC) || defined(USING_CYGWIN)
858  do {
859 #endif
860  if (pkgDataFlags != NULL) {
861  for (int32_t i = 0; i < PKGDATA_FLAGS_SIZE; i++) {
862  pkgDataFlags[i] = (char*)uprv_malloc(sizeof(char) * currentBufferSize);
863  if (pkgDataFlags[i] != NULL) {
864  pkgDataFlags[i][0] = 0;
865  } else {
866  fprintf(stderr,"Error allocating memory for pkgDataFlags.\n");
867  /* If an error occurs, ensure that the rest of the array is NULL */
868  for (int32_t n = i + 1; n < PKGDATA_FLAGS_SIZE; n++) {
869  pkgDataFlags[n] = NULL;
870  }
871  return -1;
872  }
873  }
874  } else {
875  fprintf(stderr,"Error allocating memory for pkgDataFlags.\n");
876  return -1;
877  }
878 
879  if (o->options == NULL) {
880  return result;
881  }
882 
883 #if !defined(WINDOWS_WITH_MSVC) || defined(USING_CYGWIN)
884  /* Read in options file. */
885  if(o->verbose) {
886  fprintf(stdout, "# Reading options file %s\n", o->options);
887  }
891  for (int32_t i = 0; i < PKGDATA_FLAGS_SIZE; i++) {
892  if (pkgDataFlags[i]) {
894  pkgDataFlags[i] = NULL;
895  }
896  }
897  currentBufferSize = tmpResult;
898  } else if (U_FAILURE(status)) {
899  fprintf(stderr,"Unable to open or read \"%s\" option file. status = %s\n", o->options, u_errorName(status));
900  return -1;
901  }
902 #endif
903  if(o->verbose) {
904  fprintf(stdout, "# pkgDataFlags=\n");
905  for(int32_t i=0;i<PKGDATA_FLAGS_SIZE;i++) {
906  fprintf(stdout, " [%d] %s: %s\n", i, FLAG_NAMES[i], pkgDataFlags[i]);
907  }
908  fprintf(stdout, "\n");
909  }
910 #if !defined(WINDOWS_WITH_MSVC) || defined(USING_CYGWIN)
911  } while (status == U_BUFFER_OVERFLOW_ERROR);
912 #endif
913 
914  return result;
915 }
916 
917 
918 /*
919  * Given the base libName and version numbers, generate the libary file names and store it in libFileNames.
920  * Depending on the configuration, the library name may either end with version number or shared object suffix.
921  */
922 static void createFileNames(UPKGOptions *o, const char mode, const char *version_major, const char *version, const char *libName, UBool reverseExt, UBool noVersion) {
923  const char* FILE_EXTENSION_SEP = uprv_strlen(pkgDataFlags[SO_EXT]) == 0 ? "" : ".";
924  const char* FILE_SUFFIX = pkgDataFlags[LIB_EXT_ORDER][0] == '.' ? "." : "";
925 
926 #if U_PLATFORM == U_PF_MINGW
927  /* MinGW does not need the library prefix when building in dll mode. */
928  if (IN_DLL_MODE(mode)) {
929  sprintf(libFileNames[LIB_FILE], "%s", libName);
930  } else {
931  sprintf(libFileNames[LIB_FILE], "%s%s%s",
932  (strstr(libName, "icudt") ? "lib" : ""),
934  libName);
935  }
936 #else
937  sprintf(libFileNames[LIB_FILE], "%s%s",
939  libName);
940 #endif
941 
942  if(o->verbose) {
943  fprintf(stdout, "# libFileName[LIB_FILE] = %s\n", libFileNames[LIB_FILE]);
944  }
945 
946 #if U_PLATFORM == U_PF_MINGW
947  // Name the import library lib*.dll.a
948  sprintf(libFileNames[LIB_FILE_MINGW], "lib%s.dll.a", libName);
949 #elif U_PLATFORM == U_PF_CYGWIN
950  sprintf(libFileNames[LIB_FILE_CYGWIN], "cyg%s%s%s",
951  libName,
952  FILE_EXTENSION_SEP,
954  sprintf(libFileNames[LIB_FILE_CYGWIN_VERSION], "cyg%s%s%s%s",
955  libName,
957  FILE_EXTENSION_SEP,
959 
962 #elif U_PLATFORM == U_PF_OS400 || defined(_AIX)
965  FILE_EXTENSION_SEP,
967 #elif U_PLATFORM == U_PF_OS390
970  pkgDataFlags[LIB_EXT_ORDER][0] == '.' ? "." : "",
971  reverseExt ? version : pkgDataFlags[SOBJ_EXT],
972  FILE_EXTENSION_SEP,
973  reverseExt ? pkgDataFlags[SOBJ_EXT] : version);
974 
975  sprintf(libFileNames[LIB_FILE_OS390BATCH_VERSION], "%s%s.x",
977  version);
978  sprintf(libFileNames[LIB_FILE_OS390BATCH_MAJOR], "%s%s.x",
980  version_major);
981 #else
982  if (noVersion && !reverseExt) {
985  FILE_SUFFIX,
987  } else {
990  FILE_SUFFIX,
991  reverseExt ? version : pkgDataFlags[SOBJ_EXT],
992  FILE_EXTENSION_SEP,
993  reverseExt ? pkgDataFlags[SOBJ_EXT] : version);
994  }
995 #endif
996  if (noVersion && !reverseExt) {
999  FILE_SUFFIX,
1000  pkgDataFlags[SO_EXT]);
1001 
1004  FILE_SUFFIX,
1005  pkgDataFlags[SO_EXT]);
1006  } else {
1009  FILE_SUFFIX,
1010  reverseExt ? version_major : pkgDataFlags[SO_EXT],
1011  FILE_EXTENSION_SEP,
1012  reverseExt ? pkgDataFlags[SO_EXT] : version_major);
1013 
1014  sprintf(libFileNames[LIB_FILE_VERSION], "%s%s%s%s%s",
1016  FILE_SUFFIX,
1017  reverseExt ? version : pkgDataFlags[SO_EXT],
1018  FILE_EXTENSION_SEP,
1019  reverseExt ? pkgDataFlags[SO_EXT] : version);
1020  }
1021 
1022  if(o->verbose) {
1023  fprintf(stdout, "# libFileName[LIB_FILE_VERSION] = %s\n", libFileNames[LIB_FILE_VERSION]);
1024  }
1025 
1026 #if U_PF_MINGW <= U_PLATFORM && U_PLATFORM <= U_PF_CYGWIN
1027  /* Cygwin and MinGW only deals with the version major number. */
1029 #endif
1030 
1031  if(IN_STATIC_MODE(mode)) {
1034  if(o->verbose) {
1035  fprintf(stdout, "# libFileName[LIB_FILE_VERSION] = %s (static)\n", libFileNames[LIB_FILE_VERSION]);
1036  }
1037  }
1038 }
1039 
1040 /* Create the symbolic links for the final library file. */
1041 static int32_t pkg_createSymLinks(const char *targetDir, UBool specialHandling) {
1042  int32_t result = 0;
1043  char cmd[LARGE_BUFFER_MAX_SIZE];
1044  char name1[SMALL_BUFFER_MAX_SIZE]; /* symlink file name */
1045  char name2[SMALL_BUFFER_MAX_SIZE]; /* file name to symlink */
1046  const char* FILE_EXTENSION_SEP = uprv_strlen(pkgDataFlags[SO_EXT]) == 0 ? "" : ".";
1047 
1048 #if U_PLATFORM != U_PF_CYGWIN
1049  /* No symbolic link to make. */
1052  return result;
1053  }
1054 
1055  sprintf(cmd, "cd %s && %s %s && %s %s %s",
1056  targetDir,
1057  RM_CMD,
1059  LN_CMD,
1062  result = runCommand(cmd);
1063  if (result != 0) {
1064  fprintf(stderr, "Error creating symbolic links. Failed command: %s\n", cmd);
1065  return result;
1066  }
1067 #endif
1068 
1069  if (specialHandling) {
1070 #if U_PLATFORM == U_PF_CYGWIN
1071  sprintf(name1, "%s", libFileNames[LIB_FILE_CYGWIN]);
1072  sprintf(name2, "%s", libFileNames[LIB_FILE_CYGWIN_VERSION]);
1073 #elif U_PLATFORM == U_PF_OS390
1074  /* Create the symbolic links for the import data */
1075  /* Use the cmd buffer to store path to import data file to check its existence */
1076  sprintf(cmd, "%s/%s", targetDir, libFileNames[LIB_FILE_OS390BATCH_VERSION]);
1078  sprintf(cmd, "cd %s && %s %s && %s %s %s",
1079  targetDir,
1080  RM_CMD,
1081  libFileNames[LIB_FILE_OS390BATCH_MAJOR],
1082  LN_CMD,
1083  libFileNames[LIB_FILE_OS390BATCH_VERSION],
1084  libFileNames[LIB_FILE_OS390BATCH_MAJOR]);
1085  result = runCommand(cmd);
1086  if (result != 0) {
1087  fprintf(stderr, "Error creating symbolic links. Failed command: %s\n", cmd);
1088  return result;
1089  }
1090 
1091  sprintf(cmd, "cd %s && %s %s.x && %s %s %s.x",
1092  targetDir,
1093  RM_CMD,
1095  LN_CMD,
1096  libFileNames[LIB_FILE_OS390BATCH_VERSION],
1098  result = runCommand(cmd);
1099  if (result != 0) {
1100  fprintf(stderr, "Error creating symbolic links. Failed command: %s\n", cmd);
1101  return result;
1102  }
1103  }
1104 
1105  /* Needs to be set here because special handling skips it */
1106  sprintf(name1, "%s%s%s", libFileNames[LIB_FILE], FILE_EXTENSION_SEP, pkgDataFlags[SO_EXT]);
1107  sprintf(name2, "%s", libFileNames[LIB_FILE_VERSION]);
1108 #else
1109  goto normal_symlink_mode;
1110 #endif
1111  } else {
1112 #if U_PLATFORM != U_PF_CYGWIN
1113 normal_symlink_mode:
1114 #endif
1115  sprintf(name1, "%s%s%s", libFileNames[LIB_FILE], FILE_EXTENSION_SEP, pkgDataFlags[SO_EXT]);
1116  sprintf(name2, "%s", libFileNames[LIB_FILE_VERSION]);
1117  }
1118 
1119  sprintf(cmd, "cd %s && %s %s && %s %s %s",
1120  targetDir,
1121  RM_CMD,
1122  name1,
1123  LN_CMD,
1124  name2,
1125  name1);
1126 
1127  result = runCommand(cmd);
1128 
1129  return result;
1130 }
1131 
1132 static int32_t pkg_installLibrary(const char *installDir, const char *targetDir, UBool noVersion) {
1133  int32_t result = 0;
1134  char cmd[SMALL_BUFFER_MAX_SIZE];
1135 
1136  auto ret = snprintf(cmd,
1138  "cd %s && %s %s %s%s%s",
1139  targetDir,
1143  (void)ret;
1145 
1146  result = runCommand(cmd);
1147 
1148  if (result != 0) {
1149  fprintf(stderr, "Error installing library. Failed command: %s\n", cmd);
1150  return result;
1151  }
1152 
1153 #ifdef CYGWINMSVC
1154  sprintf(cmd, "cd %s && %s %s.lib %s",
1155  targetDir,
1158  installDir
1159  );
1160  result = runCommand(cmd);
1161 
1162  if (result != 0) {
1163  fprintf(stderr, "Error installing library. Failed command: %s\n", cmd);
1164  return result;
1165  }
1166 #elif U_PLATFORM == U_PF_CYGWIN
1167  sprintf(cmd, "cd %s && %s %s %s",
1168  targetDir,
1170  libFileNames[LIB_FILE_CYGWIN_VERSION],
1171  installDir
1172  );
1173  result = runCommand(cmd);
1174 
1175  if (result != 0) {
1176  fprintf(stderr, "Error installing library. Failed command: %s\n", cmd);
1177  return result;
1178  }
1179 
1180 #elif U_PLATFORM == U_PF_OS390
1181  if (T_FileStream_file_exists(libFileNames[LIB_FILE_OS390BATCH_VERSION])) {
1182  sprintf(cmd, "%s %s %s",
1184  libFileNames[LIB_FILE_OS390BATCH_VERSION],
1185  installDir
1186  );
1187  result = runCommand(cmd);
1188 
1189  if (result != 0) {
1190  fprintf(stderr, "Error installing library. Failed command: %s\n", cmd);
1191  return result;
1192  }
1193  }
1194 #endif
1195 
1196  if (noVersion) {
1197  return result;
1198  } else {
1199  return pkg_createSymLinks(installDir, TRUE);
1200  }
1201 }
1202 
1203 static int32_t pkg_installCommonMode(const char *installDir, const char *fileName) {
1204  int32_t result = 0;
1205  char cmd[SMALL_BUFFER_MAX_SIZE] = "";
1206 
1207  if (!T_FileStream_file_exists(installDir)) {
1209 
1210  uprv_mkdir(installDir, &status);
1211  if (U_FAILURE(status)) {
1212  fprintf(stderr, "Error creating installation directory: %s\n", installDir);
1213  return -1;
1214  }
1215  }
1216 #ifndef U_WINDOWS_WITH_MSVC
1217  sprintf(cmd, "%s %s %s", pkgDataFlags[INSTALL_CMD], fileName, installDir);
1218 #else
1219  sprintf(cmd, "%s %s %s %s", WIN_INSTALL_CMD, fileName, installDir, WIN_INSTALL_CMD_FLAGS);
1220 #endif
1221 
1222  result = runCommand(cmd);
1223  if (result != 0) {
1224  fprintf(stderr, "Failed to install data file with command: %s\n", cmd);
1225  }
1226 
1227  return result;
1228 }
1229 
1230 #ifdef U_WINDOWS_MSVC
1231 /* Copy commands for installing the raw data files on Windows. */
1232 #define WIN_INSTALL_CMD "xcopy"
1233 #define WIN_INSTALL_CMD_FLAGS "/E /Y /K"
1234 #endif
1235 static int32_t pkg_installFileMode(const char *installDir, const char *srcDir, const char *fileListName) {
1236  int32_t result = 0;
1237  char cmd[SMALL_BUFFER_MAX_SIZE] = "";
1238 
1239  if (!T_FileStream_file_exists(installDir)) {
1241 
1242  uprv_mkdir(installDir, &status);
1243  if (U_FAILURE(status)) {
1244  fprintf(stderr, "Error creating installation directory: %s\n", installDir);
1245  return -1;
1246  }
1247  }
1248 #ifndef U_WINDOWS_WITH_MSVC
1249  char buffer[SMALL_BUFFER_MAX_SIZE] = "";
1250  int32_t bufferLength = 0;
1251 
1252  FileStream *f = T_FileStream_open(fileListName, "r");
1253  if (f != NULL) {
1254  for(;;) {
1256  bufferLength = static_cast<int32_t>(uprv_strlen(buffer));
1257  /* Remove new line character. */
1258  if (bufferLength > 0) {
1259  buffer[bufferLength-1] = 0;
1260  }
1261 
1262  auto ret = snprintf(cmd,
1264  "%s %s%s%s %s%s%s",
1267  installDir, PKGDATA_FILE_SEP_STRING, buffer);
1268  (void)ret;
1270 
1271  result = runCommand(cmd);
1272  if (result != 0) {
1273  fprintf(stderr, "Failed to install data file with command: %s\n", cmd);
1274  break;
1275  }
1276  } else {
1277  if (!T_FileStream_eof(f)) {
1278  fprintf(stderr, "Failed to read line from file: %s\n", fileListName);
1279  result = -1;
1280  }
1281  break;
1282  }
1283  }
1285  } else {
1286  result = -1;
1287  fprintf(stderr, "Unable to open list file: %s\n", fileListName);
1288  }
1289 #else
1290  sprintf(cmd, "%s %s %s %s", WIN_INSTALL_CMD, srcDir, installDir, WIN_INSTALL_CMD_FLAGS);
1291  result = runCommand(cmd);
1292  if (result != 0) {
1293  fprintf(stderr, "Failed to install data file with command: %s\n", cmd);
1294  }
1295 #endif
1296 
1297  return result;
1298 }
1299 
1300 /* Archiving of the library file may be needed depending on the platform and options given.
1301  * If archiving is not needed, copy over the library file name.
1302  */
1303 static int32_t pkg_archiveLibrary(const char *targetDir, const char *version, UBool reverseExt) {
1304  int32_t result = 0;
1305  char cmd[LARGE_BUFFER_MAX_SIZE];
1306 
1307  /* If the shared object suffix and the final object suffix is different and the final object suffix and the
1308  * archive file suffix is the same, then the final library needs to be archived.
1309  */
1311  sprintf(libFileNames[LIB_FILE_VERSION], "%s%s%s.%s",
1313  pkgDataFlags[LIB_EXT_ORDER][0] == '.' ? "." : "",
1314  reverseExt ? version : pkgDataFlags[SO_EXT],
1315  reverseExt ? pkgDataFlags[SO_EXT] : version);
1316 
1317  sprintf(cmd, "%s %s %s%s %s%s",
1318  pkgDataFlags[AR],
1320  targetDir,
1322  targetDir,
1324 
1325  result = runCommand(cmd);
1326  if (result != 0) {
1327  fprintf(stderr, "Error creating archive library. Failed command: %s\n", cmd);
1328  return result;
1329  }
1330 
1331  sprintf(cmd, "%s %s%s",
1332  pkgDataFlags[RANLIB],
1333  targetDir,
1335 
1336  result = runCommand(cmd);
1337  if (result != 0) {
1338  fprintf(stderr, "Error creating archive library. Failed command: %s\n", cmd);
1339  return result;
1340  }
1341 
1342  /* Remove unneeded library file. */
1343  sprintf(cmd, "%s %s%s",
1344  RM_CMD,
1345  targetDir,
1347 
1348  result = runCommand(cmd);
1349  if (result != 0) {
1350  fprintf(stderr, "Error creating archive library. Failed command: %s\n", cmd);
1351  return result;
1352  }
1353 
1354  } else {
1356  }
1357 
1358  return result;
1359 }
1360 
1361 /*
1362  * Using the compiler information from the configuration file set by -O option, generate the library file.
1363  * command may be given to allow for a larger buffer for cmd.
1364  */
1365 static int32_t pkg_generateLibraryFile(const char *targetDir, const char mode, const char *objectFile, char *command, UBool specialHandling) {
1366  int32_t result = 0;
1367  char *cmd = NULL;
1368  UBool freeCmd = FALSE;
1369  int32_t length = 0;
1370 
1371  (void)specialHandling; // Suppress unused variable compiler warnings on platforms where all usage
1372  // of this parameter is #ifdefed out.
1373 
1374  /* This is necessary because if packaging is done without assembly code, objectFile might be extremely large
1375  * containing many object files and so the calling function should supply a command buffer that is large
1376  * enough to handle this. Otherwise, use the default size.
1377  */
1378  if (command != NULL) {
1379  cmd = command;
1380  }
1381 
1382  if (IN_STATIC_MODE(mode)) {
1383  if (cmd == NULL) {
1386  if ((cmd = (char *)uprv_malloc(sizeof(char) * length)) == NULL) {
1387  fprintf(stderr, "Unable to allocate memory for command.\n");
1388  return -1;
1389  }
1390  freeCmd = TRUE;
1391  }
1392  sprintf(cmd, "%s %s %s%s %s",
1393  pkgDataFlags[AR],
1395  targetDir,
1397  objectFile);
1398 
1399  result = runCommand(cmd);
1400  if (result == 0) {
1401  sprintf(cmd, "%s %s%s",
1402  pkgDataFlags[RANLIB],
1403  targetDir,
1405 
1406  result = runCommand(cmd);
1407  }
1408  } else /* if (IN_DLL_MODE(mode)) */ {
1409  if (cmd == NULL) {
1411  ((uprv_strlen(targetDir) + uprv_strlen(libFileNames[LIB_FILE_VERSION_TMP])) * 2) +
1412  uprv_strlen(objectFile) + uprv_strlen(pkgDataFlags[LD_SONAME]) +
1415 #if U_PLATFORM == U_PF_CYGWIN
1416  length += static_cast<int32_t>(uprv_strlen(targetDir) + uprv_strlen(libFileNames[LIB_FILE_CYGWIN_VERSION]));
1417 #elif U_PLATFORM == U_PF_MINGW
1418  length += static_cast<int32_t>(uprv_strlen(targetDir) + uprv_strlen(libFileNames[LIB_FILE_MINGW]));
1419 #endif
1420  if ((cmd = (char *)uprv_malloc(sizeof(char) * length)) == NULL) {
1421  fprintf(stderr, "Unable to allocate memory for command.\n");
1422  return -1;
1423  }
1424  freeCmd = TRUE;
1425  }
1426 #if U_PLATFORM == U_PF_MINGW
1427  sprintf(cmd, "%s%s%s %s -o %s%s %s %s%s %s %s",
1429  targetDir,
1430  libFileNames[LIB_FILE_MINGW],
1432  targetDir,
1434 #elif U_PLATFORM == U_PF_CYGWIN
1435  sprintf(cmd, "%s%s%s %s -o %s%s %s %s%s %s %s",
1437  targetDir,
1440  targetDir,
1441  libFileNames[LIB_FILE_CYGWIN_VERSION],
1442 #elif U_PLATFORM == U_PF_AIX
1443  sprintf(cmd, "%s %s%s;%s %s -o %s%s %s %s%s %s %s",
1444  RM_CMD,
1445  targetDir,
1449  targetDir,
1451 #else
1452  sprintf(cmd, "%s %s -o %s%s %s %s%s %s %s",
1455  targetDir,
1457 #endif
1458  objectFile,
1463 
1464  /* Generate the library file. */
1465  result = runCommand(cmd);
1466 
1467 #if U_PLATFORM == U_PF_OS390
1468  char *env_tmp;
1469  char PDS_LibName[512];
1470  char PDS_Name[512];
1471 
1472  PDS_Name[0] = 0;
1473  PDS_LibName[0] = 0;
1474  if (specialHandling && uprv_strcmp(libFileNames[LIB_FILE],"libicudata") == 0) {
1475  if (env_tmp = getenv("ICU_PDS_NAME")) {
1476  sprintf(PDS_Name, "%s%s",
1477  env_tmp,
1478  "DA");
1479  strcat(PDS_Name, getenv("ICU_PDS_NAME_SUFFIX"));
1480  } else if (env_tmp = getenv("PDS_NAME_PREFIX")) {
1481  sprintf(PDS_Name, "%s%s",
1482  env_tmp,
1483  U_ICU_VERSION_SHORT "DA");
1484  } else {
1485  sprintf(PDS_Name, "%s%s",
1486  "IXMI",
1487  U_ICU_VERSION_SHORT "DA");
1488  }
1489  } else if (!specialHandling && uprv_strcmp(libFileNames[LIB_FILE],"libicudata_stub") == 0) {
1490  if (env_tmp = getenv("ICU_PDS_NAME")) {
1491  sprintf(PDS_Name, "%s%s",
1492  env_tmp,
1493  "D1");
1494  strcat(PDS_Name, getenv("ICU_PDS_NAME_SUFFIX"));
1495  } else if (env_tmp = getenv("PDS_NAME_PREFIX")) {
1496  sprintf(PDS_Name, "%s%s",
1497  env_tmp,
1498  U_ICU_VERSION_SHORT "D1");
1499  } else {
1500  sprintf(PDS_Name, "%s%s",
1501  "IXMI",
1502  U_ICU_VERSION_SHORT "D1");
1503  }
1504  }
1505 
1506  if (PDS_Name[0]) {
1507  sprintf(PDS_LibName,"%s%s%s%s%s",
1508  "\"//'",
1509  getenv("LOADMOD"),
1510  "(",
1511  PDS_Name,
1512  ")'\"");
1513  sprintf(cmd, "%s %s -o %s %s %s%s %s %s",
1516  PDS_LibName,
1517  objectFile,
1522 
1523  result = runCommand(cmd);
1524  }
1525 #endif
1526  }
1527 
1528  if (result != 0) {
1529  fprintf(stderr, "Error generating library file. Failed command: %s\n", cmd);
1530  }
1531 
1532  if (freeCmd) {
1533  uprv_free(cmd);
1534  }
1535 
1536  return result;
1537 }
1538 
1539 static int32_t pkg_createWithAssemblyCode(const char *targetDir, const char mode, const char *gencFilePath) {
1540  char tempObjectFile[SMALL_BUFFER_MAX_SIZE] = "";
1541  int32_t result = 0;
1542  int32_t length = 0;
1543 
1544  /* Remove the ending .s and replace it with .o for the new object file. */
1545  uprv_strcpy(tempObjectFile, gencFilePath);
1546  tempObjectFile[uprv_strlen(tempObjectFile)-1] = 'o';
1547 
1549  + uprv_strlen(tempObjectFile) + uprv_strlen(gencFilePath) + BUFFER_PADDING_SIZE);
1550 
1551  LocalMemory<char> cmd((char *)uprv_malloc(sizeof(char) * length));
1552  if (cmd.isNull()) {
1553  return -1;
1554  }
1555 
1556  /* Generate the object file. */
1557  sprintf(cmd.getAlias(), "%s %s -o %s %s",
1560  tempObjectFile,
1561  gencFilePath);
1562 
1563  result = runCommand(cmd.getAlias());
1564 
1565  if (result != 0) {
1566  fprintf(stderr, "Error creating with assembly code. Failed command: %s\n", cmd.getAlias());
1567  return result;
1568  }
1569 
1570  return pkg_generateLibraryFile(targetDir, mode, tempObjectFile);
1571 }
1572 
1573 #ifdef BUILD_DATA_WITHOUT_ASSEMBLY
1574 /*
1575  * Generation of the data library without assembly code needs to compile each data file
1576  * individually and then link it all together.
1577  * Note: Any update to the directory structure of the data needs to be reflected here.
1578  */
1579 enum {
1590 };
1591 
1592 const static char DATA_PREFIX[DATA_PREFIX_LENGTH][10] = {
1593  "brkitr",
1594  "coll",
1595  "curr",
1596  "lang",
1597  "rbnf",
1598  "region",
1599  "translit",
1600  "zone",
1601  "unit"
1602 };
1603 
1604 static int32_t pkg_createWithoutAssemblyCode(UPKGOptions *o, const char *targetDir, const char mode) {
1605  int32_t result = 0;
1606  CharList *list = o->filePaths;
1607  CharList *listNames = o->files;
1608  int32_t listSize = pkg_countCharList(list);
1609  char *buffer;
1610  char *cmd;
1611  char gencmnFile[SMALL_BUFFER_MAX_SIZE] = "";
1612  char tempObjectFile[SMALL_BUFFER_MAX_SIZE] = "";
1613 #ifdef USE_SINGLE_CCODE_FILE
1614  char icudtAll[SMALL_BUFFER_MAX_SIZE] = "";
1615  FileStream *icudtAllFile = NULL;
1616 
1617  sprintf(icudtAll, "%s%s%sall.c",
1618  o->tmpDir,
1621  /* Remove previous icudtall.c file. */
1622  if (T_FileStream_file_exists(icudtAll) && (result = remove(icudtAll)) != 0) {
1623  fprintf(stderr, "Unable to remove old icudtall file: %s\n", icudtAll);
1624  return result;
1625  }
1626 
1627  if((icudtAllFile = T_FileStream_open(icudtAll, "w"))==NULL) {
1628  fprintf(stderr, "Unable to write to icudtall file: %s\n", icudtAll);
1629  return result;
1630  }
1631 #endif
1632 
1633  if (list == NULL || listNames == NULL) {
1634  /* list and listNames should never be NULL since we are looping through the CharList with
1635  * the given size.
1636  */
1637  return -1;
1638  }
1639 
1640  if ((cmd = (char *)uprv_malloc((listSize + 2) * SMALL_BUFFER_MAX_SIZE)) == NULL) {
1641  fprintf(stderr, "Unable to allocate memory for cmd.\n");
1642  return -1;
1643  } else if ((buffer = (char *)uprv_malloc((listSize + 1) * SMALL_BUFFER_MAX_SIZE)) == NULL) {
1644  fprintf(stderr, "Unable to allocate memory for buffer.\n");
1645  uprv_free(cmd);
1646  return -1;
1647  }
1648 
1649  for (int32_t i = 0; i < (listSize + 1); i++) {
1650  const char *file ;
1651  const char *name;
1652 
1653  if (i == 0) {
1654  /* The first iteration calls the gencmn function and initailizes the buffer. */
1655  createCommonDataFile(o->tmpDir, o->shortName, o->entryName, NULL, o->srcDir, o->comment, o->fileListFiles->str, 0, TRUE, o->verbose, gencmnFile);
1656  buffer[0] = 0;
1657 #ifdef USE_SINGLE_CCODE_FILE
1658  uprv_strcpy(tempObjectFile, gencmnFile);
1659  tempObjectFile[uprv_strlen(tempObjectFile) - 1] = 'o';
1660 
1661  sprintf(cmd, "%s %s -o %s %s",
1664  tempObjectFile,
1665  gencmnFile);
1666 
1667  result = runCommand(cmd);
1668  if (result != 0) {
1669  break;
1670  }
1671 
1672  sprintf(buffer, "%s",tempObjectFile);
1673 #endif
1674  } else {
1675  char newName[SMALL_BUFFER_MAX_SIZE];
1676  char dataName[SMALL_BUFFER_MAX_SIZE];
1677  char dataDirName[SMALL_BUFFER_MAX_SIZE];
1678  const char *pSubstring;
1679  file = list->str;
1680  name = listNames->str;
1681 
1682  newName[0] = dataName[0] = 0;
1683  for (int32_t n = 0; n < DATA_PREFIX_LENGTH; n++) {
1684  dataDirName[0] = 0;
1685  sprintf(dataDirName, "%s%s", DATA_PREFIX[n], PKGDATA_FILE_SEP_STRING);
1686  /* If the name contains a prefix (indicating directory), alter the new name accordingly. */
1687  pSubstring = uprv_strstr(name, dataDirName);
1688  if (pSubstring != NULL) {
1689  char newNameTmp[SMALL_BUFFER_MAX_SIZE] = "";
1690  const char *p = name + uprv_strlen(dataDirName);
1691  for (int32_t i = 0;;i++) {
1692  if (p[i] == '.') {
1693  newNameTmp[i] = '_';
1694  continue;
1695  }
1696  newNameTmp[i] = p[i];
1697  if (p[i] == 0) {
1698  break;
1699  }
1700  }
1701  auto ret = snprintf(newName,
1703  "%s_%s",
1704  DATA_PREFIX[n],
1705  newNameTmp);
1706  (void)ret;
1708  ret = snprintf(dataName,
1710  "%s_%s",
1711  o->shortName,
1712  DATA_PREFIX[n]);
1713  (void)ret;
1715  }
1716  if (newName[0] != 0) {
1717  break;
1718  }
1719  }
1720 
1721  if(o->verbose) {
1722  printf("# Generating %s \n", gencmnFile);
1723  }
1724 
1725  writeCCode(
1726  file,
1727  o->tmpDir,
1728  dataName[0] != 0 ? dataName : o->shortName,
1729  newName[0] != 0 ? newName : NULL,
1730  gencmnFile,
1731  sizeof(gencmnFile));
1732 
1733 #ifdef USE_SINGLE_CCODE_FILE
1734  sprintf(cmd, "#include \"%s\"\n", gencmnFile);
1735  T_FileStream_writeLine(icudtAllFile, cmd);
1736  /* don't delete the file */
1737 #endif
1738  }
1739 
1740 #ifndef USE_SINGLE_CCODE_FILE
1741  uprv_strcpy(tempObjectFile, gencmnFile);
1742  tempObjectFile[uprv_strlen(tempObjectFile) - 1] = 'o';
1743 
1744  sprintf(cmd, "%s %s -o %s %s",
1747  tempObjectFile,
1748  gencmnFile);
1749  result = runCommand(cmd);
1750  if (result != 0) {
1751  fprintf(stderr, "Error creating library without assembly code. Failed command: %s\n", cmd);
1752  break;
1753  }
1754 
1755  uprv_strcat(buffer, " ");
1756  uprv_strcat(buffer, tempObjectFile);
1757 
1758 #endif
1759 
1760  if (i > 0) {
1761  list = list->next;
1762  listNames = listNames->next;
1763  }
1764  }
1765 
1766 #ifdef USE_SINGLE_CCODE_FILE
1767  T_FileStream_close(icudtAllFile);
1768  uprv_strcpy(tempObjectFile, icudtAll);
1769  tempObjectFile[uprv_strlen(tempObjectFile) - 1] = 'o';
1770 
1771  sprintf(cmd, "%s %s -I. -o %s %s",
1774  tempObjectFile,
1775  icudtAll);
1776 
1777  result = runCommand(cmd);
1778  if (result == 0) {
1779  uprv_strcat(buffer, " ");
1780  uprv_strcat(buffer, tempObjectFile);
1781  } else {
1782  fprintf(stderr, "Error creating library without assembly code. Failed command: %s\n", cmd);
1783  }
1784 #endif
1785 
1786  if (result == 0) {
1787  /* Generate the library file. */
1788 #if U_PLATFORM == U_PF_OS390
1790 #else
1791  result = pkg_generateLibraryFile(targetDir,mode, buffer, cmd);
1792 #endif
1793  }
1794 
1795  uprv_free(buffer);
1796  uprv_free(cmd);
1797 
1798  return result;
1799 }
1800 #endif
1801 
1802 #ifdef WINDOWS_WITH_MSVC
1803 #define LINK_CMD "link.exe /nologo /release /out:"
1804 #ifdef _WIN64
1805 #define LINK_FLAGS "/NXCOMPAT /DYNAMICBASE /DLL /NOENTRY /MACHINE:X64 /MANIFEST:NO /implib:"
1806 #else
1807 #define LINK_FLAGS "/NXCOMPAT /DYNAMICBASE /DLL /NOENTRY /MACHINE:X86 /MANIFEST:NO /implib:"
1808 #endif
1809 
1810 #define LINK_EXTRA_UWP_FLAGS "/APPCONTAINER "
1811 #define LINK_EXTRA_UWP_FLAGS_X86_ONLY "/SAFESEH "
1812 
1813 #define LINK_EXTRA_FLAGS_MACHINE "/MACHINE:"
1814 #define LIB_CMD "LIB.exe /nologo /out:"
1815 #define LIB_FILE "icudt.lib"
1816 #define LIB_EXT UDATA_LIB_SUFFIX
1817 #define DLL_EXT UDATA_SO_SUFFIX
1818 
1819 static int32_t pkg_createWindowsDLL(const char mode, const char *gencFilePath, UPKGOptions *o) {
1820  int32_t result = 0;
1821  char cmd[LARGE_BUFFER_MAX_SIZE];
1822  if (IN_STATIC_MODE(mode)) {
1823  char staticLibFilePath[SMALL_BUFFER_MAX_SIZE] = "";
1824 
1825 #ifdef CYGWINMSVC
1826  sprintf(staticLibFilePath, "%s%s%s%s%s",
1827  o->targetDir,
1830  o->libName,
1831  LIB_EXT);
1832 #else
1833  sprintf(staticLibFilePath, "%s%s%s%s%s",
1834  o->targetDir,
1836  (strstr(o->libName, "icudt") ? "s" : ""),
1837  o->libName,
1838  LIB_EXT);
1839 #endif
1840 
1841  sprintf(cmd, "%s\"%s\" \"%s\"",
1842  LIB_CMD,
1843  staticLibFilePath,
1844  gencFilePath);
1845  } else if (IN_DLL_MODE(mode)) {
1846  char dllFilePath[SMALL_BUFFER_MAX_SIZE] = "";
1847  char libFilePath[SMALL_BUFFER_MAX_SIZE] = "";
1848  char resFilePath[SMALL_BUFFER_MAX_SIZE] = "";
1849  char tmpResFilePath[SMALL_BUFFER_MAX_SIZE] = "";
1850 
1851 #ifdef CYGWINMSVC
1852  uprv_strcpy(dllFilePath, o->targetDir);
1853 #else
1854  uprv_strcpy(dllFilePath, o->srcDir);
1855 #endif
1856  uprv_strcat(dllFilePath, PKGDATA_FILE_SEP_STRING);
1857  uprv_strcpy(libFilePath, dllFilePath);
1858 
1859 #ifdef CYGWINMSVC
1860  uprv_strcat(libFilePath, o->libName);
1861  uprv_strcat(libFilePath, ".lib");
1862 
1863  uprv_strcat(dllFilePath, o->libName);
1864  uprv_strcat(dllFilePath, o->version);
1865 #else
1866  if (strstr(o->libName, "icudt")) {
1867  uprv_strcat(libFilePath, LIB_FILE);
1868  } else {
1869  uprv_strcat(libFilePath, o->libName);
1870  uprv_strcat(libFilePath, ".lib");
1871  }
1872  uprv_strcat(dllFilePath, o->entryName);
1873 #endif
1874  uprv_strcat(dllFilePath, DLL_EXT);
1875 
1876  uprv_strcpy(tmpResFilePath, o->tmpDir);
1877  uprv_strcat(tmpResFilePath, PKGDATA_FILE_SEP_STRING);
1878  uprv_strcat(tmpResFilePath, ICUDATA_RES_FILE);
1879 
1880  if (T_FileStream_file_exists(tmpResFilePath)) {
1881  sprintf(resFilePath, "\"%s\"", tmpResFilePath);
1882  }
1883 
1884  /* Check if dll file and lib file exists and that it is not newer than genc file. */
1885  if (!o->rebuild && (T_FileStream_file_exists(dllFilePath) && isFileModTimeLater(dllFilePath, gencFilePath)) &&
1886  (T_FileStream_file_exists(libFilePath) && isFileModTimeLater(libFilePath, gencFilePath))) {
1887  if(o->verbose) {
1888  printf("# Not rebuilding %s - up to date.\n", gencFilePath);
1889  }
1890  return 0;
1891  }
1892 
1893  char extraFlags[SMALL_BUFFER_MAX_SIZE] = "";
1894 #ifdef WINDOWS_WITH_MSVC
1895  if (options[WIN_UWP_BUILD].doesOccur) {
1896  uprv_strcat(extraFlags, LINK_EXTRA_UWP_FLAGS);
1897 
1898  if (options[WIN_DLL_ARCH].doesOccur) {
1899  if (uprv_strcmp(options[WIN_DLL_ARCH].value, "X86") == 0) {
1900  uprv_strcat(extraFlags, LINK_EXTRA_UWP_FLAGS_X86_ONLY);
1901  }
1902  }
1903  }
1904 
1905  if (options[WIN_DLL_ARCH].doesOccur) {
1906  uprv_strcat(extraFlags, LINK_EXTRA_FLAGS_MACHINE);
1907  uprv_strcat(extraFlags, options[WIN_DLL_ARCH].value);
1908  }
1909 
1910 #endif
1911  sprintf(cmd, "%s\"%s\" %s %s\"%s\" \"%s\" %s",
1912  LINK_CMD,
1913  dllFilePath,
1914  extraFlags,
1915  LINK_FLAGS,
1916  libFilePath,
1917  gencFilePath,
1918  resFilePath
1919  );
1920  }
1921 
1922  result = runCommand(cmd, TRUE);
1923  if (result != 0) {
1924  fprintf(stderr, "Error creating Windows DLL library. Failed command: %s\n", cmd);
1925  }
1926 
1927  return result;
1928 }
1929 #endif
1930 
1932 #if U_PLATFORM == U_PF_AIX
1933  /* AIX needs a map file. */
1934  char *flag = NULL;
1935  int32_t length = 0;
1936  char tmpbuffer[SMALL_BUFFER_MAX_SIZE];
1937  const char MAP_FILE_EXT[] = ".map";
1938  FileStream *f = NULL;
1939  char mapFile[SMALL_BUFFER_MAX_SIZE] = "";
1940  int32_t start = -1;
1941  uint32_t count = 0;
1942  const char rm_cmd[] = "rm -f all ;";
1943 
1945 
1946  /* This portion of the code removes 'rm -f all' in the GENLIB.
1947  * Only occurs in AIX.
1948  */
1949  if (uprv_strstr(flag, rm_cmd) != NULL) {
1950  char *tmpGenlibFlagBuffer = NULL;
1951  int32_t i, offset;
1952 
1953  length = static_cast<int32_t>(uprv_strlen(flag) + 1);
1954  tmpGenlibFlagBuffer = (char *)uprv_malloc(length);
1955  if (tmpGenlibFlagBuffer == NULL) {
1956  /* Memory allocation error */
1957  fprintf(stderr,"Unable to allocate buffer of size: %d.\n", length);
1958  return NULL;
1959  }
1960 
1961  uprv_strcpy(tmpGenlibFlagBuffer, flag);
1962 
1963  offset = static_cast<int32_t>(uprv_strlen(rm_cmd));
1964 
1965  for (i = 0; i < (length - offset); i++) {
1966  flag[i] = tmpGenlibFlagBuffer[offset + i];
1967  }
1968 
1969  /* Zero terminate the string */
1970  flag[i] = 0;
1971 
1972  uprv_free(tmpGenlibFlagBuffer);
1973  }
1974 
1976  length = static_cast<int32_t>(uprv_strlen(pkgDataFlags[BIR_FLAGS]));
1977 
1978  for (int32_t i = 0; i < length; i++) {
1979  if (flag[i] == MAP_FILE_EXT[count]) {
1980  if (count == 0) {
1981  start = i;
1982  }
1983  count++;
1984  } else {
1985  count = 0;
1986  }
1987 
1988  if (count == uprv_strlen(MAP_FILE_EXT)) {
1989  break;
1990  }
1991  }
1992 
1993  if (start >= 0) {
1994  int32_t index = 0;
1995  for (int32_t i = 0;;i++) {
1996  if (i == start) {
1997  for (int32_t n = 0;;n++) {
1998  if (o->shortName[n] == 0) {
1999  break;
2000  }
2001  tmpbuffer[index++] = o->shortName[n];
2002  }
2003  }
2004 
2005  tmpbuffer[index++] = flag[i];
2006 
2007  if (flag[i] == 0) {
2008  break;
2009  }
2010  }
2011 
2012  uprv_memset(flag, 0, length);
2013  uprv_strcpy(flag, tmpbuffer);
2014 
2015  uprv_strcpy(mapFile, o->shortName);
2016  uprv_strcat(mapFile, MAP_FILE_EXT);
2017 
2018  f = T_FileStream_open(mapFile, "w");
2019  if (f == NULL) {
2020  fprintf(stderr,"Unable to create map file: %s.\n", mapFile);
2021  return NULL;
2022  } else {
2023  sprintf(tmpbuffer, "%s%s ", o->entryName, UDATA_CMN_INTERMEDIATE_SUFFIX);
2024 
2025  T_FileStream_writeLine(f, tmpbuffer);
2026 
2028  }
2029  }
2030 #elif U_PLATFORM == U_PF_CYGWIN || U_PLATFORM == U_PF_MINGW
2031  /* Cygwin needs to change flag options. */
2032  char *flag = NULL;
2033  int32_t length = 0;
2034 
2036  length = static_cast<int32_t>(uprv_strlen(pkgDataFlags[GENLIB]));
2037 
2038  int32_t position = length - 1;
2039 
2040  for(;position >= 0;position--) {
2041  if (flag[position] == '=') {
2042  position++;
2043  break;
2044  }
2045  }
2046 
2048 #elif U_PLATFORM == U_PF_OS400
2049  /* OS/400 needs to fix the ld options (swap single quote with double quote) */
2050  char *flag = NULL;
2051  int32_t length = 0;
2052 
2054  length = static_cast<int32_t>(uprv_strlen(pkgDataFlags[GENLIB]));
2055 
2056  int32_t position = length - 1;
2057 
2058  for(int32_t i = 0; i < length; i++) {
2059  if (flag[i] == '\'') {
2060  flag[i] = '\"';
2061  }
2062  }
2063 #endif
2064  // Don't really need a return value, just need to stop compiler warnings about
2065  // the unused parameter 'o' on platforms where it is not otherwise used.
2066  return o;
2067 }
2068 
2070 {
2071  CharList *l, *tail = NULL, *tail2 = NULL;
2072  FileStream *in;
2073  char line[16384];
2074  char *linePtr, *lineNext;
2075  const uint32_t lineMax = 16300;
2076  char *tmp;
2077  int32_t tmpLength = 0;
2078  char *s;
2079  int32_t ln=0; /* line number */
2080 
2081  for(l = o->fileListFiles; l; l = l->next) {
2082  if(o->verbose) {
2083  fprintf(stdout, "# pkgdata: Reading %s..\n", l->str);
2084  }
2085  /* TODO: stdin */
2086  in = T_FileStream_open(l->str, "r"); /* open files list */
2087 
2088  if(!in) {
2089  fprintf(stderr, "Error opening <%s>.\n", l->str);
2091  return;
2092  }
2093 
2094  while(T_FileStream_readLine(in, line, sizeof(line))!=NULL) { /* for each line */
2095  ln++;
2096  if(uprv_strlen(line)>lineMax) {
2097  fprintf(stderr, "%s:%d - line too long (over %d chars)\n", l->str, (int)ln, (int)lineMax);
2098  exit(1);
2099  }
2100  /* remove spaces at the beginning */
2101  linePtr = line;
2102  /* On z/OS, disable call to isspace (#9996). Investigate using uprv_isspace instead (#9999) */
2103 #if U_PLATFORM != U_PF_OS390
2104  while(isspace(*linePtr)) {
2105  linePtr++;
2106  }
2107 #endif
2108  s=linePtr;
2109  /* remove trailing newline characters */
2110  while(*s!=0) {
2111  if(*s=='\r' || *s=='\n') {
2112  *s=0;
2113  break;
2114  }
2115  ++s;
2116  }
2117  if((*linePtr == 0) || (*linePtr == '#')) {
2118  continue; /* comment or empty line */
2119  }
2120 
2121  /* Now, process the line */
2122  lineNext = NULL;
2123 
2124  while(linePtr && *linePtr) { /* process space-separated items */
2125  while(*linePtr == ' ') {
2126  linePtr++;
2127  }
2128  /* Find the next quote */
2129  if(linePtr[0] == '"')
2130  {
2131  lineNext = uprv_strchr(linePtr+1, '"');
2132  if(lineNext == NULL) {
2133  fprintf(stderr, "%s:%d - missing trailing double quote (\")\n",
2134  l->str, (int)ln);
2135  exit(1);
2136  } else {
2137  lineNext++;
2138  if(*lineNext) {
2139  if(*lineNext != ' ') {
2140  fprintf(stderr, "%s:%d - malformed quoted line at position %d, expected ' ' got '%c'\n",
2141  l->str, (int)ln, (int)(lineNext-line), (*lineNext)?*lineNext:'0');
2142  exit(1);
2143  }
2144  *lineNext = 0;
2145  lineNext++;
2146  }
2147  }
2148  } else {
2149  lineNext = uprv_strchr(linePtr, ' ');
2150  if(lineNext) {
2151  *lineNext = 0; /* terminate at space */
2152  lineNext++;
2153  }
2154  }
2155 
2156  /* add the file */
2157  s = (char*)getLongPathname(linePtr);
2158 
2159  /* normal mode.. o->files is just the bare list without package names */
2160  o->files = pkg_appendToList(o->files, &tail, uprv_strdup(linePtr));
2161  if(uprv_pathIsAbsolute(s) || s[0] == '.') {
2162  fprintf(stderr, "pkgdata: Error: absolute path encountered. Old style paths are not supported. Use relative paths such as 'fur.res' or 'translit%cfur.res'.\n\tBad path: '%s'\n", U_FILE_SEP_CHAR, s);
2164  }
2165  /* The +5 is to add a little extra space for, among other things, PKGDATA_FILE_SEP_STRING */
2166  tmpLength = static_cast<int32_t>(uprv_strlen(o->srcDir) + uprv_strlen(s) + 5);
2167  if((tmp = (char *)uprv_malloc(tmpLength)) == NULL) {
2168  fprintf(stderr, "pkgdata: Error: Unable to allocate tmp buffer size: %d\n", tmpLength);
2170  }
2171  uprv_strcpy(tmp, o->srcDir);
2173  uprv_strcat(tmp, s);
2174  o->filePaths = pkg_appendToList(o->filePaths, &tail2, tmp);
2175  linePtr = lineNext;
2176  } /* for each entry on line */
2177  } /* for each line */
2179  } /* for each file list file */
2180 }
2181 
2182 /* Helper for pkg_getPkgDataPath() */
2183 #if U_HAVE_POPEN
2184 static UBool getPkgDataPath(const char *cmd, UBool verbose, char *buf, size_t items) {
2185  icu::CharString cmdBuf;
2187  LocalPipeFilePointer p;
2188  size_t n;
2189 
2190  cmdBuf.append(cmd, status);
2191  if (verbose) {
2192  fprintf(stdout, "# Calling: %s\n", cmdBuf.data());
2193  }
2194  p.adoptInstead( popen(cmdBuf.data(), "r") );
2195 
2196  if (p.isNull() || (n = fread(buf, 1, items-1, p.getAlias())) <= 0) {
2197  fprintf(stderr, "%s: Error calling '%s'\n", progname, cmd);
2198  *buf = 0;
2199  return FALSE;
2200  }
2201 
2202  return TRUE;
2203 }
2204 #endif
2205 
2206 /* Get path to pkgdata.inc. Try pkg-config first, falling back to icu-config. */
2208 #if U_HAVE_POPEN
2209  static char buf[512] = "";
2210  UBool pkgconfigIsValid = TRUE;
2211  const char *pkgconfigCmd = "pkg-config --variable=pkglibdir icu-uc";
2212  const char *icuconfigCmd = "icu-config --incpkgdatafile";
2213  const char *pkgdata = "pkgdata.inc";
2214 
2215  if (!getPkgDataPath(pkgconfigCmd, verbose, buf, UPRV_LENGTHOF(buf))) {
2216  if (!getPkgDataPath(icuconfigCmd, verbose, buf, UPRV_LENGTHOF(buf))) {
2217  fprintf(stderr, "%s: icu-config not found. Fix PATH or specify -O option\n", progname);
2218  return -1;
2219  }
2220 
2221  pkgconfigIsValid = FALSE;
2222  }
2223 
2224  for (int32_t length = strlen(buf) - 1; length >= 0; length--) {
2225  if (buf[length] == '\n' || buf[length] == ' ') {
2226  buf[length] = 0;
2227  } else {
2228  break;
2229  }
2230  }
2231 
2232  if (!*buf) {
2233  fprintf(stderr, "%s: Unable to locate pkgdata.inc. Unable to parse the results of '%s'. Check paths or use the -O option to specify the path to pkgdata.inc.\n", progname, pkgconfigIsValid ? pkgconfigCmd : icuconfigCmd);
2234  return -1;
2235  }
2236 
2237  if (pkgconfigIsValid) {
2239  uprv_strcat(buf, pkgdata);
2240  }
2241 
2242  buf[strlen(buf)] = 0;
2243 
2244  option->value = buf;
2245  option->doesOccur = TRUE;
2246 
2247  return 0;
2248 #else
2249  return -1;
2250 #endif
2251 }
2252 
2253 #ifdef CAN_WRITE_OBJ_CODE
2254  /* Create optMatchArch for genccode architecture detection */
2255 static void pkg_createOptMatchArch(char *optMatchArch) {
2256 #if !defined(WINDOWS_WITH_MSVC) || defined(USING_CYGWIN)
2257  const char* code = "void oma(){}";
2258  const char* source = "oma.c";
2259  const char* obj = "oma.obj";
2260  FileStream* stream = NULL;
2261 
2263  if (stream != NULL) {
2266 
2267  char cmd[LARGE_BUFFER_MAX_SIZE];
2268  sprintf(cmd, "%s %s -o %s",
2270  source,
2271  obj);
2272 
2273  if (runCommand(cmd) == 0){
2274  sprintf(optMatchArch, "%s", obj);
2275  }
2276  else {
2277  fprintf(stderr, "Failed to compile %s\n", source);
2278  }
2280  fprintf(stderr, "T_FileStream_remove failed to delete %s\n", source);
2281  }
2282  }
2283  else {
2284  fprintf(stderr, "T_FileStream_open failed to open %s for writing\n", source);
2285  }
2286 #endif
2287 }
2288 static void pkg_destroyOptMatchArch(char *optMatchArch) {
2289  if(T_FileStream_file_exists(optMatchArch) && !T_FileStream_remove(optMatchArch)){
2290  fprintf(stderr, "T_FileStream_remove failed to delete %s\n", optMatchArch);
2291  }
2292 }
2293 #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
cp
Definition: action.c:1035
#define count(a)
Definition: aptex-macros.h:781
#define tail
Definition: aptex-macros.h:514
#define mode
Definition: aptex-macros.h:510
#define UPRV_LENGTHOF(array)
Definition: cmemory.h:50
#define uprv_memset(buffer, mark, size)
Definition: cmemory.h:51
#define n
Definition: t4ht.c:1290
#define uprv_strcmp(s1, s2)
Definition: cstring.h:38
#define uprv_strstr(s, c)
Definition: cstring.h:41
#define uprv_strchr(s, c)
Definition: cstring.h:40
#define uprv_strcpy(dst, src)
Definition: cstring.h:36
#define uprv_strcat(dst, src)
Definition: cstring.h:39
#define uprv_strlen(str)
Definition: cstring.h:37
@ FALSE
Definition: dd.h:101
@ TRUE
Definition: dd.h:102
#define FILE_SUFFIX
Definition: drvnoi.h:46
int command
Definition: t4ht.c:934
#define fread
Definition: xxstdio.h:25
int printf()
long int flag
Definition: f2c.h:53
UBool T_FileStream_file_exists(const char *filename)
Definition: filestrm.cpp:82
UBool T_FileStream_remove(const char *fileName)
Definition: filestrm.cpp:225
int32_t T_FileStream_writeLine(FileStream *fileStream, const char *buffer)
Definition: filestrm.cpp:159
int T_FileStream_eof(FileStream *fileStream)
Definition: filestrm.cpp:179
void T_FileStream_close(FileStream *fileStream)
Definition: filestrm.cpp:75
char * T_FileStream_readLine(FileStream *fileStream, char *buffer, int32_t length)
Definition: filestrm.cpp:153
FileStream * T_FileStream_open(const char *filename, const char *mode)
Definition: filestrm.cpp:33
UBool isFileModTimeLater(const char *filePath, const char *checkAgainst, UBool isDir)
Definition: filetools.cpp:45
static int32_t currentBufferSize
Definition: flagparser.cpp:16
int32_t parseFlagsFile(const char *fileName, char **flagBuffer, int32_t flagBufferSize, const char **flagNames, int32_t numOfFlags, UErrorCode *status)
Definition: flagparser.cpp:25
static void
Definition: fpif.c:118
mpz_t * f
Definition: gen-fib.c:34
#define s
Definition: afcover.h:80
#define NULL
Definition: ftobjs.h:61
small capitals from c petite p
Definition: afcover.h:72
small capitals from c petite p scientific i
Definition: afcover.h:80
void exit()
unsigned int uint32_t
Definition: stdint.h:80
signed int int32_t
Definition: stdint.h:77
char * getenv()
#define buf
char * strstr()
#define popen(cmd, mode)
Definition: mingw32.h:91
#define pclose(file)
Definition: win32lib.h:271
#define system(p)
Definition: win32lib.h:269
static int ret
Definition: convert.c:72
#define fprintf
Definition: mendex.h:64
#define length(c)
Definition: ctangleboot.c:65
int remove()
#define sprintf
Definition: snprintf.c:44
#define snprintf
Definition: snprintf.c:41
#define U_IS_BIG_ENDIAN
Definition: platform.h:403
#define U_PF_CYGWIN
Definition: platform.h:99
#define U_PF_AIX
Definition: platform.h:108
#define U_CHARSET_FAMILY
Definition: platform.h:632
#define U_PLATFORM
Definition: platform.h:206
#define cmd(arg)
Definition: mitsu.h:44
unsigned int version_major()
#define version
Definition: nup.c:10
static int items
Definition: pgmtofs.c:86
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
void writeAssemblyCode(const char *filename, const char *destdir, const char *optEntryPoint, const char *optFilename, char *outFilePath, size_t outFilePathCapacity)
Definition: pkg_genc.cpp:275
void writeCCode(const char *filename, const char *destdir, const char *optName, const char *optFilename, char *outFilePath, size_t outFilePathCapacity)
Definition: pkg_genc.cpp:390
UBool checkAssemblyHeaderName(const char *optAssembly)
Definition: pkg_genc.cpp:248
#define PKGDATA_FILE_SEP_STRING
Definition: pkg_genc.h:59
#define LARGE_BUFFER_MAX_SIZE
Definition: pkg_genc.h:62
#define SMALL_BUFFER_MAX_SIZE
Definition: pkg_genc.h:63
void writeObjectCode(const char *filename, const char *destdir, const char *optEntryPoint, const char *optMatchArch, const char *optFilename, char *outFilePath, size_t outFilePathCapacity, UBool optWinDllExport)
#define BUFFER_PADDING_SIZE
Definition: pkg_genc.h:65
void createCommonDataFile(const char *destDir, const char *name, const char *entrypointName, const char *type, const char *source, const char *copyRight, const char *dataFile, uint32_t max_size, UBool sourceTOC, UBool verbose, char *gencmnFileName)
Definition: pkg_gencmn.cpp:120
int writePackageDatFile(const char *outFilename, const char *outComment, const char *sourcePath, const char *addList, Package *pkg, char outType)
Definition: pkg_icu.cpp:154
static const char DATA_PREFIX[DATA_PREFIX_LENGTH][10]
Definition: pkgdata.cpp:1592
const char options_help[][320]
Definition: pkgdata.cpp:240
static void loadLists(UPKGOptions *o, UErrorCode *status)
Definition: pkgdata.cpp:2069
int main(int argc, char *argv[])
Definition: pkgdata.cpp:273
static int32_t pkg_installFileMode(const char *installDir, const char *srcDir, const char *fileListName)
Definition: pkgdata.cpp:1235
static int32_t pkg_createWithoutAssemblyCode(UPKGOptions *o, const char *targetDir, const char mode)
Definition: pkgdata.cpp:1604
static UPKGOptions * pkg_checkFlag(UPKGOptions *o)
Definition: pkgdata.cpp:1931
static int32_t pkg_archiveLibrary(const char *targetDir, const char *version, UBool reverseExt)
Definition: pkgdata.cpp:1303
#define IN_STATIC_MODE(mode)
Definition: pkgdata.cpp:104
#define IN_DLL_MODE(mode)
Definition: pkgdata.cpp:103
#define LN_CMD
Definition: pkgdata.cpp:566
const char * desc
Definition: pkgdata.cpp:136
#define IN_FILES_MODE(mode)
Definition: pkgdata.cpp:105
static int32_t pkg_installCommonMode(const char *installDir, const char *fileName)
Definition: pkgdata.cpp:1203
static int32_t pkg_createWithAssemblyCode(const char *targetDir, const char mode, const char *gencFilePath)
Definition: pkgdata.cpp:1539
static int32_t pkg_installLibrary(const char *installDir, const char *dir, UBool noVersion)
Definition: pkgdata.cpp:1132
const char * name
Definition: pkgdata.cpp:135
static int32_t pkg_createSymLinks(const char *targetDir, UBool specialHandling=0)
Definition: pkgdata.cpp:1041
#define IN_COMMON_MODE(mode)
Definition: pkgdata.cpp:102
const char * alt_name
Definition: pkgdata.cpp:135
static int32_t pkg_getPkgDataPath(UBool verbose, UOption *option)
Definition: pkgdata.cpp:2207
static char libFileNames[LIB_FILENAMES_SIZE][256]
Definition: pkgdata.cpp:236
static char ** pkgDataFlags
Definition: pkgdata.cpp:218
U_DEFINE_LOCAL_OPEN_POINTER(LocalPipeFilePointer, FILE, pclose)
static UBool getPkgDataPath(const char *cmd, UBool verbose, char *buf, size_t items)
Definition: pkgdata.cpp:2184
@ LIB_FILE_VERSION_TMP
Definition: pkgdata.cpp:224
@ LIB_FILE
Definition: pkgdata.cpp:221
@ LIB_FILE_VERSION_MAJOR
Definition: pkgdata.cpp:222
@ LIB_FILE_VERSION
Definition: pkgdata.cpp:223
@ LIB_FILENAMES_SIZE
Definition: pkgdata.cpp:234
static struct @1267 modes[]
@ DATA_PREFIX_LANG
Definition: pkgdata.cpp:1583
@ DATA_PREFIX_BRKITR
Definition: pkgdata.cpp:1580
@ DATA_PREFIX_CURR
Definition: pkgdata.cpp:1582
@ DATA_PREFIX_LENGTH
Definition: pkgdata.cpp:1589
@ DATA_PREFIX_COLL
Definition: pkgdata.cpp:1581
@ DATA_PREFIX_RBNF
Definition: pkgdata.cpp:1584
@ DATA_PREFIX_REGION
Definition: pkgdata.cpp:1585
@ DATA_PREFIX_TRANSLIT
Definition: pkgdata.cpp:1586
@ DATA_PREFIX_ZONE
Definition: pkgdata.cpp:1587
@ DATA_PREFIX_UNIT
Definition: pkgdata.cpp:1588
@ TEMPDIR
Definition: pkgdata.cpp:118
@ BLDOPT
Definition: pkgdata.cpp:109
@ REBUILD
Definition: pkgdata.cpp:117
@ WIN_DLL_ARCH
Definition: pkgdata.cpp:129
@ QUIET
Definition: pkgdata.cpp:125
@ WIN_UWP_BUILD
Definition: pkgdata.cpp:128
@ SOURCEDIR
Definition: pkgdata.cpp:120
@ NAME
Definition: pkgdata.cpp:108
@ FORCE_PREFIX
Definition: pkgdata.cpp:123
@ MODE
Definition: pkgdata.cpp:110
@ WITHOUT_ASSEMBLY
Definition: pkgdata.cpp:126
@ COPYRIGHT
Definition: pkgdata.cpp:114
@ ENTRYPOINT
Definition: pkgdata.cpp:121
@ HELP
Definition: pkgdata.cpp:111
@ COMMENT
Definition: pkgdata.cpp:115
@ REVISION
Definition: pkgdata.cpp:122
@ LIBNAME
Definition: pkgdata.cpp:124
@ DESTDIR
Definition: pkgdata.cpp:116
@ WIN_DYNAMICBASE
Definition: pkgdata.cpp:130
@ INSTALL
Definition: pkgdata.cpp:119
@ VERBOSE
Definition: pkgdata.cpp:113
@ HELP_QUESTION_MARK
Definition: pkgdata.cpp:112
@ PDS_BUILD
Definition: pkgdata.cpp:127
const char * progname
Definition: pkgdata.cpp:270
@ COMPILER
Definition: pkgdata.cpp:186
@ RPATH_FLAGS
Definition: pkgdata.cpp:191
@ BIR_FLAGS
Definition: pkgdata.cpp:192
@ LD_SONAME
Definition: pkgdata.cpp:190
@ GENCCODE_ASSEMBLY_TYPE
Definition: pkgdata.cpp:180
@ SO_EXT
Definition: pkgdata.cpp:181
@ PKGDATA_FLAGS_SIZE
Definition: pkgdata.cpp:197
@ A_EXT
Definition: pkgdata.cpp:183
@ AR
Definition: pkgdata.cpp:193
@ LIBPREFIX
Definition: pkgdata.cpp:184
@ SOBJ_EXT
Definition: pkgdata.cpp:182
@ LDICUDTFLAGS
Definition: pkgdata.cpp:189
@ ARFLAGS
Definition: pkgdata.cpp:194
@ INSTALL_CMD
Definition: pkgdata.cpp:196
@ LIB_EXT_ORDER
Definition: pkgdata.cpp:185
@ GENLIB
Definition: pkgdata.cpp:188
@ RANLIB
Definition: pkgdata.cpp:195
@ LIBFLAGS
Definition: pkgdata.cpp:187
static int32_t pkg_executeOptions(UPKGOptions *o)
Definition: pkgdata.cpp:569
static int runCommand(const char *command, UBool specialHandling=0)
Definition: pkgdata.cpp:520
static int32_t pkg_generateLibraryFile(const char *targetDir, const char mode, const char *objectFile, char *command=((void *) 0), UBool specialHandling=0)
Definition: pkgdata.cpp:1365
static const char * FLAG_NAMES[PKGDATA_FLAGS_SIZE]
Definition: pkgdata.cpp:199
static void createFileNames(UPKGOptions *o, const char mode, const char *version_major, const char *version, const char *libName, const UBool reverseExt, UBool noVersion)
Definition: pkgdata.cpp:922
#define RM_CMD
Definition: pkgdata.cpp:567
static int32_t initializePkgDataFlags(UPKGOptions *o)
Definition: pkgdata.cpp:847
void pkg_deleteList(CharList *l)
Definition: pkgtypes.c:282
CharList * pkg_appendToList(CharList *l, CharList **end, const char *str)
Definition: pkgtypes.c:158
uint32_t pkg_countCharList(CharList *l)
Definition: pkgtypes.c:123
#define ICUDATA_RES_FILE
Definition: pkgtypes.h:168
#define UDATA_CMN_INTERMEDIATE_SUFFIX
Definition: pkgtypes.h:166
#define UDATA_CMN_SUFFIX
Definition: pkgtypes.h:165
#define UDATA_LIB_SUFFIX
Definition: pkgtypes.h:158
#define LIB_PREFIX
Definition: pkgtypes.h:155
logical rename
Definition: pmxab.c:724
static int offset
Definition: ppmtogif.c:642
char line[1024]
Definition: process_score.c:29
struct stream_s stream
Definition: pts_fax.h:93
#define dir
#define status
#define isspace(ch)
Definition: utype.h:87
#define isalpha(ch)
Definition: utype.h:82
#define isalnum(ch)
Definition: utype.h:84
C API: Platform Utilities.
#define U_FILE_SEP_CHAR
Definition: putil.h:130
#define U_FILE_SEP_STRING
Definition: putil.h:133
static FILE * in
Definition: squeeze.c:36
#define int32_t
Definition: stdint.in.h:167
Definition: tables.h:411
const char * targetDir
Definition: pkgtypes.h:116
CharList * filePaths
Definition: pkgtypes.h:109
const char * cShortName
Definition: pkgtypes.h:114
const char * entryName
Definition: pkgtypes.h:115
const char * options
Definition: pkgtypes.h:120
CharList * fileListFiles
Definition: pkgtypes.h:108
const char * version
Definition: pkgtypes.h:122
const char * tmpDir
Definition: pkgtypes.h:118
const char * install
Definition: pkgtypes.h:124
const char * shortName
Definition: pkgtypes.h:113
UBool quiet
Definition: pkgtypes.h:129
const char * libName
Definition: pkgtypes.h:126
UBool verbose
Definition: pkgtypes.h:128
UBool rebuild
Definition: pkgtypes.h:127
CharList * files
Definition: pkgtypes.h:110
UBool withoutAssembly
Definition: pkgtypes.h:130
const char * srcDir
Definition: pkgtypes.h:119
const char * mode
Definition: pkgtypes.h:121
const char * comment
Definition: pkgtypes.h:123
UBool pdsbuild
Definition: pkgtypes.h:131
const char * str
Definition: pkgtypes.h:32
struct _CharList * next
Definition: pkgtypes.h:33
Definition: utils.c:300
struct cell * next
Definition: inftrees.h:24
Definition: filedef.h:30
Definition: mendex.h:20
Definition: bdf.c:133
Definition: getopt.h:95
int value
Definition: gsftopk.c:425
char * value
Definition: ppmtopjxl.c:57
Definition: sh.h:1345
#define FILE
Definition: t1stdio.h:34
*job_name strlen((char *) job_name) - 4)
char * file
Definition: t4ht.c:931
#define verbose
Definition: jpeg.c:35
#define sp
Definition: stack.c:11
const char * getLongPathname(const char *pathname)
Definition: toolutil.cpp:107
void uprv_mkdir(const char *pathname, UErrorCode *status)
Definition: toolutil.cpp:185
#define U_ASSERT(exp)
Definition: uassert.h:37
C API: Initialize and clean up ICU.
const char * fileName
Definition: ugrep.cpp:52
#define U_CDECL_END
Definition: umachine.h:86
int8_t UBool
Definition: umachine.h:269
#define U_CDECL_BEGIN
Definition: umachine.h:85
Definition: obx.h:51
int u_parseArgs(int argc, char *argv[], int optionCount, UOption options[])
Definition: uoptions.cpp:26
#define UOPTION_VERBOSE
Definition: uoptions.h:70
#define UOPTION_HELP_QUESTION_MARK
Definition: uoptions.h:69
#define UOPTION_DESTDIR
Definition: uoptions.h:75
#define UOPTION_HELP_H
Definition: uoptions.h:68
#define U_MAIN_INIT_ARGS(argc, argv)
Definition: uoptions.h:37
#define UOPTION_DEF(longName, shortName, hasArg)
Definition: uoptions.h:64
#define UOPTION_SOURCEDIR
Definition: uoptions.h:76
#define UOPTION_COPYRIGHT
Definition: uoptions.h:73
@ UOPT_NO_ARG
Definition: uoptions.h:50
@ UOPT_REQUIRES_ARG
Definition: uoptions.h:50
#define u_errorName
Definition: urename.h:226
#define uprv_strdup
Definition: urename.h:1452
#define uprv_pathIsAbsolute
Definition: urename.h:1444
#define uprv_malloc
Definition: urename.h:1435
#define uprv_free
Definition: urename.h:1414
@ start
Definition: preamble.c:52
Basic definitions for ICU, for both C and C++ APIs.
UErrorCode
Definition: utypes.h:431
@ U_MEMORY_ALLOCATION_ERROR
Definition: utypes.h:473
@ U_BUFFER_OVERFLOW_ERROR
Definition: utypes.h:481
@ U_ILLEGAL_ARGUMENT_ERROR
Definition: utypes.h:467
@ U_FILE_ACCESS_ERROR
Definition: utypes.h:470
@ U_ZERO_ERROR
Definition: utypes.h:465
#define U_FAILURE(x)
Definition: utypes.h:735
#define U_COPYRIGHT_STRING
Definition: uvernum.h:56
#define U_ICU_VERSION_SHORT
Definition: uvernum.h:155
#define argv
Definition: xmain.c:270
#define argc
Definition: xmain.c:269
#define buffer
Definition: xmlparse.c:611