Home | History | Annotate | Download | only in common

Lines Matching defs:File

3  * Module Name: acfileio - Get ACPI tables from file
22 * copy of the source code appearing in this file ("Covered Code") an
48 * contain a file documenting the changes Licensee made to create that Covered
49 * Code and the date of any change. Licensee must include in that file the
167 FILE *File,
216 * DESCRIPTION: Get all ACPI tables from within a single file.
229 FILE *File;
235 File = fopen (Filename, "rb");
236 if (!File)
238 fprintf (stderr, "Could not open input file: %s\n", Filename);
247 /* Get the file size */
249 FileSize = CmGetFileSize (File);
257 "Input file %s, Length 0x%X (%u) bytes\n",
268 /* Check for an non-binary file */
270 if (!AcIsFileBinary (File))
273 " %s: File does not appear to contain a valid AML table\n",
279 /* Read all tables within the file */
286 Filename, File, GetOnlyAmlTables, &Table);
355 fclose(File);
364 * PARAMETERS: Filename - File where table is located
365 * File - Open FILE pointer to Filename
371 * DESCRIPTION: Read the next ACPI table from a file. Implements support
372 * for multiple tables within a single file. File must already
382 FILE *File,
411 Status = AcValidateTableHeader (File, TableOffset);
417 TableOffset = ftell (File);
418 Count = fread (&TableHeader, 1, HeaderLength, File);
465 fseek (File, TableOffset, SEEK_SET);
466 Count = fread (Table, 1, TableLength, File);
514 * PARAMETERS: File - Open input file
516 * RETURN: TRUE if file appears to be binary
518 * DESCRIPTION: Scan a file for any non-ASCII bytes.
520 * Note: Maintains current file position.
526 FILE *File)
533 /* Scan entire file for any non-ASCII bytes */
535 FileOffset = ftell (File);
536 while (fread (&Byte, 1, 1, File) == 1)
546 fseek (File, FileOffset, SEEK_SET);
555 * PARAMETERS: File - Open input file
559 * DESCRIPTION: Determine if a file seems to contain one or more binary ACPI
562 * 1) File must be at least as long as an ACPI_TABLE_HEADER
563 * 2) There must be enough room in the file to hold entire table
566 * Note: There can be multiple definition blocks per file, so we cannot
567 * expect/compare the file size to be equal to the table length. 12/2015.
569 * Note: Maintains current file position.
575 FILE *File,
602 OriginalOffset = ftell (File);
603 if (fseek (File, TableOffset, SEEK_SET))
607 Actual = fread (&TableHeader, 1, HeaderLength, File);
608 if (fseek (File, OriginalOffset, SEEK_SET))
636 "\"iasl -d -ds CDAT <file>\" or \"iasl -ds CDAT -T CDAT\"\n\n");
641 /* Validate table length against bytes remaining in the file */
643 FileSize = CmGetFileSize (File);
650 fprintf (stderr, "Table [%4.4s] is too long for file - "
651 "needs: 0x%.2X, remaining in file: 0x%.2X\n",
661 fprintf (stderr, "Table [CDAT] is too long for file - "
662 "needs: 0x%.2X, remaining in file: 0x%.2X\n",
723 * DESCRIPTION: Check table for text mode file corruption where all linefeed
768 * meaning that the table was treated as a text file somewhere.