aboutsummaryrefslogtreecommitdiffstats
path: root/wiretap/file_wrappers.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2012-05-02 21:25:48 +0000
committerGuy Harris <guy@alum.mit.edu>2012-05-02 21:25:48 +0000
commitecacaacbe284c8f94fc39ea45e0cc70e399071b1 (patch)
treee7164b94eb91a720d607cd415c8b63f8f4af2abf /wiretap/file_wrappers.c
parente1ee9ca90779bc2ceb3b28e5ccb66937f45a4bfd (diff)
Add a file_skip() routine to skip N bytes forward in the file - it's
currently just a wrapper around file_seek(), but could be implemented by reading forward if, for example, we add support for reading (sequentially only!) from a pipe. Sort the declarations of file-reading routines into one block. svn path=/trunk/; revision=42391
Diffstat (limited to 'wiretap/file_wrappers.c')
-rw-r--r--wiretap/file_wrappers.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/wiretap/file_wrappers.c b/wiretap/file_wrappers.c
index fa5aef43aa..0de09143d2 100644
--- a/wiretap/file_wrappers.c
+++ b/wiretap/file_wrappers.c
@@ -1042,6 +1042,19 @@ file_seek(FILE_T file, gint64 offset, int whence, int *err)
return file->pos + offset;
}
+/*
+ * Skip forward the specified number of bytes in the file.
+ * Currently implemented as a wrapper around file_seek(),
+ * but if, for example, we ever add support for reading
+ * sequentially from a pipe, this could instead just skip
+ * forward by reading the bytes in question.
+ */
+gint64
+file_skip(FILE_T file, gint64 delta, int *err)
+{
+ return file_seek(file, delta, SEEK_CUR, err);
+}
+
gint64
file_tell(FILE_T stream)
{