iso.h revision 199767f8919635c4928607450d9e0abb932109ce
/*-
* Copyright (c) 1994
* The Regents of the University of California. All rights reserved.
*
* This code is derived from software contributed to Berkeley
* by Pace Willisson (pace@blitz.com). The Rock Ridge Extension
* Support code is derived from software contributed to Berkeley
* by Atsushi Murai (amurai@spec.co.jp).
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* @(#)iso.h 8.6 (Berkeley) 5/10/95
* $FreeBSD$
*/
struct iso_volume_descriptor {
};
/* volume descriptor types */
#define ISO_VD_PRIMARY 1
#define ISO_VD_SUPPLEMENTARY 2
#define ISO_VD_END 255
#define ISO_STANDARD_ID "CD001"
#define ISO_ECMA_ID "CDW01"
#define ISO_SIERRA_ID "CDROM"
struct iso_primary_descriptor {
};
#define ISO_DEFAULT_BLOCK_SIZE 2048
/*
* Used by Microsoft Joliet extension to ISO9660. Almost the same
* as PVD, but byte position 8 is a flag, and 89-120 is for escape.
*/
struct iso_supplementary_descriptor {
};
struct iso_sierra_primary_descriptor {
};
struct iso_directory_record {
};
/* can't take sizeof(iso_directory_record), because of possible alignment
of the last entry (34 instead of 33) */
#define ISO_DIRECTORY_RECORD_SIZE 33
struct iso_extended_attributes {
};
#ifdef _KERNEL
/* CD-ROM Format type */
#ifndef ISOFSMNT_ROOT
#define ISOFSMNT_ROOT 0
#endif
struct iso_mnt {
struct g_consumer *im_cp;
int logical_block_size;
int im_bshift;
int im_bmask;
int volume_space_size;
int root_extent;
int root_size;
int rr_skip;
int rr_skip0;
int joliet_level;
void *im_d2l;
void *im_l2d;
};
struct ifid {
int ifid_ino;
long ifid_start;
};
struct iso_directory_record *);
extern struct vop_vector cd9660_vnodeops;
extern struct vop_vector cd9660_fifoops;
#endif /* _KERNEL */
/*
* The isonum_xxx functions are inlined anyway, and could come handy even
* outside the kernel. Thus we don't hide them here.
*/
/*
* 7xy
* x -> 1 = 8 bits, 2 = 16 bits, 3 = 32 bits
* y -> 1 = little-endian, 2 = big-endian, 3 = both (le then be)
*/
isonum_711(const unsigned char *p)
{
return (p[0]);
}
isonum_712(const unsigned char *p)
{
return ((signed char)p[0]);
}
isonum_713(const unsigned char *p)
{
return (p[0]);
}
isonum_721(const unsigned char *p)
{
return (p[0] | p[1] << 8);
}
isonum_722(const unsigned char *p)
{
return (p[1] | p[0] << 8);
}
isonum_723(const unsigned char *p)
{
return (p[0] | p[1] << 8);
}
isonum_731(const unsigned char *p)
{
return (p[0] | p[1] << 8 | p[2] << 16 | p[3] << 24);
}
isonum_732(const unsigned char *p)
{
return (p[3] | p[2] << 8 | p[1] << 16 | p[0] << 24);
}
isonum_733(const unsigned char *p)
{
return (p[0] | p[1] << 8 | p[2] << 16 | p[3] << 24);
}
/*
* Associated files have a leading '='.
*/
#define ASSOCCHAR '='