|
Common include file used only in examples. More...
Go to the source code of this file.
Macros | |
#define | EXAMPLES_USE_BENCHMARK_CONFIGURE 1 |
Enables/disables custom vendor control request (supported by the Benchmark Device Firmware). More... | |
#define | EXAMPLE_VID 0x04D8 |
Default example vendor id. | |
#define | EXAMPLE_PID 0xFA2E |
Default example product id. | |
#define | DL_PREPEND(head, add) |
Doubly linked list macro for C structures. utlist.h More... | |
#define | DL_APPEND(head, add) |
Adds an element to the end of a linked list. More... | |
#define | DL_DELETE(head, del) |
Removes an element from a linked list. More... | |
#define | DL_FOREACH(head, el) for(el=head;el;el=el->next) |
Start a foreach like enumeration though a linked list using a for loop. More... | |
#define | DL_FOREACH_SAFE(head, el, tmp) for((el)=(head);(el) && (tmp = (el)->next, 1); (el) = tmp) |
Start a foreach like enumeration though a linked list using a for loop. More... | |
#define | DL_SEARCH_SCALAR(head, out, field, val) |
Searches for a scalar field using a DL_FOREACH. More... | |
#define | DL_SEARCH(head, out, elt, cmp) |
Searches for an element using a user-defined compare function such as memcmp or strcmp. More... | |
Enumerations | |
enum | BM_COMMAND |
Custom vendor requests that must be implemented in the benchmark firmware. | |
enum | BM_TEST_TYPE |
Tests supported by the official benchmark firmware. | |
Functions | |
BOOL | Examples_GetTestDevice (KLST_HANDLE *DeviceList, KLST_DEVINFO_HANDLE *DeviceInfo, int argc, char *argv[]) |
Helper function for examples; searches a command line argument list for devices matching a specific vid/pid. More... | |
Common include file used only in examples.
#define EXAMPLES_USE_BENCHMARK_CONFIGURE 1 |
Enables/disables custom vendor control request (supported by the Benchmark Device Firmware).
#define DL_PREPEND | ( | head, | |
add | |||
) |
Doubly linked list macro for C structures. utlist.h
Provided by Troy D. Hanson
This file contains macros to manipulate singly and doubly-linked lists:
utlist.h
macros are documented. Undocumented macros will not appear in this documentation but can be downloaded here:
Performance Considerations:
head | First element of the list. |
add | Element to add. |
#define DL_APPEND | ( | head, | |
add | |||
) |
Adds an element to the end of a linked list.
head | First element of the list. |
add | Element to add. |
#define DL_DELETE | ( | head, | |
del | |||
) |
Removes an element from a linked list.
head | First element of the list. |
del | Element to remove. |
DL_DELETE
does not free or de-allocate memory. It "de-links" the element specified by del
from the list. #define DL_FOREACH | ( | head, | |
el | |||
) | for(el=head;el;el=el->next) |
Start a foreach
like enumeration though a linked list using a for loop.
head | First element of the list. |
el | assigned to an element of the linked list on each iteration. |
#define DL_FOREACH_SAFE | ( | head, | |
el, | |||
tmp | |||
) | for((el)=(head);(el) && (tmp = (el)->next, 1); (el) = tmp) |
Start a foreach
like enumeration though a linked list using a for loop.
head | First element of the list. |
el | assigned to an element of the linked list on each iteration. |
tmp | A temporary list element used to ensure safe deletion during iteration. |
#define DL_SEARCH_SCALAR | ( | head, | |
out, | |||
field, | |||
val | |||
) |
Searches for a scalar field using a DL_FOREACH.
head | First element of the list. |
out | First element whose field value equals val . |
field | Name of the field member to search. |
val | Value to compare with the field member. |
#define DL_SEARCH | ( | head, | |
out, | |||
elt, | |||
cmp | |||
) |
Searches for an element using a user-defined compare function such as memcmp or strcmp.
head | First element of the list. |
out | First matching element that matched (user-defined compare function returned 0). |
elt | Matching criteria (passed as a second paramater to the user-defined compare function) |
cmp | User-defined compare function or macro. |
BOOL Examples_GetTestDevice | ( | KLST_HANDLE * | DeviceList, |
KLST_DEVINFO_HANDLE * | DeviceInfo, | ||
int | argc, | ||
char * | argv[] | ||
) |
Helper function for examples; searches a command line argument list for devices matching a specific vid/pid.
Arguments are interpreted as follows:
DeviceList | On success, contains a pointer to the device list. |
DeviceInfo | On success, contains a pointer to the first device info structure which matched. |
argc | The argc parameter of the main() application function. |
argv | The argv parameter of the main() application function. |