-\f
-/* The "abstract class". */
-
-/* Functions implementing the addrmap functions for a particular
- implementation. */
-struct addrmap_funcs
-{
- void (*set_empty) (struct addrmap *self,
- CORE_ADDR start, CORE_ADDR end_inclusive,
- void *obj);
- void *(*find) (struct addrmap *self, CORE_ADDR addr);
- struct addrmap *(*create_fixed) (struct addrmap *self,
- struct obstack *obstack);
- void (*relocate) (struct addrmap *self, CORE_ADDR offset);
- int (*foreach) (struct addrmap *self, addrmap_foreach_fn fn);
-};
-
-
-struct addrmap
-{
- const struct addrmap_funcs *funcs;
-};
-
-
-void
-addrmap_set_empty (struct addrmap *map,
- CORE_ADDR start, CORE_ADDR end_inclusive,
- void *obj)
-{
- map->funcs->set_empty (map, start, end_inclusive, obj);
-}
-
-
-void *
-addrmap_find (struct addrmap *map, CORE_ADDR addr)
-{
- return map->funcs->find (map, addr);
-}
-
-
-struct addrmap *
-addrmap_create_fixed (struct addrmap *original, struct obstack *obstack)
-{
- return original->funcs->create_fixed (original, obstack);
-}
-
-
-/* Relocate all the addresses in MAP by OFFSET. (This can be applied
- to either mutable or immutable maps.) */
-void
-addrmap_relocate (struct addrmap *map, CORE_ADDR offset)
-{
- map->funcs->relocate (map, offset);
-}
-
-
-int
-addrmap_foreach (struct addrmap *map, addrmap_foreach_fn fn)
-{
- return map->funcs->foreach (map, fn);
-}