f28f2aaf5b20e759cd86a577b441d0262d329a19
[alexxy/gromacs.git] / src / gmxlib / selection / keywords.h
1 /*
2  *
3  *                This source code is part of
4  *
5  *                 G   R   O   M   A   C   S
6  *
7  *          GROningen MAchine for Chemical Simulations
8  *
9  * Written by David van der Spoel, Erik Lindahl, Berk Hess, and others.
10  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
11  * Copyright (c) 2001-2009, The GROMACS development team,
12  * check out http://www.gromacs.org for more information.
13
14  * This program is free software; you can redistribute it and/or
15  * modify it under the terms of the GNU General Public License
16  * as published by the Free Software Foundation; either version 2
17  * of the License, or (at your option) any later version.
18  *
19  * If you want to redistribute modifications, please consider that
20  * scientific software is very special. Version control is crucial -
21  * bugs must be traceable. We will be happy to consider code for
22  * inclusion in the official distribution, but derived work must not
23  * be called official GROMACS. Details are found in the README & COPYING
24  * files - if they are missing, get the official version at www.gromacs.org.
25  *
26  * To help us fund GROMACS development, we humbly ask that you cite
27  * the papers on the package - you can find them in the top README file.
28  *
29  * For more info, check our website at http://www.gromacs.org
30  */
31 /*! \internal \file
32  * \brief Definitions of generic keyword evaluation structures.
33  * 
34  * This is an implementation header: there should be no need to use it outside
35  * this directory.
36  */
37 #ifndef SELECTION_KEYWORDS_H
38 #define SELECTION_KEYWORDS_H
39
40 struct gmx_ana_selmethod_t;
41 struct t_selelem;
42 struct t_selexpr_param;
43
44 /** Selection method data for comparison expression evaluation. */
45 extern struct gmx_ana_selmethod_t sm_compare;
46
47 /** Selection method data for integer keyword evaluation. */
48 extern struct gmx_ana_selmethod_t sm_keyword_int;
49 /** Selection method data for real keyword evaluation. */
50 extern struct gmx_ana_selmethod_t sm_keyword_real;
51 /** Selection method data for string keyword evaluation. */
52 extern struct gmx_ana_selmethod_t sm_keyword_str;
53 /** Selection method data for position keyword evaluation. */
54 extern struct gmx_ana_selmethod_t sm_keyword_pos;
55
56 /** Prints information about a comparison expression. */
57 void
58 _gmx_selelem_print_compare_info(FILE *fp, void *data);
59
60 /** Sets the position type for position keyword evaluation. */
61 void
62 _gmx_selelem_set_kwpos_type(struct t_selelem *sel, const char *type);
63 /** Sets the flags for position keyword evaluation. */
64 void
65 _gmx_selelem_set_kwpos_flags(struct t_selelem *sel, int flags);
66
67 /** Does custom processing for parameters of the \c same selection method. */
68 int
69 _gmx_selelem_custom_init_same(struct gmx_ana_selmethod_t **method,
70                               struct t_selexpr_param *params, void *scanner);
71
72 /** Initializes a selection element for evaluating a keyword in a given group. */
73 int
74 _gmx_sel_init_keyword_evaluator(struct t_selelem **sel,
75                                 struct gmx_ana_selmethod_t *method,
76                                 struct t_selexpr_param *param, void *scanner);
77
78 #endif