| 19965 | } |
| 19966 | |
| 19967 | function deflateEnd(strm) { |
| 19968 | var status; |
| 19969 | |
| 19970 | if (!strm/*== Z_NULL*/ || !strm.state/*== Z_NULL*/) { |
| 19971 | return Z_STREAM_ERROR; |
| 19972 | } |
| 19973 | |
| 19974 | status = strm.state.status; |
| 19975 | if (status !== INIT_STATE && |
| 19976 | status !== EXTRA_STATE && |
| 19977 | status !== NAME_STATE && |
| 19978 | status !== COMMENT_STATE && |
| 19979 | status !== HCRC_STATE && |
| 19980 | status !== BUSY_STATE && |
| 19981 | status !== FINISH_STATE |
| 19982 | ) { |
| 19983 | return err(strm, Z_STREAM_ERROR); |
| 19984 | } |
| 19985 | |
| 19986 | strm.state = null; |
| 19987 | |
| 19988 | return status === BUSY_STATE ? err(strm, Z_DATA_ERROR) : Z_OK; |
| 19989 | } |
| 19990 | |
| 19991 | |
| 19992 | /* ========================================================================= |