append(map, left, right);
}
-void* pmap_get(void* mapp, void* left)
+void* pmap_findleft(void* mapp, void* left)
{
struct pmap* map = mapp;
int i;
return NULL;
}
+void* pmap_findright(void* mapp, void* right)
+{
+ struct pmap* map = mapp;
+ int i;
+
+ for (i=0; i<map->count; i++)
+ {
+ struct pmap_node* node = &map->item[i];
+ if (node->right == right)
+ return node->left;
+ }
+
+ return NULL;
+}
+
extern void pmap_put(void* map, void* left, void* right);
extern void pmap_add(void* map, void* left, void* right);
-extern void* pmap_get(void* map, void* left);
+extern void* pmap_findleft(void* map, void* left);
+extern void* pmap_findright(void* map, void* right);
#endif