From: Stephane F. <f4...@fr...> - 2001-04-03 18:28:49
|
Hi, Managing rig numbers in riglist.h with an enum is going to be a mess, if we don't take an action soon. The problem arise each time someone insert a new rig number on top of the list (Yeasu, Icom, etc.), hence shifting the number of latter ones. Hamlib needs unique and stable rig IDs among riglist.h revisions. So I've got the idea of sparse number allocation. I think 8 bits for models within a brand class should cover our future needs. Higher significant bits will then be used to code the brand. Sorry, enums have to be banned in favor of #define. Here's a proposal: #define MAKE_RIG(c,m) (((c)<<8)|(m)) /* class 0 reserved for dummy */ #define RIG_MODEL_DUMMY MAKE_RIG(0,0) /* Yeasu */ #define RIG_BRAND_YEASU 1 #define RIG_MODEL_FT847 MAKE_RIG(RIG_BRAND_YEASU,1) #define RIG_MODEL_FT747 MAKE_RIG(RIG_BRAND_YEASU,2) #define RIG_MODEL_FT1000 MAKE_RIG(RIG_BRAND_YEASU,3) /* etc. */ /* Icom */ #define RIG_BRAND_ICOM 2 #define RIG_MODEL_IC706 MAKE_RIG(RIG_BRAND_ICOM,1) #define RIG_MODEL_IC746 MAKE_RIG(RIG_BRAND_ICOM,2) /* and so on. */ This change won't affect current Hamlib code, however it would make maintenance of riglist.h and derivated utilities some much easier! Comments?? -- Stephane |