Skip to content

Commit 2f7a7c9

Browse files
z3ntuQbicz
authored andcommitted
Rename hid_device* parameters to dev
Previously, the header file used hid_device *device and the implementations used hid_device *dev. Make this consistent.
1 parent 921ad33 commit 2f7a7c9

File tree

4 files changed

+26
-26
lines changed

4 files changed

+26
-26
lines changed

hidapi/hidapi.h

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ extern "C" {
195195
the Control Endpoint (Endpoint 0).
196196
197197
@ingroup API
198-
@param device A device handle returned from hid_open().
198+
@param dev A device handle returned from hid_open().
199199
@param data The data to send, including the report number as
200200
the first byte.
201201
@param length The length in bytes of the data to send.
@@ -204,7 +204,7 @@ extern "C" {
204204
This function returns the actual number of bytes written and
205205
-1 on error.
206206
*/
207-
int HID_API_EXPORT HID_API_CALL hid_write(hid_device *device, const unsigned char *data, size_t length);
207+
int HID_API_EXPORT HID_API_CALL hid_write(hid_device *dev, const unsigned char *data, size_t length);
208208

209209
/** @brief Read an Input report from a HID device with timeout.
210210
@@ -213,7 +213,7 @@ extern "C" {
213213
contain the Report number if the device uses numbered reports.
214214
215215
@ingroup API
216-
@param device A device handle returned from hid_open().
216+
@param dev A device handle returned from hid_open().
217217
@param data A buffer to put the read data into.
218218
@param length The number of bytes to read. For devices with
219219
multiple reports, make sure to read an extra byte for
@@ -234,7 +234,7 @@ extern "C" {
234234
contain the Report number if the device uses numbered reports.
235235
236236
@ingroup API
237-
@param device A device handle returned from hid_open().
237+
@param dev A device handle returned from hid_open().
238238
@param data A buffer to put the read data into.
239239
@param length The number of bytes to read. For devices with
240240
multiple reports, make sure to read an extra byte for
@@ -245,7 +245,7 @@ extern "C" {
245245
-1 on error. If no packet was available to be read and
246246
the handle is in non-blocking mode, this function returns 0.
247247
*/
248-
int HID_API_EXPORT HID_API_CALL hid_read(hid_device *device, unsigned char *data, size_t length);
248+
int HID_API_EXPORT HID_API_CALL hid_read(hid_device *dev, unsigned char *data, size_t length);
249249

250250
/** @brief Set the device handle to be non-blocking.
251251
@@ -257,15 +257,15 @@ extern "C" {
257257
Nonblocking can be turned on and off at any time.
258258
259259
@ingroup API
260-
@param device A device handle returned from hid_open().
260+
@param dev A device handle returned from hid_open().
261261
@param nonblock enable or not the nonblocking reads
262262
- 1 to enable nonblocking
263263
- 0 to disable nonblocking.
264264
265265
@returns
266266
This function returns 0 on success and -1 on error.
267267
*/
268-
int HID_API_EXPORT HID_API_CALL hid_set_nonblocking(hid_device *device, int nonblock);
268+
int HID_API_EXPORT HID_API_CALL hid_set_nonblocking(hid_device *dev, int nonblock);
269269

270270
/** @brief Send a Feature report to the device.
271271
@@ -283,7 +283,7 @@ extern "C" {
283283
in would be 17.
284284
285285
@ingroup API
286-
@param device A device handle returned from hid_open().
286+
@param dev A device handle returned from hid_open().
287287
@param data The data to send, including the report number as
288288
the first byte.
289289
@param length The length in bytes of the data to send, including
@@ -293,7 +293,7 @@ extern "C" {
293293
This function returns the actual number of bytes written and
294294
-1 on error.
295295
*/
296-
int HID_API_EXPORT HID_API_CALL hid_send_feature_report(hid_device *device, const unsigned char *data, size_t length);
296+
int HID_API_EXPORT HID_API_CALL hid_send_feature_report(hid_device *dev, const unsigned char *data, size_t length);
297297

298298
/** @brief Get a feature report from a HID device.
299299
@@ -304,7 +304,7 @@ extern "C" {
304304
start in data[1].
305305
306306
@ingroup API
307-
@param device A device handle returned from hid_open().
307+
@param dev A device handle returned from hid_open().
308308
@param data A buffer to put the read data into, including
309309
the Report ID. Set the first byte of @p data[] to the
310310
Report ID of the report to be read, or set it to zero
@@ -318,74 +318,74 @@ extern "C" {
318318
one for the report ID (which is still in the first
319319
byte), or -1 on error.
320320
*/
321-
int HID_API_EXPORT HID_API_CALL hid_get_feature_report(hid_device *device, unsigned char *data, size_t length);
321+
int HID_API_EXPORT HID_API_CALL hid_get_feature_report(hid_device *dev, unsigned char *data, size_t length);
322322

323323
/** @brief Close a HID device.
324324
325325
@ingroup API
326-
@param device A device handle returned from hid_open().
326+
@param dev A device handle returned from hid_open().
327327
*/
328-
void HID_API_EXPORT HID_API_CALL hid_close(hid_device *device);
328+
void HID_API_EXPORT HID_API_CALL hid_close(hid_device *dev);
329329

330330
/** @brief Get The Manufacturer String from a HID device.
331331
332332
@ingroup API
333-
@param device A device handle returned from hid_open().
333+
@param dev A device handle returned from hid_open().
334334
@param string A wide string buffer to put the data into.
335335
@param maxlen The length of the buffer in multiples of wchar_t.
336336
337337
@returns
338338
This function returns 0 on success and -1 on error.
339339
*/
340-
int HID_API_EXPORT_CALL hid_get_manufacturer_string(hid_device *device, wchar_t *string, size_t maxlen);
340+
int HID_API_EXPORT_CALL hid_get_manufacturer_string(hid_device *dev, wchar_t *string, size_t maxlen);
341341

342342
/** @brief Get The Product String from a HID device.
343343
344344
@ingroup API
345-
@param device A device handle returned from hid_open().
345+
@param dev A device handle returned from hid_open().
346346
@param string A wide string buffer to put the data into.
347347
@param maxlen The length of the buffer in multiples of wchar_t.
348348
349349
@returns
350350
This function returns 0 on success and -1 on error.
351351
*/
352-
int HID_API_EXPORT_CALL hid_get_product_string(hid_device *device, wchar_t *string, size_t maxlen);
352+
int HID_API_EXPORT_CALL hid_get_product_string(hid_device *dev, wchar_t *string, size_t maxlen);
353353

354354
/** @brief Get The Serial Number String from a HID device.
355355
356356
@ingroup API
357-
@param device A device handle returned from hid_open().
357+
@param dev A device handle returned from hid_open().
358358
@param string A wide string buffer to put the data into.
359359
@param maxlen The length of the buffer in multiples of wchar_t.
360360
361361
@returns
362362
This function returns 0 on success and -1 on error.
363363
*/
364-
int HID_API_EXPORT_CALL hid_get_serial_number_string(hid_device *device, wchar_t *string, size_t maxlen);
364+
int HID_API_EXPORT_CALL hid_get_serial_number_string(hid_device *dev, wchar_t *string, size_t maxlen);
365365

366366
/** @brief Get a string from a HID device, based on its string index.
367367
368368
@ingroup API
369-
@param device A device handle returned from hid_open().
369+
@param dev A device handle returned from hid_open().
370370
@param string_index The index of the string to get.
371371
@param string A wide string buffer to put the data into.
372372
@param maxlen The length of the buffer in multiples of wchar_t.
373373
374374
@returns
375375
This function returns 0 on success and -1 on error.
376376
*/
377-
int HID_API_EXPORT_CALL hid_get_indexed_string(hid_device *device, int string_index, wchar_t *string, size_t maxlen);
377+
int HID_API_EXPORT_CALL hid_get_indexed_string(hid_device *dev, int string_index, wchar_t *string, size_t maxlen);
378378

379379
/** @brief Get a string describing the last error which occurred.
380380
381381
@ingroup API
382-
@param device A device handle returned from hid_open().
382+
@param dev A device handle returned from hid_open().
383383
384384
@returns
385385
This function returns a string containing the last error
386386
which occurred or NULL if none has occurred.
387387
*/
388-
HID_API_EXPORT const wchar_t* HID_API_CALL hid_error(hid_device *device);
388+
HID_API_EXPORT const wchar_t* HID_API_CALL hid_error(hid_device *dev);
389389

390390
#ifdef __cplusplus
391391
}

libusb/hid.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ static void free_hid_device(hid_device *dev)
205205

206206
#if 0
207207
/*TODO: Implement this funciton on hidapi/libusb.. */
208-
static void register_error(hid_device *device, const char *op)
208+
static void register_error(hid_device *dev, const char *op)
209209
{
210210

211211
}

mac/hid.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ static IOHIDManagerRef hid_mgr = 0x0;
183183

184184

185185
#if 0
186-
static void register_error(hid_device *device, const char *op)
186+
static void register_error(hid_device *dev, const char *op)
187187
{
188188

189189
}

windows/hid.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ static void free_hid_device(hid_device *dev)
169169
free(dev);
170170
}
171171

172-
static void register_error(hid_device *device, const char *op)
172+
static void register_error(hid_device *dev, const char *op)
173173
{
174174
WCHAR *ptr, *msg;
175175

0 commit comments

Comments
 (0)