]>
git.saurik.com Git - apple/xnu.git/blob - iokit/Families/IOHIDSystem/IOHIDDescriptorParser/HIDUsageInRange.c
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: HIDUsageInRange.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 *------------------------------------------------------------------------------
56 * ptUsage - The usage/UsageRange Item
57 * usagePage - The usagePage of the Item - or zero
58 * usage - The usage of the Item
61 * true - usagePage/usage is in usage/UsageRange
62 * false - usagePage/usage is not in usage/UsageRange
64 *------------------------------------------------------------------------------
66 Boolean
HIDUsageInRange (HIDP_UsageItem
*ptUsage
, HIDUsage usagePage
, HIDUsage usage
)
69 * Disallow Null Pointers
74 * Check for the proper Page, 0 means don't care
76 if ((usagePage
!= 0) && (ptUsage
->usagePage
!= usagePage
))
79 * usage = 0 means don't care
84 * The requested usage must match or be in the range
88 if ((ptUsage
->usageMinimum
> usage
) || (ptUsage
->usageMaximum
< usage
))
93 if (ptUsage
->usage
!= usage
)