+ if (off != m_last_offset)
+ {
+ if (!m_cached)
+ m_last_offset = ::lseek(m_fd, off - m_base_offset, SEEK_SET) + m_base_offset;
+ else
+ {
+ ::fseeko(m_file, off - m_base_offset, SEEK_SET);
+ m_last_offset = ::ftello(m_file) + m_base_offset;
+ }
+ return m_last_offset;
+ } else
+ {
+ return m_last_offset;
+ }
+}
+
+/* m_cached */
+FILE *eRawFile::openFileCached(int nr)
+{
+ std::string filename = m_basename;
+ if (nr)
+ {
+ char suffix[5];
+ snprintf(suffix, 5, ".%03d", nr);
+ filename += suffix;
+ }
+ return ::fopen64(filename.c_str(), "rb");