Imported Upstream version 3.2.1
[debian/amanda] / server-src / tapefile.c
index d3afe12bbfd42bb467554ad395c48578e3f1b581..406a0c426ee6e1d5340b3030799101d6c562b61b 100644 (file)
@@ -102,6 +102,8 @@ write_tapelist(
        g_fprintf(tapef, "%s %s", tp->datestamp, tp->label);
        if(tp->reuse) g_fprintf(tapef, " reuse");
        else g_fprintf(tapef, " no-reuse");
+       if (tp->barcode)
+           g_fprintf(tapef, " BARCODE:%s", tp->barcode);
        if (tp->comment)
            g_fprintf(tapef, " #%s", tp->comment);
        g_fprintf(tapef, "\n");
@@ -396,6 +398,16 @@ parse_tapeline(
        s[-1] = '\0';
        skip_whitespace(s, ch);
     }
+    if (strncmp_const(s - 1, "BARCODE:") == 0) {
+       s1 = s - 1 + 8;
+       skip_non_whitespace(s, ch);
+       s[-1] = '\0';
+       skip_whitespace(s, ch);
+       tp->barcode = stralloc(s1);
+    } else {
+       tp->barcode = NULL;
+    }
+
 
     if (*(s - 1) == '#') {
        tp->comment = stralloc(s); /* skip leading '#' */