Re: [tuxdroid-user] Daemon to USB connection
Status: Beta
Brought to you by:
ks156
From: neimad <ror...@gm...> - 2007-06-10 06:30:35
|
"David Bourgeois" <da...@ja...> writes: [...] > Finally, I find the file structure quite strange, there's only main.c > in the root folder, then all files are under /libs and all names > start with USBDaemon. I don't want to change this right now but any > idea on what a good structure and naming conventions would be? A few ideas: (1) I'd rename the daemon to "tuxd", to follow conventions in the Unix world (okay, "tuxdaemon" matches "tuxttsdaemon", but maybe that can be changed too ?). This is nitpicking. (2) I'd get rid of the "USBDaemon" prefix. It's long and annoying to type with its mixed upper and lowercase, even with filename completion. Having a prefix is generally a good idea, though: it avoids ending up with files in different directories but with the same name, which eventually leads to troubles. The project is quite small, so we don't have this problem yet. (3) Merge USBDaemon_usb_enum.[ch] and USBDaemon_usb_readWrite.[ch] into tuxd_usb.[ch] (for example). Both these files handle USB and are small enough to be merged. (4) Except for USB, logging, and maybe command_tux and pidfile, there's no point in keeping any of the libs/ source as pseudo libraries. (5) The current "main.c" is an empty shell: the daemon is actually implemented in tcp_server, command_tux and status_table. Hence these files should be moved to the daemon's toplevel directory, and main.c somehow merged with tcp_server. This is a very rough outline, but I think it will lead to a more sensible daemon file structure. Damien |