doxygen comments added
[libfirm] / ir / adt / pmap.h
index 7470cc4..e204bba 100644 (file)
@@ -1,18 +1,31 @@
 /*
- * Project:     libFIRM
- * File name:   ir/adt/eset.c
- * Purpose:     Datentyp: Vereinfachte Map (hash-map) zum Speichern von
- *              Zeigern/Adressen -> Zeigern/Adressen.
- * Author:      Hubert Schmid
- * Modified by:
- * Created:     09.06.2002
- * CVS-ID:      $Id$
- * Copyright:   (c) 2002 Universit�t Karlsruhe
- * Licence:     This file protected by GPL -  GNU GENERAL PUBLIC LICENSE.
+ * Copyright (C) 1995-2007 University of Karlsruhe.  All right reserved.
+ *
+ * This file is part of libFirm.
+ *
+ * This file may be distributed and/or modified under the terms of the
+ * GNU General Public License version 2 as published by the Free Software
+ * Foundation and appearing in the file LICENSE.GPL included in the
+ * packaging of this file.
+ *
+ * Licensees holding valid libFirm Professional Edition licenses may use
+ * this file in accordance with the libFirm Commercial License.
+ * Agreement provided with the Software.
+ *
+ * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+ * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE.
  */
 
-#ifndef _PMAP_H_
-#define _PMAP_H_
+/**
+ * @file
+ * @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
 
 /**  A map which maps addresses to addresses. */
 typedef struct pmap pmap;
@@ -21,8 +34,8 @@ typedef struct pmap pmap;
  * A key, value pair.
  */
 typedef struct pmap_entry {
-  void *key;    /**< The key. */
-  void *value;  /**< The value. */
+       const void *key;    /**< The key. */
+       void *value;  /**< The value. */
 } pmap_entry;
 
 
@@ -39,16 +52,18 @@ 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, void * key, void * value);
+void pmap_insert(pmap *map, const void * key, void * value);
 
 /** Checks if an entry with key "key" exists. */
-int pmap_contains(pmap *map, void * key);
+int pmap_contains(pmap *map, const void * key);
 
 /** Returns the key, value pair of "key". */
-pmap_entry * pmap_find(pmap *map, void * key);
+pmap_entry * pmap_find(pmap *map, const void * key);
 
 /** Returns the value of "key". */
-void * pmap_get(pmap *map, void * key);
+void * pmap_get(pmap *map, const void * key);
+
+int pmap_count(pmap *map);
 
 /**
  * Returns the first entry of a map if the map is not empty.
@@ -68,4 +83,4 @@ pmap_entry *pmap_next(pmap *);
  */
 void pmap_break(pmap *map);
 
-#endif /* _PMAP_H_ */
+#endif