diff options
author | David Sommerseth <davids@redhat.com> | 2009-06-09 16:48:15 +0200 |
---|---|---|
committer | David Sommerseth <davids@redhat.com> | 2009-06-09 16:48:15 +0200 |
commit | bfbac44bd8c0fcddcdcfade6a15313560c9cc6eb (patch) | |
tree | 23aa1bd8c8012429c00bf4f0f2210bf5d2a98675 /src/dmidecode.c | |
parent | 4b22254e56bfdbec884a7f1cf634e340eff813c5 (diff) | |
download | python-dmidecode-bfbac44bd8c0fcddcdcfade6a15313560c9cc6eb.tar.gz python-dmidecode-bfbac44bd8c0fcddcdcfade6a15313560c9cc6eb.tar.xz python-dmidecode-bfbac44bd8c0fcddcdcfade6a15313560c9cc6eb.zip |
Big rewrite again, simplified the usage of opt->type
Instead of building up an u8 array with 255 cells where we only use one
cell at the time now, just pass the type id value as an int the whole way
through.
Diffstat (limited to 'src/dmidecode.c')
-rw-r--r-- | src/dmidecode.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/dmidecode.c b/src/dmidecode.c index d55a697..0fca9c9 100644 --- a/src/dmidecode.c +++ b/src/dmidecode.c @@ -90,6 +90,7 @@ #define EFI_NOT_FOUND (-1) #define EFI_NO_SMBIOS (-2) + /******************************************************************************* ** Type-independant Stuff */ @@ -4950,13 +4951,13 @@ int dump(const char *dumpfile) return ret == 0 ? found : ret; } -static void dmi_table(u8 *type, u32 base, u16 len, u16 num, u16 ver, const char *devmem, xmlNode *xmlnode) +static void dmi_table(int type, u32 base, u16 len, u16 num, u16 ver, const char *devmem, xmlNode *xmlnode) { u8 *buf; u8 *data; int i = 0; - if(type == NULL) { + if( type == -1 ) { xmlNode *info_n = NULL; info_n = dmixml_AddTextChild(xmlnode, "DMIinfo", "%i structures occupying %i bytes", num, len); @@ -5018,7 +5019,7 @@ static void dmi_table(u8 *type, u32 base, u16 len, u16 num, u16 ver, const char next += 2; xmlNode *handle_n = NULL; - if( type == NULL || type[h.type] ) { // FIXME: Is this check correct? + if( h.type == type ) { if(next - buf <= len) { /* TODO: ... * if(opt->flags & FLAG_DUMP) { @@ -5106,7 +5107,7 @@ xmlNode *smbios_decode_get_version(u8 * buf, const char *devmem) return data_n; } -int smbios_decode(u8 *type, u8 *buf, const char *devmem, xmlNode *xmlnode) +int smbios_decode(int type, u8 *buf, const char *devmem, xmlNode *xmlnode) { int check = _smbios_decode_check(buf); @@ -5161,7 +5162,7 @@ xmlNode *legacy_decode_get_version(u8 * buf, const char *devmem) return data_n; } -int legacy_decode(u8 *type, u8 *buf, const char *devmem, xmlNode *xmlnode) +int legacy_decode(int type, u8 *buf, const char *devmem, xmlNode *xmlnode) { int check = _legacy_decode_check(buf); |