Attention is currently required from: arehbein, laforge, pespin.
daniel has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmocore/+/35079?usp=email )
Change subject: osmo_io: Remove union in struct osmo_io_ops ......................................................................
Patch Set 4:
(1 comment)
Patchset:
PS4:
It can know based on the OSMO_IO_FD_MODE configured during osmo_iofd_setup(). […]
I disagree that we should put the burden of this onto the user. It's an easy enough mistake to make.
This is complicated by the fact that the only way to set (either initially or later) the callback function is by passing in a struct osmo_iofd_ops *. This means that with the union there is *no* way at all to detect this.
``` osmo_iofd_setup(iofd, ..., mode, &ops); // Checking ops callbacks according to mode doesn't work osmo_iofd_set_ioops(iofd, &ops); // Same as above, we have iofd->mode, but ops is ambiguous ```
Maybe you're thinking of osmo_stream_* where we have *_set_read_cb() etc. functions?