diff options
author | Martin Szulecki | 2014-10-05 16:51:03 +0200 |
---|---|---|
committer | Martin Szulecki | 2014-10-05 16:51:03 +0200 |
commit | 5072dea1373b7c4789a9ea1e65d05ea30acf41ed (patch) | |
tree | 51bdd0584d727080fab86acd28bd4b360b2333bd /include/libimobiledevice/lockdown.h | |
parent | 5552fa0fcc7501d3206fb3d3a64c1d04062ec53b (diff) | |
download | libimobiledevice-5072dea1373b7c4789a9ea1e65d05ea30acf41ed.tar.gz libimobiledevice-5072dea1373b7c4789a9ea1e65d05ea30acf41ed.tar.bz2 |
Convert int16_t macro error types into enum to improve debugging/type-checking
This simple change provides various benefits for developers like compile
time errors, better auto-completition in editors and the ability of a
debugger to show the constant instead of just the raw value.
Thanks to Aaron Burghardt for the proposal.
Diffstat (limited to 'include/libimobiledevice/lockdown.h')
-rw-r--r-- | include/libimobiledevice/lockdown.h | 54 |
1 files changed, 25 insertions, 29 deletions
diff --git a/include/libimobiledevice/lockdown.h b/include/libimobiledevice/lockdown.h index 3a088c1..beb07d3 100644 --- a/include/libimobiledevice/lockdown.h +++ b/include/libimobiledevice/lockdown.h @@ -31,35 +31,31 @@ extern "C" { #include <libimobiledevice/libimobiledevice.h> #include <libimobiledevice/lockdown.h> -/** @name Error Codes */ -/*@{*/ -#define LOCKDOWN_E_SUCCESS 0 -#define LOCKDOWN_E_INVALID_ARG -1 -#define LOCKDOWN_E_INVALID_CONF -2 -#define LOCKDOWN_E_PLIST_ERROR -3 -#define LOCKDOWN_E_PAIRING_FAILED -4 -#define LOCKDOWN_E_SSL_ERROR -5 -#define LOCKDOWN_E_DICT_ERROR -6 -#define LOCKDOWN_E_START_SERVICE_FAILED -7 -#define LOCKDOWN_E_NOT_ENOUGH_DATA -8 -#define LOCKDOWN_E_SET_VALUE_PROHIBITED -9 -#define LOCKDOWN_E_GET_VALUE_PROHIBITED -10 -#define LOCKDOWN_E_REMOVE_VALUE_PROHIBITED -11 -#define LOCKDOWN_E_MUX_ERROR -12 -#define LOCKDOWN_E_ACTIVATION_FAILED -13 -#define LOCKDOWN_E_PASSWORD_PROTECTED -14 -#define LOCKDOWN_E_NO_RUNNING_SESSION -15 -#define LOCKDOWN_E_INVALID_HOST_ID -16 -#define LOCKDOWN_E_INVALID_SERVICE -17 -#define LOCKDOWN_E_INVALID_ACTIVATION_RECORD -18 -#define LOCKDOWN_E_PAIRING_DIALOG_PENDING -20 -#define LOCKDOWN_E_USER_DENIED_PAIRING -21 - -#define LOCKDOWN_E_UNKNOWN_ERROR -256 -/*@}*/ - -/** Represents an error code. */ -typedef int16_t lockdownd_error_t; +/** Error Codes */ +typedef enum { + LOCKDOWN_E_SUCCESS = 0, + LOCKDOWN_E_INVALID_ARG = -1, + LOCKDOWN_E_INVALID_CONF = -2, + LOCKDOWN_E_PLIST_ERROR = -3, + LOCKDOWN_E_PAIRING_FAILED = -4, + LOCKDOWN_E_SSL_ERROR = -5, + LOCKDOWN_E_DICT_ERROR = -6, + LOCKDOWN_E_START_SERVICE_FAILED = -7, + LOCKDOWN_E_NOT_ENOUGH_DATA = -8, + LOCKDOWN_E_SET_VALUE_PROHIBITED = -9, + LOCKDOWN_E_GET_VALUE_PROHIBITED = -10, + LOCKDOWN_E_REMOVE_VALUE_PROHIBITED = -11, + LOCKDOWN_E_MUX_ERROR = -12, + LOCKDOWN_E_ACTIVATION_FAILED = -13, + LOCKDOWN_E_PASSWORD_PROTECTED = -14, + LOCKDOWN_E_NO_RUNNING_SESSION = -15, + LOCKDOWN_E_INVALID_HOST_ID = -16, + LOCKDOWN_E_INVALID_SERVICE = -17, + LOCKDOWN_E_INVALID_ACTIVATION_RECORD = -18, + LOCKDOWN_E_PAIRING_DIALOG_PENDING = -20, + LOCKDOWN_E_USER_DENIED_PAIRING = -21, + LOCKDOWN_E_UNKNOWN_ERROR = -256 +} lockdownd_error_t; typedef struct lockdownd_client_private lockdownd_client_private; typedef lockdownd_client_private *lockdownd_client_t; /**< The client handle. */ |