tony@killer.DALLAS.TX.US (Tony Holden) (11/10/88)
Does anyone have a copy of "cb" that will handle Pro*C programs? The problem is that "cb" thinks some of the variables are labels and therefore puts them at the beginning of a line. I just don't want to reinvent the wheel if I don't have to. Thanks Tony Holden tony@killer
leo@philmds.UUCP (Leo de Wit) (11/13/88)
In article <6059@killer.DALLAS.TX.US> tony@killer.DALLAS.TX.US (Tony Holden) writes: | | |Does anyone have a copy of "cb" that will handle Pro*C programs? | |The problem is that "cb" thinks some of the variables are labels and |therefore puts them at the beginning of a line. Little chance you can get hold of such a program (unless of course somebody has been working on it). What you might consider is filtering your .pc files through cb, then cleaning up the mess that is made from the EXEC SQL statements with sed. That's what we ended up doing here. The sed command will look something like: $ sed ' /EXEC[ ]*SQL.*;/{ [...your formatting commands for embedded SQL here...] d } /EXEC[ ]*SQL/,/;/{ [...your formatting commands for embedded SQL here...] d }' yourfile.pc >yourfile.pc.new Note that you have to separate the cases where the ; terminator is on the same (first part) or on a line following the EXEC SQL. This is due to how sed treats ranges (odd I think). The '[...your formatting commands for embedded SQL here...]' lines contain the sed commands to format the Pro*C statement in the way you like it. Hope this helps, Leo.