kernel: add initial object manager definitions
This commit is contained in:
46
obj/namespace.c
Normal file
46
obj/namespace.c
Normal file
@@ -0,0 +1,46 @@
|
||||
#include <socks/object.h>
|
||||
#include <socks/printk.h>
|
||||
|
||||
struct object_namespace {
|
||||
object_t *ns_root;
|
||||
};
|
||||
|
||||
static object_type_t ns_type = {
|
||||
.ob_name = "namespace",
|
||||
.ob_size = sizeof(object_namespace_t),
|
||||
};
|
||||
|
||||
static object_namespace_t *global_ns;
|
||||
|
||||
void init_global_namespace(void)
|
||||
{
|
||||
object_type_register(&ns_type);
|
||||
global_ns = object_namespace_create();
|
||||
printk("obj: initialised global namespace");
|
||||
}
|
||||
|
||||
object_namespace_t *global_namespace(void)
|
||||
{
|
||||
return global_ns;
|
||||
}
|
||||
|
||||
object_namespace_t *object_namespace_create(void)
|
||||
{
|
||||
object_t *ns = object_create(&ns_type);
|
||||
return object_data(ns);
|
||||
}
|
||||
|
||||
kern_status_t object_namespace_get_object(object_namespace_t *ns, const char *path, object_t **out)
|
||||
{
|
||||
return KERN_OK;
|
||||
}
|
||||
|
||||
kern_status_t object_publish(object_namespace_t *ns, const char *path, object_t *obj)
|
||||
{
|
||||
return KERN_OK;
|
||||
}
|
||||
|
||||
kern_status_t object_unpublish(object_namespace_t *ns, object_t *obj)
|
||||
{
|
||||
return KERN_OK;
|
||||
}
|
||||
Reference in New Issue
Block a user