+#ifdef USE_QFA
+ if (tapeposflag) {
+ msg("reading QFA positions from %s\n", gTapeposfile);
+ if ((gTapeposfp = fopen(gTapeposfile, "r")) == NULL)
+ errx(1, "can't open file for reading -- %s",
+ gTapeposfile);
+ /* start reading header info */
+ if (fgets(gTps, sizeof(gTps), gTapeposfp) == NULL)
+ errx(1, "not requested format of -- %s", gTapeposfile);
+ gTps[strlen(gTps) - 1] = 0; /* delete end of line */
+ if (strcmp(gTps, QFA_MAGIC) != 0)
+ errx(1, "not requested format of -- %s", gTapeposfile);
+ if (fgets(gTps, sizeof(gTps), gTapeposfp) == NULL)
+ errx(1, "not requested format of -- %s", gTapeposfile);
+ gTps[strlen(gTps) - 1] = 0;
+ if (strcmp(gTps, QFA_VERSION) != 0)
+ errx(1, "not requested format of -- %s", gTapeposfile);
+ /* read dumpdate */
+ if (fgets(gTps, sizeof(gTps), gTapeposfp) == NULL)
+ errx(1, "not requested format of -- %s", gTapeposfile);
+ gTps[strlen(gTps) - 1] = 0;
+ /* TODO: check dumpdate from QFA file with current dump file's
+ * dump date */
+ /* if not equal either output warning and continue without QFA
+ * or abort */
+ /* read empty line */
+ if (fgets(gTps, sizeof(gTps), gTapeposfp) == NULL)
+ errx(1, "not requested format of -- %s", gTapeposfile);
+ gTps[strlen(gTps) - 1] = 0;
+ /* read table header line */
+ if (fgets(gTps, sizeof(gTps), gTapeposfp) == NULL)
+ errx(1, "not requested format of -- %s", gTapeposfile);
+ gTps[strlen(gTps) - 1] = 0;
+ /* end reading header info */
+ /* tape position table starts here */
+ gSeekstart = ftell(gTapeposfp); /* remember for later use */
+}
+#endif /* USE_QFA */
+