nckernel  0.1
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
object.h
Go to the documentation of this file.
1 
10 struct object;
11 
12 struct object_ops {
13  struct object *(*link)(struct object *object);
14  int (*copy)(struct object *src, struct object *dest);
16  int (*destroy)(struct object *obj);
17  int (*create)(struct object *obj, void *data);
18 };
19 
20 struct object {
21  int refcnt;
22  struct object_ops ops;
23 };
24 
31 extern int object_init(struct object *object, struct object_ops *ops);
32 
39 extern int object_create(struct object *object, void *data);
40 
46 extern int object_destroy(struct object *object);
47 
54 extern int object_copy(struct object *dest, struct object *src);
55 
62 extern struct object *object_link(struct object *object);
63 
64 #define object_get(ptr, type, member) \
65  container_of(ptr, type, member)
66 
67 /* @} End of a file */