[Hamlib-developer] Hamlib backend file structure for large backends
Library to control radio transceivers and receivers
Brought to you by:
n0nb
|
From: Mikael N. <mik...@fa...> - 2025-12-20 17:08:21
|
Hello Hamlib developers! There's been some recent discussion in Hamlib PR #1961 (see https://github.com/Hamlib/Hamlib/pull/1961) about the device backend file structure. Some backend, such as the new Yaesu FTX-1 backend have grown rather complex and with the upcoming addition of Icom network protocol support and full-featured FlexRadio backend (with audio and I/Q data streaming!) are only likely to make the backend sizes larger (these will be part of the ARDC Hamlib improvement project, also announced recently on this mailing list and in the GitHub PRs). Traditionally, most of the backends (for a single device type - or its variants) has been placed in a single source file. However, as these files grow up to several thousand lines long - or possibly even larger, to over 10k lines - it can be argued that managing the source code becomes more difficult. Additionally, splitting backend code into logical parts might make sharing common code across similar backends easier. As potential alternatives to single-file backends, there is already one proposal in the FTX-1 backend PR and I personally added another one. Here are all of the 3 options that have been discussed so far: 1) Traditional, single-file backend - no matter the size of the file 2) The current PR # structure (files split in two directories): main backend files (ftx1.c and ftx1.h) + README are in rigs/yaesu directory and the rest of the files are in rigs/yaesu/ftx1 directory 3) Similar multi-file backend as in PR #1961, but all of the files (including ftx1.c, ftx1.h and README) are placed in a backend-specific subdirectory, e,.g. rigs/yaesu/ftx1. Personally, I'd prefer option 3 - but *only* for multi-file backends. For a single-file backend, we could still use the current convention (of not having a separate subdirectory for the backend). So as a summary, this is a question of adding subdirectory for multi-file backend. And IMO there's definitely no point in starting to convert any of the existing backends - unless changes are being made to them and they grow significantly larger. Since there's already the FTX-1 backend PR under review that would benefit from this discussion, I think everyone would appreciate if we can make a decision reasonably quickly :) Please share your thoughts! 73, Mikael OH3BHX |