/*
Determine what mapping function must be called for the given datspot
record and call it
*/
int processDatSpotRecord(void *dl, xmlDocPtr xml_doc, xmlNodePtr xml_node, lc2if_ *pLC2DB, mapping::Mapper *mapper)
{
int retval;
struct datspot_id_t *id;
int ( *func )( xmlDocPtr xml_doc, xmlNodePtr xml_node,struct datspot_id_t *id, lc2if_ *pLC2DB, mapping::Mapper *mapper );
id = lookup_datspot_id();
if (id == NULL)
{
return -99;
}
// printf("before function call\n");
/* run the function for this unit if we know about it. */
func = (int (*)( xmlDocPtr, xmlNodePtr, struct datspot_id_t *, lc2if_ *, mapping::Mapper *)) dlsym(dl, id->action);
printf("action name is %s\n", id->action);
if (!func)
{
fprintf(stderr,"whoopsie! dlsym failed: %s\n",dlerror());
return -98;
}
return func(xml_doc, xml_node, id, pLC2DB, mapper);
} |