/* udf.c - Universal Disk Format filesystem. */
/*
* GRUB -- GRand Unified Bootloader
* Copyright (C) 2008,2009 Free Software Foundation, Inc.
*
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* GRUB 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 GRUB. If not, see <http://www.gnu.org/licenses/>.
*/
#include <grub/datetime.h>
GRUB_MOD_LICENSE ("GPLv3+");
struct grub_udf_lb_addr
{
} __attribute__ ((packed));
struct grub_udf_short_ad
{
} __attribute__ ((packed));
struct grub_udf_long_ad
{
} __attribute__ ((packed));
struct grub_udf_extent_ad
{
} __attribute__ ((packed));
struct grub_udf_charspec
{
} __attribute__ ((packed));
struct grub_udf_timestamp
{
} __attribute__ ((packed));
struct grub_udf_regid
{
grub_uint8_t ident[23];
} __attribute__ ((packed));
struct grub_udf_tag
{
} __attribute__ ((packed));
struct grub_udf_fileset
{
} __attribute__ ((packed));
struct grub_udf_icbtag
{
} __attribute__ ((packed));
struct grub_udf_file_ident
{
} __attribute__ ((packed));
struct grub_udf_file_entry
{
} __attribute__ ((packed));
struct grub_udf_extended_file_entry
{
} __attribute__ ((packed));
struct grub_udf_vrs
{
} __attribute__ ((packed));
struct grub_udf_avdp
{
} __attribute__ ((packed));
struct grub_udf_pd
{
} __attribute__ ((packed));
struct grub_udf_partmap
{
union
{
struct
{
} type1;
struct
{
grub_uint8_t ident[62];
} type2;
};
} __attribute__ ((packed));
struct grub_udf_lvd
{
grub_uint8_t ident[128];
} __attribute__ ((packed));
struct grub_udf_aed
{
} __attribute__ ((packed));
struct grub_udf_data
{
};
struct grub_fshelp_node
{
union
{
};
int part_ref;
};
static grub_uint32_t
{
{
return 0;
}
}
static grub_err_t
struct grub_udf_long_ad *icb,
struct grub_fshelp_node *node)
{
if (grub_errno)
return grub_errno;
sizeof (struct grub_udf_file_entry),
return grub_errno;
return 0;
}
static grub_disk_addr_t
{
char *ptr;
{
case GRUB_UDF_TAG_IDENT_FE:
break;
case GRUB_UDF_TAG_IDENT_EFE:
break;
default:
return 0;
}
{
{
if (adtype == 3)
{
if (!buf)
{
if (!buf)
return 0;
}
goto fail;
{
goto fail;
}
ad = (struct grub_udf_short_ad *)
(buf + sizeof (struct grub_udf_aed));
continue;
}
{
+ (filebytes >> (GRUB_DISK_SECTOR_BITS
}
ad++;
len -= sizeof (struct grub_udf_short_ad);
}
}
else
{
{
if (adtype == 3)
{
if (!buf)
{
if (!buf)
return 0;
}
goto fail;
{
goto fail;
}
ad = (struct grub_udf_long_ad *)
(buf + sizeof (struct grub_udf_aed));
continue;
}
{
+ (filebytes >> (GRUB_DISK_SECTOR_BITS
}
ad++;
len -= sizeof (struct grub_udf_long_ad);
}
}
fail:
return 0;
}
static grub_ssize_t
void NESTED_FUNC_ATTR
{
{
{
char *ptr;
return len;
}
return 0;
}
}
static struct grub_udf_data *
{
unsigned *sblklist;
int i, lbshift;
if (!data)
return 0;
/* Search for Anchor Volume Descriptor Pointer (AVDP)
* and determine logical block size. */
block = 0;
{
{
sizeof (struct grub_udf_avdp), &avdp))
{
goto fail;
}
{
break;
}
}
if (block)
break;
}
if (!block)
{
goto fail;
}
/* Search for Volume Recognition Sequence (VRS). */
{
sizeof (struct grub_udf_vrs), &vrs))
{
goto fail;
}
break;
{
goto fail;
}
}
/* Locate Partition Descriptor (PD) and Logical Volume Descriptor (LVD). */
while (1)
{
sizeof (struct grub_udf_tag), &tag))
{
goto fail;
}
{
{
goto fail;
}
sizeof (struct grub_udf_pd),
{
goto fail;
}
}
{
int k;
sizeof (struct grub_udf_lvd),
{
goto fail;
}
{
goto fail;
}
{
{
goto fail;
}
}
}
{
goto fail;
}
break;
block++;
}
{
int j;
{
break;
}
{
goto fail;
}
}
if (grub_errno)
goto fail;
sizeof (struct grub_udf_fileset), &root_fs))
{
goto fail;
}
{
goto fail;
}
return data;
fail:
return 0;
}
static char *
{
char *ret;
return NULL;
if (raw[0] == 8)
{
unsigned i;
if (!utf16)
return NULL;
for (i = 0; i < utf16len; i++)
}
if (raw[0] == 16)
{
unsigned i;
if (!utf16)
return NULL;
for (i = 0; i < utf16len; i++)
}
if (ret)
return ret;
}
static int
int NESTED_FUNC_ATTR
enum grub_fshelp_filetype filetype,
{
if (!child)
return 0;
/* The current directory is not stored. */
sizeof (struct grub_fshelp_node));
return 1;
{
return 0;
{
return 0;
}
{
if (!child)
return 0;
return 0;
{
/* This is the parent directory. */
return 1;
}
else
{
char *filename;
(GRUB_FSHELP_DIR) : (GRUB_FSHELP_REG));
(char *) raw))
return 0;
if (!filename)
grub_print_error ();
{
return 1;
}
}
}
/* Align to dword boundary. */
}
return 0;
}
static char *
{
char *ret;
if (sz < 4)
return NULL;
if (!raw)
return NULL;
return NULL;
return ret;
}
static grub_err_t
const struct grub_dirhook_info *info))
{
enum grub_fshelp_filetype filetype,
enum grub_fshelp_filetype filetype,
{
{
if (tz & 0x800)
tz |= 0xf000;
if (tz == -2047)
tz = 0;
}
}
if (!data)
goto fail;
goto fail;
goto fail;
fail:
return grub_errno;
}
static grub_err_t
{
if (!data)
goto fail;
goto fail;
goto fail;
return 0;
fail:
return grub_errno;
}
static grub_ssize_t
{
}
static grub_err_t
{
{
}
return GRUB_ERR_NONE;
}
static grub_err_t
{
if (data)
{
}
else
*label = 0;
return grub_errno;
}
.name = "udf",
.dir = grub_udf_dir,
.open = grub_udf_open,
.read = grub_udf_read,
.close = grub_udf_close,
.label = grub_udf_label,
.next = 0
};
{
}
{
}