Clarify format of error codes
This commit is contained in:
parent
0481df6e61
commit
929f54e13c
@ -39,7 +39,7 @@
|
|||||||
|
|
||||||
/*! \c GMIO_AMF_ERROR_TAG
|
/*! \c GMIO_AMF_ERROR_TAG
|
||||||
* Byte-mask to tag(identify) AMF-specific error codes */
|
* Byte-mask to tag(identify) AMF-specific error codes */
|
||||||
enum { GMIO_AMF_ERROR_TAG = 0x12000000 };
|
enum { GMIO_AMF_ERROR_TAG = 0x02000000 };
|
||||||
|
|
||||||
/*! Specific error codes reported by AMF read/write functions */
|
/*! Specific error codes reported by AMF read/write functions */
|
||||||
enum gmio_amf_error
|
enum gmio_amf_error
|
||||||
|
@ -39,17 +39,20 @@
|
|||||||
|
|
||||||
#include "global.h"
|
#include "global.h"
|
||||||
|
|
||||||
enum {
|
/*! Common errors
|
||||||
/*! \c GMIO_ZLIB_ERROR_TAG
|
*
|
||||||
* Byte-mask to tag(identify) zlib-specific error codes */
|
* Format:
|
||||||
GMIO_ZLIB_ERROR_TAG = 0x01000000,
|
* <code>
|
||||||
|
* 4-bytes signed integer (ISO C restricts enumerator value to 'int')
|
||||||
/*! \c GMIO_ZIP_ERROR_TAG
|
* max value: 0x7FFFFFFF
|
||||||
* Byte-mask to tag(identify) ZIP-specific error codes */
|
* bits 0x00FFFFFF..0x7FFFFFFF: tag identifying the error category
|
||||||
GMIO_ZIP_ERROR_TAG = 0x02000000
|
* bits 0x001FFFFF..0x00FFFFFF: tag identifying an error sub-category
|
||||||
};
|
* bits 0x00000000..0x000FFFFF: error value in the (sub)category
|
||||||
|
* Max count of categories : 128 (2^7)
|
||||||
/*! Common errors */
|
* Max count of sub-categories : 15 (2^4 - 1)
|
||||||
|
* Max count of error values : 1048576 (2^20)
|
||||||
|
* <encode>
|
||||||
|
*/
|
||||||
enum gmio_error
|
enum gmio_error
|
||||||
{
|
{
|
||||||
/*! No error occurred, success */
|
/*! No error occurred, success */
|
||||||
@ -80,7 +83,7 @@ enum gmio_error
|
|||||||
|
|
||||||
/* zlib */
|
/* zlib */
|
||||||
/*! See \c Z_ERRNO (file operation error) */
|
/*! See \c Z_ERRNO (file operation error) */
|
||||||
GMIO_ERROR_ZLIB_ERRNO = GMIO_ZLIB_ERROR_TAG + 0x01,
|
GMIO_ERROR_ZLIB_ERRNO,
|
||||||
|
|
||||||
/*! See \c Z_STREAM_ERROR */
|
/*! See \c Z_STREAM_ERROR */
|
||||||
GMIO_ERROR_ZLIB_STREAM,
|
GMIO_ERROR_ZLIB_STREAM,
|
||||||
@ -105,14 +108,19 @@ enum gmio_error
|
|||||||
* gmio_zlib_compress_options::memory_usage */
|
* gmio_zlib_compress_options::memory_usage */
|
||||||
GMIO_ERROR_ZLIB_INVALID_COMPRESS_MEMORY_USAGE,
|
GMIO_ERROR_ZLIB_INVALID_COMPRESS_MEMORY_USAGE,
|
||||||
|
|
||||||
|
/* ZIP */
|
||||||
/*! Zip64 format requires the compiler to provide a 64b integer type */
|
/*! Zip64 format requires the compiler to provide a 64b integer type */
|
||||||
GMIO_ERROR_ZIP_INT64_TYPE_REQUIRED = GMIO_ZIP_ERROR_TAG + 0x01,
|
GMIO_ERROR_ZIP_INT64_TYPE_REQUIRED,
|
||||||
|
|
||||||
/*! The size of some ZIP file entry exceeds 32b limit and so requires Zip64
|
/*! The size of some ZIP file entry exceeds 32b limit and so requires Zip64
|
||||||
* format */
|
* format */
|
||||||
GMIO_ERROR_ZIP64_FORMAT_REQUIRED = GMIO_ZIP_ERROR_TAG + 0x02
|
GMIO_ERROR_ZIP64_FORMAT_REQUIRED
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/*! \c GMIO_CORE_ERROR_TAG
|
||||||
|
* Byte-mask to tag(identify) gmio_core error codes */
|
||||||
|
enum { GMIO_CORE_ERROR_TAG = 0x00 };
|
||||||
|
|
||||||
/*! Returns true if <tt>code == GMIO_NO_ERROR</tt> */
|
/*! Returns true if <tt>code == GMIO_NO_ERROR</tt> */
|
||||||
GMIO_INLINE bool gmio_no_error(int code)
|
GMIO_INLINE bool gmio_no_error(int code)
|
||||||
{ return code == GMIO_ERROR_OK ? true : false; }
|
{ return code == GMIO_ERROR_OK ? true : false; }
|
||||||
|
@ -252,9 +252,9 @@ struct gmio_zip_write_result {
|
|||||||
size_t written_len;
|
size_t written_len;
|
||||||
};
|
};
|
||||||
|
|
||||||
enum { GMIO_ZIP_UTILS_ERROR_TAG = 0xAA000000 };
|
enum { GMIO_ZIP_UTILS_ERROR_TAG = 0x00100000 };
|
||||||
enum gmio_zip_utils_error {
|
enum gmio_zip_utils_error {
|
||||||
GMIO_ZIP_UTILS_ERROR_BAD_MAGIC = GMIO_ZIP_UTILS_ERROR_TAG + 0x01
|
GMIO_ZIP_UTILS_ERROR_BAD_MAGIC = GMIO_ZIP_UTILS_ERROR_TAG + 1
|
||||||
};
|
};
|
||||||
|
|
||||||
/*! Reads ZIP local file header from \p stream */
|
/*! Reads ZIP local file header from \p stream */
|
||||||
|
@ -39,7 +39,7 @@
|
|||||||
|
|
||||||
/*! \c GMIO_STL_ERROR_TAG
|
/*! \c GMIO_STL_ERROR_TAG
|
||||||
* Byte-mask to tag(identify) STL-specific error codes */
|
* Byte-mask to tag(identify) STL-specific error codes */
|
||||||
enum { GMIO_STL_ERROR_TAG = 0x11000000 };
|
enum { GMIO_STL_ERROR_TAG = 0x01000000 };
|
||||||
|
|
||||||
/*! Specific error codes reported by STL read/write functions */
|
/*! Specific error codes reported by STL read/write functions */
|
||||||
enum gmio_stl_error
|
enum gmio_stl_error
|
||||||
|
Loading…
Reference in New Issue
Block a user