whitespace cleanup

This commit is contained in:
jdolecek 2004-11-20 19:56:44 +00:00
parent 0bfb4106b0
commit b267d4ace5
1 changed files with 55 additions and 55 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: cd9660_rrip.c,v 1.3 2003/08/07 16:31:35 agc Exp $ */
/* $NetBSD: cd9660_rrip.c,v 1.4 2004/11/20 19:56:44 jdolecek Exp $ */
/*-
* Copyright (c) 1993, 1994
@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: cd9660_rrip.c,v 1.3 2003/08/07 16:31:35 agc Exp $");
__KERNEL_RCSID(0, "$NetBSD: cd9660_rrip.c,v 1.4 2004/11/20 19:56:44 jdolecek Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -123,14 +123,14 @@ cd9660_rrip_slink(v, ana)
ISO_RRIP_SLINK_COMPONENT *pcompe;
int len, wlen, cont;
char *outbuf, *inbuf;
pcomp = (ISO_RRIP_SLINK_COMPONENT *)p->component;
pcompe = (ISO_RRIP_SLINK_COMPONENT *)
((char *)p + isonum_711(p->h.length));
len = *ana->outlen;
outbuf = ana->outbuf;
cont = ana->cont;
/*
* Gathering a Symbolic name from each component with path
*/
@ -138,7 +138,7 @@ cd9660_rrip_slink(v, ana)
pcomp < pcompe;
pcomp = (ISO_RRIP_SLINK_COMPONENT *)((char *)pcomp + ISO_RRIP_SLSIZ
+ isonum_711(pcomp->clen))) {
if (!cont) {
if (len < ana->maxlen) {
len++;
@ -146,29 +146,29 @@ cd9660_rrip_slink(v, ana)
}
}
cont = 0;
inbuf = "..";
wlen = 0;
switch (*pcomp->cflag) {
case ISO_SUSP_CFLAG_CURRENT:
/* Inserting Current */
wlen = 1;
break;
case ISO_SUSP_CFLAG_PARENT:
/* Inserting Parent */
wlen = 2;
break;
case ISO_SUSP_CFLAG_ROOT:
/* Inserting slash for ROOT */
/* start over from beginning(?) */
outbuf -= len;
len = 0;
break;
case ISO_SUSP_CFLAG_VOLROOT:
/* Inserting a mount point i.e. "/cdrom" */
/* same as above */
@ -177,13 +177,13 @@ cd9660_rrip_slink(v, ana)
inbuf = ana->imp->im_mountp->mnt_stat.f_mntonname;
wlen = strlen(inbuf);
break;
case ISO_SUSP_CFLAG_HOST:
/* Inserting hostname i.e. "kurt.tools.de" */
inbuf = hostname;
wlen = hostnamelen;
break;
case ISO_SUSP_CFLAG_CONTINUE:
cont = 1;
/* fall thru */
@ -197,7 +197,7 @@ cd9660_rrip_slink(v, ana)
wlen = ana->maxlen + 1;
break;
}
if (len + wlen > ana->maxlen) {
/* indicate error to caller */
ana->cont = 1;
@ -206,7 +206,7 @@ cd9660_rrip_slink(v, ana)
*ana->outlen = 0;
return 0;
}
memcpy(outbuf, inbuf, wlen);
outbuf += wlen;
len += wlen;
@ -214,7 +214,7 @@ cd9660_rrip_slink(v, ana)
ana->outbuf = outbuf;
*ana->outlen = len;
ana->cont = cont;
if (!isonum_711(p->flags)) {
ana->fields &= ~ISO_SUSP_SLINK;
return ISO_SUSP_SLINK;
@ -234,28 +234,28 @@ cd9660_rrip_altname(v, ana)
char *inbuf;
int wlen;
int cont;
inbuf = "..";
wlen = 0;
cont = 0;
switch (*p->flags) {
case ISO_SUSP_CFLAG_CURRENT:
/* Inserting Current */
wlen = 1;
break;
case ISO_SUSP_CFLAG_PARENT:
/* Inserting Parent */
wlen = 2;
break;
case ISO_SUSP_CFLAG_HOST:
/* Inserting hostname i.e. "kurt.tools.de" */
inbuf = hostname;
wlen = hostnamelen;
break;
case ISO_SUSP_CFLAG_CONTINUE:
cont = 1;
/* fall thru */
@ -264,13 +264,13 @@ cd9660_rrip_altname(v, ana)
wlen = isonum_711(p->h.length) - 5;
inbuf = (char *)p + 5;
break;
default:
printf("RRIP with incorrect NM flags?\n");
wlen = ana->maxlen + 1;
break;
}
if ((*ana->outlen += wlen) > ana->maxlen) {
/* treat as no name field */
ana->fields &= ~ISO_SUSP_ALTNAME;
@ -278,10 +278,10 @@ cd9660_rrip_altname(v, ana)
*ana->outlen = 0;
return 0;
}
memcpy(ana->outbuf, inbuf, wlen);
ana->outbuf += wlen;
if (!cont) {
ana->fields &= ~ISO_SUSP_ALTNAME;
return ISO_SUSP_ALTNAME;
@ -352,52 +352,52 @@ cd9660_rrip_tstamp(v, ana)
{
ISO_RRIP_TSTAMP *p = v;
u_char *ptime;
ptime = p->time;
/* Check a format of time stamp (7bytes/17bytes) */
if (!(*p->flags & ISO_SUSP_TSTAMP_FORM17)) {
if (*p->flags & ISO_SUSP_TSTAMP_CREAT)
ptime += 7;
if (*p->flags & ISO_SUSP_TSTAMP_MODIFY) {
cd9660_tstamp_conv7(ptime, &ana->inop->inode.iso_mtime);
ptime += 7;
} else
memset(&ana->inop->inode.iso_mtime, 0, sizeof(struct timespec));
if (*p->flags & ISO_SUSP_TSTAMP_ACCESS) {
cd9660_tstamp_conv7(ptime, &ana->inop->inode.iso_atime);
ptime += 7;
} else
ana->inop->inode.iso_atime = ana->inop->inode.iso_mtime;
if (*p->flags & ISO_SUSP_TSTAMP_ATTR)
cd9660_tstamp_conv7(ptime, &ana->inop->inode.iso_ctime);
else
ana->inop->inode.iso_ctime = ana->inop->inode.iso_mtime;
} else {
if (*p->flags & ISO_SUSP_TSTAMP_CREAT)
ptime += 17;
if (*p->flags & ISO_SUSP_TSTAMP_MODIFY) {
cd9660_tstamp_conv17(ptime, &ana->inop->inode.iso_mtime);
ptime += 17;
} else
memset(&ana->inop->inode.iso_mtime, 0, sizeof(struct timespec));
if (*p->flags & ISO_SUSP_TSTAMP_ACCESS) {
cd9660_tstamp_conv17(ptime, &ana->inop->inode.iso_atime);
ptime += 17;
} else
ana->inop->inode.iso_atime = ana->inop->inode.iso_mtime;
if (*p->flags & ISO_SUSP_TSTAMP_ATTR)
cd9660_tstamp_conv17(ptime, &ana->inop->inode.iso_ctime);
else
ana->inop->inode.iso_ctime = ana->inop->inode.iso_mtime;
}
ana->fields &= ~ISO_SUSP_TSTAMP;
return ISO_SUSP_TSTAMP;
@ -423,10 +423,10 @@ cd9660_rrip_device(v, ana)
{
ISO_RRIP_DEVICE *p = v;
u_int high, low;
high = isonum_733(p->dev_t_high);
low = isonum_733(p->dev_t_low);
if (high == 0)
ana->inop->inode.iso_rdev = makedev(major(low), minor(low));
else
@ -449,7 +449,7 @@ cd9660_rrip_idflag(v, ana)
/* special handling of RE field */
if (ana->fields & ISO_SUSP_RELDIR)
return cd9660_rrip_reldir(p, ana);
return ISO_SUSP_IDFLAG;
}
@ -520,7 +520,7 @@ cd9660_rrip_loop(isodir, ana, table)
char *pwhead;
u_char c;
int result;
/*
* Note: If name length is odd,
* it will be padded by 1 byte after the name
@ -529,16 +529,16 @@ cd9660_rrip_loop(isodir, ana, table)
if (!(isonum_711(isodir->name_len) & 1))
pwhead++;
isochar(isodir->name, pwhead, ana->imp->im_joliet_level, &c);
/* If it's not the '.' entry of the root dir obey SP field */
if (c != 0 || isonum_733(isodir->extent) != ana->imp->root_extent)
pwhead += ana->imp->rr_skip;
else
pwhead += ana->imp->rr_skip0;
phead = (ISO_SUSP_HEADER *)pwhead;
pend = (ISO_SUSP_HEADER *)((char *)isodir + isonum_711(isodir->length));
result = 0;
while (1) {
ana->iso_ce_len = 0;
@ -570,7 +570,7 @@ cd9660_rrip_loop(isodir, ana, table)
*/
phead = (ISO_SUSP_HEADER *)((char *)phead + isonum_711(phead->length));
}
if (ana->fields && ana->iso_ce_len) {
if (ana->iso_ce_blk >= ana->imp->volume_space_size
|| ana->iso_ce_off + ana->iso_ce_len > ana->imp->logical_block_size
@ -593,7 +593,7 @@ cd9660_rrip_loop(isodir, ana, table)
for (ptable = table; ptable->func2; ptable++)
if (!(ptable->result & result))
ptable->func2(isodir, ana);
return result;
}
@ -617,11 +617,11 @@ cd9660_rrip_analyze(isodir, inop, imp)
struct iso_mnt *imp;
{
ISO_RRIP_ANALYZE analyze;
analyze.inop = inop;
analyze.imp = imp;
analyze.fields = ISO_SUSP_ATTR | ISO_SUSP_TSTAMP | ISO_SUSP_DEVICE;
return cd9660_rrip_loop(isodir, &analyze, rrip_table_analyze);
}
@ -650,7 +650,7 @@ cd9660_rrip_getname(isodir, outbuf, outlen, inump, imp)
ISO_RRIP_ANALYZE analyze;
const RRIP_TABLE *tab;
u_char c;
analyze.outbuf = outbuf;
analyze.outlen = outlen;
analyze.maxlen = NAME_MAX;
@ -658,17 +658,17 @@ cd9660_rrip_getname(isodir, outbuf, outlen, inump, imp)
analyze.imp = imp;
analyze.fields = ISO_SUSP_ALTNAME | ISO_SUSP_RELDIR | ISO_SUSP_CLINK | ISO_SUSP_PLINK;
*outlen = 0;
isochar(isodir->name, isodir->name + isonum_711(isodir->name_len),
imp->im_joliet_level, &c);
tab = rrip_table_getname;
if (c == 0 || c == 1) {
cd9660_rrip_defname(isodir, &analyze);
analyze.fields &= ~ISO_SUSP_ALTNAME;
tab++;
}
return cd9660_rrip_loop(isodir, &analyze, tab);
}
@ -691,7 +691,7 @@ cd9660_rrip_getsymname(isodir, outbuf, outlen, imp)
struct iso_mnt *imp;
{
ISO_RRIP_ANALYZE analyze;
analyze.outbuf = outbuf;
analyze.outlen = outlen;
*outlen = 0;
@ -699,7 +699,7 @@ cd9660_rrip_getsymname(isodir, outbuf, outlen, imp)
analyze.cont = 1; /* don't start with a slash */
analyze.imp = imp;
analyze.fields = ISO_SUSP_SLINK;
return cd9660_rrip_loop(isodir, &analyze, rrip_table_getsymname) & ISO_SUSP_SLINK;
}
@ -721,7 +721,7 @@ cd9660_rrip_offset(isodir, imp)
{
ISO_RRIP_OFFSET *p;
ISO_RRIP_ANALYZE analyze;
imp->rr_skip0 = 0;
p = (ISO_RRIP_OFFSET *)(isodir->name + 1);
if (memcmp(p, "SP\7\1\276\357", 6)) {
@ -731,11 +731,11 @@ cd9660_rrip_offset(isodir, imp)
if (memcmp(p, "SP\7\1\276\357", 6))
return -1;
}
analyze.imp = imp;
analyze.fields = ISO_SUSP_EXTREF;
if (!(cd9660_rrip_loop(isodir, &analyze, rrip_table_extref) & ISO_SUSP_EXTREF))
return -1;
return isonum_711(p->skip);
}