This file is indexed.

/usr/include/hidrd/usage/page.h is in libhidrd0-dev 0.2.0-11.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
/*
 * vim:nomodifiable
 *
 * ************* DO NOT EDIT ***************
 * This file is autogenerated from page.h.m4
 * *****************************************
 */
/** @file
 * @brief HID report descriptor - usage pages
 *
 * Copyright (C) 2009-2010 Nikolai Kondrashov
 *
 * This file is part of hidrd.
 *
 * Hidrd is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * Hidrd is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with hidrd; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 *
 * @author Nikolai Kondrashov <spbnick@gmail.com>
 */

#ifndef __HIDRD_USAGE_PAGE_H__
#define __HIDRD_USAGE_PAGE_H__

#include <assert.h>
#include <stdbool.h>
#include "hidrd/cfg.h"

#ifdef __cplusplus
extern "C" {
#endif

typedef enum hidrd_usage_page {
    /** Undefined */
    HIDRD_USAGE_PAGE_UNDEFINED = 0x0000,
    /** Generic desktop controls */
    HIDRD_USAGE_PAGE_DESKTOP = 0x0001,
    /** Simulation controls */
    HIDRD_USAGE_PAGE_SIMULATION = 0x0002,
    /** Virtual reality controls */
    HIDRD_USAGE_PAGE_VR = 0x0003,
    /** Sport controls */
    HIDRD_USAGE_PAGE_SPORT = 0x0004,
    /** Game controls */
    HIDRD_USAGE_PAGE_GAME = 0x0005,
    /** Generic device controls */
    HIDRD_USAGE_PAGE_DEVICE = 0x0006,
    /** Keyboard/keypad */
    HIDRD_USAGE_PAGE_KEYBOARD = 0x0007,
    /** LEDs */
    HIDRD_USAGE_PAGE_LED = 0x0008,
    /** Button */
    HIDRD_USAGE_PAGE_BUTTON = 0x0009,
    /** Ordinal */
    HIDRD_USAGE_PAGE_ORDINAL = 0x000A,
    /** Telephony */
    HIDRD_USAGE_PAGE_TELEPHONY = 0x000B,
    /** Consumer */
    HIDRD_USAGE_PAGE_CONSUMER = 0x000C,
    /** Digitizer */
    HIDRD_USAGE_PAGE_DIGITIZER = 0x000D,
    /** Physical interface device */
    HIDRD_USAGE_PAGE_PID = 0x000F,
    /** Unicode */
    HIDRD_USAGE_PAGE_UNICODE = 0x0010,
    /** Alphanumeric display */
    HIDRD_USAGE_PAGE_ALNUM_DISPLAY = 0x0014,
    /** Medical */
    HIDRD_USAGE_PAGE_MEDICAL = 0x0040,
    /** USB monitor */
    HIDRD_USAGE_PAGE_MONITOR = 0x0080,
    /** Monitor enumerated values */
    HIDRD_USAGE_PAGE_MONITOR_ENUM = 0x0081,
    /** Monitor VESA virtual control panel */
    HIDRD_USAGE_PAGE_MONITOR_VESA_VCP = 0x0082,
    /** Power device */
    HIDRD_USAGE_PAGE_POWER_DEVICE = 0x0084,
    /** Power battery system */
    HIDRD_USAGE_PAGE_POWER_BATSYS = 0x0085,
    /** POS devices - bar code scanner */
    HIDRD_USAGE_PAGE_POS_BCS = 0x008C,
    /** POS devices - scale */
    HIDRD_USAGE_PAGE_POS_SCALE = 0x008D,
    /** POS devices - magnetic stripe reader */
    HIDRD_USAGE_PAGE_POS_MSR = 0x008E,
    /** Camera control */
    HIDRD_USAGE_PAGE_CAMERA = 0x0090,
    /** Arcade */
    HIDRD_USAGE_PAGE_ARCADE = 0x0091,
} hidrd_usage_page;

#define HIDRD_USAGE_PAGE_MIN    0x0000
#define HIDRD_USAGE_PAGE_MAX    0xFFFF

/**
 * Check if a page is valid.
 *
 * @param page  Page ID to check.
 *
 * @return True if the page is valid, false otherwise.
 */
extern bool hidrd_usage_page_valid(hidrd_usage_page page);

/**
 * Check if a usage page is known, in effect,
 * if there is a description for it.
 *
 * @param page  Usage page to check.
 *
 * @return True if the usage page is known, false otherwise.
 */
extern bool hidrd_usage_page_known(hidrd_usage_page page);

/**
 * Validate a usage page ID.
 *
 * @param page  Page ID to validate.
 *
 * @return Validated page ID.
 */
static inline hidrd_usage_page
hidrd_usage_page_validate(hidrd_usage_page page)
{
    assert(hidrd_usage_page_valid(page));
    return page;
}


/**
 * Check if a page is defined (not undefined).
 *
 * @param page  Page ID to check.
 *
 * @return True if the page is defined, false otherwise.
 */
static inline bool
hidrd_usage_page_defined(hidrd_usage_page page)
{
    assert(hidrd_usage_page_valid(page));
    return page != HIDRD_USAGE_PAGE_UNDEFINED;
}


/**
 * Check if a page is reserved.
 *
 * @param page  Page ID to check.
 *
 * @return True if the page is reserved, false otherwise.
 */
extern bool hidrd_usage_page_reserved(hidrd_usage_page page);

/**
 * Check if a page is monitor page.
 *
 * @param page  Page ID to check.
 *
 * @return True if the page is monitor page, false otherwise.
 */
static inline bool
hidrd_usage_page_monitor(hidrd_usage_page page)
{
    assert(hidrd_usage_page_valid(page));
    if (page >= 0x0080 && page <= 0x0083)
        return true;
    return false;
}


/**
 * Check if a page is power page.
 *
 * @param page  Page ID to check.
 *
 * @return True if the page is power page, false otherwise.
 */
static inline bool
hidrd_usage_page_power(hidrd_usage_page page)
{
    assert(hidrd_usage_page_valid(page));
    if (page >= 0x0084 && page <= 0x0087)
        return true;
    return false;
}


/**
 * Check if a page is POS page.
 *
 * @param page  Page ID to check.
 *
 * @return True if the page is POS page, false otherwise.
 */
static inline bool
hidrd_usage_page_pos(hidrd_usage_page page)
{
    assert(hidrd_usage_page_valid(page));
    if (page >= 0x008C && page <= 0x008F)
        return true;
    return false;
}


/**
 * Check if a page is vendor-defined.
 *
 * @param page  Page ID to check.
 *
 * @return True if the page is vendor-defined, false otherwise.
 */
static inline bool
hidrd_usage_page_vendor(hidrd_usage_page page)
{
    assert(hidrd_usage_page_valid(page));
    if (page >= 0xFF00 && page <= 0xFFFF)
        return true;
    return false;
}




/* Declare usage page to numeric string conversion functions */
HIDRD_NUM_CONV_DECLS(usage_page);

#ifdef HIDRD_WITH_TOKENS
/**
 * Convert a usage page code to a string token.
 *
 * @param page  Usage page code.
 *
 * @return Dynamically allocated token string, or NULL if the page has no
 *         token or failed to allocate memory; check errno for the latter.
 */
extern char *hidrd_usage_page_to_token(hidrd_usage_page page);

/**
 * Convert a usage page string token to a code.
 *
 * @param ppage Location for resulting page code.
 * @param token Usage page string token (case insensitive).
 *
 * @return True if token is found, false otherwise.
 */
extern bool hidrd_usage_page_from_token(hidrd_usage_page   *ppage,
                                        const char         *token);

#endif /* HIDRD_WITH_TOKENS */

#ifdef HIDRD_WITH_NAMES
/**
 * Retrieve usage page name string (close to specification).
 *
 * @param page  Usage page code.
 *
 * @return Usage page name string, or NULL if not found.
 */
extern const char *hidrd_usage_page_name(hidrd_usage_page page);

/**
 * Format usage page set membership description text.
 *
 * @param page  Usage page code to generate description for.
 *
 * @return Dynamically allocated page set membership description, or NULL if
 *         failed to allocate memory; could be an empty string, if there is
 *         nothing to tell about the page.
 */
extern char *hidrd_usage_page_set_membership_desc_str(
                                            hidrd_usage_page page);

/**
 * Format page description text from page name and set membership.
 *
 * @param page  Usage page code to generate description for.
 *
 * @return Dynamically allocated page description, or NULL if failed to
 *         allocate memory; could be an empty string, if there is nothing to
 *         tell about the page.
 */
extern char *hidrd_usage_page_desc_str(hidrd_usage_page page);
#endif /* HIDRD_WITH_NAMES */

#ifdef __cplusplus
} /* extern "C" */
#endif

#endif /* __HIDRD_USAGE_PAGE_H__ */