2 * Copyright (C) 2009 Dan Carpenter.
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version 2
7 * of the License, or (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, see http://www.gnu.org/copyleft/gpl.txt
20 static struct tracker_list
*ignored
;
22 void add_ignore(int owner
, const char *name
, struct symbol
*sym
)
26 tmp
= malloc(sizeof(*tmp
));
27 tmp
->name
= alloc_string(name
);
30 add_ptr_list(&ignored
, tmp
);
33 int is_ignored(int owner
, const char *name
, struct symbol
*sym
)
37 FOR_EACH_PTR(ignored
, tmp
) {
38 if (tmp
->owner
== owner
&& tmp
->sym
== sym
39 && !strcmp(tmp
->name
, name
))
41 } END_FOR_EACH_PTR(tmp
);
45 static void clear_ignores(void)
49 __free_ptr_list((struct ptr_list
**)&ignored
);
52 void register_smatch_ignore(int id
)
54 add_hook(&clear_ignores
, END_FUNC_HOOK
);