Hi Luiz, On Wed, 2019-08-07 at 14:18 +0300, Luiz Augusto von Dentz wrote: > Hi Inga, > > On Wed, Aug 7, 2019 at 9:47 AM Inga Stotland > wrote: > > This adds the functionality of bt_shell that uses ell > > mainloop. > > " > > + > > +static void quit_on_timeout(struct l_timeout *timeout, void > > *user_data) > > +{ > > + l_main_quit(); > > +} > > + > > +bool bt_shell_attach(int fd) > > +{ > > + struct l_io *io; > > + > > + /* TODO: Allow more than one input? */ > > + if (data.input) > > + return false; > > + > > + io = l_io_new(fd); > > + > > + if (!data.mode) > > + l_io_set_read_handler(io, input_read, NULL, NULL); > > + > > + l_io_set_disconnect_handler(io, io_hup, NULL, NULL); > > There is an io abstraction to implement this, afaik most of the > things > here are just copy+paste of shell.c just with a different mainloop > and > IO while the io.h and mainloop.h are exactly to abstract these so I > wonder why you took this alternative. > True. Much easier to add ell-based mainloop.c, same effect and lightweight. Regards, Inga