/* Given a source file, open the file and parse it */
STATIC STATUS ProcessIncludeFile(SOURCE_FILE *SourceFile, SOURCE_FILE *ParentSourceFile)
/* Given a source file, open the file and parse it */
STATIC STATUS ProcessIncludeFile(SOURCE_FILE *SourceFile, SOURCE_FILE *ParentSourceFile)
{
  STATIC UINTN NestDepth = 0;
  CHAR8               FoundFileName[MAX_PATH];
  STATUS              Status;
  Status = STATUS_SUCCESS;
  NestDepth++;
  if (mGlobals.VerboseFile) {
    fprintf (stdout, "%*cProcessing file '%s'\n", (int)NestDepth * 2, ' ', SourceFile->FileName);
    fprintf (stdout, "Parent source file = '%s'\n", ParentSourceFile->FileName);
  }
  if (NestDepth > MAX_NEST_DEPTH) {
    Error (NULL, 0, 3001, "Not Supported", "%s exceeds max nesting depth (%u)", SourceFile->FileName, (unsigned) NestDepth);
    Status = STATUS_ERROR;
    goto Finish;
  }
  strcpy (FoundFileName, SourceFile->FileName);
  if ((SourceFile->Fptr = fopen (LongFilePath (FoundFileName), "rb")) == NULL) {
    return STATUS_ERROR;
  }
  ProcessFile (SourceFile);
Finish:
  if (SourceFile->Fptr != NULL) {
    fclose (SourceFile->Fptr);
    SourceFile->Fptr = NULL;
  }
  return Status;
}