]> Kevux Git Server - fll/commit
Update: Use typedef on a structure tag to avoid the need for void pointer on the...
authorKevin Day <kevin@kevux.org>
Fri, 9 Feb 2024 05:10:34 +0000 (23:10 -0600)
committerKevin Day <kevin@kevux.org>
Fri, 9 Feb 2024 05:10:34 +0000 (23:10 -0600)
commitd5b89e1e3508e19b293a55fd825c25b5dce30ede
tree203565aeb9a508b193c5e37078d9210df0d9ab6a
parent5c16170c3e04b2b9879d26f380544a1cac21a58a
Update: Use typedef on a structure tag to avoid the need for void pointer on the callback for f_state_t.

Using a typedef on the structure tag allows for having the structure reference itself.
In this case, the callback that is part of the structure accepts its own structure as one of the callback parameters.

I previously did not know that I could do this and opted to use a void pointer to provide this.
With this approach I get more safety, integrity, and less memory usage (for not having to add a variable that is a cast of the void pointer to the f_state_t).
level_0/f_type/c/type/state.h
level_2/fll_program/c/program.c
level_2/fll_program/c/program.h
level_3/controller/c/thread/private-thread_signal.c
level_3/fake/c/main/signal.c
level_3/fake/c/main/signal.h