Commit 736bafbb9ca645fc8662d9d05f5a72a2e6185e75
1 parent
0802ba27
Rename seek functions in QUtil
Showing
4 changed files
with
8 additions
and
8 deletions
include/qpdf/QUtil.hh
| ... | ... | @@ -49,9 +49,9 @@ namespace QUtil |
| 49 | 49 | |
| 50 | 50 | // Wrap around off_t versions of fseek and ftell if available |
| 51 | 51 | QPDF_DLL |
| 52 | - int fseek_off_t(FILE* stream, qpdf_offset_t offset, int whence); | |
| 52 | + int seek(FILE* stream, qpdf_offset_t offset, int whence); | |
| 53 | 53 | QPDF_DLL |
| 54 | - qpdf_offset_t ftell_off_t(FILE* stream); | |
| 54 | + qpdf_offset_t tell(FILE* stream); | |
| 55 | 55 | |
| 56 | 56 | QPDF_DLL |
| 57 | 57 | char* copy_string(std::string const&); | ... | ... |
libqpdf/QPDF.cc
| ... | ... | @@ -149,7 +149,7 @@ QPDF::FileInputSource::getName() const |
| 149 | 149 | qpdf_offset_t |
| 150 | 150 | QPDF::FileInputSource::tell() |
| 151 | 151 | { |
| 152 | - return QUtil::ftell_off_t(this->file); | |
| 152 | + return QUtil::tell(this->file); | |
| 153 | 153 | } |
| 154 | 154 | |
| 155 | 155 | void |
| ... | ... | @@ -158,7 +158,7 @@ QPDF::FileInputSource::seek(qpdf_offset_t offset, int whence) |
| 158 | 158 | QUtil::os_wrapper(std::string("seek to ") + this->filename + ", offset " + |
| 159 | 159 | QUtil::int_to_string(offset) + " (" + |
| 160 | 160 | QUtil::int_to_string(whence) + ")", |
| 161 | - QUtil::fseek_off_t(this->file, offset, whence)); | |
| 161 | + QUtil::seek(this->file, offset, whence)); | |
| 162 | 162 | } |
| 163 | 163 | |
| 164 | 164 | void |
| ... | ... | @@ -170,7 +170,7 @@ QPDF::FileInputSource::rewind() |
| 170 | 170 | size_t |
| 171 | 171 | QPDF::FileInputSource::read(char* buffer, size_t length) |
| 172 | 172 | { |
| 173 | - this->last_offset = QUtil::ftell_off_t(this->file); | |
| 173 | + this->last_offset = QUtil::tell(this->file); | |
| 174 | 174 | size_t len = fread(buffer, 1, length, this->file); |
| 175 | 175 | if ((len == 0) && ferror(this->file)) |
| 176 | 176 | { | ... | ... |
libqpdf/QUtil.cc
| ... | ... | @@ -122,7 +122,7 @@ QUtil::fopen_wrapper(std::string const& description, FILE* f) |
| 122 | 122 | } |
| 123 | 123 | |
| 124 | 124 | int |
| 125 | -QUtil::fseek_off_t(FILE* stream, qpdf_offset_t offset, int whence) | |
| 125 | +QUtil::seek(FILE* stream, qpdf_offset_t offset, int whence) | |
| 126 | 126 | { |
| 127 | 127 | #if HAVE_FSEEKO |
| 128 | 128 | return fseeko(stream, (off_t)offset, whence); |
| ... | ... | @@ -138,7 +138,7 @@ QUtil::fseek_off_t(FILE* stream, qpdf_offset_t offset, int whence) |
| 138 | 138 | } |
| 139 | 139 | |
| 140 | 140 | qpdf_offset_t |
| 141 | -QUtil::ftell_off_t(FILE* stream) | |
| 141 | +QUtil::tell(FILE* stream) | |
| 142 | 142 | { |
| 143 | 143 | #if HAVE_FSEEKO |
| 144 | 144 | return (qpdf_offset_t)ftello(stream); | ... | ... |
qpdf/test_driver.cc
| ... | ... | @@ -113,7 +113,7 @@ void runtest(int n, char const* filename) |
| 113 | 113 | FILE* f = QUtil::fopen_wrapper(std::string("open ") + filename, |
| 114 | 114 | fopen(filename, "rb")); |
| 115 | 115 | fseek(f, 0, SEEK_END); |
| 116 | - size_t size = (size_t) QUtil::ftell_off_t(f); | |
| 116 | + size_t size = (size_t) QUtil::tell(f); | |
| 117 | 117 | fseek(f, 0, SEEK_SET); |
| 118 | 118 | file_buf = PointerHolder<char>(true, new char[size]); |
| 119 | 119 | char* buf_p = file_buf.getPointer(); | ... | ... |