/* Given a source file that's been opened, read the contents into an internal buffer and pre-process it to remove comments. */
STATIC STATUS ProcessFile(SOURCE_FILE *SourceFile)
/* Given a source file that's been opened, read the contents into an internal buffer and pre-process it to remove comments. */
STATIC STATUS ProcessFile(SOURCE_FILE *SourceFile)
{
  fseek (SourceFile->Fptr, 0, SEEK_END);
  SourceFile->FileSize = ftell (SourceFile->Fptr);
  if (mGlobals.VerboseFile) {
    printf ("FileSize = %u (0x%X)\n", (unsigned) SourceFile->FileSize, (unsigned) SourceFile->FileSize);
  }
  fseek (SourceFile->Fptr, 0, SEEK_SET);
  SourceFile->FileBuffer = (CHAR8  *) malloc (SourceFile->FileSize + sizeof (CHAR8 ));
  if (SourceFile->FileBuffer == NULL) {
    Error (NULL, 0, 4001, "Resource: memory cannot be allocated", NULL);
    return STATUS_ERROR;
  }
  fread ((VOID *) SourceFile->FileBuffer, SourceFile->FileSize, 1, SourceFile->Fptr);
  SourceFile->FileBuffer[(SourceFile->FileSize / sizeof (CHAR8 ))] = T_CHAR_NULL;
  PreprocessFile (SourceFile);
  SourceFile->LineNum = 1;
  return STATUS_SUCCESS;
}