chiark / gitweb /
switch tools and volume_id from LGPL to GPLv2
[elogind.git] / extras / volume_id / volume_id / iso9660.c
index 5d4ab92a79a9853230fb04b11bdbc334328013fa..3999a1e7bfc78a25692497b60ffdfc45d7fe3ab3 100644 (file)
@@ -3,19 +3,9 @@
  *
  * Copyright (C) 2004 Kay Sievers <kay.sievers@vrfy.org>
  *
- *     This library is free software; you can redistribute it and/or
- *     modify it under the terms of the GNU Lesser General Public
- *     License as published by the Free Software Foundation; either
- *     version 2.1 of the License, or (at your option) any later version.
- *
- *     This library 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
- *     Lesser General Public License for more details.
- *
- *     You should have received a copy of the GNU Lesser General Public
- *     License along with this library; if not, write to the Free Software
- *     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *     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.
  */
 
 #ifndef _GNU_SOURCE
@@ -32,7 +22,6 @@
 #include <string.h>
 #include <errno.h>
 #include <ctype.h>
-#include <asm/types.h>
 
 #include "volume_id.h"
 #include "logging.h"
 #define ISO_VD_MAX                     16
 
 struct iso_volume_descriptor {
-       __u8    vd_type;
-       __u8    vd_id[5];
-       __u8    vd_version;
-       __u8    flags;
-       __u8    system_id[32];
-       __u8    volume_id[32];
-       __u8    unused[8];
-       __u8    space_size[8];
-       __u8    escape_sequences[8];
+       uint8_t         vd_type;
+       uint8_t         vd_id[5];
+       uint8_t         vd_version;
+       uint8_t         flags;
+       uint8_t         system_id[32];
+       uint8_t         volume_id[32];
+       uint8_t         unused[8];
+       uint8_t         space_size[8];
+       uint8_t         escape_sequences[8];
 } __attribute__((__packed__));
 
 struct high_sierra_volume_descriptor {
-       __u8    foo[8];
-       __u8    type;
-       __u8    id[4];
-       __u8    version;
+       uint8_t         foo[8];
+       uint8_t         type;
+       uint8_t         id[4];
+       uint8_t         version;
 } __attribute__((__packed__));
 
-int volume_id_probe_iso9660(struct volume_id *id, __u64 off)
+int volume_id_probe_iso9660(struct volume_id *id, uint64_t off)
 {
-       __u8 *buf;
+       uint8_t *buf;
        struct iso_volume_descriptor *is;
        struct high_sierra_volume_descriptor *hs;
 
@@ -91,7 +80,7 @@ int volume_id_probe_iso9660(struct volume_id *id, __u64 off)
                dbg("looking for SVDs");
                vd_offset = ISO_VD_OFFSET;
                for (i = 0; i < ISO_VD_MAX; i++) {
-                       char svd_label[64];
+                       uint8_t svd_label[64];
 
                        is = (struct iso_volume_descriptor *) volume_id_get_buffer(id, off + vd_offset, 0x200);
                        if (is == NULL || is->vd_type == ISO_VD_END)
@@ -104,7 +93,7 @@ int volume_id_probe_iso9660(struct volume_id *id, __u64 off)
                            memcmp(is->escape_sequences, "%/C", 3) == 0||
                            memcmp(is->escape_sequences, "%/E", 3) == 0) {
                                dbg("Joliet extension found");
-                               volume_id_set_unicode16(svd_label, sizeof(svd_label), is->volume_id, BE, 32);
+                               volume_id_set_unicode16((char *)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");
                                        break;