From 3ce31492e54c48ed411c9f314df1a0c88d560147 Mon Sep 17 00:00:00 2001 From: Tyler Dauwalder Date: Fri, 17 Jan 2003 08:23:39 +0000 Subject: [PATCH] + Shrank license + Changed "#define TRACE(x)" to "#define TRACE(x) ;" + Added some more comments git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2468 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/add-ons/kernel/disk_scanner/fs/iso9660.c | 44 +++++++------------ .../kernel/disk_scanner/session/cdrom.c | 38 +++++----------- 2 files changed, 27 insertions(+), 55 deletions(-) diff --git a/src/add-ons/kernel/disk_scanner/fs/iso9660.c b/src/add-ons/kernel/disk_scanner/fs/iso9660.c index 23afd64e74..8043219dc3 100644 --- a/src/add-ons/kernel/disk_scanner/fs/iso9660.c +++ b/src/add-ons/kernel/disk_scanner/fs/iso9660.c @@ -1,32 +1,13 @@ -//------------------------------------------------------------------------------ -// Copyright (c) 2001-2003, OpenBeOS -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the "Software"), -// to deal in the Software without restriction, including without limitation -// the rights to use, copy, modify, merge, publish, distribute, sublicense, -// and/or sell copies of the Software, and to permit persons to whom the -// Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. -// -// File Name: iso9660.c -// Author: Tyler Dauwalder (tyler@dauwalder.net) -// Description: disk_scanner filesystem module for iso9660 CD-ROM filesystems -//------------------------------------------------------------------------------ - +//---------------------------------------------------------------------- +// This software is part of the OpenBeOS distribution and is covered +// by the OpenBeOS license. +//--------------------------------------------------------------------- /*! \file iso9660.c disk_scanner filesystem module for iso9660 CD-ROM filesystems + + The standard to which this module is written is ECMA-119 second + edition, a freely available iso9660 equivalent. */ @@ -39,7 +20,7 @@ #include #include -#define TRACE(x) +#define TRACE(x) ; //#define TRACE(x) dprintf x // misc constants @@ -49,6 +30,9 @@ static const char *kISO9660Signature = "CD001"; static const uint32 kVolumeDescriptorLength = 2048; #define ISO9660_VOLUME_IDENTIFIER_LENGTH 32 +/*! \brief The portion of the volume descriptor common to all + descriptor types. +*/ typedef struct iso9660_common_volume_descriptor { uchar volume_descriptor_type; uchar standard_identifier[5]; // should be 'CD001' @@ -56,6 +40,8 @@ typedef struct iso9660_common_volume_descriptor { // Remaining bytes are unused } iso9660_common_volume_descriptor; +/*! \brief Primary volume descriptor +*/ typedef struct iso9660_primary_volume_descriptor { iso9660_common_volume_descriptor info; uchar volume_flags; @@ -64,7 +50,7 @@ typedef struct iso9660_primary_volume_descriptor { // Remaining bytes are disinteresting to us } iso9660_primary_volume_descriptor; -// volume descriptor types +//! Volume descriptor types typedef enum { ISO9660VD_BOOT, ISO9660VD_PRIMARY, @@ -179,6 +165,8 @@ iso9660_fs_identify(int deviceFD, struct extended_partition_info *partitionInfo, uchar *buffer = NULL; uint32 blockSize = partitionInfo->info.logical_block_size; bool exit = false; + // The first 16 blocks are for "system use" only, and thus are + // irrelevant to us and generally just zeros off_t offset = partitionInfo->info.offset + 16*blockSize; status_t error = B_OK; diff --git a/src/add-ons/kernel/disk_scanner/session/cdrom.c b/src/add-ons/kernel/disk_scanner/session/cdrom.c index 59406c43ee..0fc5d2f1d8 100644 --- a/src/add-ons/kernel/disk_scanner/session/cdrom.c +++ b/src/add-ons/kernel/disk_scanner/session/cdrom.c @@ -1,35 +1,19 @@ -//------------------------------------------------------------------------------ -// Copyright (c) 2001-2003, OpenBeOS -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the "Software"), -// to deal in the Software without restriction, including without limitation -// the rights to use, copy, modify, merge, publish, distribute, sublicense, -// and/or sell copies of the Software, and to permit persons to whom the -// Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. -// -// File Name: cdrom.c -// Author: Tyler Dauwalder (tyler@dauwalder.net) -// Description: disk_scanner session module for SCSI/ATAPI cdrom drives -//------------------------------------------------------------------------------ - +//---------------------------------------------------------------------- +// This software is part of the OpenBeOS distribution and is covered +// by the OpenBeOS license. +//--------------------------------------------------------------------- /*! \file cdrom.c disk_scanner session module for SCSI/ATAPI cdrom drives The protocols used in this module are based on information taken from the "SCSI-3 Multimedia Commands" draft, revision 10A. + + The SCSI command of interest is "READ TOC/PMA/ATIP", command + number \c 0x43. + + The format of interest for said command is "Full TOC", format + number \c 0x2. */ #include @@ -465,7 +449,7 @@ cdrom_session_get_nth_info(int deviceFD, int32 index, off_t deviceSize, } if (error) - dprintf("%s: get_nth error 0x%lx\n", kModuleDebugName, error); + TRACE(("%s: get_nth error 0x%lx\n", kModuleDebugName, error)); return error; }