diff options
author | nima <nima@abc39116-655e-4be6-ad55-d661dc543056> | 2008-07-03 15:59:08 +0000 |
---|---|---|
committer | nima <nima@abc39116-655e-4be6-ad55-d661dc543056> | 2008-07-03 15:59:08 +0000 |
commit | 60eb9d480daa352d7af19ad67e410f384f0e9f74 (patch) | |
tree | 7816a737b025fedbeb1866362d166d2fc16ebb84 /dmidecodemodule.c | |
parent | 831e6bd3e28b85a87f68917bb928b1f3ce7601ce (diff) | |
download | python-dmidecode-60eb9d480daa352d7af19ad67e410f384f0e9f74.tar.gz python-dmidecode-60eb9d480daa352d7af19ad67e410f384f0e9f74.tar.xz python-dmidecode-60eb9d480daa352d7af19ad67e410f384f0e9f74.zip |
Major changes have been implemented, alas, untested, in hope to move towards
a new version of dmi decode where rather than having data just printed to
screen in functions, data is passed around, and some data structure is
constructed, which is then used to construct the Python list/dicitonary
objects.
git-svn-id: svn://svn.autonomy.net.au/python-dmidecode@10 abc39116-655e-4be6-ad55-d661dc543056
Diffstat (limited to 'dmidecodemodule.c')
-rw-r--r-- | dmidecodemodule.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/dmidecodemodule.c b/dmidecodemodule.c index a36b811..36b4b04 100644 --- a/dmidecodemodule.c +++ b/dmidecodemodule.c @@ -1,6 +1,9 @@ #include "dmidecodemodule.h" +#include <mcheck.h> static PyObject* dmidecode_get(PyObject *self, char* section) { + mtrace(); + bzero(buffer, 50000); //Py_Initialize(); @@ -32,7 +35,7 @@ static PyObject* dmidecode_get(PyObject *self, char* section) { opt.flags=0; opt.type = NULL; opt.type=parse_opt_type(opt.type, section); - if(opt.type==NULL) return -1; + if(opt.type==NULL) return NULL; /* First try EFI (ia64, Intel-based Mac) */ efi = address_from_efi(&fp); @@ -50,7 +53,7 @@ static PyObject* dmidecode_get(PyObject *self, char* section) { goto exit_free; } - if(smbios_decode(buf, opt.devmem)) found++; + if(smbios_decode(buf, opt.devmem, NULL)) found++; goto done; @@ -63,10 +66,10 @@ memory_scan: for(fp=0; fp<=0xFFF0; fp+=16) { if(memcmp(buf+fp, "_SM_", 4)==0 && fp<=0xFFE0) { - if(smbios_decode(buf+fp, opt.devmem)) found++; + if(smbios_decode(buf+fp, opt.devmem, NULL)) found++; fp+=16; } else if(memcmp(buf+fp, "_DMI_", 5)==0) { - if(legacy_decode(buf+fp, opt.devmem)) found++; + if(legacy_decode(buf+fp, opt.devmem, NULL)) found++; } } @@ -113,6 +116,7 @@ exit_free: nextLine = strtok(NULL, "\n"); } + muntrace(); return data; } |