diff --git a/interfaces/kits/ani/common/enum_util.h b/interfaces/kits/ani/common/enum_util.h index 1db80dffe5efc019babf072ce601676f24b8d94a..90affd7d7cc9eaf4564a5dc165a969319cd357b4 100644 --- a/interfaces/kits/ani/common/enum_util.h +++ b/interfaces/kits/ani/common/enum_util.h @@ -246,6 +246,27 @@ private: 9, 8, }; + /* zlib.ReturnStatus + enum ReturnStatus { + OK = 0, + STREAM_END = 1, + NEED_DICT = 2, + ERRNO = -1, + STREAM_ERROR = -2, + DATA_ERROR = -3, + MEM_ERROR = -4, + BUF_ERROR = -5 + } */ + static constexpr std::array Array_Zlib_ReturnStatus = { + 0, + 1, + 2, + -1, + -2, + -3, + -4, + -5 + }; public: template @@ -463,14 +484,10 @@ public: } // zlib.ReturnStatus - // enum ReturnStatus { - // OK = 0, - // STREAM_END = 1, - // NEED_DICT = 2, - // } static inline ani_enum_item EnumNativeToETS_Zlib_ReturnStatus(ani_env* env, const int32_t value) { - return EnumNativeToETSByOffset(env, CommonFunAniNS::CLASSNAME_ZLIB_RETURN_STATUS, value, 0); + return EnumNativeToETSByTable(env, + CommonFunAniNS::CLASSNAME_ZLIB_RETURN_STATUS, value, Array_Zlib_ReturnStatus); } // appControl.ComponentType diff --git a/interfaces/kits/ani/zlib/ets/@ohos.zlib.ets b/interfaces/kits/ani/zlib/ets/@ohos.zlib.ets index a9345f015e38681a7171ff8968386262d8064896..41aa0d20a20621b01c565a5d030d4f1a2f21d614 100644 --- a/interfaces/kits/ani/zlib/ets/@ohos.zlib.ets +++ b/interfaces/kits/ani/zlib/ets/@ohos.zlib.ets @@ -64,6 +64,11 @@ export default namespace zlib { OK = 0, STREAM_END = 1, NEED_DICT = 2, + ERRNO = -1, + STREAM_ERROR = -2, + DATA_ERROR = -3, + MEM_ERROR = -4, + BUF_ERROR = -5 } export enum CompressMethod {