+/* XXX Just a placeholder, in case we decide to do something with L_CHUNK
+ * log entries. Right now they're just the equivalent of L_SUCCESS, but only
+ * for a split chunk of the overall dumpfile.
+ */
+static repdata_t *
+handle_chunk()
+{
+ disk_t *dp;
+ float sec, kps, kbytes;
+ timedata_t *sp;
+ int i;
+ char *s, *fp;
+ int ch;
+ char *hostname = NULL;
+ char *diskname = NULL;
+ repdata_t *repdata;
+ int level, chunk;
+ char *datestamp;
+
+ if(curprog != P_TAPER) {
+ bogus_line();
+ return NULL;
+ }
+
+ s = curstr;
+ ch = *s++;
+
+ skip_whitespace(s, ch);
+ if(ch == '\0') {
+ bogus_line();
+ return NULL;
+ }
+ fp = s - 1;
+ skip_non_whitespace(s, ch);
+ s[-1] = '\0';
+ hostname = stralloc(fp);
+ s[-1] = ch;
+
+ skip_whitespace(s, ch);
+ if(ch == '\0') {
+ bogus_line();
+ amfree(hostname);
+ return NULL;
+ }
+ fp = s - 1;
+ skip_non_whitespace(s, ch);
+ s[-1] = '\0';
+ diskname = stralloc(fp);
+ s[-1] = ch;
+
+ skip_whitespace(s, ch);
+ if(ch == '\0') {
+ bogus_line();
+ amfree(hostname);
+ amfree(diskname);
+ return NULL;
+ }
+ fp = s - 1;
+ skip_non_whitespace(s, ch);
+ s[-1] = '\0';
+ datestamp = stralloc(fp);
+ s[-1] = ch;
+
+ level = atoi(datestamp);
+ if(level < 100) {
+ datestamp = newstralloc(datestamp, run_datestamp);
+ }
+ else {
+ skip_whitespace(s, ch);
+ if(ch == '\0' || sscanf(s - 1, "%d", &chunk) != 1) {
+ bogus_line();
+ amfree(hostname);
+ amfree(diskname);
+ amfree(datestamp);
+ return NULL;
+ }
+ skip_integer(s, ch);
+
+ skip_whitespace(s, ch);
+ if(ch == '\0' || sscanf(s - 1, "%d", &level) != 1) {
+ bogus_line();
+ amfree(hostname);
+ amfree(diskname);
+ amfree(datestamp);
+ return NULL;
+ }
+ skip_integer(s, ch);
+ }
+ skip_whitespace(s, ch);
+
+ if(level < 0 || level > 9) {
+ amfree(hostname);
+ amfree(diskname);
+ amfree(datestamp);
+ return NULL;
+ }
+
+ if(sscanf(s - 1,"[sec %f kb %f kps %f", &sec, &kbytes, &kps) != 3) {
+ bogus_line();
+ amfree(hostname);
+ amfree(diskname);
+ amfree(datestamp);
+ return NULL;
+ }
+
+
+ dp = lookup_disk(hostname, diskname);
+ if(dp == NULL) {
+ char *str = NULL;
+
+ str = vstralloc(" ", prefix(hostname, diskname, level),
+ " ", "ERROR [not in disklist]",
+ NULL);
+ addline(&errsum, str);
+ amfree(str);
+ amfree(hostname);
+ amfree(diskname);
+ amfree(datestamp);
+ return NULL;
+ }
+
+ repdata = find_repdata(dp, datestamp, level);
+
+ sp = &(repdata->taper);
+
+ i = level > 0;
+
+ amfree(hostname);
+ amfree(diskname);
+ amfree(datestamp);
+
+ if(current_tape == NULL) {
+ error("current_tape == NULL");
+ }
+ if (sp->filenum == 0) {
+ sp->filenum = ++tapefcount;
+ sp->tapelabel = current_tape->label;
+ }
+ tapechunks[level] +=1;
+ stats[i].tapechunks +=1;
+ current_tape->taper_time += sec;
+ current_tape->coutsize += kbytes;
+ current_tape->tapechunks += 1;
+ return repdata;
+}
+
+static repdata_t *
+handle_success(logtype_t logtype)