diff options
| author | 2014-10-05 16:51:03 +0200 | |
|---|---|---|
| committer | 2014-10-05 16:51:03 +0200 | |
| commit | 5072dea1373b7c4789a9ea1e65d05ea30acf41ed (patch) | |
| tree | 51bdd0584d727080fab86acd28bd4b360b2333bd /include/libimobiledevice/mobilesync.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/mobilesync.h')
| -rw-r--r-- | include/libimobiledevice/mobilesync.h | 30 |
1 files changed, 13 insertions, 17 deletions
diff --git a/include/libimobiledevice/mobilesync.h b/include/libimobiledevice/mobilesync.h index 6ba197b..3c0d576 100644 --- a/include/libimobiledevice/mobilesync.h +++ b/include/libimobiledevice/mobilesync.h | |||
| @@ -33,20 +33,19 @@ extern "C" { | |||
| 33 | 33 | ||
| 34 | #define MOBILESYNC_SERVICE_NAME "com.apple.mobilesync" | 34 | #define MOBILESYNC_SERVICE_NAME "com.apple.mobilesync" |
| 35 | 35 | ||
| 36 | /** @name Error Codes */ | 36 | /** Error Codes */ |
| 37 | /*@{*/ | 37 | typedef enum { |
| 38 | #define MOBILESYNC_E_SUCCESS 0 | 38 | MOBILESYNC_E_SUCCESS = 0, |
| 39 | #define MOBILESYNC_E_INVALID_ARG -1 | 39 | MOBILESYNC_E_INVALID_ARG = -1, |
| 40 | #define MOBILESYNC_E_PLIST_ERROR -2 | 40 | MOBILESYNC_E_PLIST_ERROR = -2, |
| 41 | #define MOBILESYNC_E_MUX_ERROR -3 | 41 | MOBILESYNC_E_MUX_ERROR = -3, |
| 42 | #define MOBILESYNC_E_BAD_VERSION -4 | 42 | MOBILESYNC_E_BAD_VERSION = -4, |
| 43 | #define MOBILESYNC_E_SYNC_REFUSED -5 | 43 | MOBILESYNC_E_SYNC_REFUSED = -5, |
| 44 | #define MOBILESYNC_E_CANCELLED -6 | 44 | MOBILESYNC_E_CANCELLED = -6, |
| 45 | #define MOBILESYNC_E_WRONG_DIRECTION -7 | 45 | MOBILESYNC_E_WRONG_DIRECTION = -7, |
| 46 | #define MOBILESYNC_E_NOT_READY -8 | 46 | MOBILESYNC_E_NOT_READY = -8, |
| 47 | 47 | MOBILESYNC_E_UNKNOWN_ERROR = -256 | |
| 48 | #define MOBILESYNC_E_UNKNOWN_ERROR -256 | 48 | } mobilesync_error_t; |
| 49 | /*@}*/ | ||
| 50 | 49 | ||
| 51 | /** The sync type of the current sync session. */ | 50 | /** The sync type of the current sync session. */ |
| 52 | typedef enum { | 51 | typedef enum { |
| @@ -55,9 +54,6 @@ typedef enum { | |||
| 55 | MOBILESYNC_SYNC_TYPE_RESET /**< Reset-sync signals that the computer should send all data again. */ | 54 | MOBILESYNC_SYNC_TYPE_RESET /**< Reset-sync signals that the computer should send all data again. */ |
| 56 | } mobilesync_sync_type_t; | 55 | } mobilesync_sync_type_t; |
| 57 | 56 | ||
| 58 | /** Represents an error code. */ | ||
| 59 | typedef int16_t mobilesync_error_t; | ||
| 60 | |||
| 61 | typedef struct mobilesync_client_private mobilesync_client_private; | 57 | typedef struct mobilesync_client_private mobilesync_client_private; |
| 62 | typedef mobilesync_client_private *mobilesync_client_t; /**< The client handle */ | 58 | typedef mobilesync_client_private *mobilesync_client_t; /**< The client handle */ |
| 63 | 59 | ||
