first commit - moved from local dev to git
This commit is contained in:
30
tools/sboot-03/src/sets.c
Normal file
30
tools/sboot-03/src/sets.c
Normal file
@@ -0,0 +1,30 @@
|
||||
#include <tos.h>
|
||||
#include <vdi.h>
|
||||
#include <time.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include "sets.h"
|
||||
#include "ezxml/ezxml.h"
|
||||
|
||||
extern ezxml_t ezxmlh;
|
||||
|
||||
ezxml_t get_set_by_pos( short pos )
|
||||
{
|
||||
ezxml_t lset, res;
|
||||
char * tpos;
|
||||
|
||||
res = NULL;
|
||||
|
||||
for( lset = ezxml_child(ezxmlh, "set"); lset; lset = lset->next){
|
||||
tpos = (char*)ezxml_attr(lset, "pos");
|
||||
if( tpos != NULL ) {
|
||||
if( ((short)atoi(tpos)) == pos ) {
|
||||
res = lset;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return( res );
|
||||
}
|
||||
Reference in New Issue
Block a user