Lines Matching refs:fp

42 static int phar_zip_process_extra(php_stream *fp, phar_entry_info *entry, uint16_t len) /* {{{ */  in phar_zip_process_extra()  argument
51 if (sizeof(h.header) != php_stream_read(fp, (char *) &h.header, sizeof(h.header))) { in phar_zip_process_extra()
57 php_stream_seek(fp, PHAR_GET_16(h.header.size), SEEK_CUR); in phar_zip_process_extra()
63 read = php_stream_read(fp, (char *) &(h.unix3.crc32), sizeof(h.unix3) - sizeof(h.header)); in phar_zip_process_extra()
72 php_stream_seek(fp, PHAR_GET_16(h.unix3.size) - sizeof(h.unix3.size), SEEK_CUR); in phar_zip_process_extra()
166 int phar_parse_zipfile(php_stream *fp, char *fname, int fname_len, char *alias, int alias_len, phar… in phar_parse_zipfile() argument
177 size = php_stream_tell(fp); in phar_parse_zipfile()
182 if (FAILURE == php_stream_seek(fp, -size, SEEK_END)) { in phar_parse_zipfile()
183 php_stream_close(fp); in phar_parse_zipfile()
190 php_stream_seek(fp, 0, SEEK_SET); in phar_parse_zipfile()
193 if (!php_stream_read(fp, buf, size)) { in phar_parse_zipfile()
194 php_stream_close(fp); in phar_parse_zipfile()
206 php_stream_close(fp); in phar_parse_zipfile()
217 php_stream_close(fp); in phar_parse_zipfile()
233 php_stream_close(fp); in phar_parse_zipfile()
254 php_stream_close(fp); in phar_parse_zipfile()
282 php_stream_seek(fp, PHAR_GET_32(locator.cdir_offset), SEEK_SET); in phar_parse_zipfile()
301 php_stream_close(fp); \ in phar_parse_zipfile()
323 php_stream_close(fp); \ in phar_parse_zipfile()
341 zend_off_t beforeus = php_stream_tell(fp); in phar_parse_zipfile()
343 if (sizeof(zipentry) != php_stream_read(fp, (char *) &zipentry, sizeof(zipentry))) { in phar_parse_zipfile()
378 if (entry.filename_len != php_stream_read(fp, entry.filename, entry.filename_len)) { in phar_parse_zipfile()
400 php_stream_tell(fp); in phar_parse_zipfile()
407 php_stream_seek(fp, 0, SEEK_SET); in phar_parse_zipfile()
409 php_stream_copy_to_stream_ex(fp, sigfile, entry.header_offset, NULL); in phar_parse_zipfile()
411 php_stream_seek(fp, PHAR_GET_32(locator.cdir_offset), SEEK_SET); in phar_parse_zipfile()
413 php_stream_copy_to_stream_ex(fp, sigfile, beforeus - PHAR_GET_32(locator.cdir_offset), NULL); in phar_parse_zipfile()
417 …php_stream_seek(fp, sizeof(phar_zip_file_header) + entry.header_offset + entry.filename_len + PHAR… in phar_parse_zipfile()
419 read = php_stream_read(fp, sig, entry.uncompressed_filesize); in phar_parse_zipfile()
452 zend_off_t loc = php_stream_tell(fp); in phar_parse_zipfile()
453 if (FAILURE == phar_zip_process_extra(fp, &entry, PHAR_GET_16(zipentry.extra_len))) { in phar_parse_zipfile()
457 php_stream_seek(fp, loc + PHAR_GET_16(zipentry.extra_len), SEEK_SET); in phar_parse_zipfile()
521 …if (PHAR_GET_16(zipentry.comment_len) != php_stream_read(fp, buf, PHAR_GET_16(zipentry.comment_len… in phar_parse_zipfile()
546 saveloc = php_stream_tell(fp); in phar_parse_zipfile()
547 php_stream_seek(fp, PHAR_GET_32(zipentry.offset), SEEK_SET); in phar_parse_zipfile()
549 if (sizeof(local) != php_stream_read(fp, (char *) &local, sizeof(local))) { in phar_parse_zipfile()
563 php_stream_seek(fp, entry.offset, SEEK_SET); in phar_parse_zipfile()
565 fp->writepos = 0; in phar_parse_zipfile()
566 fp->readpos = 0; in phar_parse_zipfile()
567 php_stream_seek(fp, entry.offset, SEEK_SET); in phar_parse_zipfile()
568 fp->writepos = 0; in phar_parse_zipfile()
569 fp->readpos = 0; in phar_parse_zipfile()
574 filter = php_stream_filter_create("zlib.inflate", NULL, php_stream_is_persistent(fp)); in phar_parse_zipfile()
581 php_stream_filter_append(&fp->readfilters, filter); in phar_parse_zipfile()
586 zend_string *str = php_stream_copy_to_mem(fp, entry.uncompressed_filesize, 0); in phar_parse_zipfile()
606 filter = php_stream_filter_create("bzip2.decompress", NULL, php_stream_is_persistent(fp)); in phar_parse_zipfile()
613 php_stream_filter_append(&fp->readfilters, filter); in phar_parse_zipfile()
618 zend_string *str = php_stream_copy_to_mem(fp, entry.uncompressed_filesize, 0); in phar_parse_zipfile()
640 zend_string *str = php_stream_copy_to_mem(fp, entry.uncompressed_filesize, 0); in phar_parse_zipfile()
658 php_stream_seek(fp, saveloc, SEEK_SET); in phar_parse_zipfile()
665 mydata->fp = fp; in phar_parse_zipfile()
856 … if (entry->fp_type == PHAR_MOD && entry->fp != entry->phar->fp && entry->fp != entry->phar->ufp) { in phar_zip_changed_apply_int()
857 php_stream_close(entry->fp); in phar_zip_changed_apply_int()
858 entry->fp = NULL; in phar_zip_changed_apply_int()
1053 …if (entry->fp_type == PHAR_MOD && entry->fp != entry->phar->fp && entry->fp != entry->phar->ufp &&… in phar_zip_changed_apply_int()
1054 php_stream_close(entry->fp); in phar_zip_changed_apply_int()
1079 entry->fp = NULL; in phar_zip_changed_apply_int()
1143 entry.fp = php_stream_fopen_tmpfile(); in phar_zip_applysignature()
1146 if (entry.fp == NULL) { in phar_zip_applysignature()
1154 …if (8 != (int)php_stream_write(entry.fp, sigbuf, 8) || signature_length != (int)php_stream_write(e… in phar_zip_applysignature()
1218 entry.fp = php_stream_fopen_tmpfile(); in phar_zip_flush()
1219 if (entry.fp == NULL) { in phar_zip_flush()
1223 if (phar->alias_len != (int)php_stream_write(entry.fp, phar->alias, phar->alias_len)) { in phar_zip_flush()
1310 entry.fp = php_stream_fopen_tmpfile(); in phar_zip_flush()
1311 if (entry.fp == NULL) { in phar_zip_flush()
1317 if ((size_t)len != php_stream_write(entry.fp, user_stub, len) in phar_zip_flush()
1318 || 5 != php_stream_write(entry.fp, " ?>\r\n", 5)) { in phar_zip_flush()
1325 php_stream_close(entry.fp); in phar_zip_flush()
1347 entry.fp = php_stream_fopen_tmpfile(); in phar_zip_flush()
1348 if (entry.fp == NULL) { in phar_zip_flush()
1352 if (sizeof(newstub)-1 != php_stream_write(entry.fp, newstub, sizeof(newstub)-1)) { in phar_zip_flush()
1353 php_stream_close(entry.fp); in phar_zip_flush()
1367 php_stream_close(entry.fp); in phar_zip_flush()
1375 php_stream_close(entry.fp); in phar_zip_flush()
1380 php_stream_close(entry.fp); in phar_zip_flush()
1390 if (phar->fp && !phar->is_brandnew) { in phar_zip_flush()
1391 oldfile = phar->fp; in phar_zip_flush()
1513 if (phar->fp && pass.free_fp) { in phar_zip_flush()
1514 php_stream_close(phar->fp); in phar_zip_flush()
1529 phar->fp = pass.filefp; in phar_zip_flush()
1531 …phar->fp = php_stream_open_wrapper(phar->fname, "w+b", IGNORE_URL|STREAM_MUST_SEEK|REPORT_ERRORS, … in phar_zip_flush()
1532 if (!phar->fp) { in phar_zip_flush()
1536 phar->fp = pass.filefp; in phar_zip_flush()
1543 php_stream_copy_to_stream_ex(pass.filefp, phar->fp, PHP_STREAM_COPY_ALL, NULL); in phar_zip_flush()