A lot of bug fixes and improvments
This commit is contained in:
@ -7,9 +7,6 @@ int cw_out_generic_with_index(struct cw_ElemHandler * eh,
|
||||
struct cw_ElemHandlerParams * params, uint8_t * dst)
|
||||
|
||||
{
|
||||
char key[CW_CFG_MAX_KEY_LEN];
|
||||
int idx;
|
||||
cw_Val_t * result, search;
|
||||
int len,start;
|
||||
uint8_t * ob;
|
||||
struct cw_Cfg_entry *e;
|
||||
@ -18,7 +15,6 @@ int cw_out_generic_with_index(struct cw_ElemHandler * eh,
|
||||
int i,l;
|
||||
|
||||
|
||||
idx = 0;
|
||||
ob = dst;
|
||||
|
||||
cw_cfg_iter_init(params->cfg_list[0], &cfi, eh->key);
|
||||
@ -42,31 +38,5 @@ int cw_out_generic_with_index(struct cw_ElemHandler * eh,
|
||||
|
||||
return ob-dst;
|
||||
|
||||
stop();
|
||||
return 0;
|
||||
|
||||
|
||||
|
||||
do {
|
||||
sprintf(key,"%s.%d",eh->key,idx);
|
||||
search.key=key;
|
||||
result = mavl_get_first(params->cfg,&search);
|
||||
if (result==NULL)
|
||||
break;
|
||||
if (strncmp(result->key,key,strlen(key))!=0)
|
||||
break;
|
||||
|
||||
start = params->msgset->header_len(eh);
|
||||
len = cw_put_byte(ob+start,idx);
|
||||
|
||||
len += result->type->put(result,ob+start+len);
|
||||
|
||||
ob += params->msgset->write_header(eh,ob,len);
|
||||
|
||||
idx++;
|
||||
|
||||
}while(1);
|
||||
|
||||
return ob-dst;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user