chiark / gitweb /
update file headers
[elogind.git] / extras / volume_id / lib / iso9660.c
index 227641e42a7c52b03be936799f5c4bf3c047e37f..913e5b8a0e98d9b584daee587eef14546e90a976 100644 (file)
@@ -3,19 +3,24 @@
  *
  * Copyright (C) 2004 Kay Sievers <kay.sievers@vrfy.org>
  *
- *     This program is free software; you can redistribute it and/or modify it
- *     under the terms of the GNU General Public License as published by the
- *     Free Software Foundation version 2 of the License.
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
 #ifndef _GNU_SOURCE
 #define _GNU_SOURCE 1
 #endif
 
-#ifdef HAVE_CONFIG_H
-#  include <config.h>
-#endif
-
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
@@ -24,7 +29,7 @@
 #include <ctype.h>
 
 #include "libvolume_id.h"
-#include "util.h"
+#include "libvolume_id-private.h"
 
 #define ISO_SUPERBLOCK_OFFSET          0x8000
 #define ISO_SECTOR_SIZE                        0x800
@@ -59,7 +64,7 @@ int volume_id_probe_iso9660(struct volume_id *id, uint64_t off, uint64_t size)
        struct iso_volume_descriptor *is;
        struct high_sierra_volume_descriptor *hs;
 
-       info("probing at offset 0x%llx", (unsigned long long) off);
+       info("probing at offset 0x%llx\n", (unsigned long long) off);
 
        buf = volume_id_get_buffer(id, off + ISO_SUPERBLOCK_OFFSET, 0x200);
        if (buf == NULL)
@@ -71,11 +76,11 @@ int volume_id_probe_iso9660(struct volume_id *id, uint64_t off, uint64_t size)
                int vd_offset;
                int i;
 
-               dbg("read label from PVD");
+               dbg("read label from PVD\n");
                volume_id_set_label_raw(id, is->volume_id, 32);
                volume_id_set_label_string(id, is->volume_id, 32);
 
-               dbg("looking for SVDs");
+               dbg("looking for SVDs\n");
                vd_offset = ISO_VD_OFFSET;
                for (i = 0; i < ISO_VD_MAX; i++) {
                        uint8_t svd_label[64];
@@ -86,14 +91,14 @@ int volume_id_probe_iso9660(struct volume_id *id, uint64_t off, uint64_t size)
                        if (is->type != ISO_VD_SUPPLEMENTARY)
                                continue;
 
-                       dbg("found SVD at offset 0x%llx", (unsigned long long) (off + vd_offset));
+                       dbg("found SVD at offset 0x%llx\n", (unsigned long long) (off + vd_offset));
                        if (memcmp(is->escape_sequences, "%/@", 3) == 0||
                            memcmp(is->escape_sequences, "%/C", 3) == 0||
                            memcmp(is->escape_sequences, "%/E", 3) == 0) {
-                               dbg("Joliet extension found");
-                               volume_id_set_unicode16((char *)svd_label, sizeof(svd_label), is->volume_id, BE, 32);
+                               dbg("Joliet extension found\n");
+                               volume_id_set_unicode16(svd_label, sizeof(svd_label), is->volume_id, BE, 32);
                                if (memcmp(id->label, svd_label, 16) == 0) {
-                                       dbg("SVD label is identical, use the possibly longer PVD one");
+                                       dbg("SVD label is identical, use the possibly longer PVD one\n");
                                        break;
                                }