- return p;
-}
-
-/* Copies the struct resource_entry @entry to the memory pointed to by @p in the
- * on-disk format. A pointer to the byte after the memory written at @p is
- * returned. */
-void *
-put_resource_entry(void *p, const struct resource_entry *entry)
-{
- p = put_u56(p, entry->size);
- p = put_u8(p, entry->flags);
- p = put_u64(p, entry->offset);
- p = put_u64(p, entry->original_size);
- return p;
-}
-
-static FILE *
-wim_get_fp(WIMStruct *w)
-{
- FILE *fp;
-#if defined(WITH_FUSE) || defined(ENABLE_MULTITHREADED_COMPRESSION)
- pthread_mutex_lock(&w->fp_tab_mutex);
-
- wimlib_assert(w->filename != NULL);
-
- for (size_t i = 0; i < w->num_allocated_fps; i++) {
- if (w->fp_tab[i]) {
- fp = w->fp_tab[i];
- w->fp_tab[i] = NULL;
- goto out_unlock;
- }
- }
- DEBUG("Opening extra file descriptor to `%"TS"'", w->filename);
- fp = tfopen(w->filename, T("rb"));
- if (!fp)
- ERROR_WITH_ERRNO("Failed to open `%"TS"'", w->filename);
-out_unlock:
- pthread_mutex_unlock(&w->fp_tab_mutex);
-#else /* WITH_FUSE || ENABLE_MULTITHREADED_COMPRESSION */
- fp = w->fp;
-#endif /* !WITH_FUSE && !ENABLE_MULTITHREADED_COMPRESSION */
- return fp;