[gmx-developers] Where is do_func() defined in the code (for mdp read in, I think)

Erik Marklund erikm at xray.bmc.uu.se
Fri Oct 31 12:49:29 CET 2008


Hi,

And there is of course etags/ctags that does a decent job finding 
definitions of functions, types etc.

/Erik

Jochen Hub skrev:
> Mark Abraham wrote:
>   
>> Jochen Hub wrote:
>>     
>>> chris.neale at utoronto.ca wrote:
>>>       
>>>> Hello,
>>>>
>>>> I am working my way through the gromacs code with gmx-4.0 and I have a
>>>> question about how information is read in from the .mdp file.
>>>>
>>>> I find do_inputrec() in tpxio.c, which calls do_int() or do_real(), etc.
>>>> These appear to be special cases of do_func() as defined in
>>>> include/gmxfio.h
>>>>
>>>> However, I can not find the meat of do_func() anywhere in the src or
>>>> include directories.
>>>>         
>>> In such cases I usually use:
>>>
>>> find . -name "*.[hc]" -exec grep do_func {} \; -print
>>>       
>> Nice one. I have a perl script for the same purpose...
>>
>> #!/usr/bin/perl -w
>> use strict;
>>
>> my $grepfiles = join(' ', split(/\n/, `ls src/*/*.[ch] include/*.h
>> include/*/*.h src/gmxlib/nonbonded/nb_kernel*/*.[ch]
>> src/gmxlib/nonbonded/*.[ch]`));
>>
>> foreach my $text ( @ARGV ) {
>>     print `grep '$text' $grepfiles`;
>> }
>>
>> Your "find" idiom is more elegant. My approach allows for multiple
>> search keys supplied on the command line. If I ever encountered a more
>> complex need, I'd make it handle regexps too!
>>     
>
> For regextp and multiple keys you may also use egrep (grep -E)
>
> find . -name "*.[hc]" -exec egrep 'do_func|do_other_func' {} \; -print
>
> But hey, aliasing that line is indeed a good idea. For the bash you may
>  place
>
> findsource() { find . -name "*.[hc]" -exec egrep "$@" {} \; -print; }
>
> (which actually defines a function) in the .alias and use
>
> findsource "do_func|gmx_editconf"
>
> Happy source search!
>
> Jochen
>
>
>   
>> Mark
>> _______________________________________________
>> gmx-developers mailing list
>> gmx-developers at gromacs.org
>> http://www.gromacs.org/mailman/listinfo/gmx-developers
>> Please don't post (un)subscribe requests to the list. Use the www
>> interface or send it to gmx-developers-request at gromacs.org.
>>
>> .
>>
>>     
>
>
>   


-- 
-----------------------------------------------
Erik Marklund, PhD student
Laboratory of Molecular Biophysics,
Dept. of Cell and Molecular Biology, Uppsala University.
Husargatan 3, Box 596,    75124 Uppsala, Sweden
phone:    +46 18 471 4537        fax: +46 18 511 755
erikm at xray.bmc.uu.se    http://xray.bmc.uu.se/molbiophys




More information about the gromacs.org_gmx-developers mailing list