kernel/acpica/compiler/cvparser.c
/*******************************************************************************
 *
 * FUNCTION:    CvAddToFileTree
 *
 * PARAMETERS:  Filename          - Address containing the name of the current
 *                                  filename
 *              PreviousFilename  - Address containing the name of the previous
 *                                  filename
 *
 * RETURN:      None
 *
 * DESCRIPTION: Add this filename to the AcpiGbl_FileTree if it does not exist.
 *
 ******************************************************************************/
CvAddToFileTree
PARAMETERS:  Filename          - Address containing the name of the current
filename
PreviousFilename  - Address containing the name of the previous
filename

None

Add this filename to the AcpiGbl_FileTree if it does not exist.
CvAddToFileTree PARAMETERS : Filename - Address containing the name of the current filename PreviousFilename - Address containing the name of the previous filename None Add this filename to the AcpiGbl_FileTree if it does not exist .
static void
CvAddToFileTree (
    char                    *Filename,
    char                    *PreviousFilename)
{
    ACPI_FILE_NODE          *Node;
    if (!AcpiUtStricmp(Filename, AcpiGbl_RootFilename) &&
        PreviousFilename)
    {
        Node = CvFilenameExists (PreviousFilename, AcpiGbl_FileTreeRoot);
        if (Node)
        {
            Node->FileEnd = Filename;
        }
    }
    else if (!AcpiUtStricmp(Filename, AcpiGbl_RootFilename) &&
             !PreviousFilename)
    {
        return;
    }
    Node = CvFilenameExists (Filename, AcpiGbl_FileTreeRoot);
    if (Node && PreviousFilename)
    {
        Node = CvFilenameExists (PreviousFilename, AcpiGbl_FileTreeRoot);
        if (Node && (Node->FileEnd < Filename))
        {
            Node->FileEnd = Filename;
            Node = Node->Parent;
            while (Node)
            {
                if (Node->FileEnd < Filename)
                {
                    Node->FileEnd = Filename;
                }
                Node = Node->Parent;
            }
        }
    }
    else
    {
        Node = AcpiGbl_FileTreeRoot;
        AcpiGbl_FileTreeRoot = AcpiOsAcquireObject (AcpiGbl_FileCache);
        AcpiGbl_FileTreeRoot->Next = Node;
        AcpiGbl_FileTreeRoot->Parent = NULL;
        AcpiGbl_FileTreeRoot->Filename = Filename;
        AcpiGbl_FileTreeRoot->FileStart = Filename;
        AcpiGbl_FileTreeRoot->IncludeWritten = FALSE;
        AcpiGbl_FileTreeRoot->File = fopen(Filename, "w+");
        if (!AcpiGbl_FileTreeRoot->File)
        {
            FlDeleteFile (ASL_FILE_AML_OUTPUT);
            sprintf (MsgBuffer, "\"%s\" - %s", Filename, strerror (errno));
            AslCommonError (ASL_ERROR, ASL_MSG_OPEN, 0, 0, 0, 0,
                NULL, MsgBuffer);
            AslAbort ();
        }
    }
}
static void CvAddToFileTree ( char * Filename , char * PreviousFilename ) { ACPI_FILE_NODE * Node ; if ( ! AcpiUtStricmp ( Filename , AcpiGbl_RootFilename ) && PreviousFilename ) { Node = CvFilenameExists ( PreviousFilename , AcpiGbl_FileTreeRoot ) ; if ( Node ) { Node -> FileEnd = Filename ; } } else if ( ! AcpiUtStricmp ( Filename , AcpiGbl_RootFilename ) && ! PreviousFilename ) { return ; } Node = CvFilenameExists ( Filename , AcpiGbl_FileTreeRoot ) ; if ( Node && PreviousFilename ) { Node = CvFilenameExists ( PreviousFilename , AcpiGbl_FileTreeRoot ) ; if ( Node && ( Node -> FileEnd < Filename ) ) { Node -> FileEnd = Filename ; Node = Node -> Parent ; while ( Node ) { if ( Node -> FileEnd < Filename ) { Node -> FileEnd = Filename ; } Node = Node -> Parent ; } } } else { Node = AcpiGbl_FileTreeRoot ; AcpiGbl_FileTreeRoot = AcpiOsAcquireObject ( AcpiGbl_FileCache ) ; AcpiGbl_FileTreeRoot -> Next = Node ; AcpiGbl_FileTreeRoot -> Parent = NULL ; AcpiGbl_FileTreeRoot -> Filename = Filename ; AcpiGbl_FileTreeRoot -> FileStart = Filename ; AcpiGbl_FileTreeRoot -> IncludeWritten = FALSE ; AcpiGbl_FileTreeRoot -> File = fopen ( Filename , " " ) ; if ( ! AcpiGbl_FileTreeRoot -> File ) { FlDeleteFile ( ASL_FILE_AML_OUTPUT ) ; sprintf ( MsgBuffer , " \" \" " , Filename , strerror ( errno ) ) ; AslCommonError ( ASL_ERROR , ASL_MSG_OPEN , 0 , 0 , 0 , 0 , NULL , MsgBuffer ) ; AslAbort ( ) ; } } }
FUNCTION:    CvAddToFileTree
 PARAMETERS:  Filename          - Address containing the name of the current
                                  filename
              PreviousFilename  - Address containing the name of the previous
                                  filename
FUNCTION : CvAddToFileTree PARAMETERS : Filename - Address containing the name of the current filename PreviousFilename - Address containing the name of the previous filename
/*
             * Set the end point of the PreviousFilename to the address
             * of Filename.
             */ /*
         * Update the end of the previous file and all of their parents'
         * ending addresses. This is done to ensure that parent file
         * ranges extend to the end of their childrens' files.
         */ /*
         * If we can't open the file, we need to abort here before we
         * accidentally write to a NULL file.
         */ /* delete the .xxx file */