Lines Matching refs:fp

42 static int phar_zip_process_extra(php_stream *fp, phar_entry_info *entry, php_uint16 len TSRMLS_DC)…  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()
262 php_stream_close(fp); in phar_parse_zipfile()
290 php_stream_seek(fp, PHAR_GET_32(locator.cdir_offset), SEEK_SET); in phar_parse_zipfile()
309 php_stream_close(fp); \ in phar_parse_zipfile()
333 php_stream_close(fp); \ in phar_parse_zipfile()
353 off_t beforeus = php_stream_tell(fp); in phar_parse_zipfile()
355 if (sizeof(zipentry) != php_stream_read(fp, (char *) &zipentry, sizeof(zipentry))) { in phar_parse_zipfile()
390 if (entry.filename_len != php_stream_read(fp, entry.filename, entry.filename_len)) { in phar_parse_zipfile()
411 now = php_stream_tell(fp); in phar_parse_zipfile()
418 php_stream_seek(fp, 0, SEEK_SET); in phar_parse_zipfile()
420 phar_stream_copy_to_stream(fp, sigfile, entry.header_offset, NULL); in phar_parse_zipfile()
422 php_stream_seek(fp, PHAR_GET_32(locator.cdir_offset), SEEK_SET); in phar_parse_zipfile()
424 phar_stream_copy_to_stream(fp, sigfile, beforeus - PHAR_GET_32(locator.cdir_offset), NULL); in phar_parse_zipfile()
428 …php_stream_seek(fp, sizeof(phar_zip_file_header) + entry.header_offset + entry.filename_len + PHAR… in phar_parse_zipfile()
430 read = php_stream_read(fp, sig, entry.uncompressed_filesize); in phar_parse_zipfile()
463 off_t loc = php_stream_tell(fp); in phar_parse_zipfile()
464 if (FAILURE == phar_zip_process_extra(fp, &entry, PHAR_GET_16(zipentry.extra_len) TSRMLS_CC)) { in phar_parse_zipfile()
468 php_stream_seek(fp, loc + PHAR_GET_16(zipentry.extra_len), SEEK_SET); in phar_parse_zipfile()
532 …if (PHAR_GET_16(zipentry.comment_len) != php_stream_read(fp, buf, PHAR_GET_16(zipentry.comment_len… in phar_parse_zipfile()
564 saveloc = php_stream_tell(fp); in phar_parse_zipfile()
565 php_stream_seek(fp, PHAR_GET_32(zipentry.offset), SEEK_SET); in phar_parse_zipfile()
567 if (sizeof(local) != php_stream_read(fp, (char *) &local, sizeof(local))) { in phar_parse_zipfile()
583 fp->writepos = fp->readpos = 0; in phar_parse_zipfile()
585 php_stream_seek(fp, entry.offset, SEEK_SET); in phar_parse_zipfile()
587 fp->writepos = 0; in phar_parse_zipfile()
588 fp->readpos = 0; in phar_parse_zipfile()
589 php_stream_seek(fp, entry.offset, SEEK_SET); in phar_parse_zipfile()
590 fp->writepos = 0; in phar_parse_zipfile()
591 fp->readpos = 0; in phar_parse_zipfile()
597 filter = php_stream_filter_create("zlib.inflate", NULL, php_stream_is_persistent(fp) TSRMLS_CC); in phar_parse_zipfile()
604 php_stream_filter_append(&fp->readfilters, filter); in phar_parse_zipfile()
606 …if (!(entry.uncompressed_filesize = php_stream_copy_to_mem(fp, &actual_alias, entry.uncompressed_f… in phar_parse_zipfile()
618 …filter = php_stream_filter_create("bzip2.decompress", NULL, php_stream_is_persistent(fp) TSRMLS_CC… in phar_parse_zipfile()
625 php_stream_filter_append(&fp->readfilters, filter); in phar_parse_zipfile()
627 …if (!(entry.uncompressed_filesize = php_stream_copy_to_mem(fp, &actual_alias, entry.uncompressed_f… in phar_parse_zipfile()
638 …if (!(entry.uncompressed_filesize = php_stream_copy_to_mem(fp, &actual_alias, entry.uncompressed_f… in phar_parse_zipfile()
645 php_stream_seek(fp, saveloc, SEEK_SET); in phar_parse_zipfile()
652 mydata->fp = fp; in phar_parse_zipfile()
845 … if (entry->fp_type == PHAR_MOD && entry->fp != entry->phar->fp && entry->fp != entry->phar->ufp) { in phar_zip_changed_apply()
846 php_stream_close(entry->fp); in phar_zip_changed_apply()
847 entry->fp = NULL; in phar_zip_changed_apply()
1043 …if (entry->fp_type == PHAR_MOD && entry->fp != entry->phar->fp && entry->fp != entry->phar->ufp &&… in phar_zip_changed_apply()
1044 php_stream_close(entry->fp); in phar_zip_changed_apply()
1069 entry->fp = NULL; in phar_zip_changed_apply()
1127 entry.fp = php_stream_fopen_tmpfile(); in phar_zip_applysignature()
1130 if (entry.fp == NULL) { in phar_zip_applysignature()
1138 …if (8 != (int)php_stream_write(entry.fp, sigbuf, 8) || signature_length != (int)php_stream_write(e… in phar_zip_applysignature()
1203 entry.fp = php_stream_fopen_tmpfile(); in phar_zip_flush()
1204 if (entry.fp == NULL) { in phar_zip_flush()
1208 if (phar->alias_len != (int)php_stream_write(entry.fp, phar->alias, phar->alias_len)) { in phar_zip_flush()
1281 entry.fp = php_stream_fopen_tmpfile(); in phar_zip_flush()
1282 if (entry.fp == NULL) { in phar_zip_flush()
1288 if ((size_t)len != php_stream_write(entry.fp, user_stub, len) in phar_zip_flush()
1289 || 5 != php_stream_write(entry.fp, " ?>\r\n", 5)) { in phar_zip_flush()
1296 php_stream_close(entry.fp); in phar_zip_flush()
1318 entry.fp = php_stream_fopen_tmpfile(); in phar_zip_flush()
1319 if (entry.fp == NULL) { in phar_zip_flush()
1323 if (sizeof(newstub)-1 != php_stream_write(entry.fp, newstub, sizeof(newstub)-1)) { in phar_zip_flush()
1324 php_stream_close(entry.fp); in phar_zip_flush()
1338 php_stream_close(entry.fp); in phar_zip_flush()
1346 php_stream_close(entry.fp); in phar_zip_flush()
1351 php_stream_close(entry.fp); in phar_zip_flush()
1361 if (phar->fp && !phar->is_brandnew) { in phar_zip_flush()
1362 oldfile = phar->fp; in phar_zip_flush()
1484 if (phar->fp && pass.free_fp) { in phar_zip_flush()
1485 php_stream_close(phar->fp); in phar_zip_flush()
1500 phar->fp = pass.filefp; in phar_zip_flush()
1502 …phar->fp = php_stream_open_wrapper(phar->fname, "w+b", IGNORE_URL|STREAM_MUST_SEEK|REPORT_ERRORS, … in phar_zip_flush()
1503 if (!phar->fp) { in phar_zip_flush()
1507 phar->fp = pass.filefp; in phar_zip_flush()
1514 phar_stream_copy_to_stream(pass.filefp, phar->fp, PHP_STREAM_COPY_ALL, NULL); in phar_zip_flush()