You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

89 lines
3.7 KiB

From 3d71063ada4f1a4ef90611d263aa8e1d4f275359 Mon Sep 17 00:00:00 2001
From: Michael Heimpold <mhei@heimpold.de>
Date: Thu, 14 Jul 2016 00:50:12 +0200
Subject: [PATCH 11/16] Adopt to changed stream API interface
Signed-off-by: Michael Heimpold <mhei@heimpold.de>
---
dio_posix.c | 2 +-
dio_stream_wrappers.c | 14 +++++++-------
dio_win32.c | 2 +-
php_dio_common.h | 2 +-
4 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/dio_posix.c b/dio_posix.c
index 6ed8630..527d683 100644
--- a/dio_posix.c
+++ b/dio_posix.c
@@ -474,7 +474,7 @@ int dio_common_set_option(php_dio_stream_data *data, int option, int value, void
/* {{{ dio_raw_open_stream
* Opens the underlying stream.
*/
-int dio_raw_open_stream(char *filename, char *mode, php_dio_stream_data *data TSRMLS_DC) {
+int dio_raw_open_stream(const char *filename, char *mode, php_dio_stream_data *data TSRMLS_DC) {
php_dio_posix_stream_data *pdata = (php_dio_posix_stream_data*)data;
pdata->flags = dio_stream_mode_to_flags(mode);
diff --git a/dio_stream_wrappers.c b/dio_stream_wrappers.c
index 811bc07..817b0d1 100644
--- a/dio_stream_wrappers.c
+++ b/dio_stream_wrappers.c
@@ -126,12 +126,12 @@ php_stream_ops dio_raw_stream_ops = {
* fopen for the dio.raw stream.
*/
static php_stream *dio_raw_fopen_wrapper(php_stream_wrapper *wrapper,
- char *path, char *mode,
- int options, char **opened_path,
- php_stream_context *context STREAMS_DC TSRMLS_DC) {
+ const char *path, const char *mode, int options,
+ zend_string **opened_path, php_stream_context *context STREAMS_DC)
+{
php_dio_stream_data *data;
php_stream *stream;
- char *filename;
+ const char *filename;
/* Check it was actually for us (not a corrupted function pointer
somewhere!). */
@@ -287,9 +287,9 @@ php_stream_ops dio_serial_stream_ops = {
* fopen for the dio.raw stream.
*/
static php_stream *dio_serial_fopen_wrapper(php_stream_wrapper *wrapper,
- char *path, char *mode,
- int options, char **opened_path,
- php_stream_context *context STREAMS_DC TSRMLS_DC) {
+ const char *path, const char *mode, int options,
+ zend_string **opened_path, php_stream_context *context STREAMS_DC)
+{
php_dio_stream_data *data;
php_stream *stream;
char *filename;
diff --git a/dio_win32.c b/dio_win32.c
index e7ccedd..1023d36 100644
--- a/dio_win32.c
+++ b/dio_win32.c
@@ -505,7 +505,7 @@ int dio_common_set_option(php_dio_stream_data *data, int option, int value, void
/* {{{ dio_raw_open_stream
* Opens the underlying stream.
*/
-int dio_raw_open_stream(char *filename, char *mode, php_dio_stream_data *data TSRMLS_DC) {
+int dio_raw_open_stream(const char *filename, char *mode, php_dio_stream_data *data TSRMLS_DC) {
php_dio_win32_stream_data *wdata = (php_dio_win32_stream_data*)data;
DWORD err;
diff --git a/php_dio_common.h b/php_dio_common.h
index 6b14040..7a75370 100644
--- a/php_dio_common.h
+++ b/php_dio_common.h
@@ -55,7 +55,7 @@ int dio_common_close(php_dio_stream_data *data);
int dio_common_set_option(php_dio_stream_data *data, int option, int value, void *ptrparam);
-int dio_raw_open_stream(char *filename, char *mode, php_dio_stream_data *data TSRMLS_DC);
+int dio_raw_open_stream(const char *filename, char *mode, php_dio_stream_data *data TSRMLS_DC);
int dio_serial_uninit(php_dio_stream_data *data);
--
2.5.0