diff options
author | Nima Talebi <nima@autonomy.net.au> | 2009-05-23 23:02:46 +1000 |
---|---|---|
committer | Nima Talebi <nima@autonomy.net.au> | 2009-05-23 23:02:46 +1000 |
commit | 6b1598c8b98699b115525155b43d19365e79dd08 (patch) | |
tree | 347a2f697ae3def6297d1c8c5dc25568c56a9393 /src/xmlpythonizer.c | |
parent | 076bcc59efb4cb0cd0dd274d58f3706b2fd3aa13 (diff) | |
download | python-dmidecode-6b1598c8b98699b115525155b43d19365e79dd08.tar.gz python-dmidecode-6b1598c8b98699b115525155b43d19365e79dd08.tar.xz python-dmidecode-6b1598c8b98699b115525155b43d19365e79dd08.zip |
Reimplementing the type() function - WIP
Diffstat (limited to 'src/xmlpythonizer.c')
-rw-r--r-- | src/xmlpythonizer.c | 21 |
1 files changed, 15 insertions, 6 deletions
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 <libxml/tree.h> #include <libxml/xpath.h> +#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 <Mapping> 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 <Mapping> 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 ) { |