|
libsmbios_c library
|

Go to the source code of this file.
Macros | |
| #define | smbios_for_each_struct(struct_name) |
| looping helper macro. More... | |
| #define | smbios_for_each_struct_type(struct_name, struct_type) |
| looping helper macro. More... | |
Functions | |
| LIBSMBIOS_C_DLL_SPEC struct smbios_struct * | smbios_get_next_struct (const struct smbios_struct *cur) |
| Function for looping over smbios table structures. More... | |
| LIBSMBIOS_C_DLL_SPEC struct smbios_struct * | smbios_get_next_struct_by_type (const struct smbios_struct *cur, u8 type) |
| Function for looping over smbios table structures by type. More... | |
| LIBSMBIOS_C_DLL_SPEC struct smbios_struct * | smbios_get_next_struct_by_handle (const struct smbios_struct *cur, u16 handle) |
| Function for looping over smbios table structures by handle. More... | |
| LIBSMBIOS_C_DLL_SPEC void | smbios_walk (void(*fn)(const struct smbios_struct *, void *userdata), void *userdata) |
| Call a named function for each smbios structure. More... | |
| LIBSMBIOS_C_DLL_SPEC u8 | smbios_struct_get_type (const struct smbios_struct *) |
| Returns the structure type of a given smbios structure. More... | |
| LIBSMBIOS_C_DLL_SPEC u8 | smbios_struct_get_length (const struct smbios_struct *) |
| Returns the structure length of a given smbios structure. More... | |
| LIBSMBIOS_C_DLL_SPEC u16 | smbios_struct_get_handle (const struct smbios_struct *) |
| Returns the structure handle of a given smbios structure. More... | |
| LIBSMBIOS_C_DLL_SPEC int | smbios_struct_get_data (const struct smbios_struct *s, void *dest, u8 offset, size_t len) |
| Copy data out of the smbios structure. More... | |
| LIBSMBIOS_C_DLL_SPEC const char * | smbios_struct_get_string_from_offset (const struct smbios_struct *s, u8 offset) |
| get string from smbios structure. More... | |
| LIBSMBIOS_C_DLL_SPEC const char * | smbios_struct_get_string_number (const struct smbios_struct *s, u8 which) |
| get string from smbios structure. More... | |
| LIBSMBIOS_C_DLL_SPEC char * | smbios_strerror () |
| Returns string describing the last error condition. More... | |
| #define smbios_for_each_struct | ( | struct_name | ) |
looping helper macro.
This macro makes it easy to loop over each structure in the smbios table
| #define smbios_for_each_struct_type | ( | struct_name, | |
| struct_type | |||
| ) |
looping helper macro.
This macro makes it easy to loop over specific structure types in the smbios table
| LIBSMBIOS_C_DLL_SPEC struct smbios_struct * smbios_get_next_struct | ( | const struct smbios_struct * | cur | ) |
Function for looping over smbios table structures.
Returns a pointer to the next smbios structure. You can cast this structure to a specific smbios structure, or you can use the generic access methods to pull data out of the structure. Returns 0 on end of table.
| cur | pointer to current structure, or 0 to begin at the start of the table. |
| LIBSMBIOS_C_DLL_SPEC struct smbios_struct * smbios_get_next_struct_by_handle | ( | const struct smbios_struct * | cur, |
| u16 | handle | ||
| ) |
Function for looping over smbios table structures by handle.
Returns a pointer to the next smbios structure with a given handle. You can cast this structure to a specific smbios structure, or you can use the generic access methods to pull data out of the structure. Returns 0 on end of table.
| cur | pointer to current structure, or 0 to begin at the start of the table. |
| handle | only return smbios structures matching handle |
| LIBSMBIOS_C_DLL_SPEC struct smbios_struct * smbios_get_next_struct_by_type | ( | const struct smbios_struct * | cur, |
| u8 | type | ||
| ) |
Function for looping over smbios table structures by type.
Returns a pointer to the next smbios structure with a given type. You can cast this structure to a specific smbios structure, or you can use the generic access methods to pull data out of the structure. Returns 0 on end of table.
| cur | pointer to current structure, or 0 to begin at the start of the table. |
| type | only return smbios structures matching type |
| LIBSMBIOS_C_DLL_SPEC char * smbios_strerror | ( | ) |
Returns string describing the last error condition.
Needs to be freed by caller
| LIBSMBIOS_C_DLL_SPEC int smbios_struct_get_data | ( | const struct smbios_struct * | s, |
| void * | dest, | ||
| u8 | offset, | ||
| size_t | len | ||
| ) |
Copy data out of the smbios structure.
Does bounds-checking to ensure that structure overflows do not happen.
| s | pointer to structure to access |
| dest | pointer to user-allocated buffer to fill |
| offset | offset in structure |
| len | length of data to copy into buffer |
| LIBSMBIOS_C_DLL_SPEC u16 smbios_struct_get_handle | ( | const struct smbios_struct * | ) |
Returns the structure handle of a given smbios structure.
| LIBSMBIOS_C_DLL_SPEC u8 smbios_struct_get_length | ( | const struct smbios_struct * | ) |
Returns the structure length of a given smbios structure.
| LIBSMBIOS_C_DLL_SPEC const char * smbios_struct_get_string_from_offset | ( | const struct smbios_struct * | s, |
| u8 | offset | ||
| ) |
get string from smbios structure.
Most smbios structures have specific offsets that contain a string number. This function will look up the offset and retrieve the pointed-to string.
| s | pointer to smbios structure |
| offset | offset containing string pointer |
| LIBSMBIOS_C_DLL_SPEC const char * smbios_struct_get_string_number | ( | const struct smbios_struct * | s, |
| u8 | which | ||
| ) |
get string from smbios structure.
Retrieves string N from the end of a smbios structure.
| s | pointer to smbios structure |
| which | string number to return |
| LIBSMBIOS_C_DLL_SPEC u8 smbios_struct_get_type | ( | const struct smbios_struct * | ) |
Returns the structure type of a given smbios structure.
| LIBSMBIOS_C_DLL_SPEC void smbios_walk | ( | void(*)(const struct smbios_struct *, void *userdata) | fn, |
| void * | userdata | ||
| ) |
Call a named function for each smbios structure.
Calls the given function for each smbios table structure. Passes a pointer to the structure as well as the userdata pointer given.
| fn | pointer to the function to call |
| userdata | opaque pointer that will be passed to the funciton |