home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / OL.LZH / IDOL.LZH / VMS.ICN < prev    next >
Text File  |  1991-07-18  |  2KB  |  79 lines

  1. #
  2. # @(#)vms.icn    1.6 5/5/90
  3. # OS-specific code for VMS Idol
  4. #
  5. global icontopt,cd,md,env,sysok
  6.  
  7. procedure mysystem(s)
  8.   if \loud then write(s)
  9.   return system(s)
  10. end
  11.  
  12. procedure filename(s,ext)
  13.   s[9:0] := ""
  14.   s ||:= \ext
  15.   return s
  16. end
  17. # if the filename s has extension ext then return the filename less the
  18. # extension, otherwise fail.
  19. procedure fileroot(s,ext)
  20.   if s[- *ext : 0] == ext then return s[1 : - *ext]
  21. end
  22. procedure writesublink(s)
  23.   writelink(env||s)
  24. end
  25. procedure envpath(filename)
  26.   return env||filename
  27. end
  28. #
  29. # Installation.
  30. # Uses hierarchical filesystem on some systems (see initialize)
  31. #
  32. procedure install(args)
  33.   write("Installing idol environment in ",env)
  34.   if env ~== "" then mysystem(md||env)
  35.   fout := envopen("i_object.icn","w")
  36.   write(fout,"record idol_object(__state,__methods)")
  37.   close(fout)
  38.   fout := &null
  39.   cdicont(["i_object"])
  40. end
  41. procedure uninstall(args)
  42.   # not implemented yet
  43. end
  44.  
  45. procedure makeexe(args,i)
  46.   exe := args[i]
  47.   if icont(exe) = \sysok then {
  48.       mysystem("del "||exe||".icn")
  49.       if \exec then {
  50.     write("Executing:")
  51.     exe := "iconx "||exe
  52.     every i := exec+1 to *args do exe ||:= " "||args[i]
  53.     mysystem(exe)
  54.       }
  55.   }
  56. end
  57. #
  58. # system-dependent compilation of idolfile.icn
  59. #   (in the idol subdirectory, if there is one)
  60. #
  61. procedure cdicont(idolfiles)
  62.   if comp = -2 then return  # -t --> don't icont at all
  63.   args := " -c"
  64.   rms  := ""
  65.   every ifile := !idolfiles do args ||:= " " || ifile
  66.   every ifile := !idolfiles do rms  ||:= " " || ifile || ".icn"
  67.  
  68.   every ifile := !idolfiles do mysystem("@vms "||ifile||".icn")
  69.   return
  70. end
  71.  
  72. procedure sysinitialize()
  73.     icontopt := " \"-Sr500\" \"-Si1000\" \"-SF30\" \"-Sg500\" "
  74.     cd    := "set default "
  75.     md    := "create/dir "
  76.     env := getenv("IDOLENV") | "[.idolenv]"
  77.     sysok    := 1
  78. end
  79.