support for printing more caps

git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@1625 7ae35d74-ebe9-4afe-98af-79ac388436b8
Hamlib-1.2.0
Stéphane Fillod, F8CFE 2003-12-04 23:18:49 +00:00
rodzic 64bef1c299
commit a3191999f9
2 zmienionych plików z 41 dodań i 15 usunięć

Wyświetl plik

@ -3,7 +3,7 @@
* This programs dumps the capabilities of a backend rig.
*
*
* $Id: dumpcaps.c,v 1.40 2003-11-16 17:34:00 fillods Exp $
* $Id: dumpcaps.c,v 1.41 2003-12-04 23:18:49 fillods Exp $
*
*
* This program is free software; you can redistribute it and/or
@ -248,20 +248,19 @@ int dumpcaps (RIG* rig)
rig_ext_parm_foreach(rig, print_ext, NULL);
printf("\n");
#if 0
/* FIXME: use rig->state.vfo_list instead */
printf("VFO list: ");
if (caps->vfo_list!=0) {
if ((caps->vfo_list&RIG_VFO_A)==RIG_VFO_A) printf("VFOA ");
if ((caps->vfo_list&RIG_VFO_B)==RIG_VFO_A) printf("VFOB ");
if ((caps->vfo_list&RIG_VFO_C)==RIG_VFO_A) printf("VFOC ");
printf("\n");
} else {
printf(" none! This backend might be bogus!\n");
}
printf("Number of channels:\t%d\n", caps->chan_qty);
#endif
if (rig->state.vfo_list!=0)
sprintf_vfo(prntbuf, rig->state.vfo_list);
else
strcpy(prntbuf," none! This backend might be bogus!\n");
printf("VFO list: %s\n", prntbuf);
sprintf_vfop(prntbuf, caps->vfo_ops);
printf("VFO Ops: %s\n", prntbuf);
sprintf_scan(prntbuf, caps->scan_ops);
printf("Scan Ops: %s\n", prntbuf);
printf("Number of banks:\t%d\n", caps->bank_qty);
printf("Memory name desc size:\t%d\n", caps->chan_desc_sz);

Wyświetl plik

@ -2,7 +2,7 @@
* Hamlib Interface - sprintf toolbox
* Copyright (c) 2000-2003 by Stephane Fillod and Frank Singleton
*
* $Id: sprintflst.c,v 1.1 2003-11-16 16:58:35 fillods Exp $
* $Id: sprintflst.c,v 1.2 2003-12-04 23:18:49 fillods Exp $
*
* This library is free software; you can redistribute it and/or modify
* it under the terms of the GNU Library General Public License as
@ -39,6 +39,33 @@
#define DUMMY_ALL 0x7ffffffffffffffLL
int sprintf_vfo(char *str, vfo_t vfo)
{
int i, len=0;
const char *sv;
*str = '\0';
if (vfo == RIG_VFO_NONE)
return 0;
sv = strvfo(vfo & RIG_VFO_CURR);
if (sv && sv[0]) len += sprintf(str+len, "%s ", sv);
sv = strvfo(vfo & RIG_VFO_MEM);
if (sv && sv[0]) len += sprintf(str+len, "%s ", sv);
sv = strvfo(vfo & RIG_VFO_VFO);
if (sv && sv[0]) len += sprintf(str+len, "%s ", sv);
sv = strvfo(vfo & RIG_VFO_MAIN);
if (sv && sv[0]) len += sprintf(str+len, "%s ", sv);
sv = strvfo(vfo & RIG_VFO_SUB);
if (sv && sv[0]) len += sprintf(str+len, "%s ", sv);
for (i=0; i<16; i++) {
sv = strvfo(vfo & RIG_VFO_N(i));
if (sv && sv[0]) len += sprintf(str+len, "%s ", sv);
}
return len;
}
int sprintf_mode(char *str, rmode_t mode)
{
int i, len=0;