Lines Matching refs:mode

61 	ZEND_ARG_INFO(0, mode)
231 const char *mode, php_stream *innerstream STREAMS_DC) in _php_stream_bz2open_from_BZFILE() argument
243 return php_stream_alloc_rel(&php_stream_bz2io_ops, self, 0, mode); in _php_stream_bz2open_from_BZFILE()
248 const char *mode, in _php_stream_bz2open() argument
260 if (mode[0] == '\0' || (mode[0] != 'w' && mode[0] != 'r' && mode[1] != '\0')) { in _php_stream_bz2open()
278 bz_file = BZ2_bzopen(path_copy, mode); in _php_stream_bz2open()
290 stream = php_stream_open_wrapper(path, mode, options | STREAM_WILL_CAST, opened_path); in _php_stream_bz2open()
295 bz_file = BZ2_bzdopen((int)fd, mode); in _php_stream_bz2open()
302 if (opened_path && !bz_file && mode[0] == 'w') { in _php_stream_bz2open()
308 retstream = _php_stream_bz2open_from_BZFILE(bz_file, mode, stream STREAMS_REL_CC); in _php_stream_bz2open()
405 char *mode; /* The mode to open the stream with */ in PHP_FUNCTION() local
411 if (zend_parse_parameters(ZEND_NUM_ARGS(), "zs", &file, &mode, &mode_len) == FAILURE) { in PHP_FUNCTION()
415 if (mode_len != 1 || (mode[0] != 'r' && mode[0] != 'w')) { in PHP_FUNCTION()
416 …f(NULL, E_WARNING, "'%s' is not a valid mode for bzopen(). Only 'w' and 'r' are supported.", mode); in PHP_FUNCTION()
431 stream = php_stream_bz2open(NULL, Z_STRVAL_P(file), mode, REPORT_ERRORS, NULL); in PHP_FUNCTION()
438 stream_mode_len = strlen(stream->mode); in PHP_FUNCTION()
440 if (stream_mode_len != 1 && !(stream_mode_len == 2 && memchr(stream->mode, 'b', 2))) { in PHP_FUNCTION()
441 php_error_docref(NULL, E_WARNING, "cannot use stream opened in mode '%s'", stream->mode); in PHP_FUNCTION()
443 …f (stream_mode_len == 1 && stream->mode[0] != 'r' && stream->mode[0] != 'w' && stream->mode[0] != … in PHP_FUNCTION()
444 php_error_docref(NULL, E_WARNING, "cannot use stream opened in mode '%s'", stream->mode); in PHP_FUNCTION()
448 switch(mode[0]) { in PHP_FUNCTION()
451 if (stream->mode[0] != mode[0] && !(stream_mode_len == 2 && stream->mode[1] != mode[0])) { in PHP_FUNCTION()
458 if (stream->mode[0] != mode[0] && !(stream_mode_len == 2 && stream->mode[1] != mode[0]) in PHP_FUNCTION()
459 && stream->mode[0] != 'a' && !(stream_mode_len == 2 && stream->mode[1] != 'a') in PHP_FUNCTION()
460 && stream->mode[0] != 'x' && !(stream_mode_len == 2 && stream->mode[1] != 'x')) { in PHP_FUNCTION()
474 bz = BZ2_bzdopen((int)fd, mode); in PHP_FUNCTION()
476 stream = php_stream_bz2open_from_BZFILE(bz, mode, stream); in PHP_FUNCTION()