1 /******************************************************************************
3 * Module Name: aslfiles - File support functions
5 *****************************************************************************/
8 * Copyright (C) 2000 - 2016, Intel Corp.
11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions
14 * 1. Redistributions of source code must retain the above copyright
15 * notice, this list of conditions, and the following disclaimer,
16 * without modification.
17 * 2. Redistributions in binary form must reproduce at minimum a disclaimer
18 * substantially similar to the "NO WARRANTY" disclaimer below
19 * ("Disclaimer") and any redistribution must be conditioned upon
20 * including a substantially similar Disclaimer requirement for further
21 * binary redistribution.
22 * 3. Neither the names of the above-listed copyright holders nor the names
23 * of any contributors may be used to endorse or promote products derived
24 * from this software without specific prior written permission.
26 * Alternatively, this software may be distributed under the terms of the
27 * GNU General Public License ("GPL") version 2 as published by the Free
28 * Software Foundation.
31 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
32 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
33 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
34 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
35 * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
36 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
37 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
38 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
39 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
40 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
41 * POSSIBILITY OF SUCH DAMAGES.
44 #include <contrib/dev/acpica/compiler/aslcompiler.h>
45 #include <contrib/dev/acpica/include/acapps.h>
46 #include <contrib/dev/acpica/compiler/dtcompiler.h>
48 #define _COMPONENT ACPI_COMPILER
49 ACPI_MODULE_NAME ("aslfiles")
51 /* Local prototypes */
54 FlOpenIncludeWithPrefix (
56 ACPI_PARSE_OBJECT *Op,
59 #ifdef ACPI_OBSOLETE_FUNCTIONS
61 FlParseInputPathname (
66 /*******************************************************************************
68 * FUNCTION: FlSetLineNumber
70 * PARAMETERS: Op - Parse node for the LINE asl statement
74 * DESCRIPTION: Set the current line number
76 ******************************************************************************/
83 DbgPrint (ASL_PARSE_OUTPUT, "\n#line: New line number %u (old %u)\n",
84 LineNumber, Gbl_LogicalLineNumber);
86 Gbl_CurrentLineNumber = LineNumber;
90 /*******************************************************************************
92 * FUNCTION: FlSetFilename
94 * PARAMETERS: Op - Parse node for the LINE asl statement
98 * DESCRIPTION: Set the current filename
100 ******************************************************************************/
107 DbgPrint (ASL_PARSE_OUTPUT, "\n#line: New filename %s (old %s)\n",
108 Filename, Gbl_Files[ASL_FILE_INPUT].Filename);
110 /* No need to free any existing filename */
112 Gbl_Files[ASL_FILE_INPUT].Filename = Filename;
116 /*******************************************************************************
118 * FUNCTION: FlAddIncludeDirectory
120 * PARAMETERS: Dir - Directory pathname string
124 * DESCRIPTION: Add a directory the list of include prefix directories.
126 ******************************************************************************/
129 FlAddIncludeDirectory (
132 ASL_INCLUDE_DIR *NewDir;
133 ASL_INCLUDE_DIR *NextDir;
134 ASL_INCLUDE_DIR *PrevDir = NULL;
135 UINT32 NeedsSeparator = 0;
139 DirLength = strlen (Dir);
145 /* Make sure that the pathname ends with a path separator */
147 if ((Dir[DirLength-1] != '/') &&
148 (Dir[DirLength-1] != '\\'))
153 NewDir = ACPI_ALLOCATE_ZEROED (sizeof (ASL_INCLUDE_DIR));
154 NewDir->Dir = ACPI_ALLOCATE (DirLength + 1 + NeedsSeparator);
155 strcpy (NewDir->Dir, Dir);
158 strcat (NewDir->Dir, "/");
162 * Preserve command line ordering of -I options by adding new elements
163 * at the end of the list
165 NextDir = Gbl_IncludeDirList;
169 NextDir = NextDir->Next;
174 PrevDir->Next = NewDir;
178 Gbl_IncludeDirList = NewDir;
183 /*******************************************************************************
185 * FUNCTION: FlMergePathnames
187 * PARAMETERS: PrefixDir - Prefix directory pathname. Can be NULL or
188 * a zero length string.
189 * FilePathname - The include filename from the source ASL.
191 * RETURN: Merged pathname string
193 * DESCRIPTION: Merge two pathnames that (probably) have common elements, to
194 * arrive at a minimal length string. Merge can occur if the
195 * FilePathname is relative to the PrefixDir.
197 ******************************************************************************/
209 DbgPrint (ASL_PARSE_OUTPUT, "Include: Prefix path - \"%s\"\n"
210 "Include: FilePathname - \"%s\"\n",
211 PrefixDir, FilePathname);
214 * If there is no prefix directory or if the file pathname is absolute,
215 * just return the original file pathname
217 if (!PrefixDir || (!*PrefixDir) ||
218 (*FilePathname == '/') ||
219 (FilePathname[1] == ':'))
221 Pathname = UtStringCacheCalloc (strlen (FilePathname) + 1);
222 strcpy (Pathname, FilePathname);
223 goto ConvertBackslashes;
226 /* Need a local copy of the prefix directory path */
228 CommonPath = UtStringCacheCalloc (strlen (PrefixDir) + 1);
229 strcpy (CommonPath, PrefixDir);
232 * Walk forward through the file path, and simultaneously backward
233 * through the prefix directory path until there are no more
234 * relative references at the start of the file path.
236 while (*FilePathname && (!strncmp (FilePathname, "../", 3)))
238 /* Remove last element of the prefix directory path */
240 LastElement = strrchr (CommonPath, '/');
243 goto ConcatenatePaths;
246 *LastElement = 0; /* Terminate CommonPath string */
247 FilePathname += 3; /* Point to next path element */
251 * Remove the last element of the prefix directory path (it is the same as
252 * the first element of the file pathname), and build the final merged
255 LastElement = strrchr (CommonPath, '/');
261 /* Build the final merged pathname */
264 Pathname = UtStringCacheCalloc (
265 strlen (CommonPath) + strlen (FilePathname) + 2);
266 if (LastElement && *CommonPath)
268 strcpy (Pathname, CommonPath);
269 strcat (Pathname, "/");
271 strcat (Pathname, FilePathname);
273 /* Convert all backslashes to normal slashes */
276 UtConvertBackslashes (Pathname);
278 DbgPrint (ASL_PARSE_OUTPUT, "Include: Merged Pathname - \"%s\"\n",
284 /*******************************************************************************
286 * FUNCTION: FlOpenIncludeWithPrefix
288 * PARAMETERS: PrefixDir - Prefix directory pathname. Can be a zero
290 * Filename - The include filename from the source ASL.
292 * RETURN: Valid file descriptor if successful. Null otherwise.
294 * DESCRIPTION: Open an include file and push it on the input file stack.
296 ******************************************************************************/
299 FlOpenIncludeWithPrefix (
301 ACPI_PARSE_OBJECT *Op,
306 UINT32 OriginalLineNumber;
309 /* Build the full pathname to the file */
311 Pathname = FlMergePathnames (PrefixDir, Filename);
313 DbgPrint (ASL_PARSE_OUTPUT, "Include: Opening file - \"%s\"\n\n",
316 /* Attempt to open the file, push if successful */
318 IncludeFile = fopen (Pathname, "r");
321 fprintf (stderr, "Could not open include file %s\n", Pathname);
322 ACPI_FREE (Pathname);
327 * Check the entire include file for any # preprocessor directives.
328 * This is because there may be some confusion between the #include
329 * preprocessor directive and the ASL Include statement. A file included
330 * by the ASL include cannot contain preprocessor directives because
331 * the preprocessor has already run by the time the ASL include is
332 * recognized (by the compiler, not the preprocessor.)
334 * Note: DtGetNextLine strips/ignores comments.
335 * Save current line number since DtGetNextLine modifies it.
337 Gbl_CurrentLineNumber--;
338 OriginalLineNumber = Gbl_CurrentLineNumber;
340 while (DtGetNextLine (IncludeFile, DT_ALLOW_MULTILINE_QUOTES) != ASL_EOF)
342 if (Gbl_CurrentLineBuffer[0] == '#')
344 AslError (ASL_ERROR, ASL_MSG_INCLUDE_FILE,
345 Op, "use #include instead");
349 Gbl_CurrentLineNumber = OriginalLineNumber;
351 /* Must seek back to the start of the file */
353 fseek (IncludeFile, 0, SEEK_SET);
355 /* Push the include file on the open input file stack */
357 AslPushInputFileStack (IncludeFile, Pathname);
358 return (IncludeFile);
362 /*******************************************************************************
364 * FUNCTION: FlOpenIncludeFile
366 * PARAMETERS: Op - Parse node for the INCLUDE ASL statement
370 * DESCRIPTION: Open an include file and push it on the input file stack.
372 ******************************************************************************/
376 ACPI_PARSE_OBJECT *Op)
379 ASL_INCLUDE_DIR *NextDir;
382 /* Op must be valid */
386 AslCommonError (ASL_ERROR, ASL_MSG_INCLUDE_FILE_OPEN,
387 Gbl_CurrentLineNumber, Gbl_LogicalLineNumber,
388 Gbl_InputByteCount, Gbl_CurrentColumn,
389 Gbl_Files[ASL_FILE_INPUT].Filename, " - Null parse node");
395 * Flush out the "include ()" statement on this line, start
396 * the actual include file on the next line
398 AslResetCurrentLineBuffer ();
399 FlPrintFile (ASL_FILE_SOURCE_OUTPUT, "\n");
400 Gbl_CurrentLineOffset++;
403 /* Attempt to open the include file */
405 /* If the file specifies an absolute path, just open it */
407 if ((Op->Asl.Value.String[0] == '/') ||
408 (Op->Asl.Value.String[0] == '\\') ||
409 (Op->Asl.Value.String[1] == ':'))
411 IncludeFile = FlOpenIncludeWithPrefix ("", Op, Op->Asl.Value.String);
420 * The include filename is not an absolute path.
422 * First, search for the file within the "local" directory -- meaning
423 * the same directory that contains the source file.
425 * Construct the file pathname from the global directory name.
427 IncludeFile = FlOpenIncludeWithPrefix (
428 Gbl_DirectoryPath, Op, Op->Asl.Value.String);
435 * Second, search for the file within the (possibly multiple) directories
436 * specified by the -I option on the command line.
438 NextDir = Gbl_IncludeDirList;
441 IncludeFile = FlOpenIncludeWithPrefix (
442 NextDir->Dir, Op, Op->Asl.Value.String);
448 NextDir = NextDir->Next;
451 /* We could not open the include file after trying very hard */
454 sprintf (MsgBuffer, "%s, %s", Op->Asl.Value.String, strerror (errno));
455 AslError (ASL_ERROR, ASL_MSG_INCLUDE_FILE_OPEN, Op, MsgBuffer);
459 /*******************************************************************************
461 * FUNCTION: FlOpenInputFile
463 * PARAMETERS: InputFilename - The user-specified ASL source file to be
468 * DESCRIPTION: Open the specified input file, and save the directory path to
469 * the file so that include files can be opened in
470 * the same directory.
472 ******************************************************************************/
479 /* Open the input ASL file, text mode */
481 FlOpenFile (ASL_FILE_INPUT, InputFilename, "rt");
482 AslCompilerin = Gbl_Files[ASL_FILE_INPUT].Handle;
488 /*******************************************************************************
490 * FUNCTION: FlOpenAmlOutputFile
492 * PARAMETERS: FilenamePrefix - The user-specified ASL source file
496 * DESCRIPTION: Create the output filename (*.AML) and open the file. The file
497 * is created in the same directory as the parent input file.
499 ******************************************************************************/
502 FlOpenAmlOutputFile (
503 char *FilenamePrefix)
508 /* Output filename usually comes from the ASL itself */
510 Filename = Gbl_Files[ASL_FILE_AML_OUTPUT].Filename;
513 /* Create the output AML filename */
515 Filename = FlGenerateFilename (FilenamePrefix, FILE_SUFFIX_AML_CODE);
518 AslCommonError (ASL_ERROR, ASL_MSG_OUTPUT_FILENAME,
519 0, 0, 0, 0, NULL, NULL);
523 Gbl_Files[ASL_FILE_AML_OUTPUT].Filename = Filename;
526 /* Open the output AML file in binary mode */
528 FlOpenFile (ASL_FILE_AML_OUTPUT, Filename, "w+b");
533 /*******************************************************************************
535 * FUNCTION: FlOpenMiscOutputFiles
537 * PARAMETERS: FilenamePrefix - The user-specified ASL source file
541 * DESCRIPTION: Create and open the various output files needed, depending on
542 * the command line options
544 ******************************************************************************/
547 FlOpenMiscOutputFiles (
548 char *FilenamePrefix)
553 /* Create/Open a map file if requested */
557 Filename = FlGenerateFilename (FilenamePrefix, FILE_SUFFIX_MAP);
560 AslCommonError (ASL_ERROR, ASL_MSG_LISTING_FILENAME,
561 0, 0, 0, 0, NULL, NULL);
565 /* Open the hex file, text mode (closed at compiler exit) */
567 FlOpenFile (ASL_FILE_MAP_OUTPUT, Filename, "w+t");
569 AslCompilerSignon (ASL_FILE_MAP_OUTPUT);
570 AslCompilerFileHeader (ASL_FILE_MAP_OUTPUT);
573 /* All done for disassembler */
575 if (Gbl_FileType == ASL_INPUT_TYPE_BINARY_ACPI_TABLE)
580 /* Create/Open a hex output file if asked */
582 if (Gbl_HexOutputFlag)
584 Filename = FlGenerateFilename (FilenamePrefix, FILE_SUFFIX_HEX_DUMP);
587 AslCommonError (ASL_ERROR, ASL_MSG_LISTING_FILENAME,
588 0, 0, 0, 0, NULL, NULL);
592 /* Open the hex file, text mode */
594 FlOpenFile (ASL_FILE_HEX_OUTPUT, Filename, "w+t");
596 AslCompilerSignon (ASL_FILE_HEX_OUTPUT);
597 AslCompilerFileHeader (ASL_FILE_HEX_OUTPUT);
600 /* Create/Open a debug output file if asked */
604 Filename = FlGenerateFilename (FilenamePrefix, FILE_SUFFIX_DEBUG);
607 AslCommonError (ASL_ERROR, ASL_MSG_DEBUG_FILENAME,
608 0, 0, 0, 0, NULL, NULL);
612 /* Open the debug file as STDERR, text mode */
614 Gbl_Files[ASL_FILE_DEBUG_OUTPUT].Filename = Filename;
615 Gbl_Files[ASL_FILE_DEBUG_OUTPUT].Handle =
616 freopen (Filename, "w+t", stderr);
618 if (!Gbl_Files[ASL_FILE_DEBUG_OUTPUT].Handle)
621 * A problem with freopen is that on error, we no longer
622 * have stderr and cannot emit normal error messages.
623 * Emit error to stdout, close files, and exit.
626 "\nCould not open debug output file: %s\n\n", Filename);
632 AslCompilerSignon (ASL_FILE_DEBUG_OUTPUT);
633 AslCompilerFileHeader (ASL_FILE_DEBUG_OUTPUT);
636 /* Create/Open a cross-reference output file if asked */
638 if (Gbl_CrossReferenceOutput)
640 Filename = FlGenerateFilename (FilenamePrefix, FILE_SUFFIX_XREF);
643 AslCommonError (ASL_ERROR, ASL_MSG_DEBUG_FILENAME,
644 0, 0, 0, 0, NULL, NULL);
648 FlOpenFile (ASL_FILE_XREF_OUTPUT, Filename, "w+t");
650 AslCompilerSignon (ASL_FILE_XREF_OUTPUT);
651 AslCompilerFileHeader (ASL_FILE_XREF_OUTPUT);
654 /* Create/Open a listing output file if asked */
658 Filename = FlGenerateFilename (FilenamePrefix, FILE_SUFFIX_LISTING);
661 AslCommonError (ASL_ERROR, ASL_MSG_LISTING_FILENAME,
662 0, 0, 0, 0, NULL, NULL);
666 /* Open the listing file, text mode */
668 FlOpenFile (ASL_FILE_LISTING_OUTPUT, Filename, "w+t");
670 AslCompilerSignon (ASL_FILE_LISTING_OUTPUT);
671 AslCompilerFileHeader (ASL_FILE_LISTING_OUTPUT);
674 /* Create the preprocessor output temp file if preprocessor enabled */
676 if (Gbl_PreprocessFlag)
678 Filename = FlGenerateFilename (FilenamePrefix, FILE_SUFFIX_PREPROCESSOR);
681 AslCommonError (ASL_ERROR, ASL_MSG_PREPROCESSOR_FILENAME,
682 0, 0, 0, 0, NULL, NULL);
686 FlOpenFile (ASL_FILE_PREPROCESSOR, Filename, "w+t");
690 * Create the "user" preprocessor output file if -li flag set.
691 * Note, this file contains no embedded #line directives.
693 if (Gbl_PreprocessorOutputFlag)
695 Filename = FlGenerateFilename (FilenamePrefix, FILE_SUFFIX_PREPROC_USER);
698 AslCommonError (ASL_ERROR, ASL_MSG_PREPROCESSOR_FILENAME,
699 0, 0, 0, 0, NULL, NULL);
703 FlOpenFile (ASL_FILE_PREPROCESSOR_USER, Filename, "w+t");
706 /* All done for data table compiler */
708 if (Gbl_FileType == ASL_INPUT_TYPE_ASCII_DATA)
713 /* Create/Open a combined source output file */
715 Filename = FlGenerateFilename (FilenamePrefix, FILE_SUFFIX_SOURCE);
718 AslCommonError (ASL_ERROR, ASL_MSG_LISTING_FILENAME,
719 0, 0, 0, 0, NULL, NULL);
724 * Open the source output file, binary mode (so that LF does not get
725 * expanded to CR/LF on some systems, messing up our seek
728 FlOpenFile (ASL_FILE_SOURCE_OUTPUT, Filename, "w+b");
732 // AslCompilerin = Gbl_Files[ASL_FILE_SOURCE_OUTPUT].Handle;
734 /* Create/Open a assembly code source output file if asked */
736 if (Gbl_AsmOutputFlag)
738 Filename = FlGenerateFilename (FilenamePrefix, FILE_SUFFIX_ASM_SOURCE);
741 AslCommonError (ASL_ERROR, ASL_MSG_LISTING_FILENAME,
742 0, 0, 0, 0, NULL, NULL);
746 /* Open the assembly code source file, text mode */
748 FlOpenFile (ASL_FILE_ASM_SOURCE_OUTPUT, Filename, "w+t");
750 AslCompilerSignon (ASL_FILE_ASM_SOURCE_OUTPUT);
751 AslCompilerFileHeader (ASL_FILE_ASM_SOURCE_OUTPUT);
754 /* Create/Open a C code source output file if asked */
756 if (Gbl_C_OutputFlag)
758 Filename = FlGenerateFilename (FilenamePrefix, FILE_SUFFIX_C_SOURCE);
761 AslCommonError (ASL_ERROR, ASL_MSG_LISTING_FILENAME,
762 0, 0, 0, 0, NULL, NULL);
766 /* Open the C code source file, text mode */
768 FlOpenFile (ASL_FILE_C_SOURCE_OUTPUT, Filename, "w+t");
770 FlPrintFile (ASL_FILE_C_SOURCE_OUTPUT, "/*\n");
771 AslCompilerSignon (ASL_FILE_C_SOURCE_OUTPUT);
772 AslCompilerFileHeader (ASL_FILE_C_SOURCE_OUTPUT);
775 /* Create/Open a C code source output file for the offset table if asked */
777 if (Gbl_C_OffsetTableFlag)
779 Filename = FlGenerateFilename (FilenamePrefix, FILE_SUFFIX_C_OFFSET);
782 AslCommonError (ASL_ERROR, ASL_MSG_LISTING_FILENAME,
783 0, 0, 0, 0, NULL, NULL);
787 /* Open the C code source file, text mode */
789 FlOpenFile (ASL_FILE_C_OFFSET_OUTPUT, Filename, "w+t");
791 FlPrintFile (ASL_FILE_C_OFFSET_OUTPUT, "/*\n");
792 AslCompilerSignon (ASL_FILE_C_OFFSET_OUTPUT);
793 AslCompilerFileHeader (ASL_FILE_C_OFFSET_OUTPUT);
796 /* Create/Open a assembly include output file if asked */
798 if (Gbl_AsmIncludeOutputFlag)
800 Filename = FlGenerateFilename (FilenamePrefix, FILE_SUFFIX_ASM_INCLUDE);
803 AslCommonError (ASL_ERROR, ASL_MSG_LISTING_FILENAME,
804 0, 0, 0, 0, NULL, NULL);
808 /* Open the assembly include file, text mode */
810 FlOpenFile (ASL_FILE_ASM_INCLUDE_OUTPUT, Filename, "w+t");
812 AslCompilerSignon (ASL_FILE_ASM_INCLUDE_OUTPUT);
813 AslCompilerFileHeader (ASL_FILE_ASM_INCLUDE_OUTPUT);
816 /* Create/Open a C include output file if asked */
818 if (Gbl_C_IncludeOutputFlag)
820 Filename = FlGenerateFilename (FilenamePrefix, FILE_SUFFIX_C_INCLUDE);
823 AslCommonError (ASL_ERROR, ASL_MSG_LISTING_FILENAME,
824 0, 0, 0, 0, NULL, NULL);
828 /* Open the C include file, text mode */
830 FlOpenFile (ASL_FILE_C_INCLUDE_OUTPUT, Filename, "w+t");
832 FlPrintFile (ASL_FILE_C_INCLUDE_OUTPUT, "/*\n");
833 AslCompilerSignon (ASL_FILE_C_INCLUDE_OUTPUT);
834 AslCompilerFileHeader (ASL_FILE_C_INCLUDE_OUTPUT);
837 /* Create a namespace output file if asked */
839 if (Gbl_NsOutputFlag)
841 Filename = FlGenerateFilename (FilenamePrefix, FILE_SUFFIX_NAMESPACE);
844 AslCommonError (ASL_ERROR, ASL_MSG_LISTING_FILENAME,
845 0, 0, 0, 0, NULL, NULL);
849 /* Open the namespace file, text mode */
851 FlOpenFile (ASL_FILE_NAMESPACE_OUTPUT, Filename, "w+t");
853 AslCompilerSignon (ASL_FILE_NAMESPACE_OUTPUT);
854 AslCompilerFileHeader (ASL_FILE_NAMESPACE_OUTPUT);
861 #ifdef ACPI_OBSOLETE_FUNCTIONS
862 /*******************************************************************************
864 * FUNCTION: FlParseInputPathname
866 * PARAMETERS: InputFilename - The user-specified ASL source file to be
871 * DESCRIPTION: Split the input path into a directory and filename part
872 * 1) Directory part used to open include files
873 * 2) Filename part used to generate output filenames
875 ******************************************************************************/
878 FlParseInputPathname (
889 /* Get the path to the input filename's directory */
891 Gbl_DirectoryPath = strdup (InputFilename);
892 if (!Gbl_DirectoryPath)
894 return (AE_NO_MEMORY);
897 Substring = strrchr (Gbl_DirectoryPath, '\\');
900 Substring = strrchr (Gbl_DirectoryPath, '/');
903 Substring = strrchr (Gbl_DirectoryPath, ':');
909 Gbl_DirectoryPath[0] = 0;
910 if (Gbl_UseDefaultAmlFilename)
912 Gbl_OutputFilenamePrefix = strdup (InputFilename);
917 if (Gbl_UseDefaultAmlFilename)
919 Gbl_OutputFilenamePrefix = strdup (Substring + 1);
924 UtConvertBackslashes (Gbl_OutputFilenamePrefix);