Lines Matching refs:fp
124 _zip_cdir_write(struct zip_cdir *cd, FILE *fp, struct zip_error *error) in _zip_cdir_write() argument
128 cd->offset = ftello(fp); in _zip_cdir_write()
131 if (_zip_dirent_write(cd->entry+i, fp, 0, error) != 0) in _zip_cdir_write()
135 cd->size = ftello(fp) - cd->offset; in _zip_cdir_write()
138 fwrite(EOCD_MAGIC, 1, 4, fp); in _zip_cdir_write()
139 _zip_write4(0, fp); in _zip_cdir_write()
140 _zip_write2((unsigned short)cd->nentry, fp); in _zip_cdir_write()
141 _zip_write2((unsigned short)cd->nentry, fp); in _zip_cdir_write()
142 _zip_write4(cd->size, fp); in _zip_cdir_write()
143 _zip_write4(cd->offset, fp); in _zip_cdir_write()
144 _zip_write2(cd->comment_len, fp); in _zip_cdir_write()
145 fwrite(cd->comment, 1, cd->comment_len, fp); in _zip_cdir_write()
147 if (ferror(fp)) { in _zip_cdir_write()
220 _zip_dirent_read(struct zip_dirent *zde, FILE *fp, in _zip_dirent_read() argument
245 if ((fread(buf, 1, size, fp)<size)) { in _zip_dirent_read()
328 zde->filename = _zip_readfpstr(fp, zde->filename_len, 1, error); in _zip_dirent_read()
334 zde->extrafield = _zip_readfpstr(fp, zde->extrafield_len, 0, in _zip_dirent_read()
341 zde->comment = _zip_readfpstr(fp, zde->comment_len, 0, error); in _zip_dirent_read()
425 _zip_dirent_write(struct zip_dirent *zde, FILE *fp, int localp, in _zip_dirent_write() argument
430 fwrite(localp ? LOCAL_MAGIC : CENTRAL_MAGIC, 1, 4, fp); in _zip_dirent_write()
433 _zip_write2(zde->version_madeby, fp); in _zip_dirent_write()
434 _zip_write2(zde->version_needed, fp); in _zip_dirent_write()
435 _zip_write2(zde->bitflags, fp); in _zip_dirent_write()
436 _zip_write2(zde->comp_method, fp); in _zip_dirent_write()
439 _zip_write2(dostime, fp); in _zip_dirent_write()
440 _zip_write2(dosdate, fp); in _zip_dirent_write()
442 _zip_write4(zde->crc, fp); in _zip_dirent_write()
443 _zip_write4(zde->comp_size, fp); in _zip_dirent_write()
444 _zip_write4(zde->uncomp_size, fp); in _zip_dirent_write()
446 _zip_write2(zde->filename_len, fp); in _zip_dirent_write()
447 _zip_write2(zde->extrafield_len, fp); in _zip_dirent_write()
450 _zip_write2(zde->comment_len, fp); in _zip_dirent_write()
451 _zip_write2(zde->disk_number, fp); in _zip_dirent_write()
452 _zip_write2(zde->int_attrib, fp); in _zip_dirent_write()
453 _zip_write4(zde->ext_attrib, fp); in _zip_dirent_write()
454 _zip_write4(zde->offset, fp); in _zip_dirent_write()
458 fwrite(zde->filename, 1, zde->filename_len, fp); in _zip_dirent_write()
461 fwrite(zde->extrafield, 1, zde->extrafield_len, fp); in _zip_dirent_write()
465 fwrite(zde->comment, 1, zde->comment_len, fp); in _zip_dirent_write()
468 if (ferror(fp)) { in _zip_dirent_write()
528 _zip_readfpstr(FILE *fp, unsigned int len, int nulp, struct zip_error *error) in _zip_readfpstr() argument
538 if (fread(r, 1, len, fp)<len) { in _zip_readfpstr()
585 _zip_write2(unsigned short i, FILE *fp) in _zip_write2() argument
587 putc(i&0xff, fp); in _zip_write2()
588 putc((i>>8)&0xff, fp); in _zip_write2()
596 _zip_write4(unsigned int i, FILE *fp) in _zip_write4() argument
598 putc(i&0xff, fp); in _zip_write4()
599 putc((i>>8)&0xff, fp); in _zip_write4()
600 putc((i>>16)&0xff, fp); in _zip_write4()
601 putc((i>>24)&0xff, fp); in _zip_write4()