/* * read a #pragma file generated by fd2pragma and add tagcall lines for * functions which end with an "A". * */ parse arg filename . lineCount = 0 if open(fh, filename, 'r') then do do until eof(fh) lineCount = lineCount + 1 lines.lineCount = readln(fh) if (left(lines.lineCount, 7) = '#pragma') then do parse var lines.lineCount . type base func offset args . if type = 'libcall' then do if (right(func, 1) = 'A') then do lineCount = lineCount + 1 lines.lineCount = '#pragma tagcall' base left(func, length(func) - 1) offset args end end end end call close(fh) end else say 'couldn''t open' filename 'for reading.' if lineCount > 0 then if open(fh, filename, 'w') then do i = 1 to lineCount if lines.i ~= '' then call writeln(fh, lines.i) end else say 'couldn''t open' filename 'for writing.'