Enerccio / ewlc

Wayland compositor library - extended
MIT License
20 stars 3 forks source link

Improvements to FreeBSD tty code. #69

Open WLCIssuesBot opened 7 years ago

WLCIssuesBot commented 7 years ago

Issue by johalun Saturday Sep 03, 2016 at 18:41 GMT Originally opened as https://github.com/Cloudef/wlc/pull/194



johalun included the following code: https://github.com/Cloudef/wlc/pull/194/commits

WLCIssuesBot commented 7 years ago

Comment by Cloudef Monday Sep 05, 2016 at 19:13 GMT


There seems to be quite lots of indent / space changes, can you fix those before I check further.

WLCIssuesBot commented 7 years ago

Comment by johalun Monday Sep 05, 2016 at 19:26 GMT


Ah you're right.. I thought it was tabs that had been converted to spaces automatically but I see that indent is changed. Will fix it!

WLCIssuesBot commented 7 years ago

Comment by johalun Monday Sep 05, 2016 at 19:52 GMT


We end up with#ifdefs all over the place.. Maybe cleanest to put in separate files?

WLCIssuesBot commented 7 years ago

Comment by Cloudef Monday Sep 05, 2016 at 20:36 GMT


You could separate the parts that are different into functions into own files, provide tty_backend struct that contains the function prototypes. Have something like wlc_tty_backend_init(&backend); at begin of wlc_tty_init, the implementation that gets called for wlc_tty_backend_init would depend on platform (linux or bsd), by telling cmake which .c file to compile. tty.h would contain the prototype for wlc_tty_backend_init, but implementation would be in the platform specific file.

If that makes sense. Above is also really easy to modify so that tty backends could be loaded from .so's (plugins), but I don't think we ever need that. (Or at least I hope there doesn't exist multiple tty apis on single platform)