[gmx-developers] Where is do_func() defined in the code (for mdp read in, I think)
Tsjerk Wassenaar
tsjerkw at gmail.com
Fri Oct 31 08:58:57 CET 2008
Cool!
So with an alias to save some typing:
alias findcode 'find . -name "*.[hc]" -exec grep \!* {} \; -print'
SRC/gromacs-4.0> findcode do_func
do_func *do_read = do_dummy;
do_func *do_write = do_dummy;
./src/gmxlib/gmxfio.c
typedef bool do_func(void *item,int nitem,int eio,
extern do_func *do_read;
extern do_func *do_write;
./include/gmxfio.h
Tsjerk
On 10/31/08, Mark Abraham <Mark.Abraham at anu.edu.au> 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!
>
> 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.
>
--
Tsjerk A. Wassenaar, Ph.D.
Junior UD (post-doc)
Biomolecular NMR, Bijvoet Center
Utrecht University
Padualaan 8
3584 CH Utrecht
The Netherlands
P: +31-30-2539931
F: +31-30-2537623
More information about the gromacs.org_gmx-developers
mailing list