+#if COMPARE_ONTHEFLY
+/*
+ * Compare the next block of a file.
+ */
+static void
+xtrcmpfile(char *buf, size_t size)
+{
+ static char cmpbuf[MAXBSIZE];
+
+ if (cmperror)
+ return;
+
+ if (read(ifile, cmpbuf, size) != size) {
+ fprintf(stderr, "%s: size has changed.\n",
+ curfile.name);
+ cmperror = 1;
+ return;
+ }
+
+ if (memcmp(buf, cmpbuf, size) != 0) {
+ fprintf(stderr, "%s: tape and disk copies are different\n",
+ curfile.name);
+ cmperror = 1;
+ return;
+ }
+}
+
+/*
+ * Skip over a hole in a file.
+ */
+static void
+xtrcmpskip(char *buf, size_t size)
+{
+ static char cmpbuf[MAXBSIZE];
+ int i;
+
+ if (cmperror)
+ return;
+
+ if (read(ifile, cmpbuf, size) != size) {
+ fprintf(stderr, "%s: size has changed.\n",
+ curfile.name);
+ cmperror = 1;
+ return;
+ }
+
+ for (i = 0; i < size; ++i)
+ if (cmpbuf[i] != '\0') {
+ fprintf(stderr, "%s: tape and disk copies are different\n",
+ curfile.name);
+ cmperror = 1;
+ return;
+ }
+}
+#endif /* COMPARE_ONTHEFLY */
+
+#if !COMPARE_ONTHEFLY