Lines Matching refs:file_idx
111 update_foz_index(struct foz_db *foz_db, FILE *db_idx, unsigned file_idx) in update_foz_index() argument
162 entry->file_idx = file_idx; in update_foz_index()
199 load_foz_dbs(struct foz_db *foz_db, FILE *db_idx, uint8_t file_idx, in load_foz_dbs() argument
211 int err = lock_file_with_timeout(foz_db->file[file_idx], 100000000); in load_foz_dbs()
238 sizeof(stream_reference_magic_and_version), foz_db->file[file_idx]) != in load_foz_dbs()
247 fflush(foz_db->file[file_idx]); in load_foz_dbs()
251 flock(fileno(foz_db->file[file_idx]), LOCK_UN); in load_foz_dbs()
253 update_foz_index(foz_db, db_idx, file_idx); in load_foz_dbs()
259 flock(fileno(foz_db->file[file_idx]), LOCK_UN); in load_foz_dbs()
296 uint8_t file_idx = 1; in foz_prepare() local
315 foz_db->file[file_idx] = fopen(filename, "rb"); in foz_prepare()
321 if (!check_files_opened_successfully(foz_db->file[file_idx], db_idx)) { in foz_prepare()
323 foz_db->file[file_idx] = NULL; in foz_prepare()
328 if (!load_foz_dbs(foz_db, db_idx, file_idx, true)) { in foz_prepare()
334 file_idx++; in foz_prepare()
336 if (file_idx >= FOZ_MAX_DBS) in foz_prepare()
388 uint8_t file_idx = entry->file_idx; in foz_read_entry() local
389 if (fseek(foz_db->file[file_idx], entry->offset, SEEK_SET) < 0) in foz_read_entry()
393 if (fread(&entry->header, 1, header_size, foz_db->file[file_idx]) != in foz_read_entry()
407 if (fread(data, 1, data_sz, foz_db->file[file_idx]) != data_sz) in foz_read_entry()
520 entry->file_idx = 0; in foz_write_entry()