diff --git a/lithos_c/inc/Lth_callback.h b/lithos_c/inc/Lth_callback.h index c6af274..44bcdcc 100644 --- a/lithos_c/inc/Lth_callback.h +++ b/lithos_c/inc/Lth_callback.h @@ -46,6 +46,11 @@ Lth_X(SIGUPDATE , update, void, struct Lth_Context *, struct Lth_Control *) (name).data[cbIter - 1](__VA_ARGS__); \ } \ while(0) +#define Lth_ControlCall(ctrl, name, ...) \ + Lth_ListForEach(Lth_Control *owner, ctrl->descendants) \ + Lth_Call(owner->cb.name, __VA_ARGS__); \ + \ + Lth_Call(ctrl->cb.name, __VA_ARGS__) //----------------------------------------------------------------------------| diff --git a/lithos_c/inc/Lth_linklist.h b/lithos_c/inc/Lth_linklist.h index 53c3824..f3bc420 100644 --- a/lithos_c/inc/Lth_linklist.h +++ b/lithos_c/inc/Lth_linklist.h @@ -17,6 +17,14 @@ #include +#define Lth_ListForEach(tmpv, lst) \ + for(Lth_LinkList *list = (lst); list; list = list->next) \ + __with(tmpv = list->owner;) +#define Lth_ListFor(tmpv, lst) \ + for(Lth_LinkList *list = (lst); list;) \ + __with(Lth_LinkList *next = list->next, **prev = list->prev; \ + tmpv = list->owner;) + //----------------------------------------------------------------------------| // Type Definitions |