diff options
| author | Nikita Popov <nikita.ppv@gmail.com> | 2019-07-16 16:40:54 +0200 |
|---|---|---|
| committer | Nikita Popov <nikita.ppv@gmail.com> | 2019-07-16 16:44:37 +0200 |
| commit | 49bac9b77bc9cacc0f984092d226e951ae336b43 (patch) | |
| tree | f705f93aa693fc5e0ea5c44231585fd41f42dd57 /Zend/zend_stream.c | |
| parent | 46faf8f018e95de27873dbcf7c094af18c4c08e4 (diff) | |
| download | php-git-49bac9b77bc9cacc0f984092d226e951ae336b43.tar.gz | |
Introduce zend_stream_init_filename()
Avoid more ad-hoc initialization of zend_file_handle structures.
Diffstat (limited to 'Zend/zend_stream.c')
| -rw-r--r-- | Zend/zend_stream.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Zend/zend_stream.c b/Zend/zend_stream.c index fc0523ee96..08a1db2583 100644 --- a/Zend/zend_stream.c +++ b/Zend/zend_stream.c @@ -101,6 +101,12 @@ ZEND_API void zend_stream_init_fp(zend_file_handle *handle, FILE *fp, const char handle->filename = filename; } +ZEND_API void zend_stream_init_filename(zend_file_handle *handle, const char *filename) { + memset(handle, 0, sizeof(zend_file_handle)); + handle->type = ZEND_HANDLE_FILENAME; + handle->filename = filename; +} + ZEND_API int zend_stream_open(const char *filename, zend_file_handle *handle) /* {{{ */ { if (zend_stream_open_function) { |
