+static void wordAddAny (const RecWord *p)
+{
+ if (p->attrSet != 1 || p->attrUse != 1016)
+ {
+ RecWord w;
+
+ memcpy (&w, p, sizeof(w));
+ w.attrSet = 1;
+ w.attrUse = 1016;
+ wordAdd (&w);
+ }
+ wordAdd (p);
+}
+
+
+#define FILE_READ_BUF 1
+#if FILE_READ_BUF
+static char *file_buf;
+static int file_offset;
+static int file_bufsize;
+
+static void file_read_start (int fd)
+{
+ file_offset = 0;
+ file_buf = xmalloc (4096);
+ file_bufsize = read (fd, file_buf, 4096);
+}
+
+static void file_read_stop (int fd)
+{
+ xfree (file_buf);
+}
+
+static int file_read (int fd, char *buf, size_t count)
+{
+ int l = file_bufsize - file_offset;
+
+ if (count > l)
+ {
+ int r;
+ if (l > 0)
+ memcpy (buf, file_buf + file_offset, l);
+ count = count-l;
+ if (count > file_bufsize)
+ {
+ if ((r = read (fd, buf + l, count)) == -1)
+ {
+ logf (LOG_FATAL|LOG_ERRNO, "read");
+ exit (1);
+ }
+ file_bufsize = 0;
+ file_offset = 0;
+ return r;
+ }
+ file_bufsize = r = read (fd, file_buf, 4096);
+ if (r == -1)
+ {
+ logf (LOG_FATAL|LOG_ERRNO, "read");
+ exit (1);
+ }
+ else if (r <= count)
+ {
+ file_offset = r;
+ memcpy (buf + l, file_buf, r);
+ return l + r;
+ }
+ else
+ {
+ file_offset = count;
+ memcpy (buf + l, file_buf, count - l);
+ return count;
+ }
+ }
+ memcpy (buf, file_buf + file_offset, count);
+ file_offset += count;
+ return count;
+}
+#else