zipsplit.exec 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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, 4/24/98. */
  9. /* */
  10. /***********************************************************************/
  11. Address Command
  12. Parse Arg argstring
  13. Parse Source . . myname .
  14. /* Set output and input character translation so brackets show up */
  15. 'SET OUTPUT AD' 'BA'x
  16. 'SET OUTPUT BD' 'BB'x
  17. 'SET INPUT BA AD'
  18. 'SET INPUT BB BD'
  19. Call CLIB
  20. If rc<>0 Then Do
  21. Say 'The required C runtime libraries don''t appear to be available.'
  22. Say myname 'can not run.'
  23. Exit 12
  24. End
  25. /* Run the command */
  26. myname argstring
  27. Exit rc
  28. /* Contents of the CLIB EXEC, modified for RC checking. */
  29. /* Removed TXTLIB setting. Only LOADLIB needed for execution. */
  30. CLIB:
  31. /***************************************************/
  32. /* SET UP LIBRARIES FOR LE for MVS & VM */
  33. /***************************************************/
  34. Address COMMAND
  35. loadlib ='EDCLINK' /* C/370 runtime */
  36. loadlib ='SCEERUN' /* LE runtime */
  37. theirs=queued() /* old stack contentsM068*/
  38. 'QUERY LOADLIB ( LIFO' /* old setting M068*/
  39. LoadlibList='' /* init list M068*/
  40. rc=0
  41. Do while queued()^=theirs /* all lines from cmdM068*/
  42. Parse upper pull 'LOADLIB' '=' Ltemp /* get one line M068*/
  43. LoadlibList= Ltemp Loadliblist /* was stacked LIFO M068*/
  44. End /*M068*/
  45. If loadlibList='NONE' ,
  46. Then Do
  47. 'GLOBAL LOADLIB' Loadlib /* enforce what we need */
  48. End
  49. Else Do
  50. Do xx=1 to Words(loadlib)
  51. If Find(loadliblist,word(loadlib,xx)) = 0 ,
  52. then loadliblist = loadliblist word(loadlib,xx)
  53. End
  54. 'GLOBAL LOADLIB' loadliblist /* enforce what we need */
  55. End
  56. Return