PCPROCES.DEF 1.4 KB

123456789101112131415161718192021222324252627282930313233343536
  1. (* ========================================================= *)
  2. (* Preliminary library module for Gardens Point Modula *)
  3. (* ========================================================= *)
  4. FOREIGN DEFINITION MODULE PcProcesses;
  5. IMPORT IMPLEMENTATION FROM "pcprocesses.obj";
  6. FROM Types IMPORT SHORTINT;
  7. FROM SYSTEM IMPORT ADDRESS;
  8. IMPORT BuildArgs;
  9. PROCEDURE Spawns(comPath : ARRAY OF CHAR;
  10. argStrn : ARRAY OF CHAR) : SHORTINT;
  11. (* Spawns another process, and waits for return result *)
  12. (* comPath is an absolute pathname, with extension. *)
  13. (* argStrn is the additional arguments of the command *)
  14. (* Arg-0 of command is comPath, others from argStrn. *)
  15. (* Result is exit code of the spawned process *)
  16. PROCEDURE Spawnv(comPath : ARRAY OF CHAR;
  17. argvBlk : BuildArgs.ArgPtr) : SHORTINT;
  18. (* Spawns another process, and waits for return result *)
  19. (* Discards zero-th argument and concatenates the rest *)
  20. (* to form a standard command string for Spawns. *)
  21. (* Arg-0 of command is comPath, others from argbBlk. *)
  22. (* Result is exit code of the spawned process *)
  23. PROCEDURE System(command : ARRAY OF CHAR) : SHORTINT;
  24. (* Spawns another copy of the command processor as *)
  25. (* specified by the environment variable COMSPEC, this *)
  26. (* executes the command. Returns non-zero on failure *)
  27. PROCEDURE PSP() : ADDRESS;
  28. END PcProcesses.