]> git.draconx.ca Git - liblbx.git/blobdiff - src/misc.h
Split off _lbx_fseek() into a shared component of the library.
[liblbx.git] / src / misc.h
diff --git a/src/misc.h b/src/misc.h
new file mode 100644 (file)
index 0000000..d7a7605
--- /dev/null
@@ -0,0 +1,16 @@
+#ifndef LBX_MISC_H_
+#define LBX_MISC_H_
+
+#include <stdio.h>
+
+#define MIN(a,b) (((a)<(b))?(a):(b))
+#define MAX(a,b) (((a)>(b))?(a):(b))
+
+/** _lbx_fseek()
+ * Seeks the specified file to the specified offset, given that the file is
+ * currently positioned at *current.  If the file does not support seeking,
+ * and offset > *current, perform the seek by reading (and discarding) data.
+ */
+int _lbx_fseek(FILE *f, long *current, size_t offset);
+
+#endif