PIPS
methods.h
Go to the documentation of this file.
1 /*
2 
3  $Id: methods.h 23065 2016-03-02 09:05:50Z coelho $
4 
5  Copyright 1989-2016 MINES ParisTech
6 
7  This file is part of PIPS.
8 
9  PIPS is free software: you can redistribute it and/or modify it
10  under the terms of the GNU General Public License as published by
11  the Free Software Foundation, either version 3 of the License, or
12  any later version.
13 
14  PIPS is distributed in the hope that it will be useful, but WITHOUT ANY
15  WARRANTY; without even the implied warranty of MERCHANTABILITY or
16  FITNESS FOR A PARTICULAR PURPOSE.
17 
18  See the GNU General Public License for more details.
19 
20  You should have received a copy of the GNU General Public License
21  along with PIPS. If not, see <http://www.gnu.org/licenses/>.
22 
23 */
24 /*
25  * Associated to each resource, the methods to read, write, free or check it.
26  * For some reason the is no significant default, although the gen_* methods
27  * would fit most needs.
28  *
29  * NOTE: this is the unload order...
30  */
31 
32 #define NEWGEN_METHODS \
33  (READER) gen_read, \
34  (WRITER) gen_write, \
35  (FREER) gen_free, \
36  (CHECKER) gen_consistent_p
37 
38 #define NEWGENNOCHECK_METHODS \
39  (READER) gen_read, \
40  (WRITER) gen_write, \
41  (FREER) gen_free, \
42  (CHECKER) gen_true
43 
44 #define DONOTHING_METHODS \
45  no_read, no_write, no_free, (CHECKER) gen_true
46 
47 #define STATEMENT_FUNCTION_METHODS \
48  (READER) pipsdbm_read_statement_function, \
49  (WRITER) pipsdbm_write_statement_function, \
50  (FREER) gen_free, \
51  (CHECKER) pipsdbm_consistent_statement_function
52 
53 #define STATEMENT_MAPPING_METHODS \
54  (READER) pipsdbm_read_statement_mapping, \
55  (WRITER) pipsdbm_write_statement_mapping, \
56  (FREER) pipsdbm_free_statement_mapping, \
57  (CHECKER) pipsdbm_check_statement_mapping
58 
59 #define STATIC_STATEMENT_MAPPING_METHODS \
60  (READER) pipsdbm_read_statement_mapping, \
61  (WRITER) pipsdbm_write_statement_mapping, \
62  (FREER) free_static_control_mapping, \
63  (CHECKER) pipsdbm_check_statement_mapping
64 
65 #define GENFREE_METHODS \
66  no_read, no_write, (FREER) gen_free, (CHECKER) gen_true
67 
68 #define STRING_METHODS \
69  safe_readline, \
70  writeln_string, \
71  (FREER) free, \
72  (CHECKER) gen_true
73 
74 #define DECLARATIONS_METHODS \
75  (READER) declarations_read, \
76  (WRITER) declarations_write, \
77  (FREER) hash_table_free, \
78  (CHECKER) gen_true
79 
80 #define ENTITY_METHODS \
81  (READER) pipsdbm_read_entities, \
82  (WRITER) gen_write_tabulated, \
83  (FREER) pipsdbm_free_entities, \
84  (CHECKER) gen_true
85 
86 #define UNEXPECTED_METHODS \
87  (READER) unexpected, (WRITER) unexpected, \
88  (FREER) unexpected, (CHECKER) unexpected
89 
90 #include "methods-inc.h"
91 
92 
93 // this one MUST be the last one.
94 { NULL, UNEXPECTED_METHODS }
95 
#define UNEXPECTED_METHODS
Definition: methods.h:86