FreeBSD/sys/contrib/dev/acpica/compiler/dtio.c
/******************************************************************************
 *
 * FUNCTION:    DtScanFile
 *
 * PARAMETERS:  Handle              - Open file handle for the source file
 *
 * RETURN:      Pointer to start of the constructed parse tree.
 *
 * DESCRIPTION: Scan source file, link all field names and values
 *              to the global parse tree: Gbl_FieldList
 *
 *****************************************************************************/
DtScanFile
PARAMETERS:  Handle              - Open file handle for the source file

Pointer to start of the constructed parse tree.

Scan source file, link all field names and values
to the global parse tree: Gbl_FieldList
DtScanFile PARAMETERS : Handle - Open file handle for the source file Pointer to start of the constructed parse tree . Scan source file link all field names and values to the global parse tree : Gbl_FieldList
DT_FIELD *
DtScanFile (
    FILE                    *Handle)
{
    ACPI_STATUS             Status;
    UINT32                  Offset;
    ACPI_FUNCTION_NAME (DtScanFile);
    Gbl_InputByteCount = CmGetFileSize (Handle);
    if (Gbl_InputByteCount == ACPI_UINT32_MAX)
    {
        AslAbort ();
    }
    Gbl_CurrentLineNumber = 0;
    Gbl_CurrentLineOffset = 0;
    Gbl_NextLineOffset = 0;
    while ((Offset = DtGetNextLine (Handle, 0)) != ASL_EOF)
    {
        ACPI_DEBUG_PRINT ((ACPI_DB_PARSE, "Line %2.2u/%4.4X - %s",
            Gbl_CurrentLineNumber, Offset, Gbl_CurrentLineBuffer));
        Status = DtParseLine (Gbl_CurrentLineBuffer,
            Gbl_CurrentLineNumber, Offset);
        if (Status == AE_NOT_FOUND)
        {
            break;
        }
    }
    DtDumpFieldList (Gbl_FieldList);
    return (Gbl_FieldList);
}
DT_FIELD * DtScanFile ( FILE * Handle ) { ACPI_STATUS Status ; UINT32 Offset ; ACPI_FUNCTION_NAME ( DtScanFile ) ; Gbl_InputByteCount = CmGetFileSize ( Handle ) ; if ( Gbl_InputByteCount == ACPI_UINT32_MAX ) { AslAbort ( ) ; } Gbl_CurrentLineNumber = 0 ; Gbl_CurrentLineOffset = 0 ; Gbl_NextLineOffset = 0 ; while ( ( Offset = DtGetNextLine ( Handle , 0 ) ) != ASL_EOF ) { ACPI_DEBUG_PRINT ( ( ACPI_DB_PARSE , " " , Gbl_CurrentLineNumber , Offset , Gbl_CurrentLineBuffer ) ) ; Status = DtParseLine ( Gbl_CurrentLineBuffer , Gbl_CurrentLineNumber , Offset ) ; if ( Status == AE_NOT_FOUND ) { break ; } } DtDumpFieldList ( Gbl_FieldList ) ; return ( Gbl_FieldList ) ; }
FUNCTION:    DtScanFile
 PARAMETERS:  Handle              - Open file handle for the source file
FUNCTION : DtScanFile PARAMETERS : Handle - Open file handle for the source file
/* Get the file size */ /* Scan line-by-line */ /* Dump the parse tree if debug enabled */