-/**
- * A Binding is an association between a name (char*) and a value
- * (void*).
- */
-typedef struct {
- char *name;
- void *value;
-} Binding;
-
-/**
- * This callback function should return the hashcode of a key. The
- * hashcode is used for indexing into the backing Vector for
- * finding the an item via its key. The same key must map
- * consistently to the same hashcode while the hashtable contains
- * an item with that key. Different keys map map to the same
- * hashcode, in which case the Vector placement is made at the
- * first empty or hole slot following the hashcode index.
- */
-static unsigned long binding_hashcode(void *this,void *key) {
- char *name = (char *) key;
- unsigned long n = strlen( name );
- return HashVector_hashcode( (unsigned char *) name, n );
-}
-
-/**
- * This callback function should determine whether an item has a
- * given key or not.
- */
-static int binding_haskey(void *this,void *item,void *key) {
- Binding *b = (Binding*) item;
- char *name = (char *) key;
- return strcmp( name, (char*) b->name ) == 0;
-}
-
-/**
- * This callback function should return a (possibly temporary) key
- * of an item. It can be anything (i.e., with or without internal
- * structure) as it is treated as an identifier that other
- * callbacks recognize. It is merely understood as a value in an
- * identity domain.
- */
-static void *binding_itemkey(void *this,void *item) {
- Binding *b = (Binding*) item;
- return b->name;
-}
-
-
-/**
- * This callback function should handle a key obtained from the
- * itemkey callback function, e.g., reclaim temporary allocation.
- */
-static void binding_releasekey(void *this,void *key) {
-}
-
-/**
- * This callback function writes a representation of an item into
- * a character buffer.
- */
-static int binding_tostring(void *this,void *item,char *buffer,int limit) {
- Binding *b = (Binding*) item;
- return snprintf( buffer, limit, "{%s,%p}", b->name, b->value );
-}
-
-/**
- * This is the "item type" for Binding items.
- */
-ItemKeyFun bindingitem = {
- .hashcode = binding_hashcode,
- .haskey = binding_haskey,
- .itemkey = binding_itemkey,
- .releasekey = binding_releasekey,
- .tostring = binding_tostring
-};
-
-BindingTable *BindingTable_create(BindingTable *next) {