kopia lustrzana https://github.com/Hamlib/Hamlib
Fixed type mismatches that caused compile warnings.
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2132 7ae35d74-ebe9-4afe-98af-79ac388436b8Hamlib-1.2.6rc1
rodzic
20ec2ce78c
commit
8da3be80dc
100
tests/memload.c
100
tests/memload.c
|
@ -2,7 +2,7 @@
|
||||||
* memload.c - Copyright (C) 2003 Thierry Leconte
|
* memload.c - Copyright (C) 2003 Thierry Leconte
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* $Id: memload.c,v 1.5 2005-01-24 23:04:24 fillods Exp $
|
* $Id: memload.c,v 1.6 2006-10-07 19:56:57 csete Exp $
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or
|
* This program is free software; you can redistribute it and/or
|
||||||
|
@ -60,13 +60,13 @@ int xml_load (RIG *my_rig, const char *infilename)
|
||||||
fprintf(stderr,"get root failed\n");
|
fprintf(stderr,"get root failed\n");
|
||||||
exit(2);
|
exit(2);
|
||||||
}
|
}
|
||||||
if(strcmp(node->name, (const xmlChar *) "hamlib")) {
|
if(strcmp((char *) node->name, "hamlib")) {
|
||||||
fprintf(stderr,"no hamlib tag found\n");
|
fprintf(stderr,"no hamlib tag found\n");
|
||||||
exit(2);
|
exit(2);
|
||||||
}
|
}
|
||||||
for(node=node->xmlChildrenNode;node!=NULL;node=node->next) {
|
for(node=node->xmlChildrenNode;node!=NULL;node=node->next) {
|
||||||
if(xmlNodeIsText(node)) continue;
|
if(xmlNodeIsText(node)) continue;
|
||||||
if(strcmp(node->name, (const xmlChar *) "channels")==0)
|
if(strcmp((char *) node->name, "channels")==0)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if(node==NULL) {
|
if(node==NULL) {
|
||||||
|
@ -113,12 +113,12 @@ int set_chan(RIG *rig, channel_t *chan, xmlNodePtr node)
|
||||||
chan->vfo = RIG_VFO_MEM;
|
chan->vfo = RIG_VFO_MEM;
|
||||||
|
|
||||||
|
|
||||||
prop=xmlGetProp(node,"num");
|
prop=xmlGetProp(node,(unsigned char *) "num");
|
||||||
if(prop==NULL) {
|
if(prop==NULL) {
|
||||||
fprintf(stderr,"no num\n");
|
fprintf(stderr,"no num\n");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
n=chan->channel_num = atoi(prop);
|
n=chan->channel_num = atoi((char *) prop);
|
||||||
|
|
||||||
/* find chanel caps */
|
/* find chanel caps */
|
||||||
for(i=0;i<CHANLSTSIZ ;i++)
|
for(i=0;i<CHANLSTSIZ ;i++)
|
||||||
|
@ -128,68 +128,68 @@ int set_chan(RIG *rig, channel_t *chan, xmlNodePtr node)
|
||||||
fprintf(stderr,"node %d %d\n",n,i);
|
fprintf(stderr,"node %d %d\n",n,i);
|
||||||
|
|
||||||
if (rig->state.chan_list[i].mem_caps.bank_num) {
|
if (rig->state.chan_list[i].mem_caps.bank_num) {
|
||||||
prop=xmlGetProp(node, "bank_num");
|
prop=xmlGetProp(node, (unsigned char *) "bank_num");
|
||||||
if(prop!=NULL)
|
if(prop!=NULL)
|
||||||
chan->bank_num = atoi(prop);
|
chan->bank_num = atoi((char *) prop);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (rig->state.chan_list[i].mem_caps.channel_desc) {
|
if (rig->state.chan_list[i].mem_caps.channel_desc) {
|
||||||
prop=xmlGetProp(node, "channel_desc");
|
prop=xmlGetProp(node, (unsigned char *) "channel_desc");
|
||||||
if(prop!=NULL)
|
if(prop!=NULL)
|
||||||
strncpy(chan->channel_desc,prop,7);
|
strncpy(chan->channel_desc, (char *) prop, 7);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (rig->state.chan_list[i].mem_caps.ant) {
|
if (rig->state.chan_list[i].mem_caps.ant) {
|
||||||
prop=xmlGetProp(node, "ant");
|
prop=xmlGetProp(node, (unsigned char *) "ant");
|
||||||
if(prop!=NULL)
|
if(prop!=NULL)
|
||||||
chan->ant = atoi(prop);
|
chan->ant = atoi((char *) prop);
|
||||||
}
|
}
|
||||||
if (rig->state.chan_list[i].mem_caps.freq) {
|
if (rig->state.chan_list[i].mem_caps.freq) {
|
||||||
prop=xmlGetProp(node, "freq");
|
prop=xmlGetProp(node, (unsigned char *) "freq");
|
||||||
if(prop!=NULL)
|
if(prop!=NULL)
|
||||||
sscanf(prop,"%"SCNfreq,&chan->freq);
|
sscanf((char *) prop,"%"SCNfreq,&chan->freq);
|
||||||
}
|
}
|
||||||
if (rig->state.chan_list[i].mem_caps.mode) {
|
if (rig->state.chan_list[i].mem_caps.mode) {
|
||||||
prop=xmlGetProp(node, "mode");
|
prop=xmlGetProp(node, (unsigned char *) "mode");
|
||||||
if(prop!=NULL)
|
if(prop!=NULL)
|
||||||
chan->mode = rig_parse_mode(prop);
|
chan->mode = rig_parse_mode((char *) prop);
|
||||||
}
|
}
|
||||||
if (rig->state.chan_list[i].mem_caps.width) {
|
if (rig->state.chan_list[i].mem_caps.width) {
|
||||||
prop=xmlGetProp(node, "width");
|
prop=xmlGetProp(node, (unsigned char *) "width");
|
||||||
if(prop!=NULL)
|
if(prop!=NULL)
|
||||||
chan->width = atoi(prop);
|
chan->width = atoi((char *) prop);
|
||||||
}
|
}
|
||||||
if (rig->state.chan_list[i].mem_caps.tx_freq) {
|
if (rig->state.chan_list[i].mem_caps.tx_freq) {
|
||||||
prop=xmlGetProp(node, "tx_freq");
|
prop=xmlGetProp(node, (unsigned char *) "tx_freq");
|
||||||
if(prop!=NULL)
|
if(prop!=NULL)
|
||||||
sscanf(prop,"%"SCNfreq,&chan->tx_freq);
|
sscanf((char *) prop,"%"SCNfreq,&chan->tx_freq);
|
||||||
}
|
}
|
||||||
if (rig->state.chan_list[i].mem_caps.tx_mode) {
|
if (rig->state.chan_list[i].mem_caps.tx_mode) {
|
||||||
prop=xmlGetProp(node, "tx_mode");
|
prop=xmlGetProp(node, (unsigned char *)"tx_mode");
|
||||||
if(prop!=NULL)
|
if(prop!=NULL)
|
||||||
chan->tx_mode = rig_parse_mode(prop);
|
chan->tx_mode = rig_parse_mode((char *) prop);
|
||||||
}
|
}
|
||||||
if (rig->state.chan_list[i].mem_caps.tx_width) {
|
if (rig->state.chan_list[i].mem_caps.tx_width) {
|
||||||
prop=xmlGetProp(node, "tx_width");
|
prop=xmlGetProp(node, (unsigned char *)"tx_width");
|
||||||
if(prop!=NULL)
|
if(prop!=NULL)
|
||||||
chan->tx_width = atoi(prop);
|
chan->tx_width = atoi((char *) prop);
|
||||||
}
|
}
|
||||||
if (rig->state.chan_list[i].mem_caps.split) {
|
if (rig->state.chan_list[i].mem_caps.split) {
|
||||||
chan->split=RIG_SPLIT_OFF;
|
chan->split=RIG_SPLIT_OFF;
|
||||||
prop=xmlGetProp(node, "split");
|
prop=xmlGetProp(node, (unsigned char *)"split");
|
||||||
if(prop!=NULL) {
|
if(prop!=NULL) {
|
||||||
if(strcmp(prop,"on")==0) {
|
if(strcmp((char *) prop,"on")==0) {
|
||||||
chan->split=RIG_SPLIT_ON;
|
chan->split=RIG_SPLIT_ON;
|
||||||
if (rig->state.chan_list[i].mem_caps.tx_vfo) {
|
if (rig->state.chan_list[i].mem_caps.tx_vfo) {
|
||||||
prop=xmlGetProp(node, "tx_vfo");
|
prop=xmlGetProp(node, (unsigned char *)"tx_vfo");
|
||||||
if(prop!=NULL)
|
if(prop!=NULL)
|
||||||
sscanf(prop,"%x",&chan->tx_vfo);
|
sscanf((char *) prop,"%x",&chan->tx_vfo);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (rig->state.chan_list[i].mem_caps.rptr_shift) {
|
if (rig->state.chan_list[i].mem_caps.rptr_shift) {
|
||||||
prop=xmlGetProp(node, "rptr_shift");
|
prop=xmlGetProp(node, (unsigned char *)"rptr_shift");
|
||||||
if(prop)
|
if(prop)
|
||||||
switch(prop[0]) {
|
switch(prop[0]) {
|
||||||
case '=': chan->rptr_shift=RIG_RPT_SHIFT_NONE;
|
case '=': chan->rptr_shift=RIG_RPT_SHIFT_NONE;
|
||||||
|
@ -200,60 +200,60 @@ int set_chan(RIG *rig, channel_t *chan, xmlNodePtr node)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (rig->state.chan_list[i].mem_caps.rptr_offs && chan->rptr_shift!=RIG_RPT_SHIFT_NONE) {
|
if (rig->state.chan_list[i].mem_caps.rptr_offs && chan->rptr_shift!=RIG_RPT_SHIFT_NONE) {
|
||||||
prop=xmlGetProp(node, "rptr_offs");
|
prop=xmlGetProp(node, (unsigned char *)"rptr_offs");
|
||||||
if(prop!=NULL)
|
if(prop!=NULL)
|
||||||
chan->rptr_offs = atoi(prop);
|
chan->rptr_offs = atoi((char *) prop);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (rig->state.chan_list[i].mem_caps.tuning_step) {
|
if (rig->state.chan_list[i].mem_caps.tuning_step) {
|
||||||
prop=xmlGetProp(node, "tuning_step");
|
prop=xmlGetProp(node, (unsigned char *)"tuning_step");
|
||||||
if(prop!=NULL)
|
if(prop!=NULL)
|
||||||
chan->tuning_step = atoi(prop);
|
chan->tuning_step = atoi((char *) prop);
|
||||||
}
|
}
|
||||||
if (rig->state.chan_list[i].mem_caps.rit) {
|
if (rig->state.chan_list[i].mem_caps.rit) {
|
||||||
prop=xmlGetProp(node, "rit");
|
prop=xmlGetProp(node, (unsigned char *)"rit");
|
||||||
if(prop!=NULL)
|
if(prop!=NULL)
|
||||||
chan->rit = atoi(prop);
|
chan->rit = atoi((char *) prop);
|
||||||
}
|
}
|
||||||
if (rig->state.chan_list[i].mem_caps.xit) {
|
if (rig->state.chan_list[i].mem_caps.xit) {
|
||||||
prop=xmlGetProp(node, "xit");
|
prop=xmlGetProp(node, (unsigned char *)"xit");
|
||||||
if(prop!=NULL)
|
if(prop!=NULL)
|
||||||
chan->xit = atoi(prop);
|
chan->xit = atoi((char *) prop);
|
||||||
}
|
}
|
||||||
if (rig->state.chan_list[i].mem_caps.funcs) {
|
if (rig->state.chan_list[i].mem_caps.funcs) {
|
||||||
prop=xmlGetProp(node, "funcs");
|
prop=xmlGetProp(node, (unsigned char *)"funcs");
|
||||||
if(prop!=NULL)
|
if(prop!=NULL)
|
||||||
sscanf(prop,"%lx",&chan->funcs);
|
sscanf((char *) prop,"%lx",&chan->funcs);
|
||||||
}
|
}
|
||||||
if (rig->state.chan_list[i].mem_caps.ctcss_tone) {
|
if (rig->state.chan_list[i].mem_caps.ctcss_tone) {
|
||||||
prop=xmlGetProp(node, "ctcss_tone");
|
prop=xmlGetProp(node, (unsigned char *)"ctcss_tone");
|
||||||
if(prop!=NULL)
|
if(prop!=NULL)
|
||||||
chan->ctcss_tone = atoi(prop);
|
chan->ctcss_tone = atoi((char *) prop);
|
||||||
}
|
}
|
||||||
if (rig->state.chan_list[i].mem_caps.ctcss_sql) {
|
if (rig->state.chan_list[i].mem_caps.ctcss_sql) {
|
||||||
prop=xmlGetProp(node, "ctcss_sql");
|
prop=xmlGetProp(node, (unsigned char *)"ctcss_sql");
|
||||||
if(prop!=NULL)
|
if(prop!=NULL)
|
||||||
chan->ctcss_sql = atoi(prop);
|
chan->ctcss_sql = atoi((char *) prop);
|
||||||
}
|
}
|
||||||
if (rig->state.chan_list[i].mem_caps.dcs_code) {
|
if (rig->state.chan_list[i].mem_caps.dcs_code) {
|
||||||
prop=xmlGetProp(node, "dcs_code");
|
prop=xmlGetProp(node, (unsigned char *)"dcs_code");
|
||||||
if(prop!=NULL)
|
if(prop!=NULL)
|
||||||
chan->dcs_code = atoi(prop);
|
chan->dcs_code = atoi((char *) prop);
|
||||||
}
|
}
|
||||||
if (rig->state.chan_list[i].mem_caps.dcs_sql) {
|
if (rig->state.chan_list[i].mem_caps.dcs_sql) {
|
||||||
prop=xmlGetProp(node, "dcs_sql");
|
prop=xmlGetProp(node, (unsigned char *)"dcs_sql");
|
||||||
if(prop!=NULL)
|
if(prop!=NULL)
|
||||||
chan->dcs_sql = atoi(prop);
|
chan->dcs_sql = atoi((char *) prop);
|
||||||
}
|
}
|
||||||
if (rig->state.chan_list[i].mem_caps.scan_group) {
|
if (rig->state.chan_list[i].mem_caps.scan_group) {
|
||||||
prop=xmlGetProp(node, "scan_group");
|
prop=xmlGetProp(node, (unsigned char *)"scan_group");
|
||||||
if(prop!=NULL)
|
if(prop!=NULL)
|
||||||
chan->scan_group = atoi(prop);
|
chan->scan_group = atoi((char *) prop);
|
||||||
}
|
}
|
||||||
if (rig->state.chan_list[i].mem_caps.flags) {
|
if (rig->state.chan_list[i].mem_caps.flags) {
|
||||||
prop=xmlGetProp(node, "flags");
|
prop=xmlGetProp(node, (unsigned char *)"flags");
|
||||||
if(prop!=NULL)
|
if(prop!=NULL)
|
||||||
sscanf(prop,"%x",&chan->flags);
|
sscanf((char *) prop,"%x",&chan->flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
* memsave.c - Copyright (C) 2003-2005 Thierry Leconte
|
* memsave.c - Copyright (C) 2003-2005 Thierry Leconte
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* $Id: memsave.c,v 1.9 2005-04-20 14:47:04 fillods Exp $
|
* $Id: memsave.c,v 1.10 2006-10-07 19:56:57 csete Exp $
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or
|
* This program is free software; you can redistribute it and/or
|
||||||
|
@ -20,7 +20,6 @@
|
||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
#ifdef HAVE_CONFIG_H
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
#endif
|
#endif
|
||||||
|
@ -48,10 +47,10 @@ int xml_save (RIG *rig, const char *outfilename)
|
||||||
xmlNodePtr root;
|
xmlNodePtr root;
|
||||||
|
|
||||||
/* create xlm Doc */
|
/* create xlm Doc */
|
||||||
Doc=xmlNewDoc("1.0");
|
Doc=xmlNewDoc((unsigned char *) "1.0");
|
||||||
root=xmlNewNode(NULL,"hamlib");
|
root=xmlNewNode(NULL,(unsigned char *) "hamlib");
|
||||||
xmlDocSetRootElement(Doc, root);
|
xmlDocSetRootElement(Doc, root);
|
||||||
root=xmlNewChild(root,NULL,"channels",NULL);
|
root=xmlNewChild(root,NULL,(unsigned char *) "channels",NULL);
|
||||||
|
|
||||||
|
|
||||||
if (rig->caps->clone_combo_get)
|
if (rig->caps->clone_combo_get)
|
||||||
|
@ -87,7 +86,7 @@ int dump_xml_chan(RIG *rig, channel_t **chan_pp, int chan_num, const chan_t *cha
|
||||||
{
|
{
|
||||||
char attrbuf[20];
|
char attrbuf[20];
|
||||||
xmlNodePtr root = arg;
|
xmlNodePtr root = arg;
|
||||||
xmlNodePtr node;
|
xmlNodePtr node = NULL;
|
||||||
|
|
||||||
static channel_t chan;
|
static channel_t chan;
|
||||||
const channel_cap_t *mem_caps = &chan_list->mem_caps;
|
const channel_cap_t *mem_caps = &chan_list->mem_caps;
|
||||||
|
@ -107,126 +106,140 @@ int dump_xml_chan(RIG *rig, channel_t **chan_pp, int chan_num, const chan_t *cha
|
||||||
case RIG_MTYPE_NONE :
|
case RIG_MTYPE_NONE :
|
||||||
return RIG_OK;
|
return RIG_OK;
|
||||||
case RIG_MTYPE_MEM:
|
case RIG_MTYPE_MEM:
|
||||||
node=xmlNewChild(root,NULL,"mem",NULL);
|
node=xmlNewChild(root,NULL,(unsigned char *) "mem",NULL);
|
||||||
break;
|
break;
|
||||||
case RIG_MTYPE_EDGE:
|
case RIG_MTYPE_EDGE:
|
||||||
node=xmlNewChild(root,NULL,"edge",NULL);
|
node=xmlNewChild(root,NULL,(unsigned char *) "edge",NULL);
|
||||||
break;
|
break;
|
||||||
case RIG_MTYPE_CALL:
|
case RIG_MTYPE_CALL:
|
||||||
node=xmlNewChild(root,NULL,"call",NULL);
|
node=xmlNewChild(root,NULL,(unsigned char *) "call",NULL);
|
||||||
break;
|
break;
|
||||||
case RIG_MTYPE_MEMOPAD:
|
case RIG_MTYPE_MEMOPAD:
|
||||||
node=xmlNewChild(root,NULL,"memopad",NULL);
|
node=xmlNewChild(root,NULL,(unsigned char *) "memopad",NULL);
|
||||||
break;
|
break;
|
||||||
case RIG_MTYPE_SAT:
|
case RIG_MTYPE_SAT:
|
||||||
node=xmlNewChild(root,NULL,"sat",NULL);
|
node=xmlNewChild(root,NULL,(unsigned char *) "sat",NULL);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mem_caps->bank_num) {
|
if (mem_caps->bank_num) {
|
||||||
sprintf(attrbuf,"%d",chan.bank_num);
|
sprintf(attrbuf,"%d",chan.bank_num);
|
||||||
xmlNewProp(node, "bank_num", attrbuf);
|
xmlNewProp(node, (unsigned char *) "bank_num", (unsigned char *) attrbuf);
|
||||||
}
|
}
|
||||||
|
|
||||||
sprintf(attrbuf,"%d",chan.channel_num);
|
sprintf(attrbuf,"%d",chan.channel_num);
|
||||||
xmlNewProp(node, "num", attrbuf);
|
xmlNewProp(node, (unsigned char *) "num", (unsigned char *) attrbuf);
|
||||||
|
|
||||||
if (mem_caps->channel_desc && chan.channel_desc[0]!='\0') {
|
if (mem_caps->channel_desc && chan.channel_desc[0]!='\0') {
|
||||||
xmlNewProp(node, "channel_desc", chan.channel_desc);
|
xmlNewProp(node,
|
||||||
|
(unsigned char *) "channel_desc",
|
||||||
|
(unsigned char *) chan.channel_desc);
|
||||||
}
|
}
|
||||||
if (mem_caps->vfo) {
|
if (mem_caps->vfo) {
|
||||||
sprintf(attrbuf,"%d",chan.vfo);
|
sprintf(attrbuf,"%d",chan.vfo);
|
||||||
xmlNewProp(node, "vfo", attrbuf);
|
xmlNewProp(node, (unsigned char *) "vfo", (unsigned char *) attrbuf);
|
||||||
}
|
}
|
||||||
if (mem_caps->ant && chan.ant != RIG_ANT_NONE) {
|
if (mem_caps->ant && chan.ant != RIG_ANT_NONE) {
|
||||||
sprintf(attrbuf,"%d",chan.ant);
|
sprintf(attrbuf,"%d",chan.ant);
|
||||||
xmlNewProp(node, "ant", attrbuf);
|
xmlNewProp(node, (unsigned char *) "ant", (unsigned char *) attrbuf);
|
||||||
}
|
}
|
||||||
if (mem_caps->freq && chan.freq != RIG_FREQ_NONE) {
|
if (mem_caps->freq && chan.freq != RIG_FREQ_NONE) {
|
||||||
sprintf(attrbuf,"%"PRIll,(long long)chan.freq);
|
sprintf(attrbuf,"%"PRIll,(long long)chan.freq);
|
||||||
xmlNewProp(node, "freq", attrbuf);
|
xmlNewProp(node, (unsigned char *) "freq", (unsigned char *) attrbuf);
|
||||||
}
|
}
|
||||||
if (mem_caps->mode && chan.mode != RIG_MODE_NONE) {
|
if (mem_caps->mode && chan.mode != RIG_MODE_NONE) {
|
||||||
xmlNewProp(node, "mode", rig_strrmode(chan.mode));
|
xmlNewProp(node, (unsigned char *) "mode", (unsigned char *) rig_strrmode(chan.mode));
|
||||||
}
|
}
|
||||||
if (mem_caps->width && chan.width != 0) {
|
if (mem_caps->width && chan.width != 0) {
|
||||||
sprintf(attrbuf,"%d",(int)chan.width);
|
sprintf(attrbuf,"%d",(int)chan.width);
|
||||||
xmlNewProp(node, "width", attrbuf);
|
xmlNewProp(node, (unsigned char *) "width", (unsigned char *) attrbuf);
|
||||||
}
|
}
|
||||||
if (mem_caps->tx_freq && chan.tx_freq != RIG_FREQ_NONE) {
|
if (mem_caps->tx_freq && chan.tx_freq != RIG_FREQ_NONE) {
|
||||||
sprintf(attrbuf,"%"PRIll,(long long)chan.tx_freq);
|
sprintf(attrbuf,"%"PRIll,(long long)chan.tx_freq);
|
||||||
xmlNewProp(node, "tx_freq", attrbuf);
|
xmlNewProp(node, (unsigned char *) "tx_freq", (unsigned char *) attrbuf);
|
||||||
}
|
}
|
||||||
if (mem_caps->tx_mode && chan.tx_mode != RIG_MODE_NONE) {
|
if (mem_caps->tx_mode && chan.tx_mode != RIG_MODE_NONE) {
|
||||||
xmlNewProp(node, "tx_mode", rig_strrmode(chan.tx_mode));
|
xmlNewProp(node,
|
||||||
|
(unsigned char *) "tx_mode",
|
||||||
|
(unsigned char *) rig_strrmode(chan.tx_mode));
|
||||||
}
|
}
|
||||||
if (mem_caps->tx_width && chan.tx_width!=0) {
|
if (mem_caps->tx_width && chan.tx_width!=0) {
|
||||||
sprintf(attrbuf,"%d",(int)chan.tx_width);
|
sprintf(attrbuf,"%d",(int)chan.tx_width);
|
||||||
xmlNewProp(node, "tx_width", attrbuf);
|
xmlNewProp(node, (unsigned char *) "tx_width", (unsigned char *) attrbuf);
|
||||||
}
|
}
|
||||||
if (mem_caps->split && chan.split!=RIG_SPLIT_OFF) {
|
if (mem_caps->split && chan.split!=RIG_SPLIT_OFF) {
|
||||||
xmlNewProp(node, "split", "on");
|
xmlNewProp(node, (unsigned char *) "split", (unsigned char *) "on");
|
||||||
if (mem_caps->tx_vfo) {
|
if (mem_caps->tx_vfo) {
|
||||||
sprintf(attrbuf,"%x",chan.tx_vfo);
|
sprintf(attrbuf,"%x",chan.tx_vfo);
|
||||||
xmlNewProp(node, "tx_vfo", attrbuf);
|
xmlNewProp(node,
|
||||||
|
(unsigned char *) "tx_vfo",
|
||||||
|
(unsigned char *) attrbuf);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (mem_caps->rptr_shift && chan.rptr_shift!=RIG_RPT_SHIFT_NONE) {
|
if (mem_caps->rptr_shift && chan.rptr_shift!=RIG_RPT_SHIFT_NONE) {
|
||||||
switch(chan.rptr_shift) {
|
switch(chan.rptr_shift) {
|
||||||
case RIG_RPT_SHIFT_NONE:
|
case RIG_RPT_SHIFT_NONE:
|
||||||
xmlNewProp(node, "rptr_shift", "=");
|
xmlNewProp(node,
|
||||||
|
(unsigned char *) "rptr_shift",
|
||||||
|
(unsigned char *) "=");
|
||||||
break;
|
break;
|
||||||
case RIG_RPT_SHIFT_PLUS:
|
case RIG_RPT_SHIFT_PLUS:
|
||||||
xmlNewProp(node, "rptr_shift", "+");
|
xmlNewProp(node,
|
||||||
|
(unsigned char *) "rptr_shift",
|
||||||
|
(unsigned char *) "+");
|
||||||
break;
|
break;
|
||||||
case RIG_RPT_SHIFT_MINUS:
|
case RIG_RPT_SHIFT_MINUS:
|
||||||
xmlNewProp(node, "rptr_shift", "-");
|
xmlNewProp(node,
|
||||||
|
(unsigned char *) "rptr_shift",
|
||||||
|
(unsigned char *) "-");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (mem_caps->rptr_offs && (int)chan.rptr_offs!=0) {
|
if (mem_caps->rptr_offs && (int)chan.rptr_offs!=0) {
|
||||||
sprintf(attrbuf,"%d",(int)chan.rptr_offs);
|
sprintf(attrbuf,"%d",(int)chan.rptr_offs);
|
||||||
xmlNewProp(node, "rptr_offs", attrbuf);
|
xmlNewProp(node,
|
||||||
|
(unsigned char *) "rptr_offs",
|
||||||
|
(unsigned char *) attrbuf);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (mem_caps->tuning_step && chan.tuning_step !=0) {
|
if (mem_caps->tuning_step && chan.tuning_step !=0) {
|
||||||
sprintf(attrbuf,"%d",(int)chan.tuning_step);
|
sprintf(attrbuf,"%d",(int)chan.tuning_step);
|
||||||
xmlNewProp(node, "tuning_step", attrbuf);
|
xmlNewProp(node, (unsigned char *) "tuning_step", (unsigned char *) attrbuf);
|
||||||
}
|
}
|
||||||
if (mem_caps->rit && chan.rit!=0) {
|
if (mem_caps->rit && chan.rit!=0) {
|
||||||
sprintf(attrbuf,"%d",(int)chan.rit);
|
sprintf(attrbuf,"%d",(int)chan.rit);
|
||||||
xmlNewProp(node, "rit", attrbuf);
|
xmlNewProp(node, (unsigned char *) "rit", (unsigned char *) attrbuf);
|
||||||
}
|
}
|
||||||
if (mem_caps->xit && chan.xit !=0) {
|
if (mem_caps->xit && chan.xit !=0) {
|
||||||
sprintf(attrbuf,"%d",(int)chan.xit);
|
sprintf(attrbuf,"%d",(int)chan.xit);
|
||||||
xmlNewProp(node, "xit", attrbuf);
|
xmlNewProp(node, (unsigned char *) "xit", (unsigned char *) attrbuf);
|
||||||
}
|
}
|
||||||
if (mem_caps->funcs) {
|
if (mem_caps->funcs) {
|
||||||
sprintf(attrbuf,"%llx",(long long)chan.funcs);
|
sprintf(attrbuf,"%llx",(long long)chan.funcs);
|
||||||
xmlNewProp(node, "funcs", attrbuf);
|
xmlNewProp(node, (unsigned char *) "funcs", (unsigned char *) attrbuf);
|
||||||
}
|
}
|
||||||
if (mem_caps->ctcss_tone && chan.ctcss_tone !=0) {
|
if (mem_caps->ctcss_tone && chan.ctcss_tone !=0) {
|
||||||
sprintf(attrbuf,"%d",chan.ctcss_tone);
|
sprintf(attrbuf,"%d",chan.ctcss_tone);
|
||||||
xmlNewProp(node, "ctcss_tone", attrbuf);
|
xmlNewProp(node, (unsigned char *) "ctcss_tone", (unsigned char *) attrbuf);
|
||||||
}
|
}
|
||||||
if (mem_caps->ctcss_sql && chan.ctcss_sql !=0) {
|
if (mem_caps->ctcss_sql && chan.ctcss_sql !=0) {
|
||||||
sprintf(attrbuf,"%d",chan.ctcss_sql);
|
sprintf(attrbuf,"%d",chan.ctcss_sql);
|
||||||
xmlNewProp(node, "ctcss_sql", attrbuf);
|
xmlNewProp(node, (unsigned char *) "ctcss_sql", (unsigned char *) attrbuf);
|
||||||
}
|
}
|
||||||
if (mem_caps->dcs_code && chan.dcs_code !=0) {
|
if (mem_caps->dcs_code && chan.dcs_code !=0) {
|
||||||
sprintf(attrbuf,"%d",chan.dcs_code);
|
sprintf(attrbuf,"%d",chan.dcs_code);
|
||||||
xmlNewProp(node, "dcs_code", attrbuf);
|
xmlNewProp(node, (unsigned char *) "dcs_code", (unsigned char *) attrbuf);
|
||||||
}
|
}
|
||||||
if (mem_caps->dcs_sql && chan.dcs_sql !=0) {
|
if (mem_caps->dcs_sql && chan.dcs_sql !=0) {
|
||||||
sprintf(attrbuf,"%d",chan.dcs_sql);
|
sprintf(attrbuf,"%d",chan.dcs_sql);
|
||||||
xmlNewProp(node, "dcs_sql", attrbuf);
|
xmlNewProp(node, (unsigned char *) "dcs_sql", (unsigned char *) attrbuf);
|
||||||
}
|
}
|
||||||
if (mem_caps->scan_group) {
|
if (mem_caps->scan_group) {
|
||||||
sprintf(attrbuf,"%d",chan.scan_group);
|
sprintf(attrbuf,"%d",chan.scan_group);
|
||||||
xmlNewProp(node, "scan_group", attrbuf);
|
xmlNewProp(node, (unsigned char *) "scan_group", (unsigned char *) attrbuf);
|
||||||
}
|
}
|
||||||
if (mem_caps->flags) {
|
if (mem_caps->flags) {
|
||||||
sprintf(attrbuf,"%x",chan.flags);
|
sprintf(attrbuf,"%x",chan.flags);
|
||||||
xmlNewProp(node, "flags", attrbuf);
|
xmlNewProp(node, (unsigned char *) "flags", (unsigned char *) attrbuf);
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Ładowanie…
Reference in New Issue