Commit | Line | Data |
---|---|---|
9bc82bae C |
1 | (* |
2 | * Copyright 2010, INRIA, University of Copenhagen | |
3 | * Julia Lawall, Rene Rydhof Hansen, Gilles Muller, Nicolas Palix | |
4 | * Copyright 2005-2009, Ecole des Mines de Nantes, University of Copenhagen | |
5 | * Yoann Padioleau, Julia Lawall, Rene Rydhof Hansen, Henrik Stuart, Gilles Muller, Nicolas Palix | |
6 | * This file is part of Coccinelle. | |
7 | * | |
8 | * Coccinelle is free software: you can redistribute it and/or modify | |
9 | * it under the terms of the GNU General Public License as published by | |
10 | * the Free Software Foundation, according to version 2 of the License. | |
11 | * | |
12 | * Coccinelle is distributed in the hope that it will be useful, | |
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
15 | * GNU General Public License for more details. | |
16 | * | |
17 | * You should have received a copy of the GNU General Public License | |
18 | * along with Coccinelle. If not, see <http://www.gnu.org/licenses/>. | |
19 | * | |
20 | * The authors reserve the right to distribute this or future versions of | |
21 | * Coccinelle under other licenses. | |
22 | *) | |
23 | ||
24 | ||
c491d8ee C |
25 | (* |
26 | * Copyright 2010, INRIA, University of Copenhagen | |
27 | * Julia Lawall, Rene Rydhof Hansen, Gilles Muller, Nicolas Palix | |
28 | * Copyright 2005-2009, Ecole des Mines de Nantes, University of Copenhagen | |
29 | * Yoann Padioleau, Julia Lawall, Rene Rydhof Hansen, Henrik Stuart, Gilles Muller, Nicolas Palix | |
30 | * This file is part of Coccinelle. | |
31 | * | |
32 | * Coccinelle is free software: you can redistribute it and/or modify | |
33 | * it under the terms of the GNU General Public License as published by | |
34 | * the Free Software Foundation, according to version 2 of the License. | |
35 | * | |
36 | * Coccinelle is distributed in the hope that it will be useful, | |
37 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
38 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
39 | * GNU General Public License for more details. | |
40 | * | |
41 | * You should have received a copy of the GNU General Public License | |
42 | * along with Coccinelle. If not, see <http://www.gnu.org/licenses/>. | |
43 | * | |
44 | * The authors reserve the right to distribute this or future versions of | |
45 | * Coccinelle under other licenses. | |
46 | *) | |
47 | ||
48 | ||
34e49164 C |
49 | open Common |
50 | ||
51 | (* full_engine takes (coccifile, isofile) and cfiles in parameters and | |
52 | * returns a list associating to the input cfiles, and maybe header | |
53 | * files that was also required to be modified, the files containing the | |
54 | * result (in general files in /tmp). | |
b1b2de81 C |
55 | * pre_engine does the compilation of the SmPL code and runs any initially |
56 | * scripts | |
57 | * post_engine runs any finally scripts | |
ae4735db C |
58 | * |
59 | * This function uses memoisation internally, which is useful when | |
b1b2de81 | 60 | * using -dir to not redo twice the same work. So take care! |
34e49164 | 61 | *) |
b1b2de81 C |
62 | type cocci_info |
63 | val pre_engine : (filename * filename) -> cocci_info | |
64 | val full_engine : | |
65 | cocci_info -> filename list -> (filename * filename option) list | |
66 | val post_engine : cocci_info -> unit | |
34e49164 | 67 | |
ae4735db | 68 | (* because of the #include "toto.c" and also because we may associate the |
34e49164 | 69 | * same C file to multiple drivers because they share code, we can |
ae4735db C |
70 | * modify multiple times the same file when use -dir. This check |
71 | * remove duplicates and check that the modification are consistent | |
34e49164 C |
72 | * among the different drivers. |
73 | *) | |
ae4735db | 74 | val check_duplicate_modif : |
34e49164 C |
75 | (filename * filename option) list -> (filename * filename option) list |
76 | ||
77 | (* provides memoization *) | |
78 | val sp_of_file : | |
79 | filename (* coccifile *) -> filename option (* isofile *) -> | |
faf9a90c C |
80 | Ast_cocci.metavar list list * Ast_cocci.rule list * |
81 | Ast_cocci.meta_name list list list * | |
34e49164 | 82 | Ast_cocci.meta_name list list list * |
978fd7e5 C |
83 | (Ast_cocci.meta_name list list list (*used after list*) * |
84 | (*fresh used after list*) | |
85 | Ast_cocci.meta_name list list list * | |
86 | (*fresh used after list seeds*) | |
87 | Ast_cocci.meta_name list list list) * | |
88 | Ast_cocci.meta_name list list list * | |
1eddfd50 C |
89 | (string list option (*grep tokens*) * |
90 | string list option (*glimpse tokens*) * | |
91 | Get_constants2.combine option) | |
34e49164 | 92 | |
c3e37e97 | 93 | val normalize_path : string -> string |