Пример #1
0
METHODDEF void
read_file_store(j_common_ptr cinfo, backing_store_ptr info, void FAR * buffer_address, long file_offset, long byte_count)
{
	if(jdos_seek(info->handle.file_handle, file_offset))
		ERREXIT(cinfo, JERR_TFILE_SEEK);
	/* Since MAX_ALLOC_CHUNK is less than 64K, byte_count will be too. */
	if(byte_count > 65535L)		/* safety check */
		ERREXIT(cinfo, JERR_BAD_ALLOC_CHUNK);
	if(jdos_read(info->handle.file_handle, buffer_address, (unsigned short)byte_count))
		ERREXIT(cinfo, JERR_TFILE_READ);
}
METHODDEF void
read_file_store (backing_store_ptr info, void FAR * buffer_address,
		 long file_offset, long byte_count)
{
  if (jdos_seek(info->handle.file_handle, file_offset))
    ERREXIT(methods, "seek failed on temporary file");
  /* Since MAX_ALLOC_CHUNK is less than 64K, byte_count will be too. */
  if (byte_count > 65535L)	/* safety check */
    ERREXIT(methods, "MAX_ALLOC_CHUNK should be less than 64K");
  if (jdos_read(info->handle.file_handle, buffer_address,
		(unsigned short) byte_count))
    ERREXIT(methods, "read failed on temporary file");
}