Fixed compatibility of output.
[AROS.git] / arch / all-pc / acpica / source / compiler / aslfiles.c
blob0881fd46af5f44ffc33903ba076cee35a329382b
1 /******************************************************************************
3 * Module Name: aslfiles - File support functions
5 *****************************************************************************/
7 /*
8 * Copyright (C) 2000 - 2013, Intel Corp.
9 * All rights reserved.
11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions
13 * are met:
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.
30 * NO WARRANTY
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 "aslcompiler.h"
45 #include "acapps.h"
47 #define _COMPONENT ACPI_COMPILER
48 ACPI_MODULE_NAME ("aslfiles")
50 /* Local prototypes */
52 FILE *
53 FlOpenIncludeWithPrefix (
54 char *PrefixDir,
55 char *Filename);
58 #ifdef ACPI_OBSOLETE_FUNCTIONS
59 ACPI_STATUS
60 FlParseInputPathname (
61 char *InputFilename);
62 #endif
65 /*******************************************************************************
67 * FUNCTION: FlSetLineNumber
69 * PARAMETERS: Op - Parse node for the LINE asl statement
71 * RETURN: None.
73 * DESCRIPTION: Set the current line number
75 ******************************************************************************/
77 void
78 FlSetLineNumber (
79 UINT32 LineNumber)
82 DbgPrint (ASL_PARSE_OUTPUT, "\n#line: New line number %u (old %u)\n",
83 LineNumber, Gbl_LogicalLineNumber);
85 Gbl_CurrentLineNumber = LineNumber;
86 Gbl_LogicalLineNumber = LineNumber;
90 /*******************************************************************************
92 * FUNCTION: FlSetFilename
94 * PARAMETERS: Op - Parse node for the LINE asl statement
96 * RETURN: None.
98 * DESCRIPTION: Set the current filename
100 ******************************************************************************/
102 void
103 FlSetFilename (
104 char *Filename)
107 DbgPrint (ASL_PARSE_OUTPUT, "\n#line: New filename %s (old %s)\n",
108 Filename, Gbl_Files[ASL_FILE_INPUT].Filename);
110 Gbl_Files[ASL_FILE_INPUT].Filename = Filename;
114 /*******************************************************************************
116 * FUNCTION: FlAddIncludeDirectory
118 * PARAMETERS: Dir - Directory pathname string
120 * RETURN: None
122 * DESCRIPTION: Add a directory the list of include prefix directories.
124 ******************************************************************************/
126 void
127 FlAddIncludeDirectory (
128 char *Dir)
130 ASL_INCLUDE_DIR *NewDir;
131 ASL_INCLUDE_DIR *NextDir;
132 ASL_INCLUDE_DIR *PrevDir = NULL;
133 UINT32 NeedsSeparator = 0;
134 size_t DirLength;
137 DirLength = strlen (Dir);
138 if (!DirLength)
140 return;
143 /* Make sure that the pathname ends with a path separator */
145 if ((Dir[DirLength-1] != '/') &&
146 (Dir[DirLength-1] != '\\'))
148 NeedsSeparator = 1;
151 NewDir = ACPI_ALLOCATE_ZEROED (sizeof (ASL_INCLUDE_DIR));
152 NewDir->Dir = ACPI_ALLOCATE (DirLength + 1 + NeedsSeparator);
153 strcpy (NewDir->Dir, Dir);
154 if (NeedsSeparator)
156 strcat (NewDir->Dir, "/");
160 * Preserve command line ordering of -I options by adding new elements
161 * at the end of the list
163 NextDir = Gbl_IncludeDirList;
164 while (NextDir)
166 PrevDir = NextDir;
167 NextDir = NextDir->Next;
170 if (PrevDir)
172 PrevDir->Next = NewDir;
174 else
176 Gbl_IncludeDirList = NewDir;
181 /*******************************************************************************
183 * FUNCTION: FlMergePathnames
185 * PARAMETERS: PrefixDir - Prefix directory pathname. Can be NULL or
186 * a zero length string.
187 * FilePathname - The include filename from the source ASL.
189 * RETURN: Merged pathname string
191 * DESCRIPTION: Merge two pathnames that (probably) have common elements, to
192 * arrive at a minimal length string. Merge can occur if the
193 * FilePathname is relative to the PrefixDir.
195 ******************************************************************************/
197 char *
198 FlMergePathnames (
199 char *PrefixDir,
200 char *FilePathname)
202 char *CommonPath;
203 char *Pathname;
204 char *LastElement;
207 DbgPrint (ASL_PARSE_OUTPUT, "Include: Prefix path - \"%s\"\n"
208 "Include: FilePathname - \"%s\"\n",
209 PrefixDir, FilePathname);
212 * If there is no prefix directory or if the file pathname is absolute,
213 * just return the original file pathname
215 if (!PrefixDir || (!*PrefixDir) ||
216 (*FilePathname == '/') ||
217 (FilePathname[1] == ':'))
219 Pathname = ACPI_ALLOCATE (strlen (FilePathname) + 1);
220 strcpy (Pathname, FilePathname);
221 goto ConvertBackslashes;
224 /* Need a local copy of the prefix directory path */
226 CommonPath = ACPI_ALLOCATE (strlen (PrefixDir) + 1);
227 strcpy (CommonPath, PrefixDir);
230 * Walk forward through the file path, and simultaneously backward
231 * through the prefix directory path until there are no more
232 * relative references at the start of the file path.
234 while (*FilePathname && (!strncmp (FilePathname, "../", 3)))
236 /* Remove last element of the prefix directory path */
238 LastElement = strrchr (CommonPath, '/');
239 if (!LastElement)
241 goto ConcatenatePaths;
244 *LastElement = 0; /* Terminate CommonPath string */
245 FilePathname += 3; /* Point to next path element */
249 * Remove the last element of the prefix directory path (it is the same as
250 * the first element of the file pathname), and build the final merged
251 * pathname.
253 LastElement = strrchr (CommonPath, '/');
254 if (LastElement)
256 *LastElement = 0;
259 /* Build the final merged pathname */
261 ConcatenatePaths:
262 Pathname = ACPI_ALLOCATE_ZEROED (strlen (CommonPath) + strlen (FilePathname) + 2);
263 if (LastElement && *CommonPath)
265 strcpy (Pathname, CommonPath);
266 strcat (Pathname, "/");
268 strcat (Pathname, FilePathname);
269 ACPI_FREE (CommonPath);
271 /* Convert all backslashes to normal slashes */
273 ConvertBackslashes:
274 UtConvertBackslashes (Pathname);
276 DbgPrint (ASL_PARSE_OUTPUT, "Include: Merged Pathname - \"%s\"\n",
277 Pathname);
278 return (Pathname);
282 /*******************************************************************************
284 * FUNCTION: FlOpenIncludeWithPrefix
286 * PARAMETERS: PrefixDir - Prefix directory pathname. Can be a zero
287 * length string.
288 * Filename - The include filename from the source ASL.
290 * RETURN: Valid file descriptor if successful. Null otherwise.
292 * DESCRIPTION: Open an include file and push it on the input file stack.
294 ******************************************************************************/
296 FILE *
297 FlOpenIncludeWithPrefix (
298 char *PrefixDir,
299 char *Filename)
301 FILE *IncludeFile;
302 char *Pathname;
305 /* Build the full pathname to the file */
307 Pathname = FlMergePathnames (PrefixDir, Filename);
309 DbgPrint (ASL_PARSE_OUTPUT, "Include: Opening file - \"%s\"\n\n",
310 Pathname);
312 /* Attempt to open the file, push if successful */
314 IncludeFile = fopen (Pathname, "r");
315 if (!IncludeFile)
317 fprintf (stderr, "Could not open include file %s\n", Pathname);
318 ACPI_FREE (Pathname);
319 return (NULL);
322 /* Push the include file on the open input file stack */
324 AslPushInputFileStack (IncludeFile, Pathname);
325 return (IncludeFile);
329 /*******************************************************************************
331 * FUNCTION: FlOpenIncludeFile
333 * PARAMETERS: Op - Parse node for the INCLUDE ASL statement
335 * RETURN: None.
337 * DESCRIPTION: Open an include file and push it on the input file stack.
339 ******************************************************************************/
341 void
342 FlOpenIncludeFile (
343 ACPI_PARSE_OBJECT *Op)
345 FILE *IncludeFile;
346 ASL_INCLUDE_DIR *NextDir;
349 /* Op must be valid */
351 if (!Op)
353 AslCommonError (ASL_ERROR, ASL_MSG_INCLUDE_FILE_OPEN,
354 Gbl_CurrentLineNumber, Gbl_LogicalLineNumber,
355 Gbl_InputByteCount, Gbl_CurrentColumn,
356 Gbl_Files[ASL_FILE_INPUT].Filename, " - Null parse node");
358 return;
362 * Flush out the "include ()" statement on this line, start
363 * the actual include file on the next line
365 AslResetCurrentLineBuffer ();
366 FlPrintFile (ASL_FILE_SOURCE_OUTPUT, "\n");
367 Gbl_CurrentLineOffset++;
370 /* Attempt to open the include file */
372 /* If the file specifies an absolute path, just open it */
374 if ((Op->Asl.Value.String[0] == '/') ||
375 (Op->Asl.Value.String[0] == '\\') ||
376 (Op->Asl.Value.String[1] == ':'))
378 IncludeFile = FlOpenIncludeWithPrefix ("", Op->Asl.Value.String);
379 if (!IncludeFile)
381 goto ErrorExit;
383 return;
387 * The include filename is not an absolute path.
389 * First, search for the file within the "local" directory -- meaning
390 * the same directory that contains the source file.
392 * Construct the file pathname from the global directory name.
394 IncludeFile = FlOpenIncludeWithPrefix (Gbl_DirectoryPath, Op->Asl.Value.String);
395 if (IncludeFile)
397 return;
401 * Second, search for the file within the (possibly multiple) directories
402 * specified by the -I option on the command line.
404 NextDir = Gbl_IncludeDirList;
405 while (NextDir)
407 IncludeFile = FlOpenIncludeWithPrefix (NextDir->Dir, Op->Asl.Value.String);
408 if (IncludeFile)
410 return;
413 NextDir = NextDir->Next;
416 /* We could not open the include file after trying very hard */
418 ErrorExit:
419 sprintf (MsgBuffer, "%s, %s", Op->Asl.Value.String, strerror (errno));
420 AslError (ASL_ERROR, ASL_MSG_INCLUDE_FILE_OPEN, Op, MsgBuffer);
424 /*******************************************************************************
426 * FUNCTION: FlOpenInputFile
428 * PARAMETERS: InputFilename - The user-specified ASL source file to be
429 * compiled
431 * RETURN: Status
433 * DESCRIPTION: Open the specified input file, and save the directory path to
434 * the file so that include files can be opened in
435 * the same directory.
437 ******************************************************************************/
439 ACPI_STATUS
440 FlOpenInputFile (
441 char *InputFilename)
444 /* Open the input ASL file, text mode */
446 FlOpenFile (ASL_FILE_INPUT, InputFilename, "rt");
447 AslCompilerin = Gbl_Files[ASL_FILE_INPUT].Handle;
449 return (AE_OK);
453 /*******************************************************************************
455 * FUNCTION: FlOpenAmlOutputFile
457 * PARAMETERS: FilenamePrefix - The user-specified ASL source file
459 * RETURN: Status
461 * DESCRIPTION: Create the output filename (*.AML) and open the file. The file
462 * is created in the same directory as the parent input file.
464 ******************************************************************************/
466 ACPI_STATUS
467 FlOpenAmlOutputFile (
468 char *FilenamePrefix)
470 char *Filename;
473 /* Output filename usually comes from the ASL itself */
475 Filename = Gbl_Files[ASL_FILE_AML_OUTPUT].Filename;
476 if (!Filename)
478 /* Create the output AML filename */
480 Filename = FlGenerateFilename (FilenamePrefix, FILE_SUFFIX_AML_CODE);
481 if (!Filename)
483 AslCommonError (ASL_ERROR, ASL_MSG_OUTPUT_FILENAME,
484 0, 0, 0, 0, NULL, NULL);
485 return (AE_ERROR);
489 /* Open the output AML file in binary mode */
491 FlOpenFile (ASL_FILE_AML_OUTPUT, Filename, "w+b");
492 return (AE_OK);
496 /*******************************************************************************
498 * FUNCTION: FlOpenMiscOutputFiles
500 * PARAMETERS: FilenamePrefix - The user-specified ASL source file
502 * RETURN: Status
504 * DESCRIPTION: Create and open the various output files needed, depending on
505 * the command line options
507 ******************************************************************************/
509 ACPI_STATUS
510 FlOpenMiscOutputFiles (
511 char *FilenamePrefix)
513 char *Filename;
516 /* All done for disassembler */
518 if (Gbl_FileType == ASL_INPUT_TYPE_ACPI_TABLE)
520 return (AE_OK);
523 /* Create/Open a hex output file if asked */
525 if (Gbl_HexOutputFlag)
527 Filename = FlGenerateFilename (FilenamePrefix, FILE_SUFFIX_HEX_DUMP);
528 if (!Filename)
530 AslCommonError (ASL_ERROR, ASL_MSG_LISTING_FILENAME,
531 0, 0, 0, 0, NULL, NULL);
532 return (AE_ERROR);
535 /* Open the hex file, text mode */
537 FlOpenFile (ASL_FILE_HEX_OUTPUT, Filename, "w+t");
539 AslCompilerSignon (ASL_FILE_HEX_OUTPUT);
540 AslCompilerFileHeader (ASL_FILE_HEX_OUTPUT);
543 /* Create/Open a debug output file if asked */
545 if (Gbl_DebugFlag)
547 Filename = FlGenerateFilename (FilenamePrefix, FILE_SUFFIX_DEBUG);
548 if (!Filename)
550 AslCommonError (ASL_ERROR, ASL_MSG_DEBUG_FILENAME,
551 0, 0, 0, 0, NULL, NULL);
552 return (AE_ERROR);
555 /* Open the debug file as STDERR, text mode */
557 /* TBD: hide this behind a FlReopenFile function */
559 Gbl_Files[ASL_FILE_DEBUG_OUTPUT].Filename = Filename;
560 Gbl_Files[ASL_FILE_DEBUG_OUTPUT].Handle =
561 freopen (Filename, "w+t", stderr);
563 if (!Gbl_Files[ASL_FILE_DEBUG_OUTPUT].Handle)
565 AslCommonError (ASL_ERROR, ASL_MSG_DEBUG_FILENAME,
566 0, 0, 0, 0, NULL, NULL);
567 return (AE_ERROR);
570 AslCompilerSignon (ASL_FILE_DEBUG_OUTPUT);
571 AslCompilerFileHeader (ASL_FILE_DEBUG_OUTPUT);
574 /* Create/Open a listing output file if asked */
576 if (Gbl_ListingFlag)
578 Filename = FlGenerateFilename (FilenamePrefix, FILE_SUFFIX_LISTING);
579 if (!Filename)
581 AslCommonError (ASL_ERROR, ASL_MSG_LISTING_FILENAME,
582 0, 0, 0, 0, NULL, NULL);
583 return (AE_ERROR);
586 /* Open the listing file, text mode */
588 FlOpenFile (ASL_FILE_LISTING_OUTPUT, Filename, "w+t");
590 AslCompilerSignon (ASL_FILE_LISTING_OUTPUT);
591 AslCompilerFileHeader (ASL_FILE_LISTING_OUTPUT);
594 /* Create the preprocessor output file if preprocessor enabled */
596 if (Gbl_PreprocessFlag)
598 Filename = FlGenerateFilename (FilenamePrefix, FILE_SUFFIX_PREPROCESSOR);
599 if (!Filename)
601 AslCommonError (ASL_ERROR, ASL_MSG_PREPROCESSOR_FILENAME,
602 0, 0, 0, 0, NULL, NULL);
603 return (AE_ERROR);
606 FlOpenFile (ASL_FILE_PREPROCESSOR, Filename, "w+t");
609 /* All done for data table compiler */
611 if (Gbl_FileType == ASL_INPUT_TYPE_ASCII_DATA)
613 return (AE_OK);
616 /* Create/Open a combined source output file */
618 Filename = FlGenerateFilename (FilenamePrefix, FILE_SUFFIX_SOURCE);
619 if (!Filename)
621 AslCommonError (ASL_ERROR, ASL_MSG_LISTING_FILENAME,
622 0, 0, 0, 0, NULL, NULL);
623 return (AE_ERROR);
627 * Open the source output file, binary mode (so that LF does not get
628 * expanded to CR/LF on some systems, messing up our seek
629 * calculations.)
631 FlOpenFile (ASL_FILE_SOURCE_OUTPUT, Filename, "w+b");
634 // TBD: TEMP
635 // AslCompilerin = Gbl_Files[ASL_FILE_SOURCE_OUTPUT].Handle;
637 /* Create/Open a assembly code source output file if asked */
639 if (Gbl_AsmOutputFlag)
641 Filename = FlGenerateFilename (FilenamePrefix, FILE_SUFFIX_ASM_SOURCE);
642 if (!Filename)
644 AslCommonError (ASL_ERROR, ASL_MSG_LISTING_FILENAME,
645 0, 0, 0, 0, NULL, NULL);
646 return (AE_ERROR);
649 /* Open the assembly code source file, text mode */
651 FlOpenFile (ASL_FILE_ASM_SOURCE_OUTPUT, Filename, "w+t");
653 AslCompilerSignon (ASL_FILE_ASM_SOURCE_OUTPUT);
654 AslCompilerFileHeader (ASL_FILE_ASM_SOURCE_OUTPUT);
657 /* Create/Open a C code source output file if asked */
659 if (Gbl_C_OutputFlag)
661 Filename = FlGenerateFilename (FilenamePrefix, FILE_SUFFIX_C_SOURCE);
662 if (!Filename)
664 AslCommonError (ASL_ERROR, ASL_MSG_LISTING_FILENAME,
665 0, 0, 0, 0, NULL, NULL);
666 return (AE_ERROR);
669 /* Open the C code source file, text mode */
671 FlOpenFile (ASL_FILE_C_SOURCE_OUTPUT, Filename, "w+t");
673 FlPrintFile (ASL_FILE_C_SOURCE_OUTPUT, "/*\n");
674 AslCompilerSignon (ASL_FILE_C_SOURCE_OUTPUT);
675 AslCompilerFileHeader (ASL_FILE_C_SOURCE_OUTPUT);
678 /* Create/Open a C code source output file for the offset table if asked */
680 if (Gbl_C_OffsetTableFlag)
682 Filename = FlGenerateFilename (FilenamePrefix, FILE_SUFFIX_C_OFFSET);
683 if (!Filename)
685 AslCommonError (ASL_ERROR, ASL_MSG_LISTING_FILENAME,
686 0, 0, 0, 0, NULL, NULL);
687 return (AE_ERROR);
690 /* Open the C code source file, text mode */
692 FlOpenFile (ASL_FILE_C_OFFSET_OUTPUT, Filename, "w+t");
694 FlPrintFile (ASL_FILE_C_OFFSET_OUTPUT, "/*\n");
695 AslCompilerSignon (ASL_FILE_C_OFFSET_OUTPUT);
696 AslCompilerFileHeader (ASL_FILE_C_OFFSET_OUTPUT);
699 /* Create/Open a assembly include output file if asked */
701 if (Gbl_AsmIncludeOutputFlag)
703 Filename = FlGenerateFilename (FilenamePrefix, FILE_SUFFIX_ASM_INCLUDE);
704 if (!Filename)
706 AslCommonError (ASL_ERROR, ASL_MSG_LISTING_FILENAME,
707 0, 0, 0, 0, NULL, NULL);
708 return (AE_ERROR);
711 /* Open the assembly include file, text mode */
713 FlOpenFile (ASL_FILE_ASM_INCLUDE_OUTPUT, Filename, "w+t");
715 AslCompilerSignon (ASL_FILE_ASM_INCLUDE_OUTPUT);
716 AslCompilerFileHeader (ASL_FILE_ASM_INCLUDE_OUTPUT);
719 /* Create/Open a C include output file if asked */
721 if (Gbl_C_IncludeOutputFlag)
723 Filename = FlGenerateFilename (FilenamePrefix, FILE_SUFFIX_C_INCLUDE);
724 if (!Filename)
726 AslCommonError (ASL_ERROR, ASL_MSG_LISTING_FILENAME,
727 0, 0, 0, 0, NULL, NULL);
728 return (AE_ERROR);
731 /* Open the C include file, text mode */
733 FlOpenFile (ASL_FILE_C_INCLUDE_OUTPUT, Filename, "w+t");
735 FlPrintFile (ASL_FILE_C_INCLUDE_OUTPUT, "/*\n");
736 AslCompilerSignon (ASL_FILE_C_INCLUDE_OUTPUT);
737 AslCompilerFileHeader (ASL_FILE_C_INCLUDE_OUTPUT);
740 /* Create a namespace output file if asked */
742 if (Gbl_NsOutputFlag)
744 Filename = FlGenerateFilename (FilenamePrefix, FILE_SUFFIX_NAMESPACE);
745 if (!Filename)
747 AslCommonError (ASL_ERROR, ASL_MSG_LISTING_FILENAME,
748 0, 0, 0, 0, NULL, NULL);
749 return (AE_ERROR);
752 /* Open the namespace file, text mode */
754 FlOpenFile (ASL_FILE_NAMESPACE_OUTPUT, Filename, "w+t");
756 AslCompilerSignon (ASL_FILE_NAMESPACE_OUTPUT);
757 AslCompilerFileHeader (ASL_FILE_NAMESPACE_OUTPUT);
760 return (AE_OK);
764 #ifdef ACPI_OBSOLETE_FUNCTIONS
765 /*******************************************************************************
767 * FUNCTION: FlParseInputPathname
769 * PARAMETERS: InputFilename - The user-specified ASL source file to be
770 * compiled
772 * RETURN: Status
774 * DESCRIPTION: Split the input path into a directory and filename part
775 * 1) Directory part used to open include files
776 * 2) Filename part used to generate output filenames
778 ******************************************************************************/
780 ACPI_STATUS
781 FlParseInputPathname (
782 char *InputFilename)
784 char *Substring;
787 if (!InputFilename)
789 return (AE_OK);
792 /* Get the path to the input filename's directory */
794 Gbl_DirectoryPath = strdup (InputFilename);
795 if (!Gbl_DirectoryPath)
797 return (AE_NO_MEMORY);
800 Substring = strrchr (Gbl_DirectoryPath, '\\');
801 if (!Substring)
803 Substring = strrchr (Gbl_DirectoryPath, '/');
804 if (!Substring)
806 Substring = strrchr (Gbl_DirectoryPath, ':');
810 if (!Substring)
812 Gbl_DirectoryPath[0] = 0;
813 if (Gbl_UseDefaultAmlFilename)
815 Gbl_OutputFilenamePrefix = strdup (InputFilename);
818 else
820 if (Gbl_UseDefaultAmlFilename)
822 Gbl_OutputFilenamePrefix = strdup (Substring + 1);
824 *(Substring+1) = 0;
827 return (AE_OK);
829 #endif