main: rework preprocessor invocation
[cparser] / entitymap_t.h
1 /*
2  * This file is part of cparser.
3  * Copyright (C) 2007-2009 Matthias Braun <matze@braunis.de>
4  *
5  * This program is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU General Public License
7  * as published by the Free Software Foundation; either version 2
8  * of the License, or (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
18  * 02111-1307, USA.
19  */
20 #ifndef ENTITYMAP_T_H
21 #define ENTITYMAP_T_H
22
23 #include <libfirm/firm_types.h>
24 #include "symbol.h"
25
26 typedef struct entitymap_entry_t {
27         symbol_t  *symbol;
28         ir_entity *entity;
29 } entitymap_entry_t;
30
31 #define HashSet          entitymap_t
32 #define ValueType        entitymap_entry_t
33 #define DO_REHASH
34 #include "adt/hashset.h"
35 #undef DO_REHASH
36 #undef HashSetEntry
37 #undef HashSet
38
39 typedef struct entitymap_iterator_t  entitymap_iterator_t;
40 typedef struct entitymap_t           entitymap_t;
41
42 void entitymap_init(entitymap_t *map);
43
44 void entitymap_destroy(entitymap_t *map);
45
46 void entitymap_insert(entitymap_t *map, symbol_t *symbol, ir_entity *entity);
47
48 ir_entity *entitymap_get(const entitymap_t *map, symbol_t *symbol);
49
50 #endif