swu_result_t

Possible outcomes for an API call

Synopsis:

#include <swu/Common.h>
 
typedef enum {
      SWU_RESULT_SUCCESS,   
      SWU_RESULT_ERROR,   
      SWU_RESULT_EMPTY,   
      SWU_RESULT_DUPLICATE_ENTRY,   
      SWU_RESULT_NOT_FOUND,   
      SWU_RESULT_INVALID_ARGUMENT,   
      SWU_RESULT_OUT_OF_MEMORY,   
      SWU_RESULT_API_NOT_AVAILABLE,   
      SWU_RESULT_UPDATE_TARGET_BUSY,   
      SWU_RESULT_NOT_INITIALIZED,   
      SWU_RESULT_CONDITIONS_NOT_VALID_TO_INSTALL   
} swu_result_t;

Data:

SWU_RESULT_SUCCESS
The operation succeeded.
SWU_RESULT_ERROR
An unknown error ocurred (or the error doesn't fit into the other categories).
SWU_RESULT_EMPTY
The library couldn't find the information needed for the update.
SWU_RESULT_DUPLICATE_ENTRY
A library object with the same identifier values given in the arguments has already been registered.
SWU_RESULT_NOT_FOUND
A library object or callback structure referenced in the arguments couldn't be found (e.g., because an invalid ID was specified).
SWU_RESULT_INVALID_ARGUMENT
One of the arguments is invalid.
SWU_RESULT_OUT_OF_MEMORY
The system ran out of memory.
SWU_RESULT_API_NOT_AVAILABLE
The library doesn't support this operation.
SWU_RESULT_UPDATE_TARGET_BUSY
The target is busy and can't start an update installation or verification.
SWU_RESULT_NOT_INITIALIZED
The library hasn't been initialized yet.
SWU_RESULT_CONDITIONS_NOT_VALID_TO_INSTALL
The target system currently can't perform update installations.

Library:

libswu-core

Use the -l swu-core option with qcc to link against the SWU library. This library is usually included automatically.

Description:

The swu_result_t enumeration defines the codes indicating if an API call succeeded or if not, the reason it failed. Most functions in the SWU library API return an swu_result_t to indicate the success or failure of the call. Typically, the caller simply checks whether the call returned SWU_RESULT_SUCCESS. The failure result codes are useful for logging and for debugging.

The swu_result_to_string() function returns the string representation of an swu_result_t code, which is helpful for logging.