/* Version */
-#define SHER_VER "1.2"
+#define SHER_VER "1.3"
+
+/* Features */
+
+#define SHERLOCK_CONFIG_REF_WEIGHTS
+#undef SHERLOCK_CONFIG_LARGE_DB
+#undef SHERLOCK_CONFIG_LFS
/* Types */
typedef u32 oid_t; /* Object ID */
+#ifdef SHERLOCK_CONFIG_LFS /* off_t as passed to file functions */
+typedef s64 sh_off_t;
+#define BYTES_PER_FILE_POINTER 5
+#else
+typedef int sh_off_t;
+#define BYTES_PER_FILE_POINTER 4
+#endif
+
+#ifdef SHERLOCK_CONFIG_LARGE_DB /* off_t as present in database files */
+typedef s64 sh_foff_t;
+#else
+typedef s32 sh_foff_t;
+#endif
+
/* CPU characteristics */
#define CPU_LITTLE_ENDIAN
--- /dev/null
+/*
+ * Sherlock Library -- Large File Support
+ *
+ * (c) 1999 Martin Mares, <mj@atrey.karlin.mff.cuni.cz>
+ */
+
+#ifndef _SHERLOCK_LFS_H
+#define _SHERLOCK_LFS_H
+
+#ifdef SHERLOCK_CONFIG_LFS
+
+#ifndef O_LARGEFILE
+#if defined(__linux__) && defined(__i386__)
+#define O_LARGEFILE 0100000
+#else
+#error O_LARGEFILE unknown
+#endif
+#endif
+
+#if 0
+
+/* A "do it yourself" solution */
+
+#include <asm/unistd.h>
+#include <errno.h>
+
+_syscall5(int, _llseek, int, fd, int, hi, int, lo, loff_t *, result, int, whence);
+
+extern inline loff_t sh_seek(int fd, sh_off_t pos, int whence)
+{
+ loff_t result;
+ int err;
+
+ err = _llseek(fd, pos >> 32, pos, &result, whence);
+ return (err < 0) ? err : result;
+}
+#else
+
+/* Touching hidden places in glibc */
+extern loff_t llseek(int fd, loff_t pos, int whence);
+#define sh_seek(f,o,w) llseek(f,o,w)
+
+#endif
+
+#else /* !SHERLOCK_CONFIG_LFS */
+
+#define sh_seek(f,o,w) lseek(f,o,w)
+
+#endif /* !SHERLOCK_CONFIG_LFS */
+#endif /* !_SHERLOCK_LFS_H */