#include <grub/misc.h>
#include <grub/mm.h>
#include <grub/deflate.h>
+#include <grub/file.h>
GRUB_MOD_LICENSE ("GPLv3+");
if (node->compressed == 1)
{
grub_memcpy (buf, node->cbuf + pos, len);
+ if (grub_file_progress_hook && node->file)
+ grub_file_progress_hook (0, 0, len, node->file);
return len;
}
}
grub_memcpy (buf, node->cbuf + (pos % HFSPLUS_COMPRESS_BLOCK_SIZE),
curlen);
+ if (grub_file_progress_hook && node->file)
+ grub_file_progress_hook (0, 0, curlen, node->file);
buf += curlen;
pos += curlen;
len -= curlen;
{
grub_memset (buf, 0, nn * GRUB_NTFS_COM_LEN);
buf += nn * GRUB_NTFS_COM_LEN;
+ if (grub_file_progress_hook && ctx->file)
+ grub_file_progress_hook (0, 0, nn * GRUB_NTFS_COM_LEN,
+ ctx->file);
}
}
else
return grub_errno;
if (buf)
buf += GRUB_NTFS_COM_LEN;
+ if (grub_file_progress_hook && ctx->file)
+ grub_file_progress_hook (0, 0, GRUB_NTFS_COM_LEN,
+ ctx->file);
nn--;
}
}
ctx->target_vcn)) << ctx->comp.log_spc, 0,
tt << (ctx->comp.log_spc + GRUB_NTFS_BLK_SHR), buf))
return grub_errno;
+ if (grub_file_progress_hook && ctx->file)
+ grub_file_progress_hook (0, 0,
+ tt << (ctx->comp.log_spc
+ + GRUB_NTFS_BLK_SHR),
+ ctx->file);
buf += tt << (ctx->comp.log_spc + GRUB_NTFS_BLK_SHR);
}
nn -= tt;
nn << (ctx->comp.log_spc + GRUB_NTFS_BLK_SHR), buf))
return grub_errno;
buf += nn << (ctx->comp.log_spc + GRUB_NTFS_BLK_SHR);
+ if (grub_file_progress_hook && ctx->file)
+ grub_file_progress_hook (0, 0,
+ nn << (ctx->comp.log_spc
+ + GRUB_NTFS_BLK_SHR),
+ ctx->file);
}
ctx->target_vcn += nn;
}
n = len;
grub_memcpy (dest, ctx->attr->sbuf + ofs - ctx->attr->save_pos, n);
+ if (grub_file_progress_hook && ctx->file)
+ grub_file_progress_hook (0, 0, n, ctx->file);
if (n == len)
return 0;
if (ofs % GRUB_NTFS_COM_LEN)
{
grub_uint32_t t, n, o;
+ void *file = ctx->file;
+
+ ctx->file = 0;
t = ctx->target_vcn << (ctx->comp.log_spc + GRUB_NTFS_BLK_SHR);
if (read_block (ctx, ctx->attr->sbuf, 1))
goto quit;
}
+ ctx->file = file;
+
ctx->attr->save_pos = t;
o = ofs % GRUB_NTFS_COM_LEN;
if (n > len)
n = len;
grub_memcpy (dest, &ctx->attr->sbuf[o], n);
+ if (grub_file_progress_hook && ctx->file)
+ grub_file_progress_hook (0, 0, n, ctx->file);
if (n == len)
goto quit;
dest += n;
if (len)
{
grub_uint32_t t;
+ void *file = ctx->file;
+ ctx->file = 0;
t = ctx->target_vcn << (ctx->comp.log_spc + GRUB_NTFS_BLK_SHR);
if (read_block (ctx, ctx->attr->sbuf, 1))
{
ctx->attr->save_pos = t;
grub_memcpy (dest, ctx->attr->sbuf, len);
+ if (grub_file_progress_hook && file)
+ grub_file_progress_hook (0, 0, len, file);
}
quit: