Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: __LINE__ in proc
In article <6vir15$5uh$1_at_nnrp1.dejanews.com>,
pradeepj_at_delhi.tcs.co.in wrote:
> Hi !
> But the line directives included in generated .c file will not help me.
> Actually I am writing some statement like.
>
> printf("Error at line %d in file %s\n", __LINE__ , __FILE__) ;
>
> in my .pc file.
> Now I want the output should gine line position of this
> statement in proc file not the generated 'c' file.
> Same is the case with filename, it should give
> proc file instead of 'c' file.
>
> thanks,
> Pradeep
>
You will have to preprocess the __LINE__ entries before running Pro*C. Here is a quick little perl script that can do this. It is invoked as:
preline <your_file_name.x >your_file_name.pc
where your_file_name.x has the __LINE__ tokens. This should be easy to put into a make script.
--
Ed Prochak
Magic Interface, Ltd.
440-498-3702
Here's the code to preline:
--------------------------cut here------------------- #!/usr/bin/perl ################## # # preline # ed prochak Oct. 1998 # # This perl script replaces __LINE__
while ( $line = <> )
{
$n++;
$line =~ s/__LINE__/line: $n/g ;
print $line
}
-----------== Posted via Deja News, The Discussion Network ==---------- http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own Received on Fri Oct 09 1998 - 14:18:26 CDT