commit 68f48fecfdb132ecf9f993c25b35a384f236fc9c Author: Egeyar Bagcioglu Date: Sun Oct 25 22:18:51 2020 +0100 ios: Synch IOD error values with IOS error values. 2020-10-25 Egeyar Bagcioglu * libpoke/ios-dev.h: Add IOD_OK, IOD_EIOFF, IOD_EFLAGS and IOD_ENOMEM. Change the values of IOD_EOF and IOD_EINVAL. * libpoke/ios.h: Add IOS_EOF and IOS_EINVAL. Define IOD_ERROR_TO_IOS_ERROR. diff --git a/ChangeLog b/ChangeLog index 92a4cd25..95da9548 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2020-10-25 Egeyar Bagcioglu + + * libpoke/ios-dev.h: Add IOD_OK, IOD_EIOFF, IOD_EFLAGS and IOD_ENOMEM. + Change the values of IOD_EOF and IOD_EINVAL. + * libpoke/ios.h: Add IOS_EOF and IOS_EINVAL. Define + IOD_ERROR_TO_IOS_ERROR. + 2020-10-25 Jose E. Marchesi * libpoke/pvm.h: Rename pvm_type_equal to pvm_type_equal_p. diff --git a/libpoke/ios-dev.h b/libpoke/ios-dev.h index 722571ee..2a7cc1b5 100644 --- a/libpoke/ios-dev.h +++ b/libpoke/ios-dev.h @@ -34,9 +34,14 @@ typedef uint64_t ios_dev_off; /* Error codes to be used in the interface below. */ -#define IOD_ERROR -1 /* Generic error. */ -#define IOD_EOF -2 -#define IOD_EINVAL -3 /* Invalid argument. */ +#define IOD_OK 0 /* The operation was performed to completion, + in the expected way. */ +#define IOD_ERROR -1 /* Generic error. */ +#define IOD_EIOFF -2 /* The provided offset is invalid. */ +#define IOD_EFLAGS -3 /* Invalid flags specified. */ +#define IOD_ENOMEM -4 /* Memory allocation failure. */ +#define IOD_EOF -5 /* End of file / input. */ +#define IOD_EINVAL -6 /* Invalid argument. */ /* Each IO backend should implement a device interface, by filling an instance of the struct defined below. */ diff --git a/libpoke/ios.h b/libpoke/ios.h index 2f5973bf..f58c082e 100644 --- a/libpoke/ios.h +++ b/libpoke/ios.h @@ -89,13 +89,19 @@ typedef int64_t ios_off; /* The following status codes are used in the several APIs defined below in the file. */ -#define IOS_OK 0 /* The operation was performed to completion, in - the expected way. */ +#define IOS_OK 0 /* The operation was performed to completion, + in the expected way. */ -#define IOS_ERROR -1 /* An unspecified error condition happened. */ +#define IOS_ERROR -1 /* An unspecified error condition happened. */ #define IOS_ENOMEM -4 /* Memory allocation failure. */ +#define IOS_EOF -5 /* End of file / input. */ + +#define IOS_EINVAL -6 /* Invalid argument. */ + +#define IOD_ERROR_TO_IOS_ERROR(error_no) (error_no) + /* **************** IOS flags ****************************** The 64-bit unsigned flags associated with IO spaces have the