1/* filterexports.rexx
2 * Write all lines beginning with EXPORTS to the outfile if
3 * the symbol is available
4 * This is used for filtering available exports
5 * Called by ./rexxgd.exe that was just built prior to this step
6 */
7Parse Arg queryfunc infile outfile .
8str = "Call" queryfunc "'func.', 'A'"
9Interpret str
10Call Stream outfile, 'C', 'OPEN WRITE REPLACE'
11Do While( Lines( infile ) > 0 )
12   line = Linein( infile )
13   If Word( line, 1 ) = 'EXPORTS' Then
14      Do
15         Parse Var line . func .
16         If FindFunc( func ) = 0 Then Iterate
17      End
18   Call Lineout outfile, line
19End
20Call Stream outfile, 'C', 'CLOSE'
21Return 0
22
23FindFunc: Procedure Expose func.
24Parse Upper Arg func
25Do i = 1 To func.0
26   If func = func.i Then Return 1
27End
28Return 0
29