libfru 3.0.2.gb79b203
FRU Manupulation Library
|
Definitions related to Internal Use Area. More...
Functions | |
bool | fru_set_internal_binary (fru_t *fru, const void *buffer, size_t size) |
Set internal use area from binary buffer. | |
bool | fru_set_internal_hexstring (fru_t *fru, const void *hexstr) |
Set internal use area from a hex string. | |
bool | fru_delete_internal (fru_t *fru) |
Delete internal use area from FRU structure. | |
Definitions related to Internal Use Area.
bool fru_delete_internal | ( | fru_t * | fru | ) |
Delete internal use area from FRU structure.
Deallocates the internal use area and removes it from the given FRU info structure.
[in] | fru | The decoded FRU information structure to modify. |
true | Success |
false | Failure, sets fru_errno |
bool fru_set_internal_binary | ( | fru_t * | fru, |
const void * | buffer, | ||
size_t | size | ||
) |
Set internal use area from binary buffer.
Converts contents of the provided binary buffer into a hex string and copies them into fru->internal, allocating or reallocating the latter as needed. On success enables the FRU_INTERNAL_USE area. On failure, leaves it and fru->internal as they were.
[in] | fru | The decoded FRU information structure to modify. |
[in] | buffer | Source binary buffer |
[in] | size | Number of bytes in buffer |
true | Success |
false | Failure, fru unmodified, check fru_errno |
bool fru_set_internal_hexstring | ( | fru_t * | fru, |
const void * | hexstr | ||
) |
Set internal use area from a hex string.
Copies contents of the provided hex string into internal use area of the the given FRU info structure. Allocates a new buffer for that, the original buffer may safely be deallocated after the call.
On success will allocate or reallocate internal use area in fru as needed and will enable FRU_INTERNAL_USE area. The area is put at the default position.
On failure will leave fru completely unmodified.
The source string must contain only hex digits and optional delimiters that will be skipped during copying. Supported delimiters are:
Any other symbols will result in a failure.
Example
[in] | fru | The decoded FRU information structure to modify. |
[in] | hexstr | The source hex string |
true | Success |
false | Failure, fru left unmodified, check fru_errno |