1/*
2 * Copyright (c) 2000-2008 Apple Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. Please obtain a copy of the License at
10 * http://www.opensource.apple.com/apsl/ and read it before using this
11 * file.
12 *
13 * The Original Code and all software distributed under the License are
14 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
15 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
16 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
18 * Please see the License for the specific language governing rights and
19 * limitations under the License.
20 *
21 * @APPLE_LICENSE_HEADER_END@
22 */
23
24// AppleCDDAFileSystemUtils.h created by CJS on Sun 14-May-2000
25
26#ifndef __APPLE_CDDA_FS_UTILS_H__
27#define __APPLE_CDDA_FS_UTILS_H__
28
29#ifndef __APPLE_CDDA_FS_DEFINES_H__
30#include "AppleCDDAFileSystemDefines.h"
31#endif
32
33#include <sys/vnode.h>
34#include <sys/attr.h>
35
36#ifdef __cplusplus
37extern "C" {
38#endif
39
40
41//-----------------------------------------------------------------------------
42//	Function Prototypes - From AppleCDDAFileSystemUtils.c
43//-----------------------------------------------------------------------------
44
45int				InsertCDDANode 				( AppleCDDANodePtr newNodePtr,
46											  vnode_t parentVNodePtr,
47											  struct proc * theProcPtr );
48errno_t			CreateNewCDDANode 			( mount_t mountPtr,
49											  UInt32 nodeID,
50											  enum vtype vNodeType,
51											  vnode_t parentVNodePtr,
52											  struct componentname * compNamePtr,
53											  vnode_t * vNodeHandle );
54int				DisposeCDDANode 			( vnode_t vNodePtr );
55errno_t			CreateNewCDDAFile 			( mount_t mountPtr,
56											  UInt32 nodeID,
57											  AppleCDDANodeInfoPtr nodeInfoPtr,
58											  vnode_t parentVNodePtr,
59											  struct componentname * compNamePtr,
60											  vnode_t * vNodeHandle );
61errno_t			CreateNewXMLFile 			( mount_t mountPtr,
62											  UInt32 xmlFileSize,
63											  UInt8 * xmlData,
64											  vnode_t parentVNodePtr,
65											  struct componentname * compNamePtr,
66											  vnode_t * vNodeHandle );
67errno_t			CreateNewCDDADirectory 		( mount_t mountPtr,
68											  UInt32 nodeID,
69											  vnode_t * vNodeHandle );
70boolean_t		IsAudioTrack 				( const SubQTOCInfoPtr trackDescriptorPtr );
71UInt32			CalculateSize 				( const QTOCDataFormat10Ptr TOCDataPtr,
72											  UInt32 trackDescriptorOffset,
73											  UInt32 currentA2Offset );
74SInt32			ParseTOC 					( mount_t mountPtr,
75											  UInt32 numTracks );
76int				GetTrackNumberFromName 		( const char * name,
77											  UInt32 * trackNumber );
78
79int				CalculateAttributeBlockSize	( struct attrlist * attrlist );
80void			PackAttributesBlock			( struct attrlist * attrListPtr,
81											  vnode_t vNodePtr,
82											  void ** attrbufHandle,
83											  void ** varbufHandle );
84
85
86//-----------------------------------------------------------------------------
87//	Function Prototypes - From AppleCDDAFileSystemUtilities.cpp
88//-----------------------------------------------------------------------------
89
90
91QTOCDataFormat10Ptr		CreateBufferFromIORegistry 	( mount_t mountPtr );
92void					DisposeBufferFromIORegistry	( QTOCDataFormat10Ptr TOCDataPtr );
93
94
95#ifdef __cplusplus
96}
97#endif
98
99#endif // __APPLE_CDDA_FS_UTILS_H__
100