Possible outcomes for an API call
#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;
Use the -l swu-core option with qcc to link against the SWU library. This library is usually included automatically.
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.