X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=include%2Flibfirm%2Fadt%2Fpmap.h;h=dc53aade76eb226896472341c33ef11c2eaa59a1;hb=ea177aefa204d7120fc927563cbe3dcbb67d3470;hp=5e00eacf097c4954e8ab79a46929b152f34800e6;hpb=0498c577127fdb1377a47a8b6e201f804bf6750d;p=libfirm diff --git a/include/libfirm/adt/pmap.h b/include/libfirm/adt/pmap.h index 5e00eacf0..dc53aade7 100644 --- a/include/libfirm/adt/pmap.h +++ b/include/libfirm/adt/pmap.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 1995-2008 University of Karlsruhe. All right reserved. + * Copyright (C) 1995-2011 University of Karlsruhe. All right reserved. * * This file is part of libFirm. * @@ -22,11 +22,14 @@ * @brief Simplified hashnap for pointer->pointer relations * @author Hubert Schmid * @date 09.06.2002 - * @version $Id$ */ #ifndef FIRM_ADT_PMAP_H #define FIRM_ADT_PMAP_H +#include + +#include "../begin.h" + /** A map which maps addresses to addresses. */ typedef struct pmap pmap; @@ -40,40 +43,40 @@ typedef struct pmap_entry { /** Creates a new empty map. */ -pmap *pmap_create(void); +FIRM_API pmap *pmap_create(void); /** Creates a new empty map with an initial number of slots. */ -pmap *pmap_create_ex(int slots); +FIRM_API pmap *pmap_create_ex(size_t slots); /** Deletes a map. */ -void pmap_destroy(pmap *); +FIRM_API void pmap_destroy(pmap *); /** * Inserts a pair (key,value) into the map. If an entry with key * "key" already exists, its "value" is overwritten. */ -void pmap_insert(pmap *map, const void * key, void * value); +FIRM_API void pmap_insert(pmap *map, const void * key, void * value); /** Checks if an entry with key "key" exists. */ -int pmap_contains(pmap *map, const void * key); +FIRM_API int pmap_contains(pmap *map, const void * key); /** Returns the key, value pair of "key". */ -pmap_entry * pmap_find(pmap *map, const void * key); +FIRM_API pmap_entry * pmap_find(pmap *map, const void * key); /** Returns the value of "key". */ -void * pmap_get(pmap *map, const void * key); +FIRM_API void * pmap_get(pmap *map, const void * key); -int pmap_count(pmap *map); +FIRM_API size_t pmap_count(pmap *map); /** * Returns the first entry of a map if the map is not empty. */ -pmap_entry *pmap_first(pmap *map); +FIRM_API pmap_entry *pmap_first(pmap *map); /** * Returns the next entry of a map or NULL if all entries were visited. */ -pmap_entry *pmap_next(pmap *); +FIRM_API pmap_entry *pmap_next(pmap *); #define foreach_pmap(pmap, curr) \ for (curr = pmap_first(pmap); curr; curr = pmap_next(pmap)) @@ -81,6 +84,8 @@ pmap_entry *pmap_next(pmap *); /** Breaks an iteration. * Must be called, if a iteration ends before p_map_next() returns NULL. */ -void pmap_break(pmap *map); +FIRM_API void pmap_break(pmap *map); + +#include "../end.h" #endif