Пример #1
0
FILE *
PrOpenIncludeWithPrefix (
    char                    *PrefixDir,
    char                    *Filename)
{
    FILE                    *IncludeFile;
    char                    *Pathname;


    /* Build the full pathname to the file */

    Pathname = FlMergePathnames (PrefixDir, Filename);

    DbgPrint (ASL_PARSE_OUTPUT, PR_PREFIX_ID
        "Include: Opening file - \"%s\"\n",
        Gbl_CurrentLineNumber, Pathname);

    /* Attempt to open the file, push if successful */

    IncludeFile = fopen (Pathname, "r");
    if (!IncludeFile)
    {
        fprintf (stderr, "Could not open include file %s\n", Pathname);
        ACPI_FREE (Pathname);
        return (NULL);
    }

    /* Push the include file on the open input file stack */

    PrPushInputFileStack (IncludeFile, Pathname);
    return (IncludeFile);
}
Пример #2
0
FILE *
PrOpenIncludeWithPrefix (
    char                    *PrefixDir,
    char                    *Filename)
{
    FILE                    *IncludeFile;
    char                    *Pathname;


    /* Build the full pathname to the file */

    Pathname = ACPI_ALLOCATE (strlen (PrefixDir) + strlen (Filename) + 1);

    strcpy (Pathname, PrefixDir);
    strcat (Pathname, Filename);

    DbgPrint (ASL_PARSE_OUTPUT, "\n" PR_PREFIX_ID
        "Opening include file: path %s\n",
        Gbl_CurrentLineNumber, Pathname);

    /* Attempt to open the file, push if successful */

    IncludeFile = fopen (Pathname, "r");
    if (IncludeFile)
    {
        /* Push the include file on the open input file stack */

        PrPushInputFileStack (IncludeFile, Pathname);
        return (IncludeFile);
    }

    ACPI_FREE (Pathname);
    return (NULL);
}