vm_obj rb_map_fold(vm_obj const &, vm_obj const &, vm_obj const &, vm_obj const & m, vm_obj const & a, vm_obj const & fn) { vm_obj r = a; to_map(m).for_each([&](vm_obj const & k, vm_obj const & d) { r = invoke(fn, k, d, r); }); return r; }
static ssize_t map_type_show(struct kobject *kobj, struct attribute *attr, char *buf) { struct uio_map *map = to_map(kobj); struct uio_mem *mem = map->mem; struct map_sysfs_entry *entry; entry = container_of(attr, struct map_sysfs_entry, attr); if (!entry->show) return -EIO; return entry->show(mem, buf); }
static void map_release(struct kobject *kobj) { struct uio_map *map = to_map(kobj); kfree(map); }
vm_obj rb_map_max(vm_obj const &, vm_obj const &, vm_obj const & m) { if (to_map(m).empty()) return mk_vm_none(); else return mk_vm_some(to_map(m).max()); }
vm_obj rb_map_find(vm_obj const &, vm_obj const &, vm_obj const & m, vm_obj const & k) { if (auto d = to_map(m).find(k)) return mk_vm_some(*d); else return mk_vm_none(); }
vm_obj rb_map_contains(vm_obj const &, vm_obj const &, vm_obj const & m, vm_obj const & k) { return mk_vm_bool(to_map(m).contains(k)); }
vm_obj rb_map_erase(vm_obj const &, vm_obj const &, vm_obj const & m, vm_obj const & k) { return to_obj(erase(to_map(m), k)); }
vm_obj rb_map_insert(vm_obj const &, vm_obj const &, vm_obj const & m, vm_obj const & k, vm_obj const & d) { return to_obj(insert(to_map(m), k, d)); }
vm_obj rb_map_size(vm_obj const &, vm_obj const &, vm_obj const & m) { return mk_vm_nat(to_map(m).size()); }