whereis.red 714 B

12345678910111213141516171819202122232425262728293031323334
  1. % Scan the *.ins files
  2. % for a special Token
  3. Loadtime Load DIR!-STUFF$
  4. InsList!*:=Vector2List GetCleanDir "<psl.util.ins>*.ins"$
  5. Procedure ShowAllIns();
  6. Begin scalar R,C,OldC;
  7. For each F in InsList!* do
  8. <<C:=OPEN(F,'input);
  9. OldC:=RDS C; R:=READ(); RDS OldC;
  10. Close C;
  11. Print F;
  12. Print R>>;
  13. End;
  14. Procedure LoadAllIns();
  15. Begin scalar R,C,OldC;
  16. For each F in InsList!* do
  17. <<C:=OPEN(F,'input);
  18. OldC:=RDS C; R:=READ(); RDS OldC;
  19. Close C;
  20. For Each x in R do Put(x,'DefinedIn,F);
  21. PrintF(" %r loaded %n",F)>>
  22. End;
  23. Procedure WhereIs X;
  24. Begin scalar y;
  25. if(y:=get(x,'DefinedIn)) then Return y;
  26. if getd x then return "In The Kernel ";
  27. return NIL;
  28. end;