* Copyright: (c) 2002 Universität Karlsruhe
* Licence: This file protected by GPL - GNU GENERAL PUBLIC LICENSE.
*/
-
-
#ifndef _ESET_H_
#define _ESET_H_
-#include <stdbool.h>
-
/**
* "eset" is a set of addresses. The addresses are used for element
* compare and hash calculation.
typedef struct eset eset;
/** Creates a new empty set. */
-eset * eset_create(void);
+eset *eset_create(void);
/**
* Creates a copy of the given set. Did NOT work if NULL is contained in source. */
-eset * eset_copy(eset *source);
+eset *eset_copy(eset *source);
/** Deletes a set. */
void eset_destroy(eset *s);
void eset_insert(eset *s, void *p);
/** Checks, wheater an address is element of a set. */
-bool eset_contains(eset *s, void *p);
+int eset_contains(eset *s, void *p);
/**
* Starts the iteration over a set and returns the first element or NULL
*
* @note: It is NOT possible to add new elements while iterating through a set.
*/
-void * eset_first(eset *s);
+void *eset_first(eset *s);
/**
* Continues iteration through a set and returns the next element or NULL if the
*
* @note: It is NOT possible to add new elements while iterating through a set.
*/
-void * eset_next(eset *s);
+void *eset_next(eset *s);
/** Inserts all elements of source into target (union). Did NOT work if NULL is contained in source. */
-void eset_insert_all(eset * target, eset * source);
+void eset_insert_all(eset *target, eset *source);
#endif /* _ESET_H_ */
}
-bool pmap_contains(pmap *map, void *key) {
+int pmap_contains(pmap *map, void *key) {
return set_find((set *)map, &key, sizeof(pmap_entry), HASH_PTR(key)) != NULL;
}
#ifndef _PMAP_H_
#define _PMAP_H_
-
-#include <stdbool.h>
-
-
/* Map die Adressen auf Adressen abbildet. Der Vergleich und das
* Hashen findet über die Adresse statt. */
void pmap_insert(pmap *, void * key, void * value);
/* Prüft ob ein Eintrag zu "key" exisitiert. */
-bool pmap_contains(pmap *, void * key);
+int pmap_contains(pmap *, void * key);
/* Gibt den Eintrag zu "key" zurück. */
pmap_entry * pmap_find(pmap *, void * key);