util.m 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. Utils : module {
  2. PATH : con "/dis/acme/util.dis";
  3. stderr : ref Sys->FD;
  4. Arg : adt {
  5. arg0 : string;
  6. av : list of string;
  7. p : string;
  8. };
  9. PNPROC, PNGROUP : con iota;
  10. init : fn(mods : ref Dat->Mods);
  11. arginit : fn(av : list of string) : ref Arg;
  12. argopt : fn(p : ref Arg) : int;
  13. argf : fn(p : ref Arg) : string;
  14. min : fn(a : int, b : int) : int;
  15. max : fn(a : int, b : int) : int;
  16. abs : fn(x : int) : int;
  17. error : fn(s : string);
  18. warning : fn(md : ref Dat->Mntdir, t : string);
  19. debuginit : fn();
  20. debug : fn(s : string);
  21. memdebug : fn(s : string);
  22. postnote : fn(t : int, this : int, pid : int, note : string) : int;
  23. exec: fn(c: string, args : list of string);
  24. getuser : fn() : string;
  25. gethome : fn(user : string) : string;
  26. access : fn(s : string) : int;
  27. isalnum : fn(c : int) : int;
  28. savemouse : fn(w : ref Windowm->Window);
  29. restoremouse : fn(w : ref Windowm->Window);
  30. clearmouse : fn();
  31. rgetc : fn(r : string, n : int) : int;
  32. tgetc : fn(t : ref Textm->Text, n : int) : int;
  33. reverse : fn(l : list of string) : list of string;
  34. stralloc : fn(n : int) : ref Dat->Astring;
  35. strfree :fn(s : ref Dat->Astring);
  36. strchr : fn(s : string, c : int) : int;
  37. strrchr: fn(s : string, c : int) : int;
  38. strncmp : fn(s, t : string, n : int) : int;
  39. getenv : fn(s : string) : string;
  40. setenv : fn(s, t : string);
  41. stob : fn(s : string, n : int) : array of byte;
  42. btos : fn(b : array of byte, s : ref Dat->Astring);
  43. findbl : fn(s : string, n : int) : (string, int);
  44. skipbl : fn(s : string, n : int) : (string, int);
  45. newwindow : fn(t : ref Textm->Text) : ref Windowm->Window;
  46. getexc: fn(): string;
  47. readexc : fn() : (int, string, string);
  48. };