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()
413 now = php_stream_tell(fp); in phar_parse_zipfile()
420 php_stream_seek(fp, 0, SEEK_SET); in phar_parse_zipfile()
422 phar_stream_copy_to_stream(fp, sigfile, entry.header_offset, NULL); in phar_parse_zipfile()
424 php_stream_seek(fp, PHAR_GET_32(locator.cdir_offset), SEEK_SET); in phar_parse_zipfile()
426 phar_stream_copy_to_stream(fp, sigfile, beforeus - PHAR_GET_32(locator.cdir_offset), NULL); in phar_parse_zipfile()
430 …php_stream_seek(fp, sizeof(phar_zip_file_header) + entry.header_offset + entry.filename_len + PHAR… in phar_parse_zipfile()
432 read = php_stream_read(fp, sig, entry.uncompressed_filesize); in phar_parse_zipfile()
465 off_t loc = php_stream_tell(fp); in phar_parse_zipfile()
466 if (FAILURE == phar_zip_process_extra(fp, &entry, PHAR_GET_16(zipentry.extra_len) TSRMLS_CC)) { in phar_parse_zipfile()
470 php_stream_seek(fp, loc + PHAR_GET_16(zipentry.extra_len), SEEK_SET); in phar_parse_zipfile()
534 …if (PHAR_GET_16(zipentry.comment_len) != php_stream_read(fp, buf, PHAR_GET_16(zipentry.comment_len… in phar_parse_zipfile()
566 saveloc = php_stream_tell(fp); in phar_parse_zipfile()
567 php_stream_seek(fp, PHAR_GET_32(zipentry.offset), SEEK_SET); in phar_parse_zipfile()
569 if (sizeof(local) != php_stream_read(fp, (char *) &local, sizeof(local))) { in phar_parse_zipfile()
583 php_stream_seek(fp, entry.offset, SEEK_SET); in phar_parse_zipfile()
585 fp->writepos = 0; in phar_parse_zipfile()
586 fp->readpos = 0; in phar_parse_zipfile()
587 php_stream_seek(fp, entry.offset, SEEK_SET); in phar_parse_zipfile()
588 fp->writepos = 0; in phar_parse_zipfile()
589 fp->readpos = 0; in phar_parse_zipfile()
595 filter = php_stream_filter_create("zlib.inflate", NULL, php_stream_is_persistent(fp) TSRMLS_CC); in phar_parse_zipfile()
602 php_stream_filter_append(&fp->readfilters, filter); in phar_parse_zipfile()
604 …if (!(entry.uncompressed_filesize = php_stream_copy_to_mem(fp, &actual_alias, entry.uncompressed_f… in phar_parse_zipfile()
613 …filter = php_stream_filter_create("bzip2.decompress", NULL, php_stream_is_persistent(fp) TSRMLS_CC… in phar_parse_zipfile()
620 php_stream_filter_append(&fp->readfilters, filter); in phar_parse_zipfile()
622 …if (!(entry.uncompressed_filesize = php_stream_copy_to_mem(fp, &actual_alias, entry.uncompressed_f… in phar_parse_zipfile()
630 …if (!(entry.uncompressed_filesize = php_stream_copy_to_mem(fp, &actual_alias, entry.uncompressed_f… in phar_parse_zipfile()
637 php_stream_seek(fp, saveloc, SEEK_SET); in phar_parse_zipfile()
644 mydata->fp = fp; in phar_parse_zipfile()
837 … if (entry->fp_type == PHAR_MOD && entry->fp != entry->phar->fp && entry->fp != entry->phar->ufp) { in phar_zip_changed_apply()
838 php_stream_close(entry->fp); in phar_zip_changed_apply()
839 entry->fp = NULL; in phar_zip_changed_apply()
1035 …if (entry->fp_type == PHAR_MOD && entry->fp != entry->phar->fp && entry->fp != entry->phar->ufp &&… in phar_zip_changed_apply()
1036 php_stream_close(entry->fp); in phar_zip_changed_apply()
1061 entry->fp = NULL; in phar_zip_changed_apply()
1119 entry.fp = php_stream_fopen_tmpfile(); in phar_zip_applysignature()
1122 if (entry.fp == NULL) { in phar_zip_applysignature()
1130 …if (8 != (int)php_stream_write(entry.fp, sigbuf, 8) || signature_length != (int)php_stream_write(e… in phar_zip_applysignature()
1195 entry.fp = php_stream_fopen_tmpfile(); in phar_zip_flush()
1196 if (entry.fp == NULL) { in phar_zip_flush()
1200 if (phar->alias_len != (int)php_stream_write(entry.fp, phar->alias, phar->alias_len)) { in phar_zip_flush()
1273 entry.fp = php_stream_fopen_tmpfile(); in phar_zip_flush()
1274 if (entry.fp == NULL) { in phar_zip_flush()
1280 if ((size_t)len != php_stream_write(entry.fp, user_stub, len) in phar_zip_flush()
1281 || 5 != php_stream_write(entry.fp, " ?>\r\n", 5)) { in phar_zip_flush()
1288 php_stream_close(entry.fp); in phar_zip_flush()
1310 entry.fp = php_stream_fopen_tmpfile(); in phar_zip_flush()
1311 if (entry.fp == NULL) { in phar_zip_flush()
1315 if (sizeof(newstub)-1 != php_stream_write(entry.fp, newstub, sizeof(newstub)-1)) { in phar_zip_flush()
1316 php_stream_close(entry.fp); in phar_zip_flush()
1330 php_stream_close(entry.fp); in phar_zip_flush()
1338 php_stream_close(entry.fp); in phar_zip_flush()
1343 php_stream_close(entry.fp); in phar_zip_flush()
1353 if (phar->fp && !phar->is_brandnew) { in phar_zip_flush()
1354 oldfile = phar->fp; in phar_zip_flush()
1476 if (phar->fp && pass.free_fp) { in phar_zip_flush()
1477 php_stream_close(phar->fp); in phar_zip_flush()
1492 phar->fp = pass.filefp; in phar_zip_flush()
1494 …phar->fp = php_stream_open_wrapper(phar->fname, "w+b", IGNORE_URL|STREAM_MUST_SEEK|REPORT_ERRORS, … in phar_zip_flush()
1495 if (!phar->fp) { in phar_zip_flush()
1499 phar->fp = pass.filefp; in phar_zip_flush()
1506 phar_stream_copy_to_stream(pass.filefp, phar->fp, PHP_STREAM_COPY_ALL, NULL); in phar_zip_flush()