1 ! Copyright (C) 2006 Chris Double.
2 ! See http://factorcode.org/license.txt for BSD license.
7 "usb" "libusb.so" "cdecl" add-library
14 { { "char" 4097 } "dirname" }
17 { "void*" "root_dev" } ;
19 ! __attribute__ ((packed))
20 C-STRUCT: usb_device_descriptor
21 { +packed+ "uchar" "bLength" }
22 { +packed+ "uchar" "bDescriptorType" }
23 { +packed+ "ushort" "bcdUSB" }
24 { +packed+ "uchar" "bDeviceClass" }
25 { +packed+ "uchar" "bDeviceSubClass" }
26 { +packed+ "uchar" "bDeviceProtocol" }
27 { +packed+ "uchar" "bMaxPacketSize0" }
28 { +packed+ "ushort" "idVendor" }
29 { +packed+ "ushort" "idProduct" }
30 { +packed+ "ushort" "bcdDevice" }
31 { +packed+ "uchar" "iManufacturer" }
32 { +packed+ "uchar" "iProduct" }
33 { +packed+ "uchar" "iSerialNumber" }
34 { +packed+ "uchar" "bNumConfigurations" } ;
36 C-STRUCT: usb_config_descriptor
37 { +packed+ "uchar" "bLength" }
38 { +packed+ "uchar" "bDescriptorType" }
39 { +packed+ "ushort" "wTotalLength" }
40 { +packed+ "uchar" "bNumInterfaces" }
41 { +packed+ "uchar" "bConfigurationValue" }
42 { +packed+ "uchar" "iConfiguration" }
43 { +packed+ "uchar" "bmAttributes" }
44 { +packed+ "uchar" "MaxPower" }
46 { "void*" "interface" }
49 { "int" "extralen" } ;
54 { { "char" 4097 } "filename" }
56 { "usb_device_descriptor" "descriptor" }
57 { "usb_config_descriptor*" "config" }
60 { "uchar" "num_children" }
61 { "void*" "children" } ;