2 * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
6 * The contents of this file constitute Original Code as defined in and
7 * are subject to the Apple Public Source License Version 1.1 (the
8 * "License"). You may not use this file except in compliance with the
9 * License. Please obtain a copy of the License at
10 * http://www.apple.com/publicsource and read it before using this file.
12 * This Original Code and all software distributed under the License are
13 * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
14 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
15 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
17 * License for the specific language governing rights and limitations
20 * @APPLE_LICENSE_HEADER_END@
23 File: HIDProcessMainItem.c
25 Contains: xxx put contents here xxx
27 Version: xxx put version here xxx
29 Copyright: © 1999 by Apple Computer, Inc., all rights reserved.
33 DRI: xxx put dri here xxx
35 Other Contact: xxx put other contact here xxx
37 Technology: xxx put technology here xxx
43 Change History (most recent first):
45 <USB1> 3/5/99 BWS first checked in
51 *------------------------------------------------------------------------------
53 * HIDProcessMainItem - Process a MainItem
56 * ptDescriptor - The Descriptor Structure
57 * ptPreparsedData - The PreParsedData Structure
59 * ptDescriptor - The Descriptor Structure
60 * ptPreparsedData - The PreParsedData Structure
62 * kHIDSuccess - Success
63 * kHIDNullPointerErr - Argument, Pointer was Null
65 *------------------------------------------------------------------------------
67 OSStatus
HIDProcessMainItem(HIDReportDescriptor
*ptDescriptor
,
68 HIDPreparsedDataPtr ptPreparsedData
)
70 OSStatus iStatus
= kHIDSuccess
;
73 * Disallow NULL Pointers
75 if ((ptDescriptor
== NULL
) || (ptPreparsedData
== NULL
))
76 return kHIDNullPointerErr
;
78 * Process by MainItem Tag
80 switch (ptDescriptor
->item
.tag
)
82 case kHIDTagCollection
:
83 iStatus
= HIDProcessCollection(ptDescriptor
,ptPreparsedData
);
85 case kHIDTagEndCollection
:
86 iStatus
= HIDProcessEndCollection(ptDescriptor
,ptPreparsedData
);
91 iStatus
= HIDProcessReportItem(ptDescriptor
,ptPreparsedData
);