home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
cset21v1.zip
/
IBMCPP
/
ICLUIDLL
/
GETOBJS.CMD
< prev
next >
Wrap
OS/2 REXX Batch file
|
1993-09-23
|
2KB
|
76 lines
/* Rexx */
/* GETOBJS.CMD <LIB file>
*
* Extracts all .obj files from <LIB file>
*
* Example:
* GETOBJS DDE4MUIB.LIB - extracts all .obj files and writes
* them to the current directory
*/
/*
* COPYRIGHT:
* Licensed Materials - Property of IBM
* (C) Copyright IBM Corporation 1992, 1993
* All Rights Reserved
* US Government Users Restricted Rights - Use, duplication, or
* disclosure
* restricted by GSA ADP Schedule Contract with IBM Corp.
*/
signal on error
signal on novalue
call RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs'
call SysLoadFuncs
parse arg libFile .
if libFile = '' then do
say "You must supply the name of the Lib file"
exit 1
end /* Do */
rc = stream(libFile, 'c', 'open read')
if rc \= "READY:" then DO
say "Can't open" libFile "for input"
say "Reason:" rc
exit 2
end /* Do */
rc = stream(libFile, 'c', 'close')
tmpFile = SysTempFileName("getobj??.???")
rspFile = SysTempFileName("libresp.???")
rc = stream(rspFile, 'c', 'open write')
if rc \= "READY:" then DO
say "Can't open" rspFile "for output"
say "Reason:" rc
exit 3
end /* Do */
"lib" libFile ","tmpFile";"
rc = lineout(rspFile, libFile)
do while lines(tmpFile)
curLine = linein(tmpFile)
if pos("(OFFSET:0x", curLine) > 0 then do
parse var curLine . ":" objName .
if objName \= "icopyrit" then
rc = lineout(rspFile, "*"objName" &")
end
end /* do */
rc = lineout(rspFile, ";")
rc = stream(rspFile, 'c', 'close')
rc = stream(tmpFile, 'c', 'close')
"lib @"rspFile
rc = SysFileDelete(tmpFile)
rc = SysFileDelete(rspFile)