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

  1. From 3d71063ada4f1a4ef90611d263aa8e1d4f275359 Mon Sep 17 00:00:00 2001
  2. From: Michael Heimpold <mhei@heimpold.de>
  3. Date: Thu, 14 Jul 2016 00:50:12 +0200
  4. Subject: [PATCH 11/16] Adopt to changed stream API interface
  5. Signed-off-by: Michael Heimpold <mhei@heimpold.de>
  6. ---
  7. dio_posix.c | 2 +-
  8. dio_stream_wrappers.c | 14 +++++++-------
  9. dio_win32.c | 2 +-
  10. php_dio_common.h | 2 +-
  11. 4 files changed, 10 insertions(+), 10 deletions(-)
  12. diff --git a/dio_posix.c b/dio_posix.c
  13. index 6ed8630..527d683 100644
  14. --- a/dio_posix.c
  15. +++ b/dio_posix.c
  16. @@ -474,7 +474,7 @@ int dio_common_set_option(php_dio_stream_data *data, int option, int value, void
  17. /* {{{ dio_raw_open_stream
  18. * Opens the underlying stream.
  19. */
  20. -int dio_raw_open_stream(char *filename, char *mode, php_dio_stream_data *data TSRMLS_DC) {
  21. +int dio_raw_open_stream(const char *filename, char *mode, php_dio_stream_data *data TSRMLS_DC) {
  22. php_dio_posix_stream_data *pdata = (php_dio_posix_stream_data*)data;
  23. pdata->flags = dio_stream_mode_to_flags(mode);
  24. diff --git a/dio_stream_wrappers.c b/dio_stream_wrappers.c
  25. index 811bc07..817b0d1 100644
  26. --- a/dio_stream_wrappers.c
  27. +++ b/dio_stream_wrappers.c
  28. @@ -126,12 +126,12 @@ php_stream_ops dio_raw_stream_ops = {
  29. * fopen for the dio.raw stream.
  30. */
  31. static php_stream *dio_raw_fopen_wrapper(php_stream_wrapper *wrapper,
  32. - char *path, char *mode,
  33. - int options, char **opened_path,
  34. - php_stream_context *context STREAMS_DC TSRMLS_DC) {
  35. + const char *path, const char *mode, int options,
  36. + zend_string **opened_path, php_stream_context *context STREAMS_DC)
  37. +{
  38. php_dio_stream_data *data;
  39. php_stream *stream;
  40. - char *filename;
  41. + const char *filename;
  42. /* Check it was actually for us (not a corrupted function pointer
  43. somewhere!). */
  44. @@ -287,9 +287,9 @@ php_stream_ops dio_serial_stream_ops = {
  45. * fopen for the dio.raw stream.
  46. */
  47. static php_stream *dio_serial_fopen_wrapper(php_stream_wrapper *wrapper,
  48. - char *path, char *mode,
  49. - int options, char **opened_path,
  50. - php_stream_context *context STREAMS_DC TSRMLS_DC) {
  51. + const char *path, const char *mode, int options,
  52. + zend_string **opened_path, php_stream_context *context STREAMS_DC)
  53. +{
  54. php_dio_stream_data *data;
  55. php_stream *stream;
  56. char *filename;
  57. diff --git a/dio_win32.c b/dio_win32.c
  58. index e7ccedd..1023d36 100644
  59. --- a/dio_win32.c
  60. +++ b/dio_win32.c
  61. @@ -505,7 +505,7 @@ int dio_common_set_option(php_dio_stream_data *data, int option, int value, void
  62. /* {{{ dio_raw_open_stream
  63. * Opens the underlying stream.
  64. */
  65. -int dio_raw_open_stream(char *filename, char *mode, php_dio_stream_data *data TSRMLS_DC) {
  66. +int dio_raw_open_stream(const char *filename, char *mode, php_dio_stream_data *data TSRMLS_DC) {
  67. php_dio_win32_stream_data *wdata = (php_dio_win32_stream_data*)data;
  68. DWORD err;
  69. diff --git a/php_dio_common.h b/php_dio_common.h
  70. index 6b14040..7a75370 100644
  71. --- a/php_dio_common.h
  72. +++ b/php_dio_common.h
  73. @@ -55,7 +55,7 @@ int dio_common_close(php_dio_stream_data *data);
  74. int dio_common_set_option(php_dio_stream_data *data, int option, int value, void *ptrparam);
  75. -int dio_raw_open_stream(char *filename, char *mode, php_dio_stream_data *data TSRMLS_DC);
  76. +int dio_raw_open_stream(const char *filename, char *mode, php_dio_stream_data *data TSRMLS_DC);
  77. int dio_serial_uninit(php_dio_stream_data *data);
  78. --
  79. 2.5.0