};
/* {{{ Bzip2 stream openers */
-PHP_BZ2_API php_stream *_php_stream_bz2open_from_BZFILE(BZFILE *bz,
- char *mode, php_stream *innerstream STREAMS_DC TSRMLS_DC)
+PHP_BZ2_API php_stream *_php_stream_bz2open_from_BZFILE(BZFILE *bz,
+ const char *mode, php_stream *innerstream STREAMS_DC TSRMLS_DC)
{
struct php_bz2_stream_data_t *self;
-
+
self = emalloc(sizeof(*self));
self->stream = innerstream;
*opened_path = estrdup(path_copy);
}
#ifdef VIRTUAL_DIR
- free(path_copy);
+ efree(path_copy);
#endif
path_copy = NULL;
-
+
if (bz_file == NULL) {
/* that didn't work, so try and get something from the network/wrapper */
stream = php_stream_open_wrapper(path, mode, options | STREAM_WILL_CAST, opened_path);
-
+
if (stream) {
- int fd;
+ php_socket_t fd;
if (SUCCESS == php_stream_cast(stream, PHP_STREAM_AS_FD, (void **) &fd, REPORT_ERRORS)) {
bz_file = BZ2_bzdopen(fd, mode);
}