#include "precompiled.h"
#include "lib/sysdep/smbios.h"
#include "lib/bits.h"
#include "lib/alignment.h"
#include "lib/byte_order.h"
#include "lib/module_init.h"
#include <sstream>
Go to the source code of this file.
|
#define | STRUCTURE(name, id) |
|
#define | FIELD(flags, type, name, units) visitor(flags, p.name, #name, units); |
|
#define | STRUCTURE(name, id) template<class Visitor> void VisitFields(name& p, Visitor& visitor) { name##_FIELDS } |
|
#define | STRUCTURE(name, id) case id: AddStructure(header, strings, structures.name##_); break; |
|
#define | ENUM(enumerator, VALUE) |
|
#define | ENUMERATION(name, type) |
|
#define | STRUCTURE(name, id) StringizeStructure(#name, structures->name##_, ss); |
|
#define ENUM |
( |
|
enumerator, |
|
|
|
VALUE |
|
) |
| |
Value:if(field.value == VALUE) \
return #enumerator;\
{\
allowFlags = false;\
string.clear();\
}\
if(allowFlags && (field.value & (VALUE)))\
{\
if(!string.empty())\
string += "|";\
string += #enumerator;\
}
Definition at line 478 of file smbios.cpp.
#define ENUMERATION |
( |
|
name, |
|
|
|
type |
|
) |
| |
Value:template<>\
std::string StringFromEnum<name>(name field)\
{\
std::string string;\
bool allowFlags = true;\
name##_ENUMERATORS\
\
if(string.empty() && field != 0)\
{\
std::stringstream ss;\
ss << "(unknown " << #name << " " << field.value << ")";\
return ss.str();\
}\
return string;\
}
Definition at line 492 of file smbios.cpp.
#define FIELD |
( |
|
flags, |
|
|
|
type, |
|
|
|
name, |
|
|
|
units |
|
) |
| visitor(flags, p.name, #name, units); |
#define STRUCTURE |
( |
|
name, |
|
|
|
id |
|
) |
| |
Value:
{\
}
#define SAFE_FREE(p)
free memory ensuing from malloc and set the pointer to zero (thus making double-frees safe / a no-op)...
static Structures structures
Definition at line 146 of file smbios.cpp.
#define STRUCTURE |
( |
|
name, |
|
|
|
id |
|
) |
| template<class Visitor> void VisitFields(name& p, Visitor& visitor) { name##_FIELDS } |
#define STRUCTURE |
( |
|
name, |
|
|
|
id |
|
) |
| case id: AddStructure(header, strings, structures.name##_); break; |
#define STRUCTURE |
( |
|
name, |
|
|
|
id |
|
) |
| StringizeStructure(#name, structures->name##_, ss); |