home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 9 Archive / 09-Archive.zip / zip22.zip / cmsmvs / zipcloak.exec < prev    next >
Text File  |  1997-08-17  |  4KB  |  94 lines

  1. /***********************************************************************/
  2. /*                                                                     */
  3. /* Front-end EXEC to set up linkage to the C runtime libraries         */
  4. /* before executing a MODULE generated from C code.                    */
  5. /*                                                                     */
  6. /* Copy this file as an EXEC with a filename matching the C MODULE.    */
  7. /*                                                                     */
  8. /* Greg Hartwig (ghartwig@vnet.ibm.com)   7/31/97.                     */
  9. /*                                                                     */
  10. /***********************************************************************/
  11. Address Command
  12. Parse Arg argstring
  13. Parse Source . . myname .
  14.  
  15. /* Set output and input character translation so brackets show up */
  16. 'SET OUTPUT AD' 'BA'x
  17. 'SET OUTPUT BD' 'BB'x
  18. 'SET INPUT  BA   AD'
  19. 'SET INPUT  BB   BD'
  20.  
  21. Call CLIB
  22. If rc<>0 Then Do
  23.    Say 'The required C runtime libraries don''t appear to be available.'
  24.    Say myname 'can not run.'
  25.    Exit 12
  26. End
  27.  
  28. /* Run the command */
  29. myname argstring
  30. Exit rc
  31.  
  32.  
  33.  
  34.  
  35. /* Contents of the CLIB EXEC, modified for RC checking */
  36. CLIB:
  37. /* Rexx ********************************************/
  38. /*                                                 */
  39. /*                     C/370                       */
  40. /*                   Release 2.0                   */
  41. /*                                                 */
  42. /*        5688-040 (C) Copyright IBM Corp. 1989    */
  43. /*                                                 */
  44. /***************************************************/
  45. /* Set up libraries for C/370                      */
  46. /***************************************************/
  47. Address COMMAND
  48.  
  49. Txtlib   ='EDCBASE IBMLIB CMSLIB' /* required txtlibs */
  50. loadlib  ='EDCLINK'               /* required Loadlib              */
  51.  
  52. theirs=queued()                          /* old stack contentsM068*/
  53. 'QUERY TXTLIB ( LIFO'                    /* old setting       M068*/
  54. TxtlibList=''                            /* init list         M068*/
  55. rc=0
  56. Do while queued()^=theirs                /* all lines from cmdM068*/
  57.   Parse upper pull 'TXTLIB' '=' temp     /* get one line      M068*/
  58.   TxtlibList= temp Txtliblist            /* was stacked LIFO  M068*/
  59. End                                                         /*M068*/
  60. If TxtlibList='NONE' ,
  61.  Then Do
  62.   'GLOBAL TXTLIB' Txtlib           /* enforce what we need         */
  63.  End
  64.  Else Do
  65.   Do xx=1 to Words(txtlib)
  66.   If Find(txtliblist,word(txtlib,xx)) = 0 ,
  67.    then txtliblist = txtliblist word(txtlib,xx)
  68.   End
  69.   'GLOBAL TXTLIB' Txtliblist       /* enforce what we need         */
  70.  End
  71. If rc<>0 Then Return
  72.  
  73.  
  74. theirs=queued()                          /* old stack contentsM068*/
  75.  'QUERY LOADLIB ( LIFO'                   /* old setting       M068*/
  76.  LoadlibList=''                           /* init list         M068*/
  77. rc=0
  78.  Do while queued()^=theirs                /* all lines from cmdM068*/
  79.    Parse upper pull 'LOADLIB' '=' Ltemp   /* get one line      M068*/
  80.    LoadlibList= Ltemp Loadliblist         /* was stacked LIFO  M068*/
  81.  End                                                         /*M068*/
  82.  If loadlibList='NONE' ,
  83.  Then Do
  84.   'GLOBAL LOADLIB' Loadlib          /* enforce what we need         */
  85.  End
  86.  Else Do
  87.   Do xx=1 to Words(loadlib)
  88.   If Find(loadliblist,word(loadlib,xx)) = 0 ,
  89.    then loadliblist = loadliblist word(loadlib,xx)
  90.   End
  91.   'GLOBAL LOADLIB' loadliblist       /* enforce what we need         */
  92.  End
  93. Return
  94.