|
libfru 3.0
FRU Manupulation Library
|
Common definitions for the library. More...
Data Structures | |
| struct | fru_errno_t |
Enumerations | |
| enum | fru_error_code_t { FENONE , FEGENERIC , FEINIT , FENONPRINT , FENONHEX , FERANGE , FENOTEVEN , FEAUTOENC , FEBADENC , FE2SMALL , FE2BIG , FESIZE , FEHDRVER , FEHDRCKSUM , FEHDRBADPTR , FEDATACKSUM , FEAREADUP , FEAREANOTSUP , FEAREABADTYPE , FENOTERM , FEBDATE , FENOFIELD , FENOREC , FEBADDATA , FENODATA , FEMRMGMTBAD , FEMRNOTSUP , FEMREND , FEAPOS , FENOTEMPTY , FEAENABLED , FEADISABLED , FELIB , FETOTALCOUNT } |
| Defines the errors specific to libfru. More... | |
| enum | fru_error_source_t { FERR_LOC_INTERNAL , FERR_LOC_CHASSIS , FERR_LOC_BOARD , FERR_LOC_PRODUCT , FERR_LOC_MR , FERR_LOC_GENERAL , FERR_LOC_CALLER , FERR_LOC_COUNT } |
| Describes an offending area, see fru_errno_t. More... | |
Functions | |
| const char * | fru_strerr (fru_errno_t) |
Get a description of the given fru_errno value. | |
| void | fru_clearerr (void) |
| Clear the error status of the library. | |
Variables | |
| fru_error_code_t | fru_errno_t::code |
| fru_error_source_t | fru_errno_t::src |
| The source of error. | |
| int | fru_errno_t::index |
| Index of the offending entity within the source, that is, an index of a field (for FRU_*_INFO) or a record (for FRU_MR). | |
| __thread fru_errno_t | fru_errno |
| Numeric code of an error. | |
Common definitions for the library.
| enum fru_error_code_t |
Defines the errors specific to libfru.
These values are applicable to fru_errno.code
| enum fru_error_source_t |
Describes an offending area, see fru_errno_t.
For area-related values this enum matches fru_area_type_t
| void fru_clearerr | ( | void | ) |
| const char * fru_strerr | ( | fru_errno_t | ) |
Get a description of the given fru_errno value.
Converts a numeric error represented by fru_errno into a string description of the error. If fru_errno is FEGENERIC, this function will call strerror() to obtain the description of the generic libc error.
| NULL | No description found for the given value. |
| fru_error_code_t fru_errno_t::code |
|
extern |
Numeric code of an error.
Similar to errno, this thread-local variable is modified by most functons in libfru in the event of an error.
Call fru_clearerr() before invocation of any libfru function, check for non-zero values of the code field after the invocation.
Unlike errno, this variable contains the information about not just the error, but also about the part of FRU where it was detected. If the fru_errno.code is FEGENERIC, then you need to check errno for the actual error.
Please also see fru_strerr()
| int fru_errno_t::index |
Index of the offending entity within the source, that is, an index of a field (for FRU_*_INFO) or a record (for FRU_MR).
This is (-1) when not applicable. That is, the area indicated by src doesn't have any fields/records, or the error is in the area as a whole, not in some particular field/record, or the error is not in a FRU area at all (e.g., src == FERR_LOC_CALLER).
For info areas this is less than the respective FRU_*_FIELD_COUNT for the standard/mandatory fields, or is FRU_*_FIELD_COUNT + X, where X is the index of the offending custom field.
For FEAREANOTSUP and FEAREABADTYPE this field contains the bad area type (see fru_area_type_t).
| fru_error_source_t fru_errno_t::src |
The source of error.