Lines Matching refs:iofile
52 FILE *iofile;
73 signed long query_tag(FILE *iofile)
79 if (fgetpos(iofile, &save_position) == -1)
82 size = id3_tag_query(query, fread(query, 1, sizeof(query), iofile));
84 if (fsetpos(iofile, &save_position) == -1)
95 struct id3_tag *read_tag(FILE *iofile, id3_length_t size)
102 if (fread(data, size, 1, iofile) == 1)
205 location = ftell(file->iofile);
228 tag = read_tag(file->iofile, length);
266 if (fgetpos(file->iofile, &save_position) == -1 ||
267 fsetpos(file->iofile, &save_position) == -1)
272 if (fseek(file->iofile, -128, SEEK_END) == 0) {
273 size = query_tag(file->iofile);
288 rewind(file->iofile);
290 size = query_tag(file->iofile);
303 if (seek < 0 || fseek(file->iofile, seek, SEEK_CUR) == -1)
306 size = query_tag(file->iofile);
313 if (fseek(file->iofile, ((file->flags & ID3_FILE_FLAG_ID3V1) ? -128 : 0) +
315 size = query_tag(file->iofile);
316 if (size < 0 && fseek(file->iofile, size, SEEK_CUR) == 0) {
317 size = query_tag(file->iofile);
323 clearerr(file->iofile);
327 if (fsetpos(file->iofile, &save_position) == -1)
381 struct id3_file *new_file(FILE *iofile, enum id3_file_mode mode,
390 file->iofile = iofile;
430 FILE *iofile;
435 iofile = fopen(path, (mode == ID3_FILE_MODE_READWRITE) ? "r+b" : "rb");
436 if (iofile == 0)
439 file = new_file(iofile, mode, path);
441 fclose(iofile);
453 FILE *iofile;
456 iofile = fdopen(fd, (mode == ID3_FILE_MODE_READWRITE) ? "r+b" : "rb");
457 if (iofile == 0)
460 file = new_file(iofile, mode, 0);
464 /* close iofile without closing fd */
468 fclose(iofile);
490 if (fclose(file->iofile) == EOF)
522 if (fseek(file->iofile, (file->flags & ID3_FILE_FLAG_ID3V1) ? -128 : 0,
524 (location = ftell(file->iofile)) == -1 ||
525 fwrite(data, 128, 1, file->iofile) == 0 ||
526 fflush(file->iofile) == EOF)
548 if (fseek(file->iofile, 0, SEEK_END) == -1)
551 length = ftell(file->iofile);
556 if (ftruncate(fileno(file->iofile), length - 128) == -1)
585 if (fseek(file->iofile, file->tags[0].location, SEEK_SET) == -1 ||
586 fwrite(data, length, 1, file->iofile) == 0 ||
587 fflush(file->iofile) == EOF)
656 rewind(file->iofile);