| 7875 | } |
| 7876 | |
| 7877 | function deflateEnd(strm) { |
| 7878 | var status; |
| 7879 | |
| 7880 | if (!strm/*== Z_NULL*/ || !strm.state/*== Z_NULL*/) { |
| 7881 | return Z_STREAM_ERROR; |
| 7882 | } |
| 7883 | |
| 7884 | status = strm.state.status; |
| 7885 | if (status !== INIT_STATE && |
| 7886 | status !== EXTRA_STATE && |
| 7887 | status !== NAME_STATE && |
| 7888 | status !== COMMENT_STATE && |
| 7889 | status !== HCRC_STATE && |
| 7890 | status !== BUSY_STATE && |
| 7891 | status !== FINISH_STATE |
| 7892 | ) { |
| 7893 | return err(strm, Z_STREAM_ERROR); |
| 7894 | } |
| 7895 | |
| 7896 | strm.state = null; |
| 7897 | |
| 7898 | return status === BUSY_STATE ? err(strm, Z_DATA_ERROR) : Z_OK; |
| 7899 | } |
| 7900 | |
| 7901 | |
| 7902 | /* ========================================================================= |