2009-12-23 Felix Zielcke <fzielcke@z-51.de>

* commands/i386/pc/drivemap.c: Remove all trailing whitespace.
	* commands/lspci.c: Likewise.
	* commands/probe.c: Likewise.
	* commands/xnu_uuid.c: Likewise.
	* conf/i386-coreboot.rmk: Likewise.
	* conf/i386-efi.rmk: Likewise.
	* conf/i386-ieee1275.rmk: Likewise.
	* conf/i386-pc.rmk: Likewise.
	* conf/powerpc-ieee1275.rmk: Likewise.
	* conf/sparc64-ieee1275.rmk: Likewise.
	* conf/x86_64-efi.rmk: Likewise.
	* fs/i386/pc/pxe.c: Likewise.
	* gettext/gettext.c: Likewise.
	* include/grub/efi/graphics_output.h: Likewise.
	* include/grub/i386/pc/memory.h: Likewise.
	* kern/env.c: Likewise.
	* kern/i386/qemu/startup.S: Likewise.
	* lib/i386/pc/biosnum.c: Likewise.
	* lib/i386/relocator.c: Likewise.
	* lib/i386/relocator_asm.S: Likewise.
	* lib/relocator.c: Likewise.
	* loader/i386/bsd.c: Likewise.
	* loader/i386/multiboot.c: Likewise.
	* loader/i386/pc/chainloader.c: Likewise.
	* loader/i386/xnu.c: Likewise.
	* loader/xnu.c: Likewise.
	* normal/main.c: Likewise.
	* normal/menu_text.c: Likewise.
	* util/getroot.c: Likewise.
	* util/grub-mkconfig_lib.in: Likewise.
	* util/grub.d/00_header.in: Likewise.
	* util/i386/pc/grub-mkimage.c: Likewise.
	* util/mkisofs/eltorito.c: Likewise.
	* util/mkisofs/exclude.h: Likewise.
	* util/mkisofs/hash.c: Likewise.
	* util/mkisofs/iso9660.h: Likewise.
	* util/mkisofs/joliet.c: Likewise.
	* util/mkisofs/mkisofs.c: Likewise.
	* util/mkisofs/mkisofs.h: Likewise.
	* util/mkisofs/multi.c: Likewise.
	* util/mkisofs/name.c: Likewise.
	* util/mkisofs/rock.c: Likewise.
	* util/mkisofs/tree.c: Likewise.
	* util/mkisofs/write.c: Likewise.
	* video/efi_gop.c: Likewise.
This commit is contained in:
Felix Zielcke 2009-12-23 17:41:32 +01:00
parent 009ec74317
commit a2c1332b70
46 changed files with 803 additions and 755 deletions

View file

@ -1,3 +1,51 @@
2009-12-23 Felix Zielcke <fzielcke@z-51.de>
* commands/i386/pc/drivemap.c: Remove all trailing whitespace.
* commands/lspci.c: Likewise.
* commands/probe.c: Likewise.
* commands/xnu_uuid.c: Likewise.
* conf/i386-coreboot.rmk: Likewise.
* conf/i386-efi.rmk: Likewise.
* conf/i386-ieee1275.rmk: Likewise.
* conf/i386-pc.rmk: Likewise.
* conf/powerpc-ieee1275.rmk: Likewise.
* conf/sparc64-ieee1275.rmk: Likewise.
* conf/x86_64-efi.rmk: Likewise.
* fs/i386/pc/pxe.c: Likewise.
* gettext/gettext.c: Likewise.
* include/grub/efi/graphics_output.h: Likewise.
* include/grub/i386/pc/memory.h: Likewise.
* kern/env.c: Likewise.
* kern/i386/qemu/startup.S: Likewise.
* lib/i386/pc/biosnum.c: Likewise.
* lib/i386/relocator.c: Likewise.
* lib/i386/relocator_asm.S: Likewise.
* lib/relocator.c: Likewise.
* loader/i386/bsd.c: Likewise.
* loader/i386/multiboot.c: Likewise.
* loader/i386/pc/chainloader.c: Likewise.
* loader/i386/xnu.c: Likewise.
* loader/xnu.c: Likewise.
* normal/main.c: Likewise.
* normal/menu_text.c: Likewise.
* util/getroot.c: Likewise.
* util/grub-mkconfig_lib.in: Likewise.
* util/grub.d/00_header.in: Likewise.
* util/i386/pc/grub-mkimage.c: Likewise.
* util/mkisofs/eltorito.c: Likewise.
* util/mkisofs/exclude.h: Likewise.
* util/mkisofs/hash.c: Likewise.
* util/mkisofs/iso9660.h: Likewise.
* util/mkisofs/joliet.c: Likewise.
* util/mkisofs/mkisofs.c: Likewise.
* util/mkisofs/mkisofs.h: Likewise.
* util/mkisofs/multi.c: Likewise.
* util/mkisofs/name.c: Likewise.
* util/mkisofs/rock.c: Likewise.
* util/mkisofs/tree.c: Likewise.
* util/mkisofs/write.c: Likewise.
* video/efi_gop.c: Likewise.
2009-12-23 Vladimir Serbinenko <phcoder@gmail.com>
* video/efi_gop.c (grub_video_gop_get_bitmask): Fix off-by-one in mask
@ -695,7 +743,7 @@
grub_gettext_msg_list.
(grub_gettext_gettranslation_from_position): Return const char *
and not char *.
(grub_gettext_translate): Add the translated strings into a list,
(grub_gettext_translate): Add the translated strings into a list,
returns from the list if existing there.
(grub_gettext_init_ext): Add \n at the end of grub_dprintf string.
(grub_gettext_delete_list): Delete the list.
@ -736,7 +784,7 @@
(run_menu): Replaces grub_printf by print_spaces and dynamic terminal
width.
(get_entry_number): Gettextize and uses dynamic terminal width.
(notify_booting, notify_fallback, notify_execution_failure):
(notify_booting, notify_fallback, notify_execution_failure):
Gettextize.
* normal/menu_entry.c (store_completion): Cleanup the gettextized
string.
@ -1007,7 +1055,7 @@
* include/grub/i18n.h: ... to here
* include/grub/i18n.h: ... to here.
* kern/misc.c: Include <grub/i18n.h>
(grub_gettext_dummy): Move above user.
(grub_gettext_dummy): Move above user.
2009-11-24 Felix Zielcke <fzielcke@z-51.de>

View file

@ -370,7 +370,7 @@ grub_get_root_biosnumber_drivemap (void)
return grub_strtoul (biosnum, 0, 0);
dev = grub_device_open (0);
if (dev && dev->disk && dev->disk->dev
if (dev && dev->disk && dev->disk->dev
&& dev->disk->dev->id == GRUB_DISK_DEVICE_BIOSDISK_ID)
{
drivemap_node_t *curnode = map_head;

View file

@ -163,10 +163,10 @@ grub_lspci_iter (grub_pci_device_t dev, grub_pci_id_t pciid)
space = grub_pci_read (addr);
reg++;
if (space == 0)
continue;
switch (space & GRUB_PCI_ADDR_SPACE_MASK)
{
case GRUB_PCI_ADDR_SPACE_IO:
@ -175,7 +175,7 @@ grub_lspci_iter (grub_pci_device_t dev, grub_pci_id_t pciid)
(space & GRUB_PCI_ADDR_IO_MASK));
break;
case GRUB_PCI_ADDR_SPACE_MEMORY:
if ((space & GRUB_PCI_ADDR_MEM_TYPE_MASK)
if ((space & GRUB_PCI_ADDR_MEM_TYPE_MASK)
== GRUB_PCI_ADDR_MEM_TYPE_64)
{
addr = grub_pci_make_address (dev, reg);
@ -186,11 +186,11 @@ grub_lspci_iter (grub_pci_device_t dev, grub_pci_id_t pciid)
(space & GRUB_PCI_ADDR_MEM_MASK),
space & GRUB_PCI_ADDR_MEM_PREFETCH
? "prefetchable" : "non-prefetchable");
}
else
grub_printf ("\t32-bit memory space %d at 0x%016llx [%s]\n",
(reg - 1) - 4, (unsigned long long)
(reg - 1) - 4, (unsigned long long)
(space & GRUB_PCI_ADDR_MEM_MASK),
space & GRUB_PCI_ADDR_MEM_PREFETCH
? "prefetchable" : "non-prefetchable");

View file

@ -31,7 +31,7 @@
#include <grub/env.h>
#include <grub/extcmd.h>
static const struct grub_arg_option options[] =
static const struct grub_arg_option options[] =
{
{"set", 's', GRUB_ARG_OPTION_OPTIONAL,
"Set a variable to return value.", "VAR", ARG_TYPE_STRING},

View file

@ -1,4 +1,4 @@
/* xnu_uuid.c - transform 64-bit serial number
/* xnu_uuid.c - transform 64-bit serial number
to 128-bit uuid suitable for xnu. */
/*
* GRUB -- GRand Unified Bootloader
@ -38,10 +38,10 @@ struct tohash
grub_uint64_t serial;
} __attribute__ ((packed));
/* This prefix is used by xnu and boot-132 to hash
/* This prefix is used by xnu and boot-132 to hash
together with volume serial. */
static grub_uint8_t hash_prefix[16]
= {0xB3, 0xE2, 0x0F, 0x39, 0xF2, 0x92, 0x11, 0xD6,
static grub_uint8_t hash_prefix[16]
= {0xB3, 0xE2, 0x0F, 0x39, 0xF2, 0x92, 0x11, 0xD6,
0x97, 0xA4, 0x00, 0x30, 0x65, 0x43, 0xEC, 0xAC};
#define rol(x,n) ( ((x) << (n)) | ((x) >> (32-(n))) )
@ -237,7 +237,7 @@ md5_write( void *context, const void *inbuf_arg , grub_size_t inlen)
}
// _gcry_burn_stack (80+6*sizeof(void*));
while( inlen >= 64 )
while( inlen >= 64 )
{
transform( hd, inbuf );
hd->count = 0;

View file

@ -109,7 +109,7 @@ pkglib_MODULES = linux.mod multiboot.mod \
lsmmap.mod mmap.mod
# For boot.mod.
pkglib_MODULES += boot.mod
pkglib_MODULES += boot.mod
boot_mod_SOURCES = commands/boot.c
boot_mod_CFLAGS = $(COMMON_CFLAGS)
boot_mod_LDFLAGS = $(COMMON_LDFLAGS)

View file

@ -67,7 +67,7 @@ kernel_syms.lst: $(addprefix include/grub/,$(kernel_img_HEADERS)) config.h genke
/bin/sh genkernsyms.sh $(filter %.h,$^) > $@ || (rm -f $@; exit 1)
# For boot.mod.
pkglib_MODULES += boot.mod
pkglib_MODULES += boot.mod
boot_mod_SOURCES = commands/boot.c
boot_mod_CFLAGS = $(COMMON_CFLAGS)
boot_mod_LDFLAGS = $(COMMON_LDFLAGS)

View file

@ -60,7 +60,7 @@ pkglib_MODULES = halt.mod reboot.mod suspend.mod \
date.mod datehook.mod lsmmap.mod mmap.mod
# For boot.mod.
pkglib_MODULES += boot.mod
pkglib_MODULES += boot.mod
boot_mod_SOURCES = commands/boot.c
boot_mod_CFLAGS = $(COMMON_CFLAGS)
boot_mod_LDFLAGS = $(COMMON_LDFLAGS)

View file

@ -128,7 +128,7 @@ pkglib_MODULES = biosdisk.mod chain.mod \
efiemu.mod mmap.mod acpi.mod drivemap.mod
# For boot.mod.
pkglib_MODULES += boot.mod
pkglib_MODULES += boot.mod
boot_mod_SOURCES = commands/boot.c lib/i386/pc/biosnum.c
boot_mod_CFLAGS = $(COMMON_CFLAGS)
boot_mod_LDFLAGS = $(COMMON_LDFLAGS)

View file

@ -66,7 +66,7 @@ pkglib_MODULES = halt.mod \
lsmmap.mod
# For boot.mod.
pkglib_MODULES += boot.mod
pkglib_MODULES += boot.mod
boot_mod_SOURCES = commands/boot.c lib/i386/pc/biosnum.c
boot_mod_CFLAGS = $(COMMON_CFLAGS)
boot_mod_LDFLAGS = $(COMMON_LDFLAGS)

View file

@ -103,7 +103,7 @@ pkglib_MODULES = halt.mod \
lsmmap.mod
# For boot.mod.
pkglib_MODULES += boot.mod
pkglib_MODULES += boot.mod
boot_mod_SOURCES = commands/boot.c lib/i386/pc/biosnum.c
boot_mod_CFLAGS = $(COMMON_CFLAGS)
boot_mod_LDFLAGS = $(COMMON_LDFLAGS)

View file

@ -67,7 +67,7 @@ kernel_syms.lst: $(addprefix include/grub/,$(kernel_img_HEADERS)) config.h genke
/bin/sh genkernsyms.sh $(filter %.h,$^) > $@ || (rm -f $@; exit 1)
# For boot.mod.
pkglib_MODULES += boot.mod
pkglib_MODULES += boot.mod
boot_mod_SOURCES = commands/boot.c lib/i386/pc/biosnum.c
boot_mod_CFLAGS = $(COMMON_CFLAGS)
boot_mod_LDFLAGS = $(COMMON_LDFLAGS)

View file

@ -110,7 +110,7 @@ static grub_err_t
grub_pxefs_dir (grub_device_t device __attribute__ ((unused)),
const char *path __attribute__ ((unused)),
int (*hook) (const char *filename,
const struct grub_dirhook_info *info)
const struct grub_dirhook_info *info)
__attribute__ ((unused)))
{
return GRUB_ERR_NONE;

View file

@ -29,8 +29,8 @@
#include <grub/gzio.h>
#include <grub/i18n.h>
/*
.mo file information from:
/*
.mo file information from:
http://www.gnu.org/software/autoconf/manual/gettext/MO-Files.html .
*/

View file

@ -24,7 +24,7 @@
#define GRUB_EFI_GOP_GUID \
{ 0x9042a9de, 0x23dc, 0x4a38, { 0x96, 0xfb, 0x7a, 0xde, 0xd0, 0x80, 0x51, 0x6a }}
typedef enum
typedef enum
{
GRUB_EFI_GOT_RGBA8,
GRUB_EFI_GOT_BGRA8,

View file

@ -85,7 +85,7 @@
struct grub_machine_bios_data_area
{
grub_uint8_t unused1[0x17];
grub_uint8_t keyboard_flag_lower; /* 0x17 */
grub_uint8_t keyboard_flag_lower; /* 0x17 */
grub_uint8_t unused2[0xf0 - 0x18];
};

View file

@ -174,12 +174,12 @@ grub_env_export (const char *name)
if (! var)
{
grub_err_t err;
err = grub_env_set (name, "");
if (err)
return err;
var = grub_env_find (name);
}
}
var->type = GRUB_ENV_VAR_GLOBAL;
return GRUB_ERR_NONE;

View file

@ -81,7 +81,7 @@ codestart:
movl $END_SYMBOL, %ecx
subl %edi, %ecx
#endif
/* clean out */
xorl %eax, %eax
cld

View file

@ -33,7 +33,7 @@ grub_get_root_biosnumber_default (void)
return grub_strtoul (biosnum, 0, 0);
dev = grub_device_open (0);
if (dev && dev->disk && dev->disk->dev
if (dev && dev->disk && dev->disk->dev
&& dev->disk->dev->id == GRUB_DISK_DEVICE_BIOSDISK_ID)
ret = (int) dev->disk->id;

View file

@ -85,14 +85,14 @@ write_call_relocator_fw (void *ptr, void *src, grub_uint32_t dest,
grub_relocator32_forward_dest = dest;
grub_relocator32_forward_src = PTR_TO_UINT64 (src);
grub_relocator32_forward_size = size;
grub_relocator32_forward_eax = state.eax;
grub_relocator32_forward_ebx = state.ebx;
grub_relocator32_forward_ecx = state.ecx;
grub_relocator32_forward_edx = state.edx;
grub_relocator32_forward_eip = state.eip;
grub_relocator32_forward_esp = state.esp;
grub_memmove (ptr,
&grub_relocator32_forward_start,
RELOCATOR_SIZEOF (forward));

View file

@ -32,8 +32,8 @@
#else
#define RAX %eax
#define RCX %ecx
#define RDI %edi
#define RSI %esi
#define RDI %edi
#define RSI %esi
#endif
/* The code segment of the protected mode. */
@ -41,7 +41,7 @@
/* The data segment of the protected mode. */
#define DATA_SEGMENT 0x18
.p2align 4 /* force 16-byte alignment */
RELOCATOR_VARIABLE(start)
@ -92,7 +92,7 @@ RELOCATOR_VARIABLE(size)
#endif
mov RDI, RAX
#ifdef BACKWARD
add RCX, RSI
add RCX, RDI
@ -104,7 +104,7 @@ RELOCATOR_VARIABLE(size)
add $0x3, RCX
shr $2, RCX
#ifdef BACKWARD
/* Backward movsl is implicitly off-by-four. compensate that. */
sub $4, RSI
@ -213,7 +213,7 @@ RELOCATOR_VARIABLE (eip)
LOCAL(gdt):
/* NULL. */
.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
/* Reserved. */
.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
@ -234,7 +234,7 @@ LOCAL(gdt_addr):
/* Filled by the code. */
.long 0
#endif
.p2align 4
LOCAL(jump_vector):
/* Jump location. Is filled by the code */

View file

@ -79,7 +79,7 @@ PREFIX (boot) (void *relocator, grub_uint32_t dest,
/* Very unlikely condition: Relocator may risk overwrite itself.
Just move it a bit up. */
if ((grub_addr_t) dest < (grub_addr_t) relocator
+ (RELOCATOR_SIZEOF (backward) + RELOCATOR_ALIGN)
+ (RELOCATOR_SIZEOF (backward) + RELOCATOR_ALIGN)
&& (grub_addr_t) dest + (RELOCATOR_SIZEOF (forward) + RELOCATOR_ALIGN)
> (grub_addr_t) relocator)
{
@ -105,7 +105,7 @@ PREFIX (boot) (void *relocator, grub_uint32_t dest,
"Backward relocator: code %p, source: %p, "
"destination: 0x%x, size: 0x%lx\n",
(char *) relocator - overhead,
(char *) relocator - overhead,
(char *) relocator - overhead,
(unsigned) dest - overhead,
(unsigned long) size + overhead);

View file

@ -140,7 +140,7 @@ grub_bsd_get_device (grub_uint32_t * biosdev,
grub_uint32_t * slice, grub_uint32_t * part)
{
char *p;
grub_device_t dev;
grub_device_t dev;
#ifdef GRUB_MACHINE_PCBIOS
*biosdev = grub_get_root_biosnumber () & 0xff;

View file

@ -201,7 +201,7 @@ grub_multiboot_get_bootdev (grub_uint32_t *bootdev)
if (dev)
grub_device_close (dev);
*bootdev = ((biosdev & 0xff) << 24) | ((slice & 0xff) << 16)
*bootdev = ((biosdev & 0xff) << 24) | ((slice & 0xff) << 16)
| ((part & 0xff) << 8) | 0xff;
return (biosdev != ~0UL);
#else

View file

@ -102,7 +102,7 @@ grub_chainloader_cmd (const char *filename, grub_chainloader_flags_t flags)
if (dev)
grub_device_close (dev);
/* Ignore errors. Perhaps it's not fatal. */
grub_errno = GRUB_ERR_NONE;

View file

@ -832,7 +832,7 @@ grub_xnu_boot_resume (void)
state.eax = grub_xnu_arg1;
return grub_relocator32_boot (grub_xnu_heap_start, grub_xnu_heap_will_be_at,
state);
state);
}
/* Boot xnu. */

View file

@ -67,7 +67,7 @@ grub_xnu_heap_malloc (int size)
advanced mm is ready. */
grub_xnu_heap_start
= XNU_RELOCATOR (realloc) (grub_xnu_heap_start,
newblknum
newblknum
* GRUB_XNU_HEAP_ALLOC_BLOCK);
if (!grub_xnu_heap_start)
return NULL;
@ -1326,20 +1326,20 @@ grub_xnu_fill_devicetree (void)
nextdot = curdot + grub_strlen (curdot) + 1;
name = grub_realloc (name, nextdot - curdot + 1);
if (!name)
return 1;
unescape (name, curdot, nextdot, &len);
name[len] = 0;
curvalue = grub_xnu_create_value (curkey, name);
grub_free (name);
data = grub_malloc (grub_strlen (var->value) + 1);
if (!data)
return 1;
unescape (data, var->value, var->value + grub_strlen (var->value),
&len);
curvalue->datasize = len;

View file

@ -391,17 +391,17 @@ grub_normal_init_page (void)
char *msg_formatted = grub_malloc (grub_strlen(msg) +
grub_strlen(PACKAGE_VERSION));
grub_cls ();
grub_sprintf (msg_formatted, msg, PACKAGE_VERSION);
grub_uint32_t *unicode_msg;
grub_uint32_t *last_position;
msg_len = grub_utf8_to_ucs4_alloc (msg_formatted,
msg_len = grub_utf8_to_ucs4_alloc (msg_formatted,
&unicode_msg, &last_position);
if (msg_len < 0)
{
return;
@ -528,7 +528,7 @@ grub_normal_reader_init (void)
const char *msg_esc = _("ESC at any time exits.");
char *msg_formatted = grub_malloc (sizeof (char) * (grub_strlen (msg) +
char *msg_formatted = grub_malloc (sizeof (char) * (grub_strlen (msg) +
grub_strlen(msg_esc) + 1));
grub_sprintf (msg_formatted, msg, reader_nested ? msg_esc : "");
@ -536,7 +536,7 @@ grub_normal_reader_init (void)
grub_puts ("\n");
grub_free (msg_formatted);
return 0;
}

View file

@ -71,7 +71,7 @@ grub_utf8_to_ucs4_alloc (const char *msg, grub_uint32_t **unicode_msg,
grub_ssize_t msg_len = grub_strlen (msg);
*unicode_msg = grub_malloc (grub_strlen (msg) * sizeof (grub_uint32_t));
if (!*unicode_msg)
{
grub_printf ("utf8_to_ucs4 ERROR1: %s", msg);
@ -133,7 +133,7 @@ grub_print_message_indented (const char *msg, int margin_left, int margin_right)
{
if (! first_loop)
grub_putchar ('\n');
next_new_line = (grub_uint32_t *) last_position;
while (grub_getstringwidth (current_position, next_new_line) > line_len
@ -402,7 +402,7 @@ print_timeout (int timeout, int offset)
grub_sprintf (msg_translated, msg, timeout);
grub_print_message_indented (msg_translated, 3, 0);
int posx;
posx = grub_getxy() >> 8;
print_spaces (GRUB_TERM_WIDTH - posx - 1);

View file

@ -483,7 +483,7 @@ grub_util_is_dmraid (const char *os_dev)
return 1;
else if (! strncmp (os_dev, "/dev/mapper/sil_", 16))
return 1;
return 0;
}

View file

@ -100,7 +100,7 @@ prepare_grub_to_access_device ()
# Abstraction modules aren't auto-loaded.
abstraction="`${grub_probe} --device ${device} --target=abstraction`"
for module in ${abstraction} ; do
for module in ${abstraction} ; do
echo "insmod ${module}"
done

View file

@ -107,12 +107,12 @@ if [ "x${LANG}" != "xC" ] ; then
cat << EOF
set locale_dir=${locale_dir}
set lang=${grub_lang}
insmod gettext
insmod gettext
EOF
fi
if [ "x${GRUB_HIDDEN_TIMEOUT}" != "x" ] ; then
if [ "x${GRUB_HIDDEN_TIMEOUT_QUIET}" = "xtrue" ] ; then
if [ "x${GRUB_HIDDEN_TIMEOUT_QUIET}" = "xtrue" ] ; then
verbose=
else
verbose=" --verbose"

View file

@ -204,19 +204,19 @@ generate_image (const char *dir, char *prefix, FILE *out, char *mods[],
num = ((core_size + GRUB_DISK_SECTOR_SIZE - 1) >> GRUB_DISK_SECTOR_BITS);
if (num > 0xffff)
grub_util_error (_("the core image is too big"));
boot_path = grub_util_get_path (dir, "diskboot.img");
boot_size = grub_util_get_image_size (boot_path);
if (boot_size != GRUB_DISK_SECTOR_SIZE)
grub_util_error (_("diskboot.img size must be %u bytes"), GRUB_DISK_SECTOR_SIZE);
boot_img = grub_util_read_image (boot_path);
/* i386 is a little endian architecture. */
*((grub_uint16_t *) (boot_img + GRUB_DISK_SECTOR_SIZE
- GRUB_BOOT_MACHINE_LIST_SIZE + 8))
= grub_cpu_to_le16 (num);
grub_util_write_image (boot_img, boot_size, out);
free (boot_img);
free (boot_path);

View file

@ -1,6 +1,6 @@
/*
* Program eltorito.c - Handle El Torito specific extensions to iso9660.
*
*
Written by Michael Fulbright <msf@redhat.com> (1996).
@ -53,7 +53,7 @@ static struct eltorito_boot_descriptor gboot_desc;
static int tvd_write __PR((FILE * outfile));
/*
* Check for presence of boot catalog. If it does not exist then make it
* Check for presence of boot catalog. If it does not exist then make it
*/
void FDECL1(init_boot_catalog, const char *, path)
{
@ -61,37 +61,37 @@ void FDECL1(init_boot_catalog, const char *, path)
char * bootpath; /* filename of boot catalog */
char * buf;
struct stat statbuf;
bootpath = (char *) e_malloc(strlen(boot_catalog)+strlen(path)+2);
strcpy(bootpath, path);
if (bootpath[strlen(bootpath)-1] != '/')
if (bootpath[strlen(bootpath)-1] != '/')
{
strcat(bootpath,"/");
}
strcat(bootpath, boot_catalog);
/*
* check for the file existing
* check for the file existing
*/
#ifdef DEBUG_TORITO
fprintf(stderr,"Looking for boot catalog file %s\n",bootpath);
#endif
if (!stat_filter(bootpath, &statbuf))
if (!stat_filter(bootpath, &statbuf))
{
/*
* make sure its big enough to hold what we want
* make sure its big enough to hold what we want
*/
if (statbuf.st_size == 2048)
if (statbuf.st_size == 2048)
{
/*
* printf("Boot catalog exists, so we do nothing\n");
* printf("Boot catalog exists, so we do nothing\n");
*/
free(bootpath);
return;
}
else
else
{
fprintf (stderr, _("A boot catalog exists and appears corrupted.\n"));
fprintf (stderr, _("Please check the following file: %s.\n"), bootpath);
@ -100,15 +100,15 @@ void FDECL1(init_boot_catalog, const char *, path)
exit (1);
}
}
/*
* file does not exist, so we create it
* file does not exist, so we create it
* make it one CD sector long
*/
bcat = fopen (bootpath, "wb");
if (bcat == NULL)
error (1, errno, _("Error creating boot catalog (%s)"), bootpath);
buf = (char *) e_malloc( 2048 );
if (fwrite (buf, 1, 2048, bcat) != 2048)
error (1, errno, _("Error writing to boot catalog (%s)"), bootpath);
@ -127,65 +127,65 @@ void FDECL1(get_torito_desc, struct eltorito_boot_descriptor *, boot_desc)
struct directory_entry * de2;
unsigned int i;
int nsectors;
memset(boot_desc, 0, sizeof(*boot_desc));
boot_desc->id[0] = 0;
memcpy(boot_desc->id2, ISO_STANDARD_ID, sizeof(ISO_STANDARD_ID));
boot_desc->version[0] = 1;
memcpy(boot_desc->system_id, EL_TORITO_ID, sizeof(EL_TORITO_ID));
/*
* search from root of iso fs to find boot catalog
* search from root of iso fs to find boot catalog
*/
de2 = search_tree_file(root, boot_catalog);
if (!de2)
if (!de2)
{
fprintf (stderr, _("Boot catalog cannot be found!\n"));
exit (1);
}
set_731(boot_desc->bootcat_ptr,
(unsigned int) get_733(de2->isorec.extent));
/*
/*
* now adjust boot catalog
* lets find boot image first
* lets find boot image first
*/
de=search_tree_file(root, boot_image);
if (!de)
if (!de)
{
fprintf (stderr, _("Boot image cannot be found!\n"));
exit (1);
}
/*
}
/*
* we have the boot image, so write boot catalog information
* Next we write out the primary descriptor for the disc
* Next we write out the primary descriptor for the disc
*/
memset(&valid_desc, 0, sizeof(valid_desc));
valid_desc.headerid[0] = 1;
valid_desc.arch[0] = EL_TORITO_ARCH_x86;
/*
* we'll shove start of publisher id into id field, may get truncated
* but who really reads this stuff!
*/
if (publisher)
memcpy_max(valid_desc.id, publisher, MIN(23, strlen(publisher)));
valid_desc.key1[0] = 0x55;
valid_desc.key2[0] = 0xAA;
/*
* compute the checksum
* compute the checksum
*/
checksum=0;
checksum_ptr = (unsigned char *) &valid_desc;
for (i=0; i<sizeof(valid_desc); i+=2)
for (i=0; i<sizeof(valid_desc); i+=2)
{
/*
* skip adding in ckecksum word, since we dont have it yet!
* skip adding in ckecksum word, since we dont have it yet!
*/
if (i == 28)
{
@ -194,82 +194,82 @@ void FDECL1(get_torito_desc, struct eltorito_boot_descriptor *, boot_desc)
checksum += (unsigned int)checksum_ptr[i];
checksum += ((unsigned int)checksum_ptr[i+1])*256;
}
/*
* now find out the real checksum
/*
* now find out the real checksum
*/
checksum = -checksum;
set_721(valid_desc.cksum, (unsigned int) checksum);
/*
* now make the initial/default entry for boot catalog
* now make the initial/default entry for boot catalog
*/
memset(&default_desc, 0, sizeof(default_desc));
default_desc.boot_id[0] = EL_TORITO_BOOTABLE;
/*
* use default BIOS loadpnt
*/
*/
set_721(default_desc.loadseg, 0);
default_desc.arch[0] = EL_TORITO_ARCH_x86;
/*
* figure out size of boot image in sectors, for now hard code to
* assume 512 bytes/sector on a bootable floppy
*/
nsectors = ((de->size + 511) & ~(511))/512;
fprintf (stderr, _("\nSize of boot image is %d sectors"), nsectors);
fprintf (stderr, " -> ");
fprintf (stderr, _("\nSize of boot image is %d sectors"), nsectors);
fprintf (stderr, " -> ");
if (! use_eltorito_emul_floppy)
{
default_desc.boot_media[0] = EL_TORITO_MEDIA_NOEMUL;
fprintf (stderr, _("No emulation\n"));
}
else if (nsectors == 2880 )
else if (nsectors == 2880 )
/*
* choose size of emulated floppy based on boot image size
* choose size of emulated floppy based on boot image size
*/
{
default_desc.boot_media[0] = EL_TORITO_MEDIA_144FLOP;
fprintf (stderr, _("Emulating a 1.44 meg floppy\n"));
}
else if (nsectors == 5760 )
else if (nsectors == 5760 )
{
default_desc.boot_media[0] = EL_TORITO_MEDIA_288FLOP;
fprintf (stderr, _("Emulating a 2.88 meg floppy\n"));
}
else if (nsectors == 2400 )
else if (nsectors == 2400 )
{
default_desc.boot_media[0] = EL_TORITO_MEDIA_12FLOP;
fprintf (stderr, _("Emulating a 1.2 meg floppy\n"));
}
else
else
{
fprintf (stderr, _("\nError - boot image is not the an allowable size.\n"));
exit (1);
}
/*
* FOR NOW LOAD 1 SECTOR, JUST LIKE FLOPPY BOOT!!!
/*
* FOR NOW LOAD 1 SECTOR, JUST LIKE FLOPPY BOOT!!!
*/
nsectors = 1;
set_721(default_desc.nsect, (unsigned int) nsectors );
#ifdef DEBUG_TORITO
fprintf(stderr,"Extent of boot images is %d\n",get_733(de->isorec.extent));
#endif
set_731(default_desc.bootoff,
set_731(default_desc.bootoff,
(unsigned int) get_733(de->isorec.extent));
/*
* now write it to disk
* now write it to disk
*/
bootcat = fopen (de2->whole_name, "r+b");
if (bootcat == NULL)
if (bootcat == NULL)
error (1, errno, _("Error opening boot catalog for update"));
/*
* write out
/*
* write out
*/
if (fwrite (&valid_desc, 1, 32, bootcat) != 32)
error (1, errno, _("Error writing to boot catalog"));
@ -332,7 +332,7 @@ void FDECL1(get_torito_desc, struct eltorito_boot_descriptor *, boot_desc)
static int FDECL1(tvd_write, FILE *, outfile)
{
/*
* Next we write out the boot volume descriptor for the disc
* Next we write out the boot volume descriptor for the disc
*/
get_torito_desc(&gboot_desc);
xfwrite(&gboot_desc, 1, 2048, outfile);

View file

@ -1,6 +1,6 @@
/*
* 9-Dec-93 R.-D. Marzusch, marzusch@odiehh.hanse.de:
* added 'exclude' option (-x) to specify pathnames NOT to be included in
* added 'exclude' option (-x) to specify pathnames NOT to be included in
* CD image.
*
* $Id: exclude.h,v 1.2 1999/03/02 03:41:25 eric Exp $

View file

@ -33,7 +33,7 @@ void FDECL1(add_hash, struct directory_entry *, spnt){
struct file_hash * s_hash;
unsigned int hash_number;
if(spnt->size == 0 || spnt->starting_block == 0)
if(spnt->size == 0 || spnt->starting_block == 0)
if(spnt->size != 0 || spnt->starting_block != 0) {
fprintf(stderr,"Non zero-length file assigned zero extent.\n");
exit(1);
@ -116,10 +116,10 @@ static unsigned int FDECL1(name_hash, const char *, name)
{
unsigned int hash = 0;
const char * p;
p = name;
while (*p)
while (*p)
{
/*
* Don't hash the iso9660 version number. This way
@ -155,7 +155,7 @@ struct directory_entry * FDECL1(find_file_hash, char *, name)
struct name_hash * nh;
char * p1;
char * p2;
for(nh = name_hash_table[name_hash(name)]; nh; nh = nh->next)
{
p1 = name;
@ -220,6 +220,6 @@ void flush_file_hash(){
nh = nh1;
}
name_hash_table[i] = NULL;
}
}

View file

@ -138,7 +138,7 @@ struct eltorito_boot_info
char pvd_addr[ISODCL (1, 4)];
/* Boot file address. */
char file_addr[ISODCL (5, 8)];
/* Boot file length. */
/* Boot file length. */
char file_length[ISODCL (9, 12)];
/* Boot file checksum. */
char file_checksum[ISODCL (13, 16)];

View file

@ -87,13 +87,13 @@ static int DECL(joliet_sort_directory, (struct directory_entry ** sort_dir));
static void DECL(assign_joliet_directory_addresses, (struct directory * node));
static int jroot_gen __PR((void));
/*
/*
* Function: convert_to_unicode
*
* Purpose: Perform a 1/2 assed unicode conversion on a text
* string.
*
* Notes:
* Notes:
*/
static void FDECL3(convert_to_unicode, unsigned char *, buffer, int, size, char *, source )
{
@ -127,9 +127,9 @@ static void FDECL3(convert_to_unicode, unsigned char *, buffer, int, size, char
* JS integrated from: Achim_Kaiser@t-online.de
*
* Let all valid unicode characters pass through (assuming ISO-8859-1).
* Others are set to '_' .
*/
if( tmpbuf[j] != 0 &&
* Others are set to '_' .
*/
if( tmpbuf[j] != 0 &&
(tmpbuf[j] <= 0x1f || (tmpbuf[j] >= 0x7F && tmpbuf[j] <= 0xA0)) )
{
buffer[i+1] = '_';
@ -163,7 +163,7 @@ static void FDECL3(convert_to_unicode, unsigned char *, buffer, int, size, char
}
}
/*
/*
* Function: joliet_strlen
*
* Purpose: Return length in bytes of string after conversion to unicode.
@ -178,7 +178,7 @@ static int FDECL1(joliet_strlen, const char *, string)
rtn = strlen(string) << 1;
/*
/*
* We do clamp the maximum length of a Joliet string to be the
* maximum path size. This helps to ensure that we don't completely
* bolix things up with very long paths. The Joliet specs say
@ -191,7 +191,7 @@ static int FDECL1(joliet_strlen, const char *, string)
return rtn;
}
/*
/*
* Function: get_joliet_vol_desc
*
* Purpose: generate a Joliet compatible volume desc.
@ -212,7 +212,7 @@ static void FDECL1(get_joliet_vol_desc, struct iso_primary_descriptor *, jvol_de
* "expands" 8 bit character codes to 16 bits and does nothing
* special with the Unicode characters, therefore shouldn't mkisofs
* really be stating that it's using UCS-2 Level 1, not Level 3 for
* the Joliet directory tree.
* the Joliet directory tree.
*/
strcpy(jvol_desc->escape_sequences, "%/@");
@ -228,7 +228,7 @@ static void FDECL1(get_joliet_vol_desc, struct iso_primary_descriptor *, jvol_de
/*
* Set this one up.
*/
memcpy(jvol_desc->root_directory_record, &jroot_record,
memcpy(jvol_desc->root_directory_record, &jroot_record,
sizeof(struct iso_directory_record));
/*
@ -256,7 +256,7 @@ static void FDECL1(assign_joliet_directory_addresses, struct directory *, node)
struct directory * dpnt;
dpnt = node;
while (dpnt)
{
if( (dpnt->dir_flags & INHIBIT_JOLIET_ENTRY) == 0 )
@ -275,7 +275,7 @@ static void FDECL1(assign_joliet_directory_addresses, struct directory *, node)
}
/* skip if hidden - but not for the rr_moved dir */
if(dpnt->subdir && (!(dpnt->dir_flags & INHIBIT_JOLIET_ENTRY) || dpnt == reloc_dir))
if(dpnt->subdir && (!(dpnt->dir_flags & INHIBIT_JOLIET_ENTRY) || dpnt == reloc_dir))
{
assign_joliet_directory_addresses(dpnt->subdir);
}
@ -283,13 +283,13 @@ static void FDECL1(assign_joliet_directory_addresses, struct directory *, node)
}
}
static
static
void FDECL1(build_jpathlist, struct directory *, node)
{
struct directory * dpnt;
dpnt = node;
while (dpnt)
{
@ -302,7 +302,7 @@ void FDECL1(build_jpathlist, struct directory *, node)
}
} /* build_jpathlist(... */
static int FDECL2(joliet_compare_paths, void const *, r, void const *, l)
static int FDECL2(joliet_compare_paths, void const *, r, void const *, l)
{
struct directory const *ll = *(struct directory * const *)l;
struct directory const *rr = *(struct directory * const *)r;
@ -325,13 +325,13 @@ static int FDECL2(joliet_compare_paths, void const *, r, void const *, l)
return -1;
}
if (rparent > lparent)
if (rparent > lparent)
{
return 1;
}
return strcmp(rr->self->name, ll->self->name);
} /* compare_paths(... */
static int generate_joliet_path_tables()
@ -346,7 +346,7 @@ static int generate_joliet_path_tables()
int tablesize;
/*
* First allocate memory for the tables and initialize the memory
* First allocate memory for the tables and initialize the memory
*/
tablesize = jpath_blocks << 11;
jpath_table_m = (char *) e_malloc(tablesize);
@ -361,10 +361,10 @@ static int generate_joliet_path_tables()
exit (1);
}
/*
* Now start filling in the path tables. Start with root directory
* Now start filling in the path tables. Start with root directory
*/
jpath_table_index = 0;
jpathlist = (struct directory **) e_malloc(sizeof(struct directory *)
jpathlist = (struct directory **) e_malloc(sizeof(struct directory *)
* next_jpath_index);
memset(jpathlist, 0, sizeof(struct directory *) * next_jpath_index);
build_jpathlist(root);
@ -373,10 +373,10 @@ static int generate_joliet_path_tables()
{
fix = 0;
#ifdef __STDC__
qsort(&jpathlist[1], next_jpath_index-1, sizeof(struct directory *),
qsort(&jpathlist[1], next_jpath_index-1, sizeof(struct directory *),
(int (*)(const void *, const void *))joliet_compare_paths);
#else
qsort(&jpathlist[1], next_jpath_index-1, sizeof(struct directory *),
qsort(&jpathlist[1], next_jpath_index-1, sizeof(struct directory *),
joliet_compare_paths);
#endif
@ -399,20 +399,20 @@ static int generate_joliet_path_tables()
exit (1);
}
npnt = dpnt->de_name;
npnt1 = strrchr(npnt, PATH_SEPARATOR);
if(npnt1)
{
if(npnt1)
{
npnt = npnt1 + 1;
}
de = dpnt->self;
if(!de)
if(!de)
{
fprintf (stderr, _("Fatal goof - directory has amnesia\n"));
fprintf (stderr, _("Fatal goof - directory has amnesia\n"));
exit (1);
}
namelen = joliet_strlen(de->name);
if( dpnt == root )
@ -426,28 +426,28 @@ static int generate_joliet_path_tables()
jpath_table_m[jpath_table_index] = namelen;
}
jpath_table_index += 2;
set_731(jpath_table_l + jpath_table_index, dpnt->jextent);
set_732(jpath_table_m + jpath_table_index, dpnt->jextent);
set_731(jpath_table_l + jpath_table_index, dpnt->jextent);
set_732(jpath_table_m + jpath_table_index, dpnt->jextent);
jpath_table_index += 4;
if( dpnt->parent != reloc_dir )
{
set_721(jpath_table_l + jpath_table_index,
dpnt->parent->jpath_index);
set_722(jpath_table_m + jpath_table_index,
dpnt->parent->jpath_index);
set_721(jpath_table_l + jpath_table_index,
dpnt->parent->jpath_index);
set_722(jpath_table_m + jpath_table_index,
dpnt->parent->jpath_index);
}
else
{
set_721(jpath_table_l + jpath_table_index,
dpnt->self->parent_rec->filedir->jpath_index);
set_722(jpath_table_m + jpath_table_index,
dpnt->self->parent_rec->filedir->jpath_index);
set_721(jpath_table_l + jpath_table_index,
dpnt->self->parent_rec->filedir->jpath_index);
set_722(jpath_table_m + jpath_table_index,
dpnt->self->parent_rec->filedir->jpath_index);
}
jpath_table_index += 2;
/*
* The root directory is still represented in non-unicode fashion.
*/
@ -459,19 +459,19 @@ static int generate_joliet_path_tables()
}
else
{
convert_to_unicode((uint8_t *)jpath_table_l + jpath_table_index,
convert_to_unicode((uint8_t *)jpath_table_l + jpath_table_index,
namelen, de->name);
convert_to_unicode((uint8_t *)jpath_table_m + jpath_table_index,
convert_to_unicode((uint8_t *)jpath_table_m + jpath_table_index,
namelen, de->name);
jpath_table_index += namelen;
}
if(jpath_table_index & 1)
if(jpath_table_index & 1)
{
jpath_table_index++; /* For odd lengths we pad */
}
}
free(jpathlist);
if(jpath_table_index != jpath_table_size)
{
@ -493,20 +493,20 @@ static void FDECL2(generate_one_joliet_directory, struct directory *, dpnt, FILE
unsigned int total_size;
int cvt_len;
struct directory * finddir;
total_size = (dpnt->jsize + (SECTOR_SIZE - 1)) & ~(SECTOR_SIZE - 1);
directory_buffer = (char *) e_malloc(total_size);
memset(directory_buffer, 0, total_size);
dir_index = 0;
s_entry = dpnt->jcontents;
while(s_entry)
while(s_entry)
{
if(s_entry->de_flags & INHIBIT_JOLIET_ENTRY) {
s_entry = s_entry->jnext;
continue;
}
/*
* If this entry was a directory that was relocated, we have a bit
* of trouble here. We need to dig out the real thing and put it
@ -535,43 +535,43 @@ static void FDECL2(generate_one_joliet_directory, struct directory *, dpnt, FILE
{
s_entry1 = s_entry;
}
/*
* We do not allow directory entries to cross sector boundaries.
* Simply pad, and then start the next entry at the next sector
/*
* We do not allow directory entries to cross sector boundaries.
* Simply pad, and then start the next entry at the next sector
*/
new_reclen = s_entry1->jreclen;
if( (dir_index & (SECTOR_SIZE - 1)) + new_reclen >= SECTOR_SIZE )
{
dir_index = (dir_index + (SECTOR_SIZE - 1)) &
dir_index = (dir_index + (SECTOR_SIZE - 1)) &
~(SECTOR_SIZE - 1);
}
memcpy(&jrec, &s_entry1->isorec, sizeof(struct iso_directory_record) -
sizeof(s_entry1->isorec.name));
cvt_len = joliet_strlen(s_entry1->name);
/*
* Fix the record length - this was the non-Joliet version we
* were seeing.
*/
jrec.name_len[0] = cvt_len;
jrec.length[0] = s_entry1->jreclen;
/*
* If this is a directory, fix the correct size and extent
* number.
*/
if( (jrec.flags[0] & 2) != 0 )
{
if(strcmp(s_entry1->name,".") == 0)
if(strcmp(s_entry1->name,".") == 0)
{
jrec.name_len[0] = 1;
set_733((char *) jrec.extent, dpnt->jextent);
set_733((char *) jrec.size, ROUND_UP(dpnt->jsize));
}
else if(strcmp(s_entry1->name,"..") == 0)
else if(strcmp(s_entry1->name,"..") == 0)
{
jrec.name_len[0] = 1;
if( dpnt->parent == reloc_dir )
@ -600,7 +600,7 @@ static void FDECL2(generate_one_joliet_directory, struct directory *, dpnt, FILE
{
if(finddir->self == s_entry1) break;
finddir = finddir->next;
if(!finddir)
if(!finddir)
{
fprintf (stderr, _("Fatal goof - unable to find directory location\n"));
exit (1);
@ -610,25 +610,25 @@ static void FDECL2(generate_one_joliet_directory, struct directory *, dpnt, FILE
set_733((char *) jrec.size, ROUND_UP(finddir->jsize));
}
}
memcpy(directory_buffer + dir_index, &jrec,
memcpy(directory_buffer + dir_index, &jrec,
sizeof(struct iso_directory_record) -
sizeof(s_entry1->isorec.name));
dir_index += sizeof(struct iso_directory_record) -
dir_index += sizeof(struct iso_directory_record) -
sizeof (s_entry1->isorec.name);
/*
* Finally dump the Unicode version of the filename.
* Note - . and .. are the same as with non-Joliet discs.
*/
if( (jrec.flags[0] & 2) != 0
if( (jrec.flags[0] & 2) != 0
&& strcmp(s_entry1->name, ".") == 0 )
{
directory_buffer[dir_index++] = 0;
}
else if( (jrec.flags[0] & 2) != 0
else if( (jrec.flags[0] & 2) != 0
&& strcmp(s_entry1->name, "..") == 0 )
{
directory_buffer[dir_index++] = 1;
@ -640,7 +640,7 @@ static void FDECL2(generate_one_joliet_directory, struct directory *, dpnt, FILE
s_entry1->name);
dir_index += cvt_len;
}
if(dir_index & 1)
{
directory_buffer[dir_index++] = 0;
@ -648,13 +648,13 @@ static void FDECL2(generate_one_joliet_directory, struct directory *, dpnt, FILE
s_entry = s_entry->jnext;
}
if(dpnt->jsize != dir_index)
{
fprintf (stderr, _("Unexpected joliet directory length %d %d %s\n"),
dpnt->jsize, dir_index, dpnt->de_name);
}
xfwrite(directory_buffer, 1, total_size, outfile);
last_extent_written += total_size >> 11;
free(directory_buffer);
@ -678,7 +678,7 @@ static int FDECL1(joliet_sort_n_finish, struct directory *, this_dir)
{
continue;
}
/*
* First update the path table sizes for directories.
*
@ -690,15 +690,15 @@ static int FDECL1(joliet_sort_n_finish, struct directory *, this_dir)
*/
if(s_entry->isorec.flags[0] == 2)
{
if (strcmp(s_entry->name,".") && strcmp(s_entry->name,".."))
if (strcmp(s_entry->name,".") && strcmp(s_entry->name,".."))
{
jpath_table_size += joliet_strlen(s_entry->name) + sizeof(struct iso_path_table) - 1;
if (jpath_table_size & 1)
if (jpath_table_size & 1)
{
jpath_table_size++;
}
}
else
else
{
if (this_dir == root && strlen(s_entry->name) == 1)
{
@ -708,11 +708,11 @@ static int FDECL1(joliet_sort_n_finish, struct directory *, this_dir)
}
}
if (strcmp(s_entry->name,".") && strcmp(s_entry->name,".."))
if (strcmp(s_entry->name,".") && strcmp(s_entry->name,".."))
{
s_entry->jreclen = sizeof(struct iso_directory_record)
- sizeof(s_entry->isorec.name)
+ joliet_strlen(s_entry->name)
+ joliet_strlen(s_entry->name)
+ 1;
}
else
@ -737,9 +737,9 @@ static int FDECL1(joliet_sort_n_finish, struct directory *, this_dir)
this_dir->jcontents = this_dir->contents;
status = joliet_sort_directory(&this_dir->jcontents);
/*
/*
* Now go through the directory and figure out how large this one will be.
* Do not split a directory entry across a sector boundary
* Do not split a directory entry across a sector boundary
*/
s_entry = this_dir->jcontents;
/*
@ -756,10 +756,10 @@ static int FDECL1(joliet_sort_n_finish, struct directory *, this_dir)
}
jreclen = s_entry->jreclen;
if ((this_dir->jsize & (SECTOR_SIZE - 1)) + jreclen >= SECTOR_SIZE)
{
this_dir->jsize = (this_dir->jsize + (SECTOR_SIZE - 1)) &
this_dir->jsize = (this_dir->jsize + (SECTOR_SIZE - 1)) &
~(SECTOR_SIZE - 1);
}
this_dir->jsize += jreclen;
@ -771,11 +771,11 @@ static int FDECL1(joliet_sort_n_finish, struct directory *, this_dir)
* Similar to the iso9660 case, except here we perform a full sort based upon the
* regular name of the file, not the 8.3 version.
*/
static int FDECL2(joliet_compare_dirs, const void *, rr, const void *, ll)
static int FDECL2(joliet_compare_dirs, const void *, rr, const void *, ll)
{
char * rpnt, *lpnt;
struct directory_entry ** r, **l;
r = (struct directory_entry **) rr;
l = (struct directory_entry **) ll;
rpnt = (*r)->name;
@ -788,7 +788,7 @@ static int FDECL2(joliet_compare_dirs, const void *, rr, const void *, ll)
{
sort_goof++;
}
/*
* Put the '.' and '..' entries on the head of the sorted list.
* For normal ASCII, this always happens to be the case, but out of
@ -800,13 +800,13 @@ static int FDECL2(joliet_compare_dirs, const void *, rr, const void *, ll)
if( strcmp(rpnt, "..") == 0 ) return -1;
if( strcmp(lpnt, "..") == 0 ) return 1;
while(*rpnt && *lpnt)
while(*rpnt && *lpnt)
{
if(*rpnt == ';' && *lpnt != ';') return -1;
if(*rpnt != ';' && *lpnt == ';') return 1;
if(*rpnt == ';' && *lpnt == ';') return 0;
/*
* Extensions are not special here. Don't treat the dot as something that
* must be bumped to the start of the list.
@ -815,7 +815,7 @@ static int FDECL2(joliet_compare_dirs, const void *, rr, const void *, ll)
if(*rpnt == '.' && *lpnt != '.') return -1;
if(*rpnt != '.' && *lpnt == '.') return 1;
#endif
if(*rpnt < *lpnt) return -1;
if(*rpnt > *lpnt) return 1;
rpnt++; lpnt++;
@ -826,7 +826,7 @@ static int FDECL2(joliet_compare_dirs, const void *, rr, const void *, ll)
}
/*
/*
* Function: sort_directory
*
* Purpose: Sort the directory in the appropriate ISO9660
@ -840,7 +840,7 @@ static int FDECL1(joliet_sort_directory, struct directory_entry **, sort_dir)
int i;
struct directory_entry * s_entry;
struct directory_entry ** sortlist;
s_entry = *sort_dir;
while(s_entry)
{
@ -851,9 +851,9 @@ static int FDECL1(joliet_sort_directory, struct directory_entry **, sort_dir)
}
/*
* OK, now we know how many there are. Build a vector for sorting.
* OK, now we know how many there are. Build a vector for sorting.
*/
sortlist = (struct directory_entry **)
sortlist = (struct directory_entry **)
e_malloc(sizeof(struct directory_entry *) * dcount);
dcount = 0;
@ -867,18 +867,18 @@ static int FDECL1(joliet_sort_directory, struct directory_entry **, sort_dir)
}
s_entry = s_entry->next;
}
sort_goof = 0;
#ifdef __STDC__
qsort(sortlist, dcount, sizeof(struct directory_entry *),
qsort(sortlist, dcount, sizeof(struct directory_entry *),
(int (*)(const void *, const void *))joliet_compare_dirs);
#else
qsort(sortlist, dcount, sizeof(struct directory_entry *),
qsort(sortlist, dcount, sizeof(struct directory_entry *),
joliet_compare_dirs);
#endif
/*
* Now reassemble the linked list in the proper sorted order
/*
* Now reassemble the linked list in the proper sorted order
*/
for(i=0; i<dcount-1; i++)
{
@ -887,7 +887,7 @@ static int FDECL1(joliet_sort_directory, struct directory_entry **, sort_dir)
sortlist[dcount-1]->jnext = NULL;
*sort_dir = sortlist[0];
free(sortlist);
return sort_goof;
}
@ -934,7 +934,7 @@ static void FDECL2(generate_joliet_directories, struct directory *, node, FILE*,
}
}
/* skip if hidden - but not for the rr_moved dir */
if(dpnt->subdir && (!(dpnt->dir_flags & INHIBIT_JOLIET_ENTRY) || dpnt == reloc_dir))
if(dpnt->subdir && (!(dpnt->dir_flags & INHIBIT_JOLIET_ENTRY) || dpnt == reloc_dir))
generate_joliet_directories(dpnt->subdir, outfile);
dpnt = dpnt->next;
}
@ -947,7 +947,7 @@ static void FDECL2(generate_joliet_directories, struct directory *, node, FILE*,
static int FDECL1(jpathtab_write, FILE *, outfile)
{
/*
* Next we write the path tables
* Next we write the path tables
*/
xfwrite(jpath_table_l, 1, jpath_blocks << 11, outfile);
xfwrite(jpath_table_m, 1, jpath_blocks << 11, outfile);
@ -995,7 +995,7 @@ static int FDECL1(jvd_write, FILE *, outfile)
struct iso_primary_descriptor jvol_desc;
/*
* Next we write out the boot volume descriptor for the disc
* Next we write out the boot volume descriptor for the disc
*/
jvol_desc = vol_desc;
get_joliet_vol_desc(&jvol_desc);
@ -1013,7 +1013,7 @@ static int FDECL1(jpathtab_size, int, starting_extent)
jpath_table[1] = 0;
jpath_table[2] = jpath_table[0] + jpath_blocks;
jpath_table[3] = 0;
last_extent += 2*jpath_blocks;
return 0;
}

View file

@ -564,8 +564,8 @@ void usage(){
}
/*
* Fill in date in the iso9660 format
/*
* Fill in date in the iso9660 format
*
* The standards state that the timezone offset is in multiples of 15
* minutes, and is what you add to GMT to get the localtime. The U.S.
@ -583,9 +583,9 @@ int FDECL2(iso9660_date,char *, result, time_t, crtime){
result[4] = local->tm_min;
result[5] = local->tm_sec;
/*
/*
* Must recalculate proper timezone offset each time,
* as some files use daylight savings time and some don't...
* as some files use daylight savings time and some don't...
*/
result[6] = local->tm_yday; /* save yday 'cause gmtime zaps it */
local = gmtime(&crtime);
@ -593,11 +593,11 @@ int FDECL2(iso9660_date,char *, result, time_t, crtime){
local->tm_yday -= result[6];
local->tm_hour -= result[3];
local->tm_min -= result[4];
if (local->tm_year < 0)
if (local->tm_year < 0)
{
local->tm_yday = -1;
}
else
else
{
if (local->tm_year > 0) local->tm_yday = 1;
}
@ -972,7 +972,7 @@ parse_input_files:
{
int resource;
struct rlimit rlp;
if (getrlimit(RLIMIT_DATA,&rlp) == -1)
if (getrlimit(RLIMIT_DATA,&rlp) == -1)
perror (_("Warning: getrlimit"));
else {
rlp.rlim_cur=33554432;
@ -1092,7 +1092,7 @@ parse_input_files:
merge_image);
}
memcpy(&de.isorec.extent, mrootp->extent, 8);
memcpy(&de.isorec.extent, mrootp->extent, 8);
}
/*
@ -1175,8 +1175,8 @@ parse_input_files:
break;
}
*pnt = '\0';
graft_dir = find_or_create_directory(graft_dir,
graft_point,
graft_dir = find_or_create_directory(graft_dir,
graft_point,
NULL, TRUE);
*pnt = PATH_SEPARATOR;
xpnt = pnt + 1;
@ -1262,12 +1262,12 @@ parse_input_files:
if (goof)
error (1, 0, _("Joliet tree sort failed.\n"));
/*
* Fix a couple of things in the root directory so that everything
* is self consistent.
*/
root->self = root->contents; /* Fix this up so that the path
root->self = root->contents; /* Fix this up so that the path
tables get done right */
/*
@ -1344,8 +1344,8 @@ parse_input_files:
outputlist_insert(&dirtree_clean);
if(extension_record)
{
if(extension_record)
{
outputlist_insert(&extension_desc);
}
@ -1356,7 +1356,7 @@ parse_input_files:
* will always be a primary and an end volume descriptor.
*/
last_extent = session_start;
/*
* Calculate the size of all of the components of the disc, and assign
* extent numbers.
@ -1402,7 +1402,7 @@ parse_input_files:
if( verbose > 0 )
{
#ifdef HAVE_SBRK
fprintf (stderr, _("Max brk space used %x\n"),
fprintf (stderr, _("Max brk space used %x\n"),
(unsigned int)(((unsigned long)sbrk(0)) - mem_start));
#endif
fprintf (stderr, _("%llu extents written (%llu MiB)\n"), last_extent, last_extent >> 9);

View file

@ -190,7 +190,7 @@ struct file_hash{
unsigned int starting_block;
unsigned int size;
};
/*
* This structure is used to control the output of fragments to the cdrom
@ -243,7 +243,7 @@ extern struct output_fragment jdirtree_desc;
extern struct output_fragment extension_desc;
extern struct output_fragment files_desc;
/*
/*
* This structure describes one complete directory. It has pointers
* to other directories in the overall tree so that it is clear where
* this directory lives in the tree, and it also must contain pointers
@ -326,14 +326,14 @@ extern struct directory *
struct directory_entry * self, int));
extern void DECL (finish_cl_pl_entries, (void));
extern int DECL(scan_directory_tree,(struct directory * this_dir,
char * path,
char * path,
struct directory_entry * self));
extern int DECL(insert_file_entry,(struct directory *, char *,
extern int DECL(insert_file_entry,(struct directory *, char *,
char *));
extern void DECL(generate_iso9660_directories,(struct directory *, FILE*));
extern void DECL(dump_tree,(struct directory * node));
extern struct directory_entry * DECL(search_tree_file, (struct
extern struct directory_entry * DECL(search_tree_file, (struct
directory * node,char * filename));
extern void DECL(update_nlink_field,(struct directory * node));
extern void DECL (init_fstatbuf, (void));
@ -374,17 +374,17 @@ extern char *effective_date;
extern FILE * in_image;
extern struct iso_directory_record *
DECL(merge_isofs,(char * path));
DECL(merge_isofs,(char * path));
extern int DECL(free_mdinfo, (struct directory_entry **, int len));
extern struct directory_entry **
extern struct directory_entry **
DECL(read_merging_directory,(struct iso_directory_record *, int*));
extern void
DECL(merge_remaining_entries, (struct directory *,
extern void
DECL(merge_remaining_entries, (struct directory *,
struct directory_entry **, int));
extern int
DECL(merge_previous_session, (struct directory *,
extern int
DECL(merge_previous_session, (struct directory *,
struct iso_directory_record *));
extern int DECL(get_session_start, (int *));
@ -401,7 +401,7 @@ struct dirent * DECL(readdir_add_files, (char **, char *, DIR *));
/* */
extern int DECL(iso9660_file_length,(const char* name,
extern int DECL(iso9660_file_length,(const char* name,
struct directory_entry * sresult, int flag));
extern int DECL(iso9660_date,(char *, time_t));
extern void DECL(add_hash,(struct directory_entry *));
@ -413,7 +413,7 @@ extern int DECL(delete_file_hash,(struct directory_entry *));
extern struct directory_entry * DECL(find_file_hash,(char *));
extern void DECL(add_file_hash,(struct directory_entry *));
extern int DECL(generate_rock_ridge_attributes,(char *, char *,
struct directory_entry *,
struct directory_entry *,
struct stat *, struct stat *,
int deep_flag));
extern char * DECL(generate_rr_extension_record,(char * id, char * descriptor,

View file

@ -1,5 +1,5 @@
/*
* File multi.c - scan existing iso9660 image and merge into
* File multi.c - scan existing iso9660 image and merge into
* iso9660 filesystem. Used for multisession support.
*
* Written by Eric Youngdale (1996).
@ -166,7 +166,7 @@ readsecs(startsecno, buffer, sectorcount)
/*
* Parse the RR attributes so we can find the file name.
*/
static int
static int
FDECL3(parse_rr, unsigned char *, pnt, int, len, struct directory_entry *,dpnt)
{
int cont_extent, cont_offset, cont_size;
@ -219,10 +219,10 @@ FDECL3(parse_rr, unsigned char *, pnt, int, len, struct directory_entry *,dpnt)
} /* parse_rr */
static int
FDECL4(check_rr_dates, struct directory_entry *, dpnt,
struct directory_entry *, current,
struct stat *, statbuf,
static int
FDECL4(check_rr_dates, struct directory_entry *, dpnt,
struct directory_entry *, current,
struct stat *, statbuf,
struct stat *,lstatbuf)
{
int cont_extent, cont_offset, cont_size;
@ -233,8 +233,8 @@ FDECL4(check_rr_dates, struct directory_entry *, dpnt,
int same_file_type;
mode_t mode;
char time_buf[7];
cont_extent = cont_offset = cont_size = 0;
same_file = 1;
same_file_type = 1;
@ -270,14 +270,14 @@ FDECL4(check_rr_dates, struct directory_entry *, dpnt,
if( pnt[4] & TF_CREATE )
{
iso9660_date((char *) time_buf, lstatbuf->st_ctime);
if(memcmp(time_buf, pnt+offset, 7) == 0)
if(memcmp(time_buf, pnt+offset, 7) == 0)
same_file = 0;
offset += 7;
}
if( pnt[4] & TF_MODIFY )
{
iso9660_date((char *) time_buf, lstatbuf->st_mtime);
if(memcmp(time_buf, pnt+offset, 7) == 0)
if(memcmp(time_buf, pnt+offset, 7) == 0)
same_file = 0;
offset += 7;
}
@ -350,7 +350,7 @@ FDECL2(read_merging_directory, struct iso_directory_record *, mrootp,
while(i < len )
{
idr = (struct iso_directory_record *) &dirbuff[i];
if(idr->length[0] == 0)
if(idr->length[0] == 0)
{
i = (i + SECTOR_SIZE - 1) & ~(SECTOR_SIZE - 1);
continue;
@ -378,7 +378,7 @@ FDECL2(read_merging_directory, struct iso_directory_record *, mrootp,
while(i < len )
{
idr = (struct iso_directory_record *) &dirbuff[i];
if(idr->length[0] == 0)
if(idr->length[0] == 0)
{
i = (i + SECTOR_SIZE - 1) & ~(SECTOR_SIZE - 1);
continue;
@ -413,16 +413,16 @@ FDECL2(read_merging_directory, struct iso_directory_record *, mrootp,
*/
rlen = idr->length[0] & 0xff;
cpnt = (unsigned char *) idr;
rlen -= sizeof(struct iso_directory_record);
cpnt += sizeof(struct iso_directory_record);
rlen += sizeof(idr->name);
cpnt -= sizeof(idr->name);
rlen -= idr->name_len[0];
cpnt += idr->name_len[0];
if((idr->name_len[0] & 1) == 0){
cpnt++;
rlen--;
@ -444,7 +444,7 @@ FDECL2(read_merging_directory, struct iso_directory_record *, mrootp,
memset(cpnt, 0, sizeof((*pnt)->isorec.name) - idr->name_len[0]);
parse_rr((*pnt)->rr_attributes, rlen, *pnt);
if( ((*pnt)->isorec.name_len[0] == 1)
&& ( ((*pnt)->isorec.name[0] == 0)
|| ((*pnt)->isorec.name[0] == 1)) )
@ -485,7 +485,7 @@ FDECL2(read_merging_directory, struct iso_directory_record *, mrootp,
tt_extent = isonum_733((unsigned char *)idr->extent);
tt_size = isonum_733((unsigned char *)idr->size);
}
pnt++;
i += idr->length[0];
}
@ -515,7 +515,7 @@ FDECL2(read_merging_directory, struct iso_directory_record *, mrootp,
{
rlen = isonum_711((*pnt)->isorec.name_len);
if( strncmp((char *) cpnt + 2, (*pnt)->isorec.name,
rlen) == 0
rlen) == 0
&& cpnt[2+rlen] == ' ')
{
(*pnt)->table = e_malloc(strlen((char*)cpnt) - 33);
@ -534,7 +534,7 @@ FDECL2(read_merging_directory, struct iso_directory_record *, mrootp,
cpnt = cpnt1 + 1;
cpnt1 = cpnt;
}
free(tt_buf);
}
else if( !seen_rockridge && !warning_given )
@ -553,14 +553,14 @@ FDECL2(read_merging_directory, struct iso_directory_record *, mrootp,
{
free(dirbuff);
}
return rtn;
} /* read_merging_directory */
/*
* Free any associated data related to the structures.
*/
int
int
FDECL2(free_mdinfo, struct directory_entry ** , ptr, int, len )
{
int i;
@ -792,7 +792,7 @@ struct iso_directory_record * FDECL1(merge_isofs, char *, path)
/*
* Get the location and size of the root directory.
*/
rootp = (struct iso_directory_record *)
rootp = (struct iso_directory_record *)
malloc(sizeof(struct iso_directory_record));
memcpy(rootp, pri->root_directory_record, sizeof(*rootp));
@ -820,7 +820,7 @@ void FDECL3(merge_remaining_entries, struct directory *, this_dir,
{
continue;
}
if( pnt[i]->name != NULL && pnt[i]->whole_name == NULL)
{
/*
@ -868,7 +868,7 @@ void FDECL3(merge_remaining_entries, struct directory *, this_dir,
this_dir->contents = pnt[i];
pnt[i] = NULL;
}
/*
* If we don't have an entry for the translation table, then
@ -945,7 +945,7 @@ void FDECL3(merge_remaining_entries, struct directory *, this_dir,
* location. FIXME(eric).
*/
static int
FDECL2(merge_old_directory_into_tree, struct directory_entry *, dpnt,
FDECL2(merge_old_directory_into_tree, struct directory_entry *, dpnt,
struct directory *, parent)
{
struct directory_entry **contents = NULL;
@ -997,7 +997,7 @@ FDECL2(merge_old_directory_into_tree, struct directory_entry *, dpnt,
/*
* We can always reuse the TRANS.TBL in this particular case.
*/
contents[i]->de_flags |= SAFE_TO_REUSE_TABLE_ENTRY;
contents[i]->de_flags |= SAFE_TO_REUSE_TABLE_ENTRY;
if( ((contents[i]->isorec.flags[0] & 2) != 0)
&& (i >= 2) )
@ -1059,7 +1059,7 @@ FDECL2(merge_old_directory_into_tree, struct directory_entry *, dpnt,
char * cdwrite_data = NULL;
int
FDECL1(get_session_start, int *, file_addr)
FDECL1(get_session_start, int *, file_addr)
{
char * pnt;
@ -1171,14 +1171,14 @@ FDECL2(merge_previous_session,struct directory *, this_dir,
{
int dflag;
if (strcmp(s_entry->name,".") && strcmp(s_entry->name,".."))
if (strcmp(s_entry->name,".") && strcmp(s_entry->name,".."))
{
struct directory * child;
child = find_or_create_directory(this_dir,
s_entry->whole_name,
child = find_or_create_directory(this_dir,
s_entry->whole_name,
s_entry, 1);
dflag = merge_previous_session(child,
dflag = merge_previous_session(child,
&odpnt->isorec);
/* If unable to scan directory, mark this as a non-directory */
if(!dflag)
@ -1188,14 +1188,14 @@ FDECL2(merge_previous_session,struct directory *, this_dir,
}
}
}
/*
* Whatever is left over, are things which are no longer in the tree
* on disk. We need to also merge these into the tree.
*/
merge_remaining_entries(this_dir, orig_contents, n_orig);
free_mdinfo(orig_contents, n_orig);
return 1;
}

View file

@ -27,7 +27,7 @@
#include <ctype.h>
extern int allow_leading_dots;
/*
* Function: iso9660_file_length
*
@ -43,8 +43,8 @@ extern int allow_leading_dots;
* would also be nice to have.
*/
int FDECL3(iso9660_file_length,
const char*, name,
struct directory_entry *, sresult,
const char*, name,
struct directory_entry *, sresult,
int, dirflag)
{
char * c;
@ -69,7 +69,7 @@ int FDECL3(iso9660_file_length,
*/
if(strcmp(name,".") == 0)
{
if(result)
if(result)
{
*result = 0;
}
@ -82,7 +82,7 @@ int FDECL3(iso9660_file_length,
*/
if(strcmp(name,"..") == 0)
{
if(result)
if(result)
{
*result++ = 1;
*result++ = 0;
@ -115,7 +115,7 @@ int FDECL3(iso9660_file_length,
while(*pnt)
{
#ifdef VMS
if( strcmp(pnt,".DIR;1") == 0 )
if( strcmp(pnt,".DIR;1") == 0 )
{
break;
}
@ -126,11 +126,11 @@ int FDECL3(iso9660_file_length,
* generated by some editors. Lower the priority of
* the file.
*/
if(*pnt == '#')
if(*pnt == '#')
{
priority = 1;
pnt++;
continue;
priority = 1;
pnt++;
continue;
}
/*
@ -138,11 +138,11 @@ int FDECL3(iso9660_file_length,
* generated by some editors. Lower the priority of
* the file.
*/
if(*pnt == '~')
if(*pnt == '~')
{
priority = 1;
tildes++;
pnt++;
priority = 1;
tildes++;
pnt++;
continue;
}
@ -170,9 +170,9 @@ int FDECL3(iso9660_file_length,
* If we have a name with multiple '.' characters, we ignore everything
* after we have gotten the extension.
*/
if(ignore)
if(ignore)
{
pnt++;
pnt++;
continue;
}
@ -181,7 +181,7 @@ int FDECL3(iso9660_file_length,
*/
if(seen_semic)
{
if(*pnt >= '0' && *pnt <= '9')
if(*pnt >= '0' && *pnt <= '9')
{
*result++ = *pnt;
}
@ -197,19 +197,19 @@ int FDECL3(iso9660_file_length,
* option. We still only allow one '.' character in the
* name, however.
*/
if(full_iso9660_filenames)
if(full_iso9660_filenames)
{
/* Here we allow a more relaxed syntax. */
if(*pnt == '.')
if(*pnt == '.')
{
if (seen_dot)
if (seen_dot)
{
ignore++;
ignore++;
continue;
}
seen_dot++;
}
if(current_length < 30)
if(current_length < 30)
{
if( !isascii (*pnt))
{
@ -222,21 +222,21 @@ int FDECL3(iso9660_file_length,
}
}
else
{
/*
{
/*
* Dos style filenames. We really restrict the
* names here.
*/
/* It would be nice to have .tar.gz transform to .tgz,
* .ps.gz to .psz, ...
*/
if(*pnt == '.')
if(*pnt == '.')
{
if (!chars_before_dot && !allow_leading_dots)
if (!chars_before_dot && !allow_leading_dots)
{
/* DOS can't read files with dot first */
chars_before_dot++;
if (result)
if (result)
{
*result++ = '_'; /* Substitute underscore */
}
@ -247,36 +247,36 @@ int FDECL3(iso9660_file_length,
* If this isn't the dot that we use for the extension,
* then change the character into a '_' instead.
*/
if(chars_before_dot < 8)
if(chars_before_dot < 8)
{
chars_before_dot++;
if(result)
if(result)
{
*result++ = '_';
}
}
}
else
else
{
if (seen_dot)
if (seen_dot)
{
ignore++; continue;
}
if(result)
if(result)
{
*result++ = '.';
}
seen_dot++;
}
}
else
else
{
if( (seen_dot && (chars_after_dot < 3) && ++chars_after_dot)
|| (!seen_dot && (chars_before_dot < 8) && ++chars_before_dot) )
{
if(result)
if(result)
{
switch (*pnt)
switch (*pnt)
{
default:
if( !isascii (*pnt) )
@ -289,7 +289,7 @@ int FDECL3(iso9660_file_length,
}
break;
/*
/*
* Descriptions of DOS's 'Parse Filename'
* (function 29H) describes V1 and V2.0+
* separator and terminator characters.
@ -329,7 +329,7 @@ int FDECL3(iso9660_file_length,
current_length++;
pnt++;
} /* while (*pnt) */
/*
* OK, that wraps up the scan of the name. Now tidy up a few other
* things.
@ -345,11 +345,11 @@ int FDECL3(iso9660_file_length,
{
int prio1 = 0;
pnt = name;
while (*pnt && *pnt != '~')
while (*pnt && *pnt != '~')
{
pnt++;
}
if (*pnt)
if (*pnt)
{
pnt++;
}
@ -360,7 +360,7 @@ int FDECL3(iso9660_file_length,
}
priority = prio1;
}
/*
* If this is not a directory, force a '.' in case we haven't
* seen one, and add a version number if we haven't seen one
@ -368,12 +368,12 @@ int FDECL3(iso9660_file_length,
*/
if (!dirflag)
{
if (!seen_dot && !omit_period)
if (!seen_dot && !omit_period)
{
if (result) *result++ = '.';
if (result) *result++ = '.';
extra++;
}
if(!omit_version_number && !seen_semic)
if(!omit_version_number && !seen_semic)
{
if(result)
{
@ -383,8 +383,8 @@ int FDECL3(iso9660_file_length,
extra += 2;
}
}
if(result)
if(result)
{
*result++ = 0;
}

View file

@ -87,7 +87,7 @@
a CE entry for the continuation record */
#define MAYBE_ADD_CE_ENTRY(BYTES) \
((unsigned) ((BYTES) + CE_SIZE + currlen + ipnt) > (unsigned) (recstart + reclimit) ? 1 : 0)
((unsigned) ((BYTES) + CE_SIZE + currlen + ipnt) > (unsigned) (recstart + reclimit) ? 1 : 0)
/*
* Buffer to build RR attributes
@ -210,13 +210,13 @@ int deep_opt;
};
/*
* Add the posix modes
* Add the posix modes
*/
if(MAYBE_ADD_CE_ENTRY(PX_SIZE)) add_CE_entry();
Rock[ipnt++] ='P';
Rock[ipnt++] ='X';
Rock[ipnt++] = PX_SIZE;
Rock[ipnt++] = SU_VERSION;
Rock[ipnt++] = SU_VERSION;
flagval |= (1<<0);
set_733((char*)Rock + ipnt, lstatbuf->st_mode);
ipnt += 8;
@ -236,7 +236,7 @@ int deep_opt;
Rock[ipnt++] ='P';
Rock[ipnt++] ='N';
Rock[ipnt++] = PN_SIZE;
Rock[ipnt++] = SU_VERSION;
Rock[ipnt++] = SU_VERSION;
flagval |= (1<<1);
#if defined(MAJOR_IN_SYSMACROS) || defined(MAJOR_IN_MKDEV)
set_733((char*)Rock + ipnt, major(lstatbuf->st_rdev ));
@ -286,25 +286,25 @@ int deep_opt;
cpnt = &symlink_buff[0];
flagval |= (1<<2);
if (! split_SL_field)
if (! split_SL_field)
{
int sl_bytes = 0;
for (cpnt1 = cpnt; *cpnt1 != '\0'; cpnt1++)
for (cpnt1 = cpnt; *cpnt1 != '\0'; cpnt1++)
{
if (*cpnt1 == '/')
if (*cpnt1 == '/')
{
sl_bytes += 4;
}
else
}
else
{
sl_bytes += 1;
}
}
if (sl_bytes > 250)
if (sl_bytes > 250)
{
/*
/*
* the symbolic link won't fit into one SL System Use Field
* print an error message and continue with splited one
* print an error message and continue with splited one
*/
fprintf(stderr, _("symbolic link ``%s'' to long for one SL System Use Field, splitting"), cpnt);
}
@ -317,7 +317,7 @@ int deep_opt;
Rock[ipnt++] ='L';
lenpos = ipnt;
Rock[ipnt++] = SL_SIZE;
Rock[ipnt++] = SU_VERSION;
Rock[ipnt++] = SU_VERSION;
Rock[ipnt++] = 0; /* Flags */
lenval = 5;
while(*cpnt){
@ -326,7 +326,7 @@ int deep_opt;
nchar--;
*cpnt1 = 0;
};
/* We treat certain components in a special way. */
if(cpnt[0] == '.' && cpnt[1] == '.' && cpnt[2] == 0){
if(MAYBE_ADD_CE_ENTRY(2)) add_CE_entry();
@ -349,7 +349,7 @@ int deep_opt;
/* If we do not have enough room for a component, start
a new continuations segment now */
if(split_SL_component ? MAYBE_ADD_CE_ENTRY(6) :
MAYBE_ADD_CE_ENTRY(6 + strlen ((char *) cpnt)))
MAYBE_ADD_CE_ENTRY(6 + strlen ((char *) cpnt)))
{
add_CE_entry();
if(cpnt1)
@ -397,7 +397,7 @@ int deep_opt;
if(nchar) Rock[lenpos + 2] = SL_CONTINUE; /* We need another SL entry */
} /* while nchar */
} /* Is a symbolic link */
/*
/*
* Add in the Rock Ridge TF time field
*/
if(MAYBE_ADD_CE_ENTRY(TF_SIZE)) add_CE_entry();
@ -422,7 +422,7 @@ int deep_opt;
iso9660_date((char *) &Rock[ipnt], lstatbuf->st_ctime);
ipnt += 7;
/*
/*
* Add in the Rock Ridge RE time field
*/
if(deep_opt & NEED_RE){
@ -433,7 +433,7 @@ int deep_opt;
Rock[ipnt++] = SU_VERSION;
flagval |= (1<<6);
};
/*
/*
* Add in the Rock Ridge PL record, if required.
*/
if(deep_opt & NEED_PL){
@ -447,7 +447,7 @@ int deep_opt;
flagval |= (1<<5);
};
/*
/*
* Add in the Rock Ridge CL field, if required.
*/
if(deep_opt & NEED_CL){
@ -464,7 +464,7 @@ int deep_opt;
#ifndef VMS
/* If transparent compression was requested, fill in the correct
field for this file */
if(transparent_compression &&
if(transparent_compression &&
S_ISREG(lstatbuf->st_mode) &&
strlen(name) > 3 &&
strcmp(name + strlen(name) - 3,".gZ") == 0){
@ -498,8 +498,8 @@ int deep_opt;
else {
int blocksize;
blocksize = (header[3] << 8) | header[2];
file_size = ((unsigned int)header[7] << 24) |
((unsigned int)header[6] << 16) |
file_size = ((unsigned int)header[7] << 24) |
((unsigned int)header[6] << 16) |
((unsigned int)header[5] << 8) | header[4];
#if 0
fprintf(stderr,"Blocksize = %d %d\n", blocksize, file_size);
@ -534,7 +534,7 @@ int deep_opt;
};
}
#endif
/*
/*
* Add in the Rock Ridge CE field, if required. We use this for the
* extension record that is stored in the root directory.
*/

File diff suppressed because it is too large Load diff

View file

@ -40,7 +40,7 @@
#include "mkisofs.h"
#include "iso9660.h"
#include "msdos_partition.h"
#ifdef __SVR4
extern char * strdup(const char *);
#endif
@ -161,7 +161,7 @@ void FDECL4(xfwrite, void *, buffer, uint64_t, count, uint64_t, size, FILE *, fi
error (1, errno, _("Cannot open '%s'"), nbuf);
}
while(count)
while(count)
{
size_t got = fwrite (buffer, size, count, file);
@ -196,7 +196,7 @@ static int FDECL1(assign_directory_addresses, struct directory *, node)
struct directory * dpnt;
dpnt = node;
while (dpnt)
{
/* skip if it's hidden */
@ -214,13 +214,13 @@ static int FDECL1(assign_directory_addresses, struct directory *, node)
{
dpnt->extent = last_extent;
dir_size = (dpnt->size + (SECTOR_SIZE - 1)) >> 11;
last_extent += dir_size;
/*
/*
* Leave room for the CE entries for this directory. Keep them
* close to the reference directory so that access will be
* quick.
* close to the reference directory so that access will be
* quick.
*/
if(dpnt->ce_bytes)
{
@ -228,7 +228,7 @@ static int FDECL1(assign_directory_addresses, struct directory *, node)
}
}
if(dpnt->subdir)
if(dpnt->subdir)
{
assign_directory_addresses(dpnt->subdir);
}
@ -238,7 +238,7 @@ static int FDECL1(assign_directory_addresses, struct directory *, node)
return 0;
}
static void FDECL3(write_one_file, char *, filename,
static void FDECL3(write_one_file, char *, filename,
uint64_t, size, FILE *, outfile)
{
char buffer[SECTOR_SIZE * NSECT];
@ -247,7 +247,7 @@ static void FDECL3(write_one_file, char *, filename,
size_t use;
if ((infile = fopen(filename, "rb")) == NULL)
if ((infile = fopen(filename, "rb")) == NULL)
error (1, errno, _("cannot open %s\n"), filename);
remain = size;
@ -256,12 +256,12 @@ static void FDECL3(write_one_file, char *, filename,
use = (remain > SECTOR_SIZE * NSECT - 1 ? NSECT*SECTOR_SIZE : remain);
use = ROUND_UP(use); /* Round up to nearest sector boundary */
memset(buffer, 0, use);
if (fread(buffer, 1, use, infile) == 0)
error (1, errno, _("cannot read %llu bytes from %s"), use, filename);
if (fread(buffer, 1, use, infile) == 0)
error (1, errno, _("cannot read %llu bytes from %s"), use, filename);
xfwrite(buffer, 1, use, outfile);
last_extent_written += use/SECTOR_SIZE;
#if 0
if((last_extent_written % 1000) < use/SECTOR_SIZE)
if((last_extent_written % 1000) < use/SECTOR_SIZE)
{
fprintf(stderr,"%d..", last_extent_written);
}
@ -271,7 +271,7 @@ static void FDECL3(write_one_file, char *, filename,
time_t now;
time_t the_end;
double frac;
time(&now);
frac = last_extent_written / (double)last_extent;
the_end = begun + (now - begun) / frac;
@ -290,13 +290,13 @@ static void FDECL1(write_files, FILE *, outfile)
dwpnt = dw_head;
while(dwpnt)
{
if(dwpnt->table)
if(dwpnt->table)
{
write_one_file (dwpnt->table, dwpnt->size, outfile);
table_size += dwpnt->size;
free (dwpnt->table);
}
else
else
{
#ifdef VMS
@ -327,11 +327,11 @@ static void dump_filelist()
}
#endif
static int FDECL2(compare_dirs, const void *, rr, const void *, ll)
static int FDECL2(compare_dirs, const void *, rr, const void *, ll)
{
char * rpnt, *lpnt;
struct directory_entry ** r, **l;
r = (struct directory_entry **) rr;
l = (struct directory_entry **) ll;
rpnt = (*r)->isorec.name;
@ -344,7 +344,7 @@ static int FDECL2(compare_dirs, const void *, rr, const void *, ll)
{
sort_goof++;
}
/*
* Put the '.' and '..' entries on the head of the sorted list.
* For normal ASCII, this always happens to be the case, but out of
@ -376,16 +376,16 @@ static int FDECL2(compare_dirs, const void *, rr, const void *, ll)
if((*l)->isorec.name_len[0] == 1 && *lpnt == 1) return 1;
#endif
while(*rpnt && *lpnt)
while(*rpnt && *lpnt)
{
if(*rpnt == ';' && *lpnt != ';') return -1;
if(*rpnt != ';' && *lpnt == ';') return 1;
if(*rpnt == ';' && *lpnt == ';') return 0;
if(*rpnt == '.' && *lpnt != '.') return -1;
if(*rpnt != '.' && *lpnt == '.') return 1;
if((unsigned char)*rpnt < (unsigned char)*lpnt) return -1;
if((unsigned char)*rpnt > (unsigned char)*lpnt) return 1;
rpnt++; lpnt++;
@ -395,7 +395,7 @@ static int FDECL2(compare_dirs, const void *, rr, const void *, ll)
return 0;
}
/*
/*
* Function: sort_directory
*
* Purpose: Sort the directory in the appropriate ISO9660
@ -411,7 +411,7 @@ int FDECL1(sort_directory, struct directory_entry **, sort_dir)
int i, len;
struct directory_entry * s_entry;
struct directory_entry ** sortlist;
/* need to keep a count of how many entries are hidden */
s_entry = *sort_dir;
while(s_entry)
@ -428,9 +428,9 @@ int FDECL1(sort_directory, struct directory_entry **, sort_dir)
}
/*
* OK, now we know how many there are. Build a vector for sorting.
* OK, now we know how many there are. Build a vector for sorting.
*/
sortlist = (struct directory_entry **)
sortlist = (struct directory_entry **)
e_malloc(sizeof(struct directory_entry *) * dcount);
j = dcount - 1;
@ -452,29 +452,29 @@ int FDECL1(sort_directory, struct directory_entry **, sort_dir)
s_entry->isorec.name[len] = 0;
s_entry = s_entry->next;
}
/*
* Each directory is required to contain at least . and ..
*/
if( dcount < 2 )
{
sort_goof = 1;
}
else
{
/* only sort the non-hidden entries */
sort_goof = 0;
#ifdef __STDC__
qsort(sortlist, dcount, sizeof(struct directory_entry *),
qsort(sortlist, dcount, sizeof(struct directory_entry *),
(int (*)(const void *, const void *))compare_dirs);
#else
qsort(sortlist, dcount, sizeof(struct directory_entry *),
qsort(sortlist, dcount, sizeof(struct directory_entry *),
compare_dirs);
#endif
/*
* Now reassemble the linked list in the proper sorted order
/*
* Now reassemble the linked list in the proper sorted order
* We still need the hidden entries, as they may be used in the
* Joliet tree.
*/
@ -482,7 +482,7 @@ int FDECL1(sort_directory, struct directory_entry **, sort_dir)
{
sortlist[i]->next = sortlist[i+1];
}
sortlist[dcount+xcount-1]->next = NULL;
*sort_dir = sortlist[0];
}
@ -494,7 +494,7 @@ int FDECL1(sort_directory, struct directory_entry **, sort_dir)
static int root_gen()
{
init_fstatbuf();
root_record.length[0] = 1 + sizeof(struct iso_directory_record)
- sizeof(root_record.name);
root_record.ext_attr_length[0] = 0;
@ -533,16 +533,16 @@ static void FDECL1(assign_file_addresses, struct directory *, dpnt)
{
continue;
}
/*
* This saves some space if there are symlinks present
/*
* This saves some space if there are symlinks present
*/
s_hash = find_hash(s_entry->dev, s_entry->inode);
if(s_hash)
{
if(verbose > 2)
{
fprintf (stderr, _("Cache hit for %s%s%s\n"), s_entry->filedir->de_name,
fprintf (stderr, _("Cache hit for %s%s%s\n"), s_entry->filedir->de_name,
SPATH_SEPARATOR, s_entry->name);
}
set_733((char *) s_entry->isorec.extent, s_hash->starting_block);
@ -551,12 +551,12 @@ static void FDECL1(assign_file_addresses, struct directory *, dpnt)
}
/*
* If this is for a directory that is not a . or a .. entry,
* If this is for a directory that is not a . or a .. entry,
* then look up the information for the entry. We have already
* assigned extents for directories, so we just need to
* fill in the blanks here.
*/
if (strcmp(s_entry->name,".") && strcmp(s_entry->name,"..") &&
if (strcmp(s_entry->name,".") && strcmp(s_entry->name,"..") &&
s_entry->isorec.flags[0] == 2)
{
finddir = dpnt->subdir;
@ -564,7 +564,7 @@ static void FDECL1(assign_file_addresses, struct directory *, dpnt)
{
if(finddir->self == s_entry) break;
finddir = finddir->next;
if (!finddir)
if (!finddir)
error (1, 0, _("Fatal goof\n"));
}
set_733((char *) s_entry->isorec.extent, finddir->extent);
@ -581,45 +581,45 @@ static void FDECL1(assign_file_addresses, struct directory *, dpnt)
* If this is . or .., then look up the relevant info from the
* tables.
*/
if(strcmp(s_entry->name,".") == 0)
if(strcmp(s_entry->name,".") == 0)
{
set_733((char *) s_entry->isorec.extent, dpnt->extent);
/*
/*
* Set these so that the hash table has the
* correct information
*/
s_entry->starting_block = dpnt->extent;
s_entry->size = ROUND_UP(dpnt->size);
add_hash(s_entry);
s_entry->starting_block = dpnt->extent;
set_733((char *) s_entry->isorec.size, ROUND_UP(dpnt->size));
continue;
}
if(strcmp(s_entry->name,"..") == 0)
if(strcmp(s_entry->name,"..") == 0)
{
if(dpnt == root)
{
{
total_dir_size += root->size;
}
set_733((char *) s_entry->isorec.extent, dpnt->parent->extent);
/*
/*
* Set these so that the hash table has the
* correct information
*/
s_entry->starting_block = dpnt->parent->extent;
s_entry->size = ROUND_UP(dpnt->parent->size);
add_hash(s_entry);
s_entry->starting_block = dpnt->parent->extent;
set_733((char *) s_entry->isorec.size, ROUND_UP(dpnt->parent->size));
continue;
}
/*
/*
* Some ordinary non-directory file. Just schedule the
* file to be written. This is all quite
* straightforward, just make a list and assign extents
@ -627,28 +627,28 @@ static void FDECL1(assign_file_addresses, struct directory *, dpnt)
* directories, we should be ready write out these
* files
*/
if(s_entry->size)
if(s_entry->size)
{
dwpnt = (struct deferred_write *)
dwpnt = (struct deferred_write *)
e_malloc(sizeof(struct deferred_write));
if(dw_tail)
{
dw_tail->next = dwpnt;
dw_tail = dwpnt;
}
else
}
else
{
dw_head = dwpnt;
dw_tail = dwpnt;
}
if(s_entry->inode == TABLE_INODE)
if(s_entry->inode == TABLE_INODE)
{
dwpnt->table = s_entry->table;
dwpnt->name = NULL;
sprintf(whole_path,"%s%sTRANS.TBL",
s_entry->filedir->whole_name, SPATH_SEPARATOR);
}
else
}
else
{
dwpnt->table = NULL;
strcpy(whole_path, s_entry->whole_name);
@ -672,15 +672,15 @@ static void FDECL1(assign_file_addresses, struct directory *, dpnt)
fprintf (stderr, "Warning: large file %s\n", whole_path);
fprintf (stderr, "Starting block is %d\n", s_entry->starting_block);
fprintf (stderr, "Reported file size is %d extents\n", s_entry->size);
}
#endif
#ifdef NOT_NEEDED /* Never use this code if you like to create a DVD */
if(last_extent > (800000000 >> 11))
{
if(last_extent > (800000000 >> 11))
{
/*
* More than 800Mb? Punt
* More than 800Mb? Punt
*/
fprintf(stderr,"Extent overflow processing file %s\n", whole_path);
fprintf(stderr,"Starting block is %d\n", s_entry->starting_block);
@ -699,7 +699,7 @@ static void FDECL1(assign_file_addresses, struct directory *, dpnt)
*/
set_733((char *) s_entry->isorec.extent, last_extent);
}
if(dpnt->subdir)
if(dpnt->subdir)
{
assign_file_addresses(dpnt->subdir);
}
@ -711,13 +711,13 @@ static void FDECL1(free_one_directory, struct directory *, dpnt)
{
struct directory_entry * s_entry;
struct directory_entry * s_entry_d;
s_entry = dpnt->contents;
while(s_entry)
while(s_entry)
{
s_entry_d = s_entry;
s_entry = s_entry->next;
if( s_entry_d->name != NULL )
{
free (s_entry_d->name);
@ -753,31 +753,31 @@ void FDECL2(generate_one_directory, struct directory *, dpnt, FILE *, outfile)
struct directory_entry * s_entry;
struct directory_entry * s_entry_d;
unsigned int total_size;
total_size = (dpnt->size + (SECTOR_SIZE - 1)) & ~(SECTOR_SIZE - 1);
directory_buffer = (char *) e_malloc(total_size);
memset(directory_buffer, 0, total_size);
dir_index = 0;
ce_size = (dpnt->ce_bytes + (SECTOR_SIZE - 1)) & ~(SECTOR_SIZE - 1);
ce_buffer = NULL;
if(ce_size)
if(ce_size)
{
ce_buffer = (char *) e_malloc(ce_size);
memset(ce_buffer, 0, ce_size);
ce_index = 0;
/*
* Absolute byte address of CE entries for this directory
* Absolute byte address of CE entries for this directory
*/
ce_address = last_extent_written + (total_size >> 11);
ce_address = ce_address << 11;
}
s_entry = dpnt->contents;
while(s_entry)
while(s_entry)
{
/* skip if it's hidden */
if(s_entry->de_flags & INHIBIT_ISO9660_ENTRY) {
@ -785,25 +785,25 @@ void FDECL2(generate_one_directory, struct directory *, dpnt, FILE *, outfile)
continue;
}
/*
* We do not allow directory entries to cross sector boundaries.
* Simply pad, and then start the next entry at the next sector
/*
* We do not allow directory entries to cross sector boundaries.
* Simply pad, and then start the next entry at the next sector
*/
new_reclen = s_entry->isorec.length[0];
if( (dir_index & (SECTOR_SIZE - 1)) + new_reclen >= SECTOR_SIZE )
{
dir_index = (dir_index + (SECTOR_SIZE - 1)) &
dir_index = (dir_index + (SECTOR_SIZE - 1)) &
~(SECTOR_SIZE - 1);
}
memcpy(directory_buffer + dir_index, &s_entry->isorec,
memcpy(directory_buffer + dir_index, &s_entry->isorec,
sizeof(struct iso_directory_record) -
sizeof(s_entry->isorec.name) + s_entry->isorec.name_len[0]);
dir_index += sizeof(struct iso_directory_record) -
dir_index += sizeof(struct iso_directory_record) -
sizeof (s_entry->isorec.name)+ s_entry->isorec.name_len[0];
/*
* Add the Rock Ridge attributes, if present
* Add the Rock Ridge attributes, if present
*/
if(s_entry->rr_attr_size)
{
@ -812,20 +812,20 @@ void FDECL2(generate_one_directory, struct directory *, dpnt, FILE *, outfile)
directory_buffer[dir_index++] = 0;
}
/*
/*
* If the RR attributes were too long, then write the
* CE records, as required.
*/
if(s_entry->rr_attr_size != s_entry->total_rr_attr_size)
if(s_entry->rr_attr_size != s_entry->total_rr_attr_size)
{
unsigned char * pnt;
int len, nbytes;
/*
/*
* Go through the entire record and fix up the CE entries
* so that the extent and offset are correct
* so that the extent and offset are correct
*/
pnt = s_entry->rr_attributes;
len = s_entry->total_rr_attr_size;
while(len > 3)
@ -837,30 +837,30 @@ void FDECL2(generate_one_directory, struct directory *, dpnt, FILE *, outfile)
ce_index, ce_address);
}
#endif
if(pnt[0] == 'C' && pnt[1] == 'E')
if(pnt[0] == 'C' && pnt[1] == 'E')
{
nbytes = get_733( (char *) pnt+20);
if((ce_index & (SECTOR_SIZE - 1)) + nbytes >=
SECTOR_SIZE)
SECTOR_SIZE)
{
ce_index = ROUND_UP(ce_index);
}
set_733( (char *) pnt+4,
set_733( (char *) pnt+4,
(ce_address + ce_index) >> 11);
set_733( (char *) pnt+12,
set_733( (char *) pnt+12,
(ce_address + ce_index) & (SECTOR_SIZE - 1));
/*
* Now store the block in the ce buffer
/*
* Now store the block in the ce buffer
*/
memcpy(ce_buffer + ce_index,
memcpy(ce_buffer + ce_index,
pnt + pnt[2], nbytes);
ce_index += nbytes;
if(ce_index & 1)
if(ce_index & 1)
{
ce_index++;
}
@ -868,11 +868,11 @@ void FDECL2(generate_one_directory, struct directory *, dpnt, FILE *, outfile)
len -= pnt[2];
pnt += pnt[2];
}
}
rockridge_size += s_entry->total_rr_attr_size;
memcpy(directory_buffer + dir_index, s_entry->rr_attributes,
memcpy(directory_buffer + dir_index, s_entry->rr_attributes,
s_entry->rr_attr_size);
dir_index += s_entry->rr_attr_size;
}
@ -880,14 +880,14 @@ void FDECL2(generate_one_directory, struct directory *, dpnt, FILE *, outfile)
{
directory_buffer[dir_index++] = 0;
}
s_entry_d = s_entry;
s_entry = s_entry->next;
/*
* Joliet doesn't use the Rock Ridge attributes, so we free it here.
*/
if (s_entry_d->rr_attributes)
if (s_entry_d->rr_attributes)
{
free(s_entry_d->rr_attributes);
s_entry_d->rr_attributes = NULL;
@ -915,16 +915,16 @@ void FDECL2(generate_one_directory, struct directory *, dpnt, FILE *, outfile)
last_extent_written += ce_size >> 11;
free(ce_buffer);
}
} /* generate_one_directory(... */
static
static
void FDECL1(build_pathlist, struct directory *, node)
{
struct directory * dpnt;
dpnt = node;
while (dpnt)
{
/* skip if it's hidden */
@ -936,7 +936,7 @@ void FDECL1(build_pathlist, struct directory *, node)
}
} /* build_pathlist(... */
static int FDECL2(compare_paths, void const *, r, void const *, l)
static int FDECL2(compare_paths, void const *, r, void const *, l)
{
struct directory const *ll = *(struct directory * const *)l;
struct directory const *rr = *(struct directory * const *)r;
@ -946,13 +946,13 @@ static int FDECL2(compare_paths, void const *, r, void const *, l)
return -1;
}
if (rr->parent->path_index > ll->parent->path_index)
if (rr->parent->path_index > ll->parent->path_index)
{
return 1;
}
return strcmp(rr->self->isorec.name, ll->self->isorec.name);
} /* compare_paths(... */
static int generate_path_tables()
@ -968,7 +968,7 @@ static int generate_path_tables()
int tablesize;
/*
* First allocate memory for the tables and initialize the memory
* First allocate memory for the tables and initialize the memory
*/
tablesize = path_blocks << 11;
path_table_m = (char *) e_malloc(tablesize);
@ -977,7 +977,7 @@ static int generate_path_tables()
memset(path_table_m, 0, tablesize);
/*
* Now start filling in the path tables. Start with root directory
* Now start filling in the path tables. Start with root directory
*/
if( next_path_index > 0xffff )
{
@ -986,7 +986,7 @@ static int generate_path_tables()
}
path_table_index = 0;
pathlist = (struct directory **) e_malloc(sizeof(struct directory *)
pathlist = (struct directory **) e_malloc(sizeof(struct directory *)
* next_path_index);
memset(pathlist, 0, sizeof(struct directory *) * next_path_index);
build_pathlist(root);
@ -995,10 +995,10 @@ static int generate_path_tables()
{
fix = 0;
#ifdef __STDC__
qsort(&pathlist[1], next_path_index-1, sizeof(struct directory *),
qsort(&pathlist[1], next_path_index-1, sizeof(struct directory *),
(int (*)(const void *, const void *))compare_paths);
#else
qsort(&pathlist[1], next_path_index-1, sizeof(struct directory *),
qsort(&pathlist[1], next_path_index-1, sizeof(struct directory *),
compare_paths);
#endif
@ -1020,55 +1020,55 @@ static int generate_path_tables()
error (1, 0, _("Entry %d not in path tables\n"), j);
}
npnt = dpnt->de_name;
/*
* So the root comes out OK
/*
* So the root comes out OK
*/
if( (*npnt == 0) || (dpnt == root) )
if( (*npnt == 0) || (dpnt == root) )
{
npnt = ".";
npnt = ".";
}
npnt1 = strrchr(npnt, PATH_SEPARATOR);
if(npnt1)
{
if(npnt1)
{
npnt = npnt1 + 1;
}
de = dpnt->self;
if(!de)
if(!de)
{
error (1, 0, _("Fatal goof\n"));
}
namelen = de->isorec.name_len[0];
path_table_l[path_table_index] = namelen;
path_table_m[path_table_index] = namelen;
path_table_index += 2;
set_731(path_table_l + path_table_index, dpnt->extent);
set_732(path_table_m + path_table_index, dpnt->extent);
set_731(path_table_l + path_table_index, dpnt->extent);
set_732(path_table_m + path_table_index, dpnt->extent);
path_table_index += 4;
set_721(path_table_l + path_table_index,
dpnt->parent->path_index);
set_722(path_table_m + path_table_index,
dpnt->parent->path_index);
set_721(path_table_l + path_table_index,
dpnt->parent->path_index);
set_722(path_table_m + path_table_index,
dpnt->parent->path_index);
path_table_index += 2;
for(i =0; i<namelen; i++)
{
path_table_l[path_table_index] = de->isorec.name[i];
path_table_m[path_table_index] = de->isorec.name[i];
path_table_index++;
}
if(path_table_index & 1)
if(path_table_index & 1)
{
path_table_index++; /* For odd lengths we pad */
}
}
free(pathlist);
if(path_table_index != path_table_size)
{
@ -1111,7 +1111,7 @@ static int FDECL1(file_write, FILE *, outfile)
/*
* OK, all done with that crap. Now write out the directories.
* This is where the fur starts to fly, because we need to keep track of
* each file as we find it and keep track of where we put it.
* each file as we find it and keep track of where we put it.
*/
should_write = last_extent - session_start;
@ -1127,16 +1127,16 @@ static int FDECL1(file_write, FILE *, outfile)
#ifdef DBG_ISO
fprintf(stderr,"Total directory extents being written = %llu\n", last_extent);
#endif
fprintf (stderr, _("Total extents scheduled to be written = %llu\n"),
fprintf (stderr, _("Total extents scheduled to be written = %llu\n"),
last_extent - session_start);
}
/*
* Now write all of the files that we need.
/*
* Now write all of the files that we need.
*/
write_files(outfile);
/*
* The rest is just fluff.
*/
@ -1148,8 +1148,8 @@ static int FDECL1(file_write, FILE *, outfile)
fprintf (stderr, _("Total extents actually written = %llu\n"),
last_extent_written - session_start);
/*
* Hard links throw us off here
/*
* Hard links throw us off here
*/
assert (last_extent > session_start);
if(should_write + session_start != last_extent)
@ -1195,7 +1195,7 @@ static int FDECL1(pvd_write, FILE *, outfile)
/*
* This will break in the year 2000, I supose, but there is no good way
* to get the top two digits of the year.
* to get the top two digits of the year.
*/
sprintf(iso_time, "%4.4d%2.2d%2.2d%2.2d%2.2d%2.2d00", 1900 + local.tm_year,
local.tm_mon+1, local.tm_mday,
@ -1207,28 +1207,28 @@ static int FDECL1(pvd_write, FILE *, outfile)
iso_time[16] = (local.tm_min + 60*(local.tm_hour + 24*local.tm_yday)) / 15;
/*
* Next we write out the primary descriptor for the disc
* Next we write out the primary descriptor for the disc
*/
memset(&vol_desc, 0, sizeof(vol_desc));
vol_desc.type[0] = ISO_VD_PRIMARY;
memcpy(vol_desc.id, ISO_STANDARD_ID, sizeof(ISO_STANDARD_ID));
vol_desc.version[0] = 1;
memset(vol_desc.system_id, ' ', sizeof(vol_desc.system_id));
memcpy_max(vol_desc.system_id, system_id, strlen(system_id));
memset(vol_desc.volume_id, ' ', sizeof(vol_desc.volume_id));
memcpy_max(vol_desc.volume_id, volume_id, strlen(volume_id));
should_write = last_extent - session_start;
set_733((char *) vol_desc.volume_space_size, should_write);
set_723(vol_desc.volume_set_size, volume_set_size);
set_723(vol_desc.volume_sequence_number, volume_sequence_number);
set_723(vol_desc.logical_block_size, 2048);
/*
* The path tables are used by DOS based machines to cache directory
* locations
* locations
*/
set_733((char *) vol_desc.path_table_size, path_table_size);
@ -1238,9 +1238,9 @@ static int FDECL1(pvd_write, FILE *, outfile)
set_732(vol_desc.opt_type_m_path_table, path_table[3]);
/*
* Now we copy the actual root directory record
* Now we copy the actual root directory record
*/
memcpy(vol_desc.root_directory_record, &root_record,
memcpy(vol_desc.root_directory_record, &root_record,
sizeof(struct iso_directory_record) + 1);
/*
@ -1260,15 +1260,15 @@ static int FDECL1(pvd_write, FILE *, outfile)
if(appid) memcpy_max(vol_desc.application_id, appid, strlen(appid));
FILL_SPACE(copyright_file_id);
if(copyright) memcpy_max(vol_desc.copyright_file_id, copyright,
if(copyright) memcpy_max(vol_desc.copyright_file_id, copyright,
strlen(copyright));
FILL_SPACE(abstract_file_id);
if(abstract) memcpy_max(vol_desc.abstract_file_id, abstract,
if(abstract) memcpy_max(vol_desc.abstract_file_id, abstract,
strlen(abstract));
FILL_SPACE(bibliographic_file_id);
if(biblio) memcpy_max(vol_desc.bibliographic_file_id, biblio,
if(biblio) memcpy_max(vol_desc.bibliographic_file_id, biblio,
strlen(biblio));
FILL_SPACE(creation_date);
@ -1284,7 +1284,7 @@ static int FDECL1(pvd_write, FILE *, outfile)
memcpy(vol_desc.effective_date, effective_date ? effective_date : iso_time, 17);
/*
* if not a bootable cd do it the old way
* if not a bootable cd do it the old way
*/
xfwrite(&vol_desc, 1, 2048, outfile);
last_extent_written++;
@ -1299,7 +1299,7 @@ static int FDECL1(evd_write, FILE *, outfile)
struct iso_primary_descriptor evol_desc;
/*
* Now write the end volume descriptor. Much simpler than the other one
* Now write the end volume descriptor. Much simpler than the other one
*/
memset(&evol_desc, 0, sizeof(evol_desc));
evol_desc.type[0] = ISO_VD_END;
@ -1316,7 +1316,7 @@ static int FDECL1(evd_write, FILE *, outfile)
static int FDECL1(pathtab_write, FILE *, outfile)
{
/*
* Next we write the path tables
* Next we write the path tables
*/
xfwrite(path_table_l, 1, path_blocks << 11, outfile);
xfwrite(path_table_m, 1, path_blocks << 11, outfile);

View file

@ -93,7 +93,7 @@ grub_video_gop_get_bpp (struct grub_efi_gop_mode_info *in)
total_mask = in->pixel_bitmask.r | in->pixel_bitmask.g
| in->pixel_bitmask.b | in->pixel_bitmask.a;
for (i = 31; i >= 0; i--)
if (total_mask & (1 << i))
return i + 1;
@ -212,7 +212,7 @@ grub_video_gop_setup (unsigned int width, unsigned int height,
found = 1;
}
}
if (!found)
{
unsigned mode;
@ -221,7 +221,7 @@ grub_video_gop_setup (unsigned int width, unsigned int height,
{
grub_efi_uintn_t size;
grub_efi_status_t status;
status = efi_call_4 (gop->query_mode, gop, mode, &size, &info);
if (status)
{
@ -255,7 +255,7 @@ grub_video_gop_setup (unsigned int width, unsigned int height,
* ((unsigned long long) bpp))
{
best_volume = ((unsigned long long) info->width)
* ((unsigned long long) info->height)
* ((unsigned long long) info->height)
* ((unsigned long long) bpp);
best_mode = mode;
}
@ -293,8 +293,8 @@ grub_video_gop_setup (unsigned int width, unsigned int height,
grub_dprintf ("video", "GOP: initialising FB @ %p %dx%dx%d\n",
framebuffer.ptr, framebuffer.mode_info.width,
framebuffer.mode_info.height, framebuffer.mode_info.bpp);
err = grub_video_fb_create_render_target_from_pointer
err = grub_video_fb_create_render_target_from_pointer
(&framebuffer.render_target, &framebuffer.mode_info, framebuffer.ptr);
if (err)
@ -302,15 +302,15 @@ grub_video_gop_setup (unsigned int width, unsigned int height,
grub_dprintf ("video", "GOP: Couldn't create FB target\n");
return err;
}
err = grub_video_fb_set_active_render_target (framebuffer.render_target);
if (err)
{
grub_dprintf ("video", "GOP: Couldn't set FB target\n");
return err;
}
err = grub_video_fb_set_palette (0, GRUB_VIDEO_FBSTD_NUMCOLORS,
grub_video_fbstd_colors);
@ -318,7 +318,7 @@ grub_video_gop_setup (unsigned int width, unsigned int height,
grub_dprintf ("video", "GOP: Couldn't set palette\n");
else
grub_dprintf ("video", "GOP: Success\n");
return err;
}