From 6b1598c8b98699b115525155b43d19365e79dd08 Mon Sep 17 00:00:00 2001 From: Nima Talebi Date: Sat, 23 May 2009 23:02:46 +1000 Subject: Reimplementing the type() function - WIP --- src/xmlpythonizer.c | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) (limited to 'src/xmlpythonizer.c') diff --git a/src/xmlpythonizer.c b/src/xmlpythonizer.c index f1d755e..ea78b94 100644 --- a/src/xmlpythonizer.c +++ b/src/xmlpythonizer.c @@ -35,6 +35,7 @@ #include #include +#include "util.h" #include "dmixml.h" #include "xmlpythonizer.h" @@ -338,14 +339,22 @@ ptzMAP *dmiMAP_ParseMappingXML(xmlDoc *xmlmap, const char *mapname) { return NULL; } - // Find the section matching our request (mapname) - for( node = node->children->next; node != NULL; node = node->next ) { - if( xmlStrcmp(node->name, (xmlChar *) "Mapping") == 0) { - char *name = dmixml_GetAttrValue(node, "name"); - if( (name != NULL) && (strcmp(name, mapname) == 0) ) { - break; + if(!is_int(mapname)) { + // Find the section matching our request (mapname) + for( node = node->children->next; node != NULL; node = node->next ) { + if( xmlStrcmp(node->name, (xmlChar *) "Mapping") == 0) { + char *name = dmixml_GetAttrValue(node, "name"); + if( (name != NULL) && (strcmp(name, mapname) == 0) ) { + break; + } } } + } else { + //. FIXME + char msg[8194]; + snprintf(msg, 8193, "Not (yet) implemented%c", 0); + PyErr_SetString(PyExc_SystemError, msg); + return NULL; } if( node == NULL ) { -- cgit