libFirm 1.20
libfirm/adt/pset.h File Reference

optimized version of set for sets containing only pointers (deprecated) More...

#include <stddef.h>
#include "hashptr.h"
#include "../begin.h"
#include "../end.h"

Go to the source code of this file.

Data Structures

struct  pset_entry
 The entry of a pset, representing an element pointer in the set and its meta-information. More...

Defines

#define pset_insert_ptr(set, key)   pset_insert(set, key, hash_ptr(key))
 Inserts into pointer set with default hash function.
#define pset_hinsert_ptr(set, key)   pset_hinsert(set, key, hash_ptr(key))
 Inserts into pointer set with default hash function and return entry.
#define pset_remove_ptr(set, key)   pset_remove(set, key, hash_ptr(key))
 Removes pointer from pointer set with default hash function.
#define pset_find_ptr(set, key)   pset_find(set, key, hash_ptr(key))
 Finds pointer in pointer set with default hash function.
#define pset_new_ptr(slots)   new_pset(pset_default_ptr_cmp, slots)
 Creates new pointer set with default compare function.
#define pset_new_ptr_default()   pset_new_ptr(64)
 Creates new pointer set with default compare function and default size.
#define foreach_pset(pset, type, entry)   for (entry = (type)pset_first(pset); entry; entry = (type)pset_next(pset))
 Iterates oven an pset.

Typedefs

typedef struct pset pset
 The abstract type of a pset (Set of pointers).
typedef int(* pset_cmp_fun )(const void *elt, const void *key)
 The type of a set compare function.

Functions

int pset_default_ptr_cmp (const void *x, const void *y)
 The default comparison function for pointers.
psetnew_pset (pset_cmp_fun func, size_t slots)
 Creates a new pset.
void del_pset (pset *pset)
 Deletes a pset.
size_t pset_count (pset *pset)
 Returns the number of elements in a pset.
void * pset_find (pset *pset, const void *key, unsigned hash)
 Searches an element pointer in a pset.
void * pset_insert (pset *pset, const void *key, unsigned hash)
 Inserts an element pointer into a pset.
pset_entrypset_hinsert (pset *pset, const void *key, unsigned hash)
 Inserts an element pointer into a pset and returns its pset_entry.
void * pset_remove (pset *pset, const void *key, unsigned hash)
 Removes an element from a pset.
void * pset_first (pset *pset)
 Returns the first element of a pset.
void * pset_next (pset *pset)
 Returns the next element of a pset.
void pset_break (pset *pset)
 Breaks the iteration of a set.
void pset_insert_pset_ptr (pset *target, pset *src)
 Inserts all elements of the pointer set src into the set target (union).

Detailed Description

optimized version of set for sets containing only pointers (deprecated)

Author:
Markus Armbruster

Definition in file pset.h.