makefs: eliminate global cd9660 structure
For diff reduction with NetBSD NetBSD file versions: cd9660.c 1.39 cd9660.h 1.19 cd9660/cd9660_debug.c 1.12 cd9660/cd9660_eltorito.c 1.20 cd9660/cd9660_write.c 1.16 cd9660/iso9660_rrip.c 1.12 cd9660/iso9660_rrip.h 1.6 Reviewed by: ngie Obtained from: NetBSD MFC after: 1 month Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D9627
This commit is contained in:
parent
c9cde8251c
commit
1631d42aa6
File diff suppressed because it is too large
Load Diff
@ -310,9 +310,6 @@ typedef struct _iso9660_disk {
|
||||
|
||||
} iso9660_disk;
|
||||
|
||||
/******** GLOBAL VARIABLES ***********/
|
||||
extern iso9660_disk diskStructure;
|
||||
|
||||
/************ FUNCTIONS **************/
|
||||
int cd9660_valid_a_chars(const char *);
|
||||
int cd9660_valid_d_chars(const char *);
|
||||
@ -331,25 +328,27 @@ void cd9660_time_915(unsigned char *, time_t);
|
||||
|
||||
/*** Boot Functions ***/
|
||||
int cd9660_write_generic_bootimage(FILE *);
|
||||
int cd9660_add_generic_bootimage(const char *);
|
||||
int cd9660_write_boot(FILE *);
|
||||
int cd9660_add_boot_disk(const char *);
|
||||
int cd9660_eltorito_add_boot_option(const char *, const char *);
|
||||
int cd9660_setup_boot(int);
|
||||
int cd9660_setup_boot_volume_descriptor(volume_descriptor *);
|
||||
int cd9660_add_generic_bootimage(iso9660_disk *, const char *);
|
||||
int cd9660_write_boot(iso9660_disk *, FILE *);
|
||||
int cd9660_add_boot_disk(iso9660_disk *, const char *);
|
||||
int cd9660_eltorito_add_boot_option(iso9660_disk *, const char *,
|
||||
const char *);
|
||||
int cd9660_setup_boot(iso9660_disk *, int);
|
||||
int cd9660_setup_boot_volume_descriptor(iso9660_disk *,
|
||||
volume_descriptor *);
|
||||
|
||||
|
||||
/*** Write Functions ***/
|
||||
int cd9660_write_image(const char *image);
|
||||
int cd9660_copy_file(FILE *, off_t, const char *);
|
||||
int cd9660_write_image(iso9660_disk *, const char *image);
|
||||
int cd9660_copy_file(iso9660_disk *, FILE *, off_t, const char *);
|
||||
|
||||
void cd9660_compute_full_filename(cd9660node *, char *);
|
||||
int cd9660_compute_record_size(cd9660node *);
|
||||
int cd9660_compute_record_size(iso9660_disk *, cd9660node *);
|
||||
|
||||
/* Debugging functions */
|
||||
void debug_print_tree(cd9660node *,int);
|
||||
void debug_print_tree(iso9660_disk *, cd9660node *,int);
|
||||
void debug_print_path_tree(cd9660node *);
|
||||
void debug_print_volume_descriptor_information(void);
|
||||
void debug_print_volume_descriptor_information(iso9660_disk *);
|
||||
void debug_dump_to_xml_ptentry(path_table_entry *,int, int);
|
||||
void debug_dump_to_xml_path_table(FILE *, off_t, int, int);
|
||||
void debug_dump_to_xml(FILE *);
|
||||
|
@ -83,7 +83,7 @@ debug_print_susp_attrs(cd9660node *n, int indent)
|
||||
}
|
||||
|
||||
void
|
||||
debug_print_tree(cd9660node *node, int level)
|
||||
debug_print_tree(iso9660_disk *diskStructure, cd9660node *node, int level)
|
||||
{
|
||||
#if !HAVE_NBTOOL_CONFIG_H
|
||||
cd9660node *cn;
|
||||
@ -111,10 +111,10 @@ debug_print_tree(cd9660node *node, int level)
|
||||
node->fileDataSector
|
||||
+ node->fileSectorsUsed - 1);
|
||||
}
|
||||
if (diskStructure.rock_ridge_enabled)
|
||||
if (diskStructure->rock_ridge_enabled)
|
||||
debug_print_susp_attrs(node, level + 1);
|
||||
TAILQ_FOREACH(cn, &node->cn_children, cn_next_child)
|
||||
debug_print_tree(cn, level + 1);
|
||||
debug_print_tree(diskStructure, cn, level + 1);
|
||||
#else
|
||||
printf("Sorry, debugging is not supported in host-tools mode.\n");
|
||||
#endif
|
||||
@ -141,9 +141,9 @@ debug_print_path_tree(cd9660node *n)
|
||||
}
|
||||
|
||||
void
|
||||
debug_print_volume_descriptor_information(void)
|
||||
debug_print_volume_descriptor_information(iso9660_disk *diskStructure)
|
||||
{
|
||||
volume_descriptor *tmp = diskStructure.firstVolumeDescriptor;
|
||||
volume_descriptor *tmp = diskStructure->firstVolumeDescriptor;
|
||||
char temp[CD9660_SECTOR_SIZE];
|
||||
|
||||
printf("==Listing Volume Descriptors==\n");
|
||||
|
@ -55,7 +55,7 @@ static u_char cd9660_boot_get_system_type(struct cd9660_boot_image *);
|
||||
#endif
|
||||
|
||||
int
|
||||
cd9660_add_boot_disk(const char *boot_info)
|
||||
cd9660_add_boot_disk(iso9660_disk *diskStructure, const char *boot_info)
|
||||
{
|
||||
struct stat stbuf;
|
||||
const char *mode_msg;
|
||||
@ -89,7 +89,7 @@ cd9660_add_boot_disk(const char *boot_info)
|
||||
|
||||
*filename++ = '\0';
|
||||
|
||||
if (diskStructure.verbose_level > 0) {
|
||||
if (diskStructure->verbose_level > 0) {
|
||||
printf("Found bootdisk with system %s, and filename %s\n",
|
||||
sysname, filename);
|
||||
}
|
||||
@ -151,14 +151,14 @@ cd9660_add_boot_disk(const char *boot_info)
|
||||
break;
|
||||
}
|
||||
|
||||
if (diskStructure.verbose_level > 0)
|
||||
if (diskStructure->verbose_level > 0)
|
||||
printf("%s\n", mode_msg);
|
||||
|
||||
new_image->size = stbuf.st_size;
|
||||
new_image->num_sectors =
|
||||
howmany(new_image->size, diskStructure.sectorSize) *
|
||||
howmany(diskStructure.sectorSize, 512);
|
||||
if (diskStructure.verbose_level > 0) {
|
||||
howmany(new_image->size, diskStructure->sectorSize) *
|
||||
howmany(diskStructure->sectorSize, 512);
|
||||
if (diskStructure->verbose_level > 0) {
|
||||
printf("New image has size %d, uses %d 512-byte sectors\n",
|
||||
new_image->size, new_image->num_sectors);
|
||||
}
|
||||
@ -168,27 +168,28 @@ cd9660_add_boot_disk(const char *boot_info)
|
||||
/* Add boot disk */
|
||||
|
||||
/* Group images for the same platform together. */
|
||||
TAILQ_FOREACH(tmp_image, &diskStructure.boot_images, image_list) {
|
||||
TAILQ_FOREACH(tmp_image, &diskStructure->boot_images, image_list) {
|
||||
if (tmp_image->system != new_image->system)
|
||||
break;
|
||||
}
|
||||
|
||||
if (tmp_image == NULL) {
|
||||
TAILQ_INSERT_HEAD(&diskStructure.boot_images, new_image,
|
||||
TAILQ_INSERT_HEAD(&diskStructure->boot_images, new_image,
|
||||
image_list);
|
||||
} else
|
||||
TAILQ_INSERT_BEFORE(tmp_image, new_image, image_list);
|
||||
|
||||
new_image->serialno = diskStructure.image_serialno++;
|
||||
new_image->serialno = diskStructure->image_serialno++;
|
||||
|
||||
/* TODO : Need to do anything about the boot image in the tree? */
|
||||
diskStructure.is_bootable = 1;
|
||||
diskStructure->is_bootable = 1;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
int
|
||||
cd9660_eltorito_add_boot_option(const char *option_string, const char *value)
|
||||
cd9660_eltorito_add_boot_option(iso9660_disk *diskStructure,
|
||||
const char *option_string, const char *value)
|
||||
{
|
||||
char *eptr;
|
||||
struct cd9660_boot_image *image;
|
||||
@ -196,8 +197,8 @@ cd9660_eltorito_add_boot_option(const char *option_string, const char *value)
|
||||
assert(option_string != NULL);
|
||||
|
||||
/* Find the last image added */
|
||||
TAILQ_FOREACH(image, &diskStructure.boot_images, image_list) {
|
||||
if (image->serialno + 1 == diskStructure.image_serialno)
|
||||
TAILQ_FOREACH(image, &diskStructure->boot_images, image_list) {
|
||||
if (image->serialno + 1 == diskStructure->image_serialno)
|
||||
break;
|
||||
}
|
||||
if (image == NULL)
|
||||
@ -351,7 +352,7 @@ cd9660_boot_get_system_type(struct cd9660_boot_image *disk)
|
||||
* Set up the BVD, Boot catalog, and the boot entries, but do no writing
|
||||
*/
|
||||
int
|
||||
cd9660_setup_boot(int first_sector)
|
||||
cd9660_setup_boot(iso9660_disk *diskStructure, int first_sector)
|
||||
{
|
||||
int sector;
|
||||
int used_sectors;
|
||||
@ -365,14 +366,14 @@ cd9660_setup_boot(int first_sector)
|
||||
x86_head = mac_head = ppc_head = NULL;
|
||||
|
||||
/* If there are no boot disks, don't bother building boot information */
|
||||
if (TAILQ_EMPTY(&diskStructure.boot_images))
|
||||
if (TAILQ_EMPTY(&diskStructure->boot_images))
|
||||
return 0;
|
||||
|
||||
/* Point to catalog: For now assume it consumes one sector */
|
||||
ELTORITO_DPRINTF(("Boot catalog will go in sector %d\n", first_sector));
|
||||
diskStructure.boot_catalog_sector = first_sector;
|
||||
diskStructure->boot_catalog_sector = first_sector;
|
||||
cd9660_bothendian_dword(first_sector,
|
||||
diskStructure.boot_descriptor->boot_catalog_pointer);
|
||||
diskStructure->boot_descriptor->boot_catalog_pointer);
|
||||
|
||||
/* Step 1: Generate boot catalog */
|
||||
/* Step 1a: Validation entry */
|
||||
@ -387,16 +388,16 @@ cd9660_setup_boot(int first_sector)
|
||||
num_entries = 1;
|
||||
used_sectors = 0;
|
||||
|
||||
TAILQ_FOREACH(tmp_disk, &diskStructure.boot_images, image_list) {
|
||||
TAILQ_FOREACH(tmp_disk, &diskStructure->boot_images, image_list) {
|
||||
used_sectors += tmp_disk->num_sectors;
|
||||
|
||||
/* One default entry per image */
|
||||
num_entries++;
|
||||
}
|
||||
catalog_sectors = howmany(num_entries * 0x20, diskStructure.sectorSize);
|
||||
catalog_sectors = howmany(num_entries * 0x20, diskStructure->sectorSize);
|
||||
used_sectors += catalog_sectors;
|
||||
|
||||
if (diskStructure.verbose_level > 0) {
|
||||
if (diskStructure->verbose_level > 0) {
|
||||
printf("%s: there will be %i entries consuming %i sectors. "
|
||||
"Catalog is %i sectors\n", __func__, num_entries,
|
||||
used_sectors, catalog_sectors);
|
||||
@ -404,16 +405,16 @@ cd9660_setup_boot(int first_sector)
|
||||
|
||||
/* Populate sector numbers */
|
||||
sector = first_sector + catalog_sectors;
|
||||
TAILQ_FOREACH(tmp_disk, &diskStructure.boot_images, image_list) {
|
||||
TAILQ_FOREACH(tmp_disk, &diskStructure->boot_images, image_list) {
|
||||
tmp_disk->sector = sector;
|
||||
sector += tmp_disk->num_sectors;
|
||||
}
|
||||
|
||||
LIST_INSERT_HEAD(&diskStructure.boot_entries, valid_entry, ll_struct);
|
||||
LIST_INSERT_HEAD(&diskStructure->boot_entries, valid_entry, ll_struct);
|
||||
|
||||
/* Step 1b: Initial/default entry */
|
||||
/* TODO : PARAM */
|
||||
tmp_disk = TAILQ_FIRST(&diskStructure.boot_images);
|
||||
tmp_disk = TAILQ_FIRST(&diskStructure->boot_images);
|
||||
default_entry = cd9660_boot_setup_default_entry(tmp_disk);
|
||||
if (default_entry == NULL) {
|
||||
warnx("Error: memory allocation failed in cd9660_setup_boot");
|
||||
@ -483,7 +484,8 @@ cd9660_setup_boot(int first_sector)
|
||||
}
|
||||
|
||||
int
|
||||
cd9660_setup_boot_volume_descriptor(volume_descriptor *bvd)
|
||||
cd9660_setup_boot_volume_descriptor(iso9660_disk *diskStructure,
|
||||
volume_descriptor *bvd)
|
||||
{
|
||||
boot_volume_descriptor *bvdData =
|
||||
(boot_volume_descriptor*)bvd->volumeDescriptorData;
|
||||
@ -493,7 +495,7 @@ cd9660_setup_boot_volume_descriptor(volume_descriptor *bvd)
|
||||
bvdData->version[0] = 1;
|
||||
memcpy(bvdData->boot_system_identifier, ET_ID, 23);
|
||||
memcpy(bvdData->identifier, ISO_VOLUME_DESCRIPTOR_STANDARD_ID, 5);
|
||||
diskStructure.boot_descriptor =
|
||||
diskStructure->boot_descriptor =
|
||||
(boot_volume_descriptor*) bvd->volumeDescriptorData;
|
||||
return 1;
|
||||
}
|
||||
@ -588,7 +590,7 @@ cd9660_write_apm_partition_entry(FILE *fd, int idx, int total_partitions,
|
||||
}
|
||||
|
||||
int
|
||||
cd9660_write_boot(FILE *fd)
|
||||
cd9660_write_boot(iso9660_disk *diskStructure, FILE *fd)
|
||||
{
|
||||
struct boot_catalog_entry *e;
|
||||
struct cd9660_boot_image *t;
|
||||
@ -596,16 +598,16 @@ cd9660_write_boot(FILE *fd)
|
||||
int mbr_partitions = 0;
|
||||
|
||||
/* write boot catalog */
|
||||
if (fseeko(fd, (off_t)diskStructure.boot_catalog_sector *
|
||||
diskStructure.sectorSize, SEEK_SET) == -1)
|
||||
if (fseeko(fd, (off_t)diskStructure->boot_catalog_sector *
|
||||
diskStructure->sectorSize, SEEK_SET) == -1)
|
||||
err(1, "fseeko");
|
||||
|
||||
if (diskStructure.verbose_level > 0) {
|
||||
if (diskStructure->verbose_level > 0) {
|
||||
printf("Writing boot catalog to sector %" PRId64 "\n",
|
||||
diskStructure.boot_catalog_sector);
|
||||
diskStructure->boot_catalog_sector);
|
||||
}
|
||||
LIST_FOREACH(e, &diskStructure.boot_entries, ll_struct) {
|
||||
if (diskStructure.verbose_level > 0) {
|
||||
LIST_FOREACH(e, &diskStructure->boot_entries, ll_struct) {
|
||||
if (diskStructure->verbose_level > 0) {
|
||||
printf("Writing catalog entry of type %d\n",
|
||||
e->entry_type);
|
||||
}
|
||||
@ -615,16 +617,16 @@ cd9660_write_boot(FILE *fd)
|
||||
*/
|
||||
fwrite(&(e->entry_data.VE), 1, 32, fd);
|
||||
}
|
||||
if (diskStructure.verbose_level > 0)
|
||||
if (diskStructure->verbose_level > 0)
|
||||
printf("Finished writing boot catalog\n");
|
||||
|
||||
/* copy boot images */
|
||||
TAILQ_FOREACH(t, &diskStructure.boot_images, image_list) {
|
||||
if (diskStructure.verbose_level > 0) {
|
||||
TAILQ_FOREACH(t, &diskStructure->boot_images, image_list) {
|
||||
if (diskStructure->verbose_level > 0) {
|
||||
printf("Writing boot image from %s to sectors %d\n",
|
||||
t->filename, t->sector);
|
||||
}
|
||||
cd9660_copy_file(fd, t->sector, t->filename);
|
||||
cd9660_copy_file(diskStructure, fd, t->sector, t->filename);
|
||||
|
||||
if (t->system == ET_SYS_MAC)
|
||||
apm_partitions++;
|
||||
@ -633,7 +635,7 @@ cd9660_write_boot(FILE *fd)
|
||||
}
|
||||
|
||||
/* some systems need partition tables as well */
|
||||
if (mbr_partitions > 0 || diskStructure.chrp_boot) {
|
||||
if (mbr_partitions > 0 || diskStructure->chrp_boot) {
|
||||
uint16_t sig;
|
||||
|
||||
fseek(fd, 0x1fe, SEEK_SET);
|
||||
@ -643,18 +645,18 @@ cd9660_write_boot(FILE *fd)
|
||||
mbr_partitions = 0;
|
||||
|
||||
/* Write ISO9660 descriptor, enclosing the whole disk */
|
||||
if (diskStructure.chrp_boot)
|
||||
if (diskStructure->chrp_boot)
|
||||
cd9660_write_mbr_partition_entry(fd, mbr_partitions++,
|
||||
0, diskStructure.totalSectors *
|
||||
(diskStructure.sectorSize / 512), 0x96);
|
||||
0, diskStructure->totalSectors *
|
||||
(diskStructure->sectorSize / 512), 0x96);
|
||||
|
||||
/* Write all partition entries */
|
||||
TAILQ_FOREACH(t, &diskStructure.boot_images, image_list) {
|
||||
TAILQ_FOREACH(t, &diskStructure->boot_images, image_list) {
|
||||
if (t->system != ET_SYS_PPC)
|
||||
continue;
|
||||
cd9660_write_mbr_partition_entry(fd, mbr_partitions++,
|
||||
t->sector * (diskStructure.sectorSize / 512),
|
||||
t->num_sectors * (diskStructure.sectorSize / 512),
|
||||
t->sector * (diskStructure->sectorSize / 512),
|
||||
t->num_sectors * (diskStructure->sectorSize / 512),
|
||||
0x41 /* PReP Boot */);
|
||||
}
|
||||
}
|
||||
@ -672,8 +674,8 @@ cd9660_write_boot(FILE *fd)
|
||||
apm16 = htobe16(512);
|
||||
fwrite(&apm16, sizeof(apm16), 1, fd);
|
||||
/* Device block count */
|
||||
apm32 = htobe32(diskStructure.totalSectors *
|
||||
(diskStructure.sectorSize / 512));
|
||||
apm32 = htobe32(diskStructure->totalSectors *
|
||||
(diskStructure->sectorSize / 512));
|
||||
fwrite(&apm32, sizeof(apm32), 1, fd);
|
||||
/* Device type/id */
|
||||
apm16 = htobe16(1);
|
||||
@ -689,20 +691,20 @@ cd9660_write_boot(FILE *fd)
|
||||
|
||||
/* Write all partition entries */
|
||||
apm_partitions = 0;
|
||||
TAILQ_FOREACH(t, &diskStructure.boot_images, image_list) {
|
||||
TAILQ_FOREACH(t, &diskStructure->boot_images, image_list) {
|
||||
if (t->system != ET_SYS_MAC)
|
||||
continue;
|
||||
|
||||
cd9660_write_apm_partition_entry(fd,
|
||||
1 + apm_partitions++, total_parts,
|
||||
t->sector * (diskStructure.sectorSize / 512),
|
||||
t->num_sectors * (diskStructure.sectorSize / 512),
|
||||
t->sector * (diskStructure->sectorSize / 512),
|
||||
t->num_sectors * (diskStructure->sectorSize / 512),
|
||||
512, "CD Boot", "Apple_Bootstrap");
|
||||
}
|
||||
/* Write ISO9660 descriptor, enclosing the whole disk */
|
||||
cd9660_write_apm_partition_entry(fd, 2 + apm_partitions,
|
||||
total_parts, 0, diskStructure.totalSectors *
|
||||
(diskStructure.sectorSize / 512), 512, "ISO9660",
|
||||
total_parts, 0, diskStructure->totalSectors *
|
||||
(diskStructure->sectorSize / 512), 512, "ISO9660",
|
||||
"CD_ROM_Mode_1");
|
||||
}
|
||||
|
||||
|
@ -38,15 +38,16 @@
|
||||
#include <sys/cdefs.h>
|
||||
__FBSDID("$FreeBSD$");
|
||||
|
||||
static int cd9660_write_volume_descriptors(FILE *);
|
||||
static int cd9660_write_path_table(FILE *, off_t, int);
|
||||
static int cd9660_write_path_tables(FILE *);
|
||||
static int cd9660_write_file(FILE *, cd9660node *);
|
||||
static int cd9660_write_filedata(FILE *, off_t, const unsigned char *, int);
|
||||
static int cd9660_write_volume_descriptors(iso9660_disk *, FILE *);
|
||||
static int cd9660_write_path_table(iso9660_disk *, FILE *, off_t, int);
|
||||
static int cd9660_write_path_tables(iso9660_disk *, FILE *);
|
||||
static int cd9660_write_file(iso9660_disk *, FILE *, cd9660node *);
|
||||
static int cd9660_write_filedata(iso9660_disk *, FILE *, off_t,
|
||||
const unsigned char *, int);
|
||||
#if 0
|
||||
static int cd9660_write_buffered(FILE *, off_t, int, const unsigned char *);
|
||||
#endif
|
||||
static void cd9660_write_rr(FILE *, cd9660node *, off_t, off_t);
|
||||
static void cd9660_write_rr(iso9660_disk *, FILE *, cd9660node *, off_t, off_t);
|
||||
|
||||
/*
|
||||
* Write the image
|
||||
@ -55,7 +56,7 @@ static void cd9660_write_rr(FILE *, cd9660node *, off_t, off_t);
|
||||
* @returns int 1 on success, 0 on failure
|
||||
*/
|
||||
int
|
||||
cd9660_write_image(const char* image)
|
||||
cd9660_write_image(iso9660_disk *diskStructure, const char* image)
|
||||
{
|
||||
FILE *fd;
|
||||
int status;
|
||||
@ -66,12 +67,12 @@ cd9660_write_image(const char* image)
|
||||
image);
|
||||
}
|
||||
|
||||
if (diskStructure.verbose_level > 0)
|
||||
if (diskStructure->verbose_level > 0)
|
||||
printf("Writing image\n");
|
||||
|
||||
if (diskStructure.has_generic_bootimage) {
|
||||
status = cd9660_copy_file(fd, 0,
|
||||
diskStructure.generic_bootimage);
|
||||
if (diskStructure->has_generic_bootimage) {
|
||||
status = cd9660_copy_file(diskStructure, fd, 0,
|
||||
diskStructure->generic_bootimage);
|
||||
if (status == 0) {
|
||||
warnx("%s: Error writing generic boot image",
|
||||
__func__);
|
||||
@ -80,70 +81,71 @@ cd9660_write_image(const char* image)
|
||||
}
|
||||
|
||||
/* Write the volume descriptors */
|
||||
status = cd9660_write_volume_descriptors(fd);
|
||||
status = cd9660_write_volume_descriptors(diskStructure, fd);
|
||||
if (status == 0) {
|
||||
warnx("%s: Error writing volume descriptors to image",
|
||||
__func__);
|
||||
goto cleanup_bad_image;
|
||||
}
|
||||
|
||||
if (diskStructure.verbose_level > 0)
|
||||
if (diskStructure->verbose_level > 0)
|
||||
printf("Volume descriptors written\n");
|
||||
|
||||
/*
|
||||
* Write the path tables: there are actually four, but right
|
||||
* now we are only concearned with two.
|
||||
*/
|
||||
status = cd9660_write_path_tables(fd);
|
||||
status = cd9660_write_path_tables(diskStructure, fd);
|
||||
if (status == 0) {
|
||||
warnx("%s: Error writing path tables to image", __func__);
|
||||
goto cleanup_bad_image;
|
||||
}
|
||||
|
||||
if (diskStructure.verbose_level > 0)
|
||||
if (diskStructure->verbose_level > 0)
|
||||
printf("Path tables written\n");
|
||||
|
||||
/* Write the directories and files */
|
||||
status = cd9660_write_file(fd, diskStructure.rootNode);
|
||||
status = cd9660_write_file(diskStructure, fd, diskStructure->rootNode);
|
||||
if (status == 0) {
|
||||
warnx("%s: Error writing files to image", __func__);
|
||||
goto cleanup_bad_image;
|
||||
}
|
||||
|
||||
if (diskStructure.is_bootable) {
|
||||
cd9660_write_boot(fd);
|
||||
if (diskStructure->is_bootable) {
|
||||
cd9660_write_boot(diskStructure, fd);
|
||||
}
|
||||
|
||||
/* Write padding bits. This is temporary */
|
||||
memset(buf, 0, CD9660_SECTOR_SIZE);
|
||||
cd9660_write_filedata(fd, diskStructure.totalSectors - 1, buf, 1);
|
||||
cd9660_write_filedata(diskStructure, fd,
|
||||
diskStructure->totalSectors - 1, buf, 1);
|
||||
|
||||
if (diskStructure.verbose_level > 0)
|
||||
if (diskStructure->verbose_level > 0)
|
||||
printf("Files written\n");
|
||||
fclose(fd);
|
||||
|
||||
if (diskStructure.verbose_level > 0)
|
||||
if (diskStructure->verbose_level > 0)
|
||||
printf("Image closed\n");
|
||||
return 1;
|
||||
|
||||
cleanup_bad_image:
|
||||
fclose(fd);
|
||||
if (!diskStructure.keep_bad_images)
|
||||
if (!diskStructure->keep_bad_images)
|
||||
unlink(image);
|
||||
if (diskStructure.verbose_level > 0)
|
||||
if (diskStructure->verbose_level > 0)
|
||||
printf("Bad image cleaned up\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
cd9660_write_volume_descriptors(FILE *fd)
|
||||
cd9660_write_volume_descriptors(iso9660_disk *diskStructure, FILE *fd)
|
||||
{
|
||||
volume_descriptor *vd_temp = diskStructure.firstVolumeDescriptor;
|
||||
volume_descriptor *vd_temp = diskStructure->firstVolumeDescriptor;
|
||||
int pos;
|
||||
|
||||
while (vd_temp != NULL) {
|
||||
pos = vd_temp->sector * diskStructure.sectorSize;
|
||||
cd9660_write_filedata(fd, vd_temp->sector,
|
||||
pos = vd_temp->sector * diskStructure->sectorSize;
|
||||
cd9660_write_filedata(diskStructure, fd, vd_temp->sector,
|
||||
vd_temp->volumeDescriptorData, 1);
|
||||
vd_temp = vd_temp->next;
|
||||
}
|
||||
@ -159,26 +161,27 @@ cd9660_write_volume_descriptors(FILE *fd)
|
||||
* @returns int 1 on success, 0 on failure
|
||||
*/
|
||||
static int
|
||||
cd9660_write_path_table(FILE *fd, off_t sector, int mode)
|
||||
cd9660_write_path_table(iso9660_disk *diskStructure, FILE *fd, off_t sector,
|
||||
int mode)
|
||||
{
|
||||
int path_table_sectors = CD9660_BLOCKS(diskStructure.sectorSize,
|
||||
diskStructure.pathTableLength);
|
||||
int path_table_sectors = CD9660_BLOCKS(diskStructure->sectorSize,
|
||||
diskStructure->pathTableLength);
|
||||
unsigned char *buffer;
|
||||
unsigned char *buffer_head;
|
||||
int len, ret;
|
||||
path_table_entry temp_entry;
|
||||
cd9660node *ptcur;
|
||||
|
||||
buffer = malloc(diskStructure.sectorSize * path_table_sectors);
|
||||
buffer = malloc(diskStructure->sectorSize * path_table_sectors);
|
||||
if (buffer == NULL) {
|
||||
warnx("%s: Memory allocation error allocating buffer",
|
||||
__func__);
|
||||
return 0;
|
||||
}
|
||||
buffer_head = buffer;
|
||||
memset(buffer, 0, diskStructure.sectorSize * path_table_sectors);
|
||||
memset(buffer, 0, diskStructure->sectorSize * path_table_sectors);
|
||||
|
||||
ptcur = diskStructure.rootNode;
|
||||
ptcur = diskStructure->rootNode;
|
||||
|
||||
while (ptcur != NULL) {
|
||||
memset(&temp_entry, 0, sizeof(path_table_entry));
|
||||
@ -213,7 +216,7 @@ cd9660_write_path_table(FILE *fd, off_t sector, int mode)
|
||||
ptcur = ptcur->ptnext;
|
||||
}
|
||||
|
||||
ret = cd9660_write_filedata(fd, sector, buffer_head,
|
||||
ret = cd9660_write_filedata(diskStructure, fd, sector, buffer_head,
|
||||
path_table_sectors);
|
||||
free(buffer_head);
|
||||
return ret;
|
||||
@ -235,14 +238,14 @@ cd9660_write_path_table(FILE *fd, off_t sector, int mode)
|
||||
* @returns int 0 on failure, 1 on success
|
||||
*/
|
||||
static int
|
||||
cd9660_write_path_tables(FILE *fd)
|
||||
cd9660_write_path_tables(iso9660_disk *diskStructure, FILE *fd)
|
||||
{
|
||||
if (cd9660_write_path_table(fd,
|
||||
diskStructure.primaryLittleEndianTableSector, LITTLE_ENDIAN) == 0)
|
||||
if (cd9660_write_path_table(diskStructure, fd,
|
||||
diskStructure->primaryLittleEndianTableSector, LITTLE_ENDIAN) == 0)
|
||||
return 0;
|
||||
|
||||
if (cd9660_write_path_table(fd,
|
||||
diskStructure.primaryBigEndianTableSector, BIG_ENDIAN) == 0)
|
||||
if (cd9660_write_path_table(diskStructure, fd,
|
||||
diskStructure->primaryBigEndianTableSector, BIG_ENDIAN) == 0)
|
||||
return 0;
|
||||
|
||||
/* @TODO: handle remaining two path tables */
|
||||
@ -261,7 +264,7 @@ cd9660_write_path_tables(FILE *fd)
|
||||
* @returns int 0 on failure, 1 on success
|
||||
*/
|
||||
static int
|
||||
cd9660_write_file(FILE *fd, cd9660node *writenode)
|
||||
cd9660_write_file(iso9660_disk *diskStructure, FILE *fd, cd9660node *writenode)
|
||||
{
|
||||
char *buf;
|
||||
char *temp_file_name;
|
||||
@ -281,7 +284,7 @@ cd9660_write_file(FILE *fd, cd9660node *writenode)
|
||||
|
||||
memset(temp_file_name, 0, CD9660MAXPATH + 1);
|
||||
|
||||
buf = malloc(diskStructure.sectorSize);
|
||||
buf = malloc(diskStructure->sectorSize);
|
||||
if (buf == NULL)
|
||||
err(EXIT_FAILURE, "%s: malloc", __func__);
|
||||
|
||||
@ -299,7 +302,8 @@ cd9660_write_file(FILE *fd, cd9660node *writenode)
|
||||
if (writenode->node->contents == NULL)
|
||||
cd9660_compute_full_filename(writenode,
|
||||
temp_file_name);
|
||||
ret = cd9660_copy_file(fd, writenode->fileDataSector,
|
||||
ret = cd9660_copy_file(diskStructure, fd,
|
||||
writenode->fileDataSector,
|
||||
(writenode->node->contents != NULL) ?
|
||||
writenode->node->contents : temp_file_name);
|
||||
if (ret == 0)
|
||||
@ -318,7 +322,7 @@ cd9660_write_file(FILE *fd, cd9660node *writenode)
|
||||
*/
|
||||
cur_sector_offset = 0;
|
||||
working_sector = writenode->fileDataSector;
|
||||
if (fseeko(fd, working_sector * diskStructure.sectorSize,
|
||||
if (fseeko(fd, working_sector * diskStructure->sectorSize,
|
||||
SEEK_SET) == -1)
|
||||
err(1, "fseeko");
|
||||
|
||||
@ -335,27 +339,27 @@ cd9660_write_file(FILE *fd, cd9660node *writenode)
|
||||
sizeof(iso_directory_record_cd9660));
|
||||
|
||||
temp_record.length[0] =
|
||||
cd9660_compute_record_size(temp);
|
||||
cd9660_compute_record_size(diskStructure, temp);
|
||||
|
||||
if (temp_record.length[0] + cur_sector_offset >=
|
||||
diskStructure.sectorSize) {
|
||||
diskStructure->sectorSize) {
|
||||
cur_sector_offset = 0;
|
||||
working_sector++;
|
||||
|
||||
/* Seek to the next sector. */
|
||||
if (fseeko(fd, working_sector *
|
||||
diskStructure.sectorSize, SEEK_SET) == -1)
|
||||
diskStructure->sectorSize, SEEK_SET) == -1)
|
||||
err(1, "fseeko");
|
||||
}
|
||||
/* Write out the basic ISO directory record */
|
||||
written = fwrite(&temp_record, 1,
|
||||
temp->isoDirRecord->length[0], fd);
|
||||
if (diskStructure.rock_ridge_enabled) {
|
||||
cd9660_write_rr(fd, temp,
|
||||
if (diskStructure->rock_ridge_enabled) {
|
||||
cd9660_write_rr(diskStructure, fd, temp,
|
||||
cur_sector_offset, working_sector);
|
||||
}
|
||||
if (fseeko(fd, working_sector *
|
||||
diskStructure.sectorSize + cur_sector_offset +
|
||||
diskStructure->sectorSize + cur_sector_offset +
|
||||
temp_record.length[0] - temp->su_tail_size,
|
||||
SEEK_SET) == -1)
|
||||
err(1, "fseeko");
|
||||
@ -374,7 +378,7 @@ cd9660_write_file(FILE *fd, cd9660node *writenode)
|
||||
* Recurse on children.
|
||||
*/
|
||||
TAILQ_FOREACH(temp, &writenode->cn_children, cn_next_child) {
|
||||
if ((ret = cd9660_write_file(fd, temp)) == 0)
|
||||
if ((ret = cd9660_write_file(diskStructure, fd, temp)) == 0)
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
@ -399,24 +403,24 @@ out:
|
||||
* is written, the rest should be set to 0.
|
||||
*/
|
||||
static int
|
||||
cd9660_write_filedata(FILE *fd, off_t sector, const unsigned char *buf,
|
||||
int numsecs)
|
||||
cd9660_write_filedata(iso9660_disk *diskStructure, FILE *fd, off_t sector,
|
||||
const unsigned char *buf, int numsecs)
|
||||
{
|
||||
off_t curpos;
|
||||
size_t success;
|
||||
|
||||
curpos = ftello(fd);
|
||||
|
||||
if (fseeko(fd, sector * diskStructure.sectorSize, SEEK_SET) == -1)
|
||||
if (fseeko(fd, sector * diskStructure->sectorSize, SEEK_SET) == -1)
|
||||
err(1, "fseeko");
|
||||
|
||||
success = fwrite(buf, diskStructure.sectorSize * numsecs, 1, fd);
|
||||
success = fwrite(buf, diskStructure->sectorSize * numsecs, 1, fd);
|
||||
|
||||
if (fseeko(fd, curpos, SEEK_SET) == -1)
|
||||
err(1, "fseeko");
|
||||
|
||||
if (success == 1)
|
||||
success = diskStructure.sectorSize * numsecs;
|
||||
success = diskStructure->sectorSize * numsecs;
|
||||
return success;
|
||||
}
|
||||
|
||||
@ -433,12 +437,13 @@ cd9660_write_buffered(FILE *fd, off_t offset, int buff_len,
|
||||
#endif
|
||||
|
||||
int
|
||||
cd9660_copy_file(FILE *fd, off_t start_sector, const char *filename)
|
||||
cd9660_copy_file(iso9660_disk *diskStructure, FILE *fd, off_t start_sector,
|
||||
const char *filename)
|
||||
{
|
||||
FILE *rf;
|
||||
int bytes_read;
|
||||
off_t sector = start_sector;
|
||||
int buf_size = diskStructure.sectorSize;
|
||||
int buf_size = diskStructure->sectorSize;
|
||||
char *buf;
|
||||
|
||||
buf = malloc(buf_size);
|
||||
@ -451,10 +456,10 @@ cd9660_copy_file(FILE *fd, off_t start_sector, const char *filename)
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (diskStructure.verbose_level > 1)
|
||||
if (diskStructure->verbose_level > 1)
|
||||
printf("Writing file: %s\n",filename);
|
||||
|
||||
if (fseeko(fd, start_sector * diskStructure.sectorSize, SEEK_SET) == -1)
|
||||
if (fseeko(fd, start_sector * diskStructure->sectorSize, SEEK_SET) == -1)
|
||||
err(1, "fseeko");
|
||||
|
||||
while (!feof(rf)) {
|
||||
@ -482,13 +487,14 @@ cd9660_copy_file(FILE *fd, off_t start_sector, const char *filename)
|
||||
}
|
||||
|
||||
static void
|
||||
cd9660_write_rr(FILE *fd, cd9660node *writenode, off_t offset, off_t sector)
|
||||
cd9660_write_rr(iso9660_disk *diskStructure, FILE *fd, cd9660node *writenode,
|
||||
off_t offset, off_t sector)
|
||||
{
|
||||
int in_ca = 0;
|
||||
struct ISO_SUSP_ATTRIBUTES *myattr;
|
||||
|
||||
offset += writenode->isoDirRecord->length[0];
|
||||
if (fseeko(fd, sector * diskStructure.sectorSize + offset, SEEK_SET) ==
|
||||
if (fseeko(fd, sector * diskStructure->sectorSize + offset, SEEK_SET) ==
|
||||
-1)
|
||||
err(1, "fseeko");
|
||||
/* Offset now points at the end of the record */
|
||||
@ -502,9 +508,9 @@ cd9660_write_rr(FILE *fd, cd9660node *writenode, off_t offset, off_t sector)
|
||||
* Point the offset to the start of this
|
||||
* record's CE area
|
||||
*/
|
||||
if (fseeko(fd, ((off_t)diskStructure.
|
||||
if (fseeko(fd, ((off_t)diskStructure->
|
||||
susp_continuation_area_start_sector *
|
||||
diskStructure.sectorSize)
|
||||
diskStructure->sectorSize)
|
||||
+ writenode->susp_entry_ce_start,
|
||||
SEEK_SET) == -1)
|
||||
err(1, "fseeko");
|
||||
@ -518,7 +524,7 @@ cd9660_write_rr(FILE *fd, cd9660node *writenode, off_t offset, off_t sector)
|
||||
* where we should be.
|
||||
*/
|
||||
if (in_ca)
|
||||
if (fseeko(fd, sector * diskStructure.sectorSize + offset,
|
||||
if (fseeko(fd, sector * diskStructure->sectorSize + offset,
|
||||
SEEK_SET) == -1)
|
||||
err(1, "fseeko");
|
||||
}
|
||||
|
@ -47,12 +47,13 @@ __FBSDID("$FreeBSD$");
|
||||
#include "iso9660_rrip.h"
|
||||
|
||||
static void cd9660_rrip_initialize_inode(cd9660node *);
|
||||
static int cd9660_susp_handle_continuation(cd9660node *);
|
||||
static int cd9660_susp_handle_continuation_common(cd9660node *, int);
|
||||
static int cd9660_susp_handle_continuation(iso9660_disk *, cd9660node *);
|
||||
static int cd9660_susp_handle_continuation_common(iso9660_disk *, cd9660node *,
|
||||
int);
|
||||
|
||||
int
|
||||
cd9660_susp_initialize(cd9660node *node, cd9660node *parent,
|
||||
cd9660node *grandparent)
|
||||
cd9660_susp_initialize(iso9660_disk *diskStructure, cd9660node *node,
|
||||
cd9660node *parent, cd9660node *grandparent)
|
||||
{
|
||||
cd9660node *cn;
|
||||
int r;
|
||||
@ -69,11 +70,11 @@ cd9660_susp_initialize(cd9660node *node, cd9660node *parent,
|
||||
TAILQ_INIT(&(node->dot_dot_record->head));
|
||||
|
||||
/* SUSP specific entries here */
|
||||
if ((r = cd9660_susp_initialize_node(node)) < 0)
|
||||
if ((r = cd9660_susp_initialize_node(diskStructure, node)) < 0)
|
||||
return r;
|
||||
|
||||
/* currently called cd9660node_rrip_init_links */
|
||||
r = cd9660_rrip_initialize_node(node, parent, grandparent);
|
||||
r = cd9660_rrip_initialize_node(diskStructure, node, parent, grandparent);
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
@ -84,35 +85,35 @@ cd9660_susp_initialize(cd9660node *node, cd9660node *parent,
|
||||
* This should be called after all extensions. After
|
||||
* this is called, no new records should be added.
|
||||
*/
|
||||
if ((r = cd9660_susp_handle_continuation(node)) < 0)
|
||||
if ((r = cd9660_susp_handle_continuation(diskStructure, node)) < 0)
|
||||
return r;
|
||||
|
||||
/* Recurse on children. */
|
||||
TAILQ_FOREACH(cn, &node->cn_children, cn_next_child) {
|
||||
if ((r = cd9660_susp_initialize(cn, node, parent)) < 0)
|
||||
if ((r = cd9660_susp_initialize(diskStructure, cn, node, parent)) < 0)
|
||||
return 0;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
int
|
||||
cd9660_susp_finalize(cd9660node *node)
|
||||
cd9660_susp_finalize(iso9660_disk *diskStructure, cd9660node *node)
|
||||
{
|
||||
cd9660node *temp;
|
||||
int r;
|
||||
|
||||
assert(node != NULL);
|
||||
|
||||
if (node == diskStructure.rootNode)
|
||||
diskStructure.susp_continuation_area_current_free = 0;
|
||||
if (node == diskStructure->rootNode)
|
||||
diskStructure->susp_continuation_area_current_free = 0;
|
||||
|
||||
if ((r = cd9660_susp_finalize_node(node)) < 0)
|
||||
if ((r = cd9660_susp_finalize_node(diskStructure, node)) < 0)
|
||||
return r;
|
||||
if ((r = cd9660_rrip_finalize_node(node)) < 0)
|
||||
return r;
|
||||
|
||||
TAILQ_FOREACH(temp, &node->cn_children, cn_next_child) {
|
||||
if ((r = cd9660_susp_finalize(temp)) < 0)
|
||||
if ((r = cd9660_susp_finalize(diskStructure, temp)) < 0)
|
||||
return r;
|
||||
}
|
||||
return 1;
|
||||
@ -132,15 +133,15 @@ cd9660_susp_finalize(cd9660node *node)
|
||||
* CE (continuation area)
|
||||
*/
|
||||
int
|
||||
cd9660_susp_finalize_node(cd9660node *node)
|
||||
cd9660_susp_finalize_node(iso9660_disk *diskStructure, cd9660node *node)
|
||||
{
|
||||
struct ISO_SUSP_ATTRIBUTES *t;
|
||||
|
||||
/* Handle CE counters */
|
||||
if (node->susp_entry_ce_length > 0) {
|
||||
node->susp_entry_ce_start =
|
||||
diskStructure.susp_continuation_area_current_free;
|
||||
diskStructure.susp_continuation_area_current_free +=
|
||||
diskStructure->susp_continuation_area_current_free;
|
||||
diskStructure->susp_continuation_area_current_free +=
|
||||
node->susp_entry_ce_length;
|
||||
}
|
||||
|
||||
@ -149,12 +150,12 @@ cd9660_susp_finalize_node(cd9660node *node)
|
||||
t->entry_type != SUSP_ENTRY_SUSP_CE)
|
||||
continue;
|
||||
cd9660_bothendian_dword(
|
||||
diskStructure.
|
||||
diskStructure->
|
||||
susp_continuation_area_start_sector,
|
||||
t->attr.su_entry.CE.ca_sector);
|
||||
|
||||
cd9660_bothendian_dword(
|
||||
diskStructure.
|
||||
diskStructure->
|
||||
susp_continuation_area_start_sector,
|
||||
t->attr.su_entry.CE.ca_sector);
|
||||
cd9660_bothendian_dword(node->susp_entry_ce_start,
|
||||
@ -199,7 +200,8 @@ cd9660_rrip_finalize_node(cd9660node *node)
|
||||
}
|
||||
|
||||
static int
|
||||
cd9660_susp_handle_continuation_common(cd9660node *node, int space)
|
||||
cd9660_susp_handle_continuation_common(iso9660_disk *diskStructure,
|
||||
cd9660node *node, int space)
|
||||
{
|
||||
int ca_used, susp_used, susp_used_pre_ce, working;
|
||||
struct ISO_SUSP_ATTRIBUTES *temp, *pre_ce, *last, *CE, *ST;
|
||||
@ -272,18 +274,18 @@ cd9660_susp_handle_continuation_common(cd9660node *node, int space)
|
||||
node->susp_entry_size = susp_used;
|
||||
node->susp_entry_ce_length = ca_used;
|
||||
|
||||
diskStructure.susp_continuation_area_size += ca_used;
|
||||
diskStructure->susp_continuation_area_size += ca_used;
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* See if a continuation entry is needed for each of the different types */
|
||||
static int
|
||||
cd9660_susp_handle_continuation(cd9660node *node)
|
||||
cd9660_susp_handle_continuation(iso9660_disk *diskStructure, cd9660node *node)
|
||||
{
|
||||
assert (node != NULL);
|
||||
|
||||
/* Entry */
|
||||
if (cd9660_susp_handle_continuation_common(
|
||||
if (cd9660_susp_handle_continuation_common(diskStructure,
|
||||
node,(int)(node->isoDirRecord->length[0])) < 0)
|
||||
return 0;
|
||||
|
||||
@ -291,7 +293,7 @@ cd9660_susp_handle_continuation(cd9660node *node)
|
||||
}
|
||||
|
||||
int
|
||||
cd9660_susp_initialize_node(cd9660node *node)
|
||||
cd9660_susp_initialize_node(iso9660_disk *diskStructure, cd9660node *node)
|
||||
{
|
||||
struct ISO_SUSP_ATTRIBUTES *temp;
|
||||
|
||||
@ -307,7 +309,7 @@ cd9660_susp_initialize_node(cd9660node *node)
|
||||
|
||||
/* Check for root directory, add SP and ER if needed. */
|
||||
if (node->type & CD9660_TYPE_DOT) {
|
||||
if (node->parent == diskStructure.rootNode) {
|
||||
if (node->parent == diskStructure->rootNode) {
|
||||
temp = cd9660node_susp_create_node(SUSP_TYPE_SUSP,
|
||||
SUSP_ENTRY_SUSP_SP, "SP", SUSP_LOC_DOT);
|
||||
cd9660_susp_sp(temp, node);
|
||||
@ -366,8 +368,8 @@ cd9660_rrip_initialize_inode(cd9660node *node)
|
||||
}
|
||||
|
||||
int
|
||||
cd9660_rrip_initialize_node(cd9660node *node, cd9660node *parent,
|
||||
cd9660node *grandparent)
|
||||
cd9660_rrip_initialize_node(iso9660_disk *diskStructure, cd9660node *node,
|
||||
cd9660node *parent, cd9660node *grandparent)
|
||||
{
|
||||
struct ISO_SUSP_ATTRIBUTES *current = NULL;
|
||||
|
||||
@ -378,7 +380,7 @@ cd9660_rrip_initialize_node(cd9660node *node, cd9660node *parent,
|
||||
* Handle ER - should be the only entry to appear on
|
||||
* a "." record
|
||||
*/
|
||||
if (node->parent == diskStructure.rootNode) {
|
||||
if (node->parent == diskStructure->rootNode) {
|
||||
cd9660_susp_ER(node, 1, SUSP_RRIP_ER_EXT_ID,
|
||||
SUSP_RRIP_ER_EXT_DES, SUSP_RRIP_ER_EXT_SRC);
|
||||
}
|
||||
@ -416,7 +418,7 @@ cd9660_rrip_initialize_node(cd9660node *node, cd9660node *parent,
|
||||
*
|
||||
* The rr_moved_dir needs to be assigned a NM record as well.
|
||||
*/
|
||||
if (node == diskStructure.rr_moved_dir) {
|
||||
if (node == diskStructure->rr_moved_dir) {
|
||||
cd9660_rrip_add_NM(node, RRIP_DEFAULT_MOVE_DIR_NAME);
|
||||
}
|
||||
else if ((node->node != NULL) &&
|
||||
|
@ -217,10 +217,10 @@ struct ISO_SUSP_ATTRIBUTES {
|
||||
((int) ((entry)->attr.su_entry.SP.h.length[0]))
|
||||
|
||||
/* Recursive function - move later to func pointer code*/
|
||||
int cd9660_susp_finalize(cd9660node *);
|
||||
int cd9660_susp_finalize(iso9660_disk *, cd9660node *);
|
||||
|
||||
/* These two operate on single nodes */
|
||||
int cd9660_susp_finalize_node(cd9660node *);
|
||||
int cd9660_susp_finalize_node(iso9660_disk *, cd9660node *);
|
||||
int cd9660_rrip_finalize_node(cd9660node *);
|
||||
|
||||
/* POSIX File attribute */
|
||||
@ -272,15 +272,17 @@ struct ISO_SUSP_ATTRIBUTES *cd9660_susp_ES(struct ISO_SUSP_ATTRIBUTES*,
|
||||
/* Helper functions */
|
||||
|
||||
/* Common SUSP/RRIP functions */
|
||||
int cd9660_susp_initialize(cd9660node *, cd9660node *, cd9660node *);
|
||||
int cd9660_susp_initialize_node(cd9660node *);
|
||||
int cd9660_susp_initialize(iso9660_disk *, cd9660node *, cd9660node *,
|
||||
cd9660node *);
|
||||
int cd9660_susp_initialize_node(iso9660_disk *, cd9660node *);
|
||||
struct ISO_SUSP_ATTRIBUTES *cd9660node_susp_create_node(int, int, const char *,
|
||||
int);
|
||||
struct ISO_SUSP_ATTRIBUTES *cd9660node_susp_add_entry(cd9660node *,
|
||||
struct ISO_SUSP_ATTRIBUTES *, struct ISO_SUSP_ATTRIBUTES *, int);
|
||||
|
||||
/* RRIP specific functions */
|
||||
int cd9660_rrip_initialize_node(cd9660node *, cd9660node *, cd9660node *);
|
||||
int cd9660_rrip_initialize_node(iso9660_disk *, cd9660node *, cd9660node *,
|
||||
cd9660node *);
|
||||
void cd9660_createSL(cd9660node *);
|
||||
|
||||
/* Functions that probably can be removed */
|
||||
|
Loading…
x
Reference in New Issue
Block a user