next up previous
Next: Generated Files Up: Package Storage in the Previous: Import files from a

Advance to the next compilation unit

When the end of the current compilation unit is reached, AnotherCompilationUnit will be invoked to determine whether another compilation unit is available.

The Java file may be present but not readable, in which case CompileType must issue an error report and return without disturbing the source module:

int AnotherCompilationUnit(void)[7]:
{ int fd;
  Binding bind;
  char *name;

  for (bind = DefinitionsOf(FilRootEnv);
       GetIsDone(KeyOf(bind), 0);
       bind = NextDefinition(bind)) ;

  if (bind == NoBinding) return 0;

  ResetIsDone(KeyOf(bind), 1);

  name = StringTable(IdnOf(bind));

  if ((fd = open(name, 0)) == -1) {
    (void)perror(name);
    return 1;
  }

  (void)close(finlBuf());
  initBuf(name, fd);
  AddBreak(name, 1);
#ifdef MONITOR
  _dapto_source_changed(name, 1, LineNum, 1, 1, 1);
#endif
  return 1;
}
This macro is invoked in definition 9.



2008-09-11