Lines Matching refs:file_handle
277 ZEND_API void zend_destroy_file_handle(zend_file_handle *file_handle) in zend_destroy_file_handle() argument
279 …zend_llist_del_element(&CG(open_files), file_handle, (int (*)(void *, void *)) zend_compare_file_h… in zend_destroy_file_handle()
281 file_handle->opened_path = NULL; in zend_destroy_file_handle()
282 if (file_handle->free_filename) { in zend_destroy_file_handle()
283 file_handle->filename = NULL; in zend_destroy_file_handle()
500 ZEND_API int open_file_for_scanning(zend_file_handle *file_handle) in open_file_for_scanning() argument
507 if (CG(start_lineno) == 2 && file_handle->type == ZEND_HANDLE_FP && file_handle->handle.fp) { in open_file_for_scanning()
508 if ((offset = ftell(file_handle->handle.fp)) == (size_t)-1) { in open_file_for_scanning()
513 if (zend_stream_fixup(file_handle, &buf, &size) == FAILURE) { in open_file_for_scanning()
517 zend_llist_add_element(&CG(open_files), file_handle); in open_file_for_scanning()
518 …if (file_handle->handle.stream.handle >= (void*)file_handle && file_handle->handle.stream.handle <… in open_file_for_scanning()
520 size_t diff = (char*)file_handle->handle.stream.handle - (char*)file_handle; in open_file_for_scanning()
522 file_handle->handle.stream.handle = fh->handle.stream.handle; in open_file_for_scanning()
526 SCNG(yy_in) = file_handle; in open_file_for_scanning()
554 if (file_handle->opened_path) { in open_file_for_scanning()
555 compiled_filename = zend_string_copy(file_handle->opened_path); in open_file_for_scanning()
557 compiled_filename = zend_string_init(file_handle->filename, strlen(file_handle->filename), 0); in open_file_for_scanning()
621 ZEND_API zend_op_array *compile_file(zend_file_handle *file_handle, int type) in compile_file() argument
627 if (open_file_for_scanning(file_handle)==FAILURE) { in compile_file()
629 zend_message_dispatcher(ZMSG_FAILED_REQUIRE_FOPEN, file_handle->filename); in compile_file()
632 zend_message_dispatcher(ZMSG_FAILED_INCLUDE_FOPEN, file_handle->filename); in compile_file()
645 zend_file_handle file_handle; in compile_filename() local
656 file_handle.filename = Z_STRVAL_P(filename); in compile_filename()
657 file_handle.free_filename = 0; in compile_filename()
658 file_handle.type = ZEND_HANDLE_FILENAME; in compile_filename()
659 file_handle.opened_path = NULL; in compile_filename()
660 file_handle.handle.fp = NULL; in compile_filename()
662 retval = zend_compile_file(&file_handle, type); in compile_filename()
663 if (retval && file_handle.handle.stream.handle) { in compile_filename()
664 if (!file_handle.opened_path) { in compile_filename()
665 file_handle.opened_path = opened_path = zend_string_copy(Z_STR_P(filename)); in compile_filename()
668 zend_hash_add_empty_element(&EG(included_files), file_handle.opened_path); in compile_filename()
674 zend_destroy_file_handle(&file_handle); in compile_filename()
781 zend_file_handle file_handle; in BEGIN_EXTERN_C() local
783 file_handle.type = ZEND_HANDLE_FILENAME; in BEGIN_EXTERN_C()
784 file_handle.filename = filename; in BEGIN_EXTERN_C()
785 file_handle.free_filename = 0; in BEGIN_EXTERN_C()
786 file_handle.opened_path = NULL; in BEGIN_EXTERN_C()
788 if (open_file_for_scanning(&file_handle)==FAILURE) { in BEGIN_EXTERN_C()
798 zend_destroy_file_handle(&file_handle); in BEGIN_EXTERN_C()