aslfiles.c (241973) | aslfiles.c (243347) |
---|---|
1/****************************************************************************** 2 * 3 * Module Name: aslfiles - file I/O suppoert 4 * 5 *****************************************************************************/ 6 7/* 8 * Copyright (C) 2000 - 2012, Intel Corp. --- 129 unchanged lines hidden (view full) --- 138 UINT32 FileId, 139 char *Filename, 140 char *Mode) 141{ 142 FILE *File; 143 144 145 File = fopen (Filename, Mode); | 1/****************************************************************************** 2 * 3 * Module Name: aslfiles - file I/O suppoert 4 * 5 *****************************************************************************/ 6 7/* 8 * Copyright (C) 2000 - 2012, Intel Corp. --- 129 unchanged lines hidden (view full) --- 138 UINT32 FileId, 139 char *Filename, 140 char *Mode) 141{ 142 FILE *File; 143 144 145 File = fopen (Filename, Mode); |
146 147 Gbl_Files[FileId].Filename = Filename; 148 Gbl_Files[FileId].Handle = File; 149 | |
150 if (!File) 151 { 152 FlFileError (FileId, ASL_MSG_OPEN); 153 AslAbort (); 154 } | 146 if (!File) 147 { 148 FlFileError (FileId, ASL_MSG_OPEN); 149 AslAbort (); 150 } |
151 152 Gbl_Files[FileId].Filename = Filename; 153 Gbl_Files[FileId].Handle = File; |
|
155} 156 157 158/******************************************************************************* 159 * 160 * FUNCTION: FlGetFileSize 161 * 162 * PARAMETERS: FileId - Index into file info array --- 48 unchanged lines hidden (view full) --- 211 UINT32 Length) 212{ 213 UINT32 Actual; 214 215 216 /* Read and check for error */ 217 218 Actual = fread (Buffer, 1, Length, Gbl_Files[FileId].Handle); | 154} 155 156 157/******************************************************************************* 158 * 159 * FUNCTION: FlGetFileSize 160 * 161 * PARAMETERS: FileId - Index into file info array --- 48 unchanged lines hidden (view full) --- 210 UINT32 Length) 211{ 212 UINT32 Actual; 213 214 215 /* Read and check for error */ 216 217 Actual = fread (Buffer, 1, Length, Gbl_Files[FileId].Handle); |
219 if (Actual != Length) | 218 if (Actual < Length) |
220 { 221 if (feof (Gbl_Files[FileId].Handle)) 222 { 223 /* End-of-file, just return error */ 224 225 return (AE_ERROR); 226 } 227 --- 426 unchanged lines hidden (view full) --- 654 Pathname = FlMergePathnames (PrefixDir, Filename); 655 656 DbgPrint (ASL_PARSE_OUTPUT, "Include: Opening file - \"%s\"\n\n", 657 Pathname); 658 659 /* Attempt to open the file, push if successful */ 660 661 IncludeFile = fopen (Pathname, "r"); | 219 { 220 if (feof (Gbl_Files[FileId].Handle)) 221 { 222 /* End-of-file, just return error */ 223 224 return (AE_ERROR); 225 } 226 --- 426 unchanged lines hidden (view full) --- 653 Pathname = FlMergePathnames (PrefixDir, Filename); 654 655 DbgPrint (ASL_PARSE_OUTPUT, "Include: Opening file - \"%s\"\n\n", 656 Pathname); 657 658 /* Attempt to open the file, push if successful */ 659 660 IncludeFile = fopen (Pathname, "r"); |
662 if (IncludeFile) | 661 if (!IncludeFile) |
663 { | 662 { |
664 /* Push the include file on the open input file stack */ 665 666 AslPushInputFileStack (IncludeFile, Pathname); 667 return (IncludeFile); | 663 fprintf (stderr, "Could not open include file %s\n", Pathname); 664 ACPI_FREE (Pathname); 665 return (NULL); |
668 } 669 | 666 } 667 |
670 ACPI_FREE (Pathname); 671 return (NULL); | 668 /* Push the include file on the open input file stack */ 669 670 AslPushInputFileStack (IncludeFile, Pathname); 671 return (IncludeFile); |
672} 673 674 675/******************************************************************************* 676 * 677 * FUNCTION: FlOpenIncludeFile 678 * 679 * PARAMETERS: Op - Parse node for the INCLUDE ASL statement --- 267 unchanged lines hidden (view full) --- 947 948 /* All done for data table compiler */ 949 950 if (Gbl_FileType == ASL_INPUT_TYPE_ASCII_DATA) 951 { 952 return (AE_OK); 953 } 954 | 672} 673 674 675/******************************************************************************* 676 * 677 * FUNCTION: FlOpenIncludeFile 678 * 679 * PARAMETERS: Op - Parse node for the INCLUDE ASL statement --- 267 unchanged lines hidden (view full) --- 947 948 /* All done for data table compiler */ 949 950 if (Gbl_FileType == ASL_INPUT_TYPE_ASCII_DATA) 951 { 952 return (AE_OK); 953 } 954 |
955 /* Create/Open a combined source output file */ | 955 /* Create/Open a combined source output file */ |
956 957 Filename = FlGenerateFilename (FilenamePrefix, FILE_SUFFIX_SOURCE); 958 if (!Filename) 959 { 960 AslCommonError (ASL_ERROR, ASL_MSG_LISTING_FILENAME, 961 0, 0, 0, 0, NULL, NULL); 962 return (AE_ERROR); 963 } --- 184 unchanged lines hidden --- | 956 957 Filename = FlGenerateFilename (FilenamePrefix, FILE_SUFFIX_SOURCE); 958 if (!Filename) 959 { 960 AslCommonError (ASL_ERROR, ASL_MSG_LISTING_FILENAME, 961 0, 0, 0, 0, NULL, NULL); 962 return (AE_ERROR); 963 } --- 184 unchanged lines hidden --- |