version 1.2, 2003/08/07 16:31:36 |
version 1.7.2.1, 2006/02/18 15:39:18 |
|
|
* structures. |
* structures. |
*/ |
*/ |
|
|
|
#ifndef _ISOFS_CD9660_ISO_H_ |
|
#define _ISOFS_CD9660_ISO_H_ |
|
|
#define ISODCL(from, to) (to - from + 1) |
#define ISODCL(from, to) (to - from + 1) |
|
|
struct iso_volume_descriptor { |
struct iso_volume_descriptor { |
Line 168 struct iso_extended_attributes { |
|
Line 171 struct iso_extended_attributes { |
|
u_char len_au [ISODCL (247, 250)]; /* 723 */ |
u_char len_au [ISODCL (247, 250)]; /* 723 */ |
}; |
}; |
|
|
static __inline int isonum_711 __P((u_char *)) __attribute__ ((unused)); |
static __inline int isonum_711(u_char *) __attribute__ ((unused)); |
static __inline int isonum_712 __P((char *)) __attribute__ ((unused)); |
static __inline int isonum_712(char *) __attribute__ ((unused)); |
static __inline int isonum_721 __P((u_char *)) __attribute__ ((unused)); |
static __inline uint16_t isonum_721(u_char *) __attribute__ ((unused)); |
static __inline int isonum_722 __P((u_char *)) __attribute__ ((unused)); |
static __inline uint16_t isonum_722(u_char *) __attribute__ ((unused)); |
static __inline int isonum_723 __P((u_char *)) __attribute__ ((unused)); |
static __inline uint16_t isonum_723(u_char *) __attribute__ ((unused)); |
static __inline int isonum_731 __P((u_char *)) __attribute__ ((unused)); |
static __inline uint32_t isonum_731(u_char *) __attribute__ ((unused)); |
static __inline int isonum_732 __P((u_char *)) __attribute__ ((unused)); |
static __inline uint32_t isonum_732(u_char *) __attribute__ ((unused)); |
static __inline int isonum_733 __P((u_char *)) __attribute__ ((unused)); |
static __inline uint32_t isonum_733(u_char *) __attribute__ ((unused)); |
|
|
/* 7.1.1: unsigned char */ |
/* 7.1.1: unsigned char */ |
static __inline int |
static __inline int |
#if __STDC__ |
|
isonum_711(u_char *p) |
isonum_711(u_char *p) |
#else |
|
isonum_711(p) |
|
u_char *p; |
|
#endif |
|
{ |
{ |
return *p; |
return *p; |
} |
} |
|
|
/* 7.1.2: signed(?) char */ |
/* 7.1.2: signed(?) char */ |
static __inline int |
static __inline int |
#if __STDC__ |
|
isonum_712(char *p) |
isonum_712(char *p) |
#else |
|
isonum_712(p) |
|
char *p; |
|
#endif |
|
{ |
{ |
return *p; |
return *p; |
} |
} |
|
|
/* 7.2.1: unsigned little-endian 16-bit value. NOT USED IN KERNEL. */ |
/* 7.2.1: unsigned little-endian 16-bit value. NOT USED IN KERNEL. */ |
static __inline int |
static __inline uint16_t |
isonum_721(p) |
isonum_721(u_char *p) |
u_char *p; |
|
{ |
{ |
#if defined(UNALIGNED_ACCESS) && (BYTE_ORDER == LITTLE_ENDIAN) |
#if defined(UNALIGNED_ACCESS) && (BYTE_ORDER == LITTLE_ENDIAN) |
return *(u_int16t *)p; |
return *(uint16_t *)p; |
#else |
#else |
return *p|((char)p[1] << 8); |
return *p|((char)p[1] << 8); |
#endif |
#endif |
} |
} |
|
|
/* 7.2.2: unsigned big-endian 16-bit value. NOT USED IN KERNEL. */ |
/* 7.2.2: unsigned big-endian 16-bit value. NOT USED IN KERNEL. */ |
static __inline int |
static __inline uint16_t |
isonum_722(p) |
isonum_722(u_char *p) |
unsigned char *p; |
|
{ |
{ |
#if defined(UNALIGNED_ACCESS) && (BYTE_ORDER == BIG_ENDIAN) |
#if defined(UNALIGNED_ACCESS) && (BYTE_ORDER == BIG_ENDIAN) |
return *(u_int16t *)p; |
return *(uint16_t *)p; |
#else |
#else |
return ((char)*p << 8)|p[1]; |
return ((char)*p << 8)|p[1]; |
#endif |
#endif |
} |
} |
|
|
/* 7.2.3: unsigned both-endian (little, then big) 16-bit value */ |
/* 7.2.3: unsigned both-endian (little, then big) 16-bit value */ |
static __inline int |
static __inline uint16_t |
#if __STDC__ |
|
isonum_723(u_char *p) |
isonum_723(u_char *p) |
#else |
|
isonum_723(p) |
|
u_char *p; |
|
#endif |
|
{ |
{ |
#if defined(UNALIGNED_ACCESS) && \ |
#if defined(UNALIGNED_ACCESS) && \ |
((BYTE_ORDER == LITTLE_ENDIAN) || (BYTE_ORDER == BIG_ENDIAN)) |
((BYTE_ORDER == LITTLE_ENDIAN) || (BYTE_ORDER == BIG_ENDIAN)) |
#if BYTE_ORDER == LITTLE_ENDIAN |
#if BYTE_ORDER == LITTLE_ENDIAN |
return *(u_int16t *)p; |
return *(uint16_t *)p; |
#else |
#else |
return *(u_int16t *)(p + 2); |
return *(uint16_t *)(p + 2); |
#endif |
#endif |
#else /* !UNALIGNED_ACCESS or weird byte order */ |
#else /* !UNALIGNED_ACCESS or weird byte order */ |
return *p|(p[1] << 8); |
return *p|(p[1] << 8); |
|
|
} |
} |
|
|
/* 7.3.1: unsigned little-endian 32-bit value. NOT USED IN KERNEL. */ |
/* 7.3.1: unsigned little-endian 32-bit value. NOT USED IN KERNEL. */ |
static __inline int |
static __inline uint32_t |
isonum_731(p) |
isonum_731(u_char *p) |
u_char *p; |
|
{ |
{ |
#if defined(UNALIGNED_ACCESS) && (BYTE_ORDER == LITTLE_ENDIAN) |
#if defined(UNALIGNED_ACCESS) && (BYTE_ORDER == LITTLE_ENDIAN) |
return *(u_int32t *)p; |
return *(uint32_t *)p; |
#else |
#else |
return *p|(p[1] << 8)|(p[2] << 16)|(p[3] << 24); |
return *p|(p[1] << 8)|(p[2] << 16)|(p[3] << 24); |
#endif |
#endif |
} |
} |
|
|
/* 7.3.2: unsigned big-endian 32-bit value. NOT USED IN KERNEL. */ |
/* 7.3.2: unsigned big-endian 32-bit value. NOT USED IN KERNEL. */ |
static __inline int |
static __inline uint32_t |
isonum_732(p) |
isonum_732(u_char *p) |
unsigned char *p; |
|
{ |
{ |
#if defined(UNALIGNED_ACCESS) && (BYTE_ORDER == BIG_ENDIAN) |
#if defined(UNALIGNED_ACCESS) && (BYTE_ORDER == BIG_ENDIAN) |
return *(u_int32t *)p; |
return *(uint32_t *)p; |
#else |
#else |
return (*p << 24)|(p[1] << 16)|(p[2] << 8)|p[3]; |
return (*p << 24)|(p[1] << 16)|(p[2] << 8)|p[3]; |
#endif |
#endif |
} |
} |
|
|
/* 7.3.3: unsigned both-endian (little, then big) 32-bit value */ |
/* 7.3.3: unsigned both-endian (little, then big) 32-bit value */ |
static __inline int |
static __inline uint32_t |
#if __STDC__ |
|
isonum_733(u_char *p) |
isonum_733(u_char *p) |
#else |
|
isonum_733(p) |
|
u_char *p; |
|
#endif |
|
{ |
{ |
#if defined(UNALIGNED_ACCESS) && \ |
#if defined(UNALIGNED_ACCESS) && \ |
((BYTE_ORDER == LITTLE_ENDIAN) || (BYTE_ORDER == BIG_ENDIAN)) |
((BYTE_ORDER == LITTLE_ENDIAN) || (BYTE_ORDER == BIG_ENDIAN)) |
#if BYTE_ORDER == LITTLE_ENDIAN |
#if BYTE_ORDER == LITTLE_ENDIAN |
return *(u_int32t *)p; |
return *(uint32_t *)p; |
#else |
#else |
return *(u_int32t *)(p + 4); |
return *(uint32_t *)(p + 4); |
#endif |
#endif |
#else /* !UNALIGNED_ACCESS or weird byte order */ |
#else /* !UNALIGNED_ACCESS or weird byte order */ |
return *p|(p[1] << 8)|(p[2] << 16)|(p[3] << 24); |
return *p|(p[1] << 8)|(p[2] << 16)|(p[3] << 24); |
|
|
* Associated files have a leading '='. |
* Associated files have a leading '='. |
*/ |
*/ |
#define ASSOCCHAR '=' |
#define ASSOCCHAR '=' |
|
|
|
#endif /* _ISOFS_CD9660_ISO_H_ */ |