home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: Product / Product.zip / sc621_3.zip / src / VMS_NOTES < prev    next >
Internet Message Format  |  1994-03-15  |  4KB

  1. From: ihnp4!gargoyle!oddjob!noao!arizona!naucse!jdc (John Campbell)
  2. To: arizona!noao!oddjob!gargoyle!ihnp4!nsc!nscpdc!rgb
  3. Subject: VMS SC
  4.  
  5. VMS USERS:
  6.  
  7. Bob Bond has been generous enough to give me free rein in adding what I
  8. think is needed to make SC run on VMS.  Any problems with VMS should be
  9. directed to me--they are not Bob's fault.
  10.  
  11. The VMS SC is "SIMPLE" for the most part, except that the arrow keys
  12. (instead of hjkl) will move you around the cells.  The VMS version of SC
  13. will not interact with the Bourne shell (obviously), which means that CRYPT
  14. and EXTERNAL FUNCTIONS will not be available.
  15.  
  16. If you have a 'C' compiler and GNU Bison then you should be able to get
  17. SC running on VMS by following the instructions below.
  18.  
  19. Step 1:  Get all the files
  20.  
  21. I've heard of a few sites that can unpack unix shar files directly on
  22. VMS.  Most people, however, will need access to a unix machine to get
  23. the original distribution unpacked.  At this time you should also build
  24. experres.h and statres.h and perhaps run the man pages off if you need
  25. to port the documentation. To build the two "missing" hearder files:
  26.    sed <gram.y >experres.h -f eres.sed
  27.    sed <gram.y >statres.h -f sres.sed
  28.  
  29. Step 2: Cut out BUILD.COM and GETOPT.C
  30.  
  31. At the end of this file are two other pieces: BUILD.COM and GETOPT.C.  After
  32. you've moved everything to VMS, cut BUILD.COM and GETOPT.C out of here and
  33. put them in the same directory as the rest of the SC distribution.
  34.  
  35. Step 3: Build it
  36.  
  37. Theoretically all you now need to do is @BUILD and SC (as well as PSC)
  38. will be running on VMS.  If you have problems feel free to contact me
  39. at ...!arizona!naucse!jdc  (or even call at 602-523-6259).
  40.  
  41. ---------------------cut here for BUILD.COM--------------------------
  42. $! VMS command file to build SC and PSC (requires bison)
  43. $! SC:
  44. $ bison -d gram.y
  45. $ ren gram_tab.c gram.c
  46. $ cc  /define=("SIMPLE","SIGVOID") sc.c
  47. $ cc  /define=("SIMPLE","SIGVOID") gram.c
  48. $ cc  /define=("SIMPLE","SIGVOID") lex.c
  49. $ cc  /define=("SIMPLE","SIGVOID") interp
  50. $ cc  /define=("SIMPLE","SIGVOID") cmds
  51. $ cc  /define=("SIMPLE","SIGVOID") xmalloc
  52. $ cc  /define=("SIMPLE","SIGVOID") range
  53. $ cc  /define=("SIMPLE","SIGVOID") help
  54. $ link sc.obj,lex.obj,gram.obj,interp.obj,cmds.obj,xmalloc.obj,-
  55.        range.obj,help.obj,sys$library:vaxcrtl.olb/lib
  56. $ !
  57. $ ! Create VMS foreign command symbol to test SC
  58. $ !
  59. $ sc == "$" + f$logical("SYS$DISK") + f$directory() + "SC.EXE"
  60. $!
  61. $! Now PSC
  62. $!
  63. $ cc psc.c
  64. $ cc getopt.c
  65. $ link psc,getopt,sys$library:vaxcrtl.olb/lib
  66. $ !
  67. $ ! Create VMS foreign command symbol to test PSC (Note that
  68. $ ! PSC reads SYS$INPUT and writes to SYS$OUTPUT, so use
  69. $ ! DEFINE/USER to redirect.)
  70. $ !
  71. $ psc == "$" + f$logical("SYS$DISK") + f$directory() + "PSC.EXE"
  72.  
  73. ---------------------cut here for GETOPT.C------------------------
  74. /*
  75.  * getopt - get option letter from argv
  76.  *      This software is in the public domain
  77.  *      Originally written by Henry Spencer at the U. of Toronto
  78.  */
  79.  
  80. #include <stdio.h>
  81. #include <string.h>
  82.  
  83. char    *optarg;        /* Global argument pointer. */
  84. int     optind = 0;     /* Global argv index. */
  85.  
  86. static char     *scan = NULL;   /* Private scan pointer. */
  87.  
  88. /* extern char     *index();  obsolete, used strchr (JDC). */
  89.  
  90. int
  91. getopt(argc, argv, optstring)
  92. int argc;
  93. char *argv[];
  94. char *optstring;
  95. {
  96.         register char c;
  97.         register char *place;
  98.  
  99.         optarg = NULL;
  100.  
  101.         if (scan == NULL || *scan == '\0') {
  102.                 if (optind == 0)
  103.                         optind++;
  104.  
  105.                 if (optind >= argc || argv[optind][0] != '-' || argv[optind][1] == '\0')
  106.                         return(EOF);
  107.                 if (strcmp(argv[optind], "--")==0) {
  108.                         optind++;
  109.                         return(EOF);
  110.                 }
  111.  
  112.                 scan = argv[optind]+1;
  113.                 optind++;
  114.         }
  115.  
  116.         c = *scan++;
  117.         place = strchr(optstring, c);
  118.  
  119.         if (place == NULL || c == ':') {
  120.                 fprintf(stderr, "%s: unknown option -%c\n", argv[0], c);
  121.                 return('?');
  122.         }
  123.  
  124.         place++;
  125.         if (*place == ':') {
  126.                 if (*scan != '\0') {
  127.                         optarg = scan;
  128.                         scan = NULL;
  129.                 } else {
  130.                         optarg = argv[optind];
  131.                         optind++;
  132.                 }
  133.         }
  134.  
  135.         return(c);
  136. }
  137.