57 int32_t (*
write)(
struct object *obj, uint8_t *buf, uint32_t length);
59 int32_t (*
read)(
struct object *obj, uint8_t *buf, uint32_t length);
66 #define objectContainer(p, type, functions) \ 67 ((type *)((uint8_t *)__objectCheckType((p), (functions)) - offsetof(type, obj))) 76 static inline void __objectInit(
struct object *obj,
const struct objectFunctions *functions)
89 #define objectAddRef(p) __objectAddRef(&(p)->obj) 90 static inline struct object *__objectAddRef(
struct object *obj)
97 #define objectRelease(p) __objectRelease(&(p)->obj) 98 static inline void __objectRelease(
struct object *obj)
105 #define objectGetMinHandle(p) __objectGetMinHandle(&(p)->obj) 106 static inline uint32_t __objectGetMinHandle(
struct object *obj)
111 #define objectShutdown(p, a) __objectShutdown(&(p)->obj, a) 112 static inline void __objectShutdown(
struct object *obj, uint32_t
mode)
117 #define objectGetStatus(p, a) __objectGetStatus(&(p)->obj, a) 118 static inline int32_t __objectGetStatus(
struct object *obj, uint32_t
mode)
123 #define objectWait(p, a, b) __objectWait(&(p)->obj, a, b) 124 static inline struct linkedList *__objectWait(
struct object *obj, uint32_t
mode, uint32_t *result)
129 #define objectSignal(p, a) __objectSignal(&(p)->obj, a) 130 static inline void __objectSignal(
struct object *obj, uint32_t result)
135 #define objectWrite(p, a, b) __objectWrite(&(p)->obj, a, b) 136 static inline int32_t __objectWrite(
struct object *obj, uint8_t *buf, uint32_t length)
141 #define objectRead(p, a, b) __objectRead(&(p)->obj, a, b) 142 static inline int32_t __objectRead(
struct object *obj, uint8_t *buf, uint32_t length)
147 #define objectAttachObj(p, a, b, c) __objectAttachObj(&(p)->obj, a, b, c) 148 static inline bool __objectAttachObj(
struct object *obj,
struct object *subObj, uint32_t
mode, uint32_t ident)
153 #define objectDetachObj(p, a) __objectDetachObj(&(p)->obj, a) 154 static inline bool __objectDetachObj(
struct object *obj, uint32_t ident)
159 static inline void queueWakeup(
struct linkedList *queue,
bool all, uint32_t
eax)
161 struct object *obj, *__obj;
164 __objectSignal(obj, eax);
const struct objectFunctions * functions
void(* shutdown)(struct object *obj, uint32_t mode)
int32_t(* read)(struct object *obj, uint8_t *buf, uint32_t length)
bool(* attachObj)(struct object *obj, struct object *subObj, uint32_t mode, uint32_t ident)
int32_t(* write)(struct object *obj, uint8_t *buf, uint32_t length)
int32_t(* getStatus)(struct object *obj, uint32_t mode)
struct linkedList *(* wait)(struct object *obj, uint32_t mode, uint32_t *result)
bool(* detachObj)(struct object *obj, uint32_t ident)
uint32_t(* getMinHandle)(struct object *obj)
void(* destroy)(struct object *obj)
void(* signal)(struct object *obj, uint32_t result)
#define LL_FOR_EACH_SAFE(element, next_element, list, type, field)
Allows to iterate a linkedList similar to a for-loop (safe when deleting elements).