@@ -172,7 +172,11 @@ static int php_xz_init_encoder(struct php_xz_stream_data_t *self)
172172
173173/* {{{ php_xziop_read
174174 Reads from the stream. */
175+ #if PHP_VERSION_ID >= 70400
175176static ssize_t php_xziop_read (php_stream * stream , char * buf , size_t count )
177+ #else
178+ static size_t php_xziop_read (php_stream * stream , char * buf , size_t count )
179+ #endif
176180{
177181 struct php_xz_stream_data_t * self = (struct php_xz_stream_data_t * ) stream -> abstract ;
178182 lzma_stream * strm = & self -> strm ;
@@ -210,7 +214,11 @@ static ssize_t php_xziop_read(php_stream *stream, char *buf, size_t count)
210214
211215/* {{{ php_xziop_write
212216 Writes to the stream. */
217+ #if PHP_VERSION_ID >= 70400
213218static ssize_t php_xziop_write (php_stream * stream , const char * buf , size_t count )
219+ #else
220+ static size_t php_xziop_write (php_stream * stream , const char * buf , size_t count )
221+ #endif
214222{
215223 struct php_xz_stream_data_t * self = (struct php_xz_stream_data_t * ) stream -> abstract ;
216224 int wrote = 0 , bytes_consumed = 0 ;
@@ -305,14 +313,21 @@ php_stream_ops php_stream_xzio_ops = {
305313 NULL , /* cast */
306314 NULL , /* stat */
307315 NULL /* set_option */
316+ .label = "XZ" ,
317+ .write = php_xziop_write ,
318+ .read = php_xziop_read ,
319+ .close = php_xziop_close ,
320+ .flush = php_xziop_flush ,
321+ .seek = NULL ,
322+ .cast = NULL ,
323+ .stat = NULL ,
324+ .set_option = NULL
308325};
309326/* }}} */
310327
311328/* {{{ php_stream_xzopen
312329 Opens a stream. */
313- php_stream * php_stream_xzopen (php_stream_wrapper * wrapper , const char * path ,
314- const char * mode_pass , int options , zend_string * * opened_path ,
315- php_stream_context * context STREAMS_DC )
330+ php_stream * php_stream_xzopen (php_stream_wrapper * wrapper , const char * path , const char * mode_pass , int options , zend_string * * opened_path , php_stream_context * context STREAMS_DC )
316331{
317332 char mode [64 ];
318333 unsigned long level = 6 ;
@@ -323,7 +338,7 @@ php_stream *php_stream_xzopen(php_stream_wrapper *wrapper, const char *path,
323338
324339 /* The pointer below is freed even though it is `const` because it was
325340 manually allocated in `xzopen`.. */
326- efree ((void * ) mode_pass );
341+ efree ((char * ) mode_pass );
327342
328343 /* Split compression level and mode. */
329344 char * colonp = strchr (mode , ':' );
0 commit comments