On 8/18/07, Dr.Ruud <[EMAIL PROTECTED]> wrote:
> [EMAIL PROTECTED] schreef:
>
> > I have multiple C/C++ files which I need to go manually and find out
> > specific function call. I want to check 2nd parameter of this
> > function
> > (Function_To_Look_For) and get value of it and store it in local file
>
> I would use (not Perl but) the preprocessor for that.
snip

I don't mean to be rude, but how?  As far as I know the C preprocessor
just takes C files and follows #directives (#define, #include, #ifdef,
etc).  It can't be used to search the C code for calls to a function
and return the second argument to that function.  You might be able to
do something like this

cpp file_to_look_at.c -DFunction_To_Look_For="***this is the func***"

to make it easier to find instances of the function, but I don't think
it makes it significantly easier.  Now, if you had said use cbrowser
(or cscope, which cbrowser is built on) I would been with you, but for
the fact that the poster said he was using C++ and I remember those
tools as being ANSI C only (they are probably ISO C only now).  That
said, there are many tools on the market that will help you analyze
your C/C++ code for refactoring purposes.  A quick Google search for
"c call tree" should bring up a bunch, but the question was "can Perl
do it", and I think the answer is yes, at least as easily as any other
language can.

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to