libusb-0.1.8/ libusb-0.1.8/README libusb-0.1.8/Makefile.in libusb-0.1.8/configure libusb-0.1.8/AUTHORS libusb-0.1.8/COPYING libusb-0.1.8/ChangeLog libusb-0.1.8/INSTALL.libusb.in libusb-0.1.8/Makefile.am libusb-0.1.8/NEWS libusb-0.1.8/README.in libusb-0.1.8/aclocal.m4 libusb-0.1.8/config.guess libusb-0.1.8/config.h.in libusb-0.1.8/config.sub libusb-0.1.8/configure.in libusb-0.1.8/depcomp libusb-0.1.8/install-sh libusb-0.1.8/libusb-config.in libusb-0.1.8/libusb.spec.in libusb-0.1.8/ltmain.sh libusb-0.1.8/missing libusb-0.1.8/mkinstalldirs libusb-0.1.8/usb.h.in libusb-0.1.8/usb.c libusb-0.1.8/usbi.h libusb-0.1.8/error.c libusb-0.1.8/error.h libusb-0.1.8/descriptors.c libusb-0.1.8/bsd.c libusb-0.1.8/linux.c libusb-0.1.8/linux.h libusb-0.1.8/darwin.c libusb-0.1.8/LICENSE libusb-0.1.8/libusb.spec libusb-0.1.8/INSTALL.libusb libusb-0.1.8/tests/ libusb-0.1.8/tests/Makefile.in libusb-0.1.8/tests/Makefile.am libusb-0.1.8/tests/testlibusb.c libusb-0.1.8/doc/ libusb-0.1.8/doc/Makefile.in libusb-0.1.8/doc/Makefile.am libusb-0.1.8/doc/manual.sgml libusb-0.1.8/doc/api.sgml libusb-0.1.8/doc/examples.sgml libusb-0.1.8/doc/functions.sgml libusb-0.1.8/doc/intro.sgml libusb-0.1.8/doc/website.dsl patching file debian/po/POTFILES.in patching file debian/po/da.po patching file debian/po/de.po patching file debian/po/fr.po patching file debian/po/templates.pot patching file debian/libusb-dev.manpages patching file debian/control patching file debian/rules patching file debian/libusb-0.1-4.config patching file debian/changelog patching file debian/libusb-config.1 patching file debian/libusb-0.1-4.postinst patching file debian/libusb-0.1-4.install patching file debian/libusb-dev.install patching file debian/libusb-0.1-4.templates patching file debian/copyright patching file debian/libusb-dev.docs patching file debian/libusb-dev.doc-base patching file debian/compat patching file debian/README.Debian patching file missing patching file ltmain.sh checking for a BSD-compatible install... /usr/bin/ginstall -c checking whether build environment is sane... yes checking for gawk... gawk checking whether make sets $(MAKE)... yes checking build system type... sparc-unknown-linux-gnu checking host system type... sparc-unknown-linux-gnu checking for style of include used by make... GNU checking for gcc... gcc checking for C compiler default output... a.out checking whether the C compiler works... yes checking whether we are cross compiling... no checking for suffix of executables... checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether gcc accepts -g... yes checking for gcc option to accept ANSI C... none needed checking dependency style of gcc... gcc3 checking for a sed that does not truncate output... /usr/bin/sed checking for egrep... grep -E checking for ld used by gcc... /usr/sparc-splack-linux/bin/ld checking if the linker (/usr/sparc-splack-linux/bin/ld) is GNU ld... yes checking for /usr/sparc-splack-linux/bin/ld option to reload object files... -r checking for BSD-compatible nm... /usr/bin/nm -B checking whether ln -s works... yes checking how to recognise dependent libraries... pass_all checking how to run the C preprocessor... gcc -E checking for ANSI C header files... yes checking for sys/types.h... yes checking for sys/stat.h... yes checking for stdlib.h... yes checking for string.h... yes checking for memory.h... yes checking for strings.h... yes checking for inttypes.h... yes checking for stdint.h... yes checking for unistd.h... yes checking dlfcn.h usability... yes checking dlfcn.h presence... yes checking for dlfcn.h... yes checking for g++... g++ checking whether we are using the GNU C++ compiler... yes checking whether g++ accepts -g... yes checking dependency style of g++... gcc3 checking how to run the C++ preprocessor... g++ -E checking for g77... g77 checking whether we are using the GNU Fortran 77 compiler... yes checking whether g77 accepts -g... yes checking the maximum length of command line arguments... 65536 checking command to parse /usr/bin/nm -B output from gcc object... ok checking for objdir... .libs checking for ar... ar checking for ranlib... ranlib checking for strip... strip checking if gcc static flag works... yes checking if gcc supports -fno-rtti -fno-exceptions... no checking for gcc option to produce PIC... -fPIC checking if gcc PIC flag -fPIC works... yes checking if gcc supports -c -o file.o... yes checking whether the gcc linker (/usr/sparc-splack-linux/bin/ld) supports shared libraries... yes checking whether -lc should be explicitly linked in... no checking how to hardcode library paths into programs... immediate checking whether stripping libraries is possible... yes checking dynamic linker characteristics... GNU/Linux ld.so checking if libtool supports shared libraries... yes checking whether to build shared libraries... yes checking whether to build static libraries... yes configure: creating libtool appending configuration tag "CXX" to libtool checking for ld used by g++... /usr/sparc-splack-linux/bin/ld checking if the linker (/usr/sparc-splack-linux/bin/ld) is GNU ld... yes checking whether the g++ linker (/usr/sparc-splack-linux/bin/ld) supports shared libraries... yes checking for g++ option to produce PIC... -fPIC checking if g++ PIC flag -fPIC works... yes checking if g++ supports -c -o file.o... yes checking whether the g++ linker (/usr/sparc-splack-linux/bin/ld) supports shared libraries... yes checking how to hardcode library paths into programs... immediate checking whether stripping libraries is possible... yes checking dynamic linker characteristics... GNU/Linux ld.so appending configuration tag "F77" to libtool checking if libtool supports shared libraries... yes checking whether to build shared libraries... yes checking whether to build static libraries... yes checking for g77 option to produce PIC... -fPIC checking if g77 PIC flag -fPIC works... yes checking if g77 supports -c -o file.o... yes checking whether the g77 linker (/usr/sparc-splack-linux/bin/ld) supports shared libraries... yes checking how to hardcode library paths into programs... immediate checking whether stripping libraries is possible... yes checking dynamic linker characteristics... GNU/Linux ld.so checking whether to enable maintainer-specific portions of Makefiles... no checking for what USB OS support... Linux checking for gcc... (cached) gcc checking whether we are using the GNU C compiler... (cached) yes checking whether gcc accepts -g... (cached) yes checking for gcc option to accept ANSI C... (cached) none needed checking dependency style of gcc... (cached) gcc3 checking for gcc option to accept ANSI C... none needed checking for a BSD-compatible install... /usr/bin/ginstall -c checking for ANSI C header files... (cached) yes checking for vprintf... yes checking for _doprnt... no checking for an ANSI C-conforming const... yes checking whether byte ordering is bigendian... yes checking limits.h usability... yes checking limits.h presence... yes checking for limits.h... yes checking for unistd.h... (cached) yes checking values.h usability... yes checking values.h presence... yes checking for values.h... yes checking for memmove... yes checking if we should build the documentation... auto checking for jade... jade configure: creating ./config.status config.status: creating Makefile config.status: creating doc/Makefile config.status: creating libusb.spec config.status: creating libusb-config config.status: creating tests/Makefile config.status: creating README config.status: creating INSTALL.libusb config.status: creating usb.h config.status: creating config.h config.status: executing depfiles commands config.status: executing default commands make all-recursive make[1]: Entering directory `/tmp/libusb-0.1.8' Making all in . make[2]: Entering directory `/tmp/libusb-0.1.8' if /bin/sh ./libtool --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I. -MT usb.lo -MD -MP -MF ".deps/usb.Tpo" \ -c -o usb.lo `test -f 'usb.c' || echo './'`usb.c; \ then mv -f ".deps/usb.Tpo" ".deps/usb.Plo"; \ else rm -f ".deps/usb.Tpo"; exit 1; \ fi mkdir .libs gcc -DHAVE_CONFIG_H -I. -I. -I. -MT usb.lo -MD -MP -MF .deps/usb.Tpo -c usb.c -fPIC -DPIC -o .libs/usb.o gcc -DHAVE_CONFIG_H -I. -I. -I. -MT usb.lo -MD -MP -MF .deps/usb.Tpo -c usb.c -o usb.o >/dev/null 2>&1 if /bin/sh ./libtool --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I. -MT error.lo -MD -MP -MF ".deps/error.Tpo" \ -c -o error.lo `test -f 'error.c' || echo './'`error.c; \ then mv -f ".deps/error.Tpo" ".deps/error.Plo"; \ else rm -f ".deps/error.Tpo"; exit 1; \ fi gcc -DHAVE_CONFIG_H -I. -I. -I. -MT error.lo -MD -MP -MF .deps/error.Tpo -c error.c -fPIC -DPIC -o .libs/error.o gcc -DHAVE_CONFIG_H -I. -I. -I. -MT error.lo -MD -MP -MF .deps/error.Tpo -c error.c -o error.o >/dev/null 2>&1 if /bin/sh ./libtool --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I. -MT descriptors.lo -MD -MP -MF ".deps/descriptors.Tpo" \ -c -o descriptors.lo `test -f 'descriptors.c' || echo './'`descriptors.c; \ then mv -f ".deps/descriptors.Tpo" ".deps/descriptors.Plo"; \ else rm -f ".deps/descriptors.Tpo"; exit 1; \ fi gcc -DHAVE_CONFIG_H -I. -I. -I. -MT descriptors.lo -MD -MP -MF .deps/descriptors.Tpo -c descriptors.c -fPIC -DPIC -o .libs/descriptors.o gcc -DHAVE_CONFIG_H -I. -I. -I. -MT descriptors.lo -MD -MP -MF .deps/descriptors.Tpo -c descriptors.c -o descriptors.o >/dev/null 2>&1 if /bin/sh ./libtool --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I. -MT linux.lo -MD -MP -MF ".deps/linux.Tpo" \ -c -o linux.lo `test -f 'linux.c' || echo './'`linux.c; \ then mv -f ".deps/linux.Tpo" ".deps/linux.Plo"; \ else rm -f ".deps/linux.Tpo"; exit 1; \ fi gcc -DHAVE_CONFIG_H -I. -I. -I. -MT linux.lo -MD -MP -MF .deps/linux.Tpo -c linux.c -fPIC -DPIC -o .libs/linux.o gcc -DHAVE_CONFIG_H -I. -I. -I. -MT linux.lo -MD -MP -MF .deps/linux.Tpo -c linux.c -o linux.o >/dev/null 2>&1 /bin/sh ./libtool --mode=link gcc -o libusb.la -rpath /usr/lib -version-info 8:0:4 -release 0.1 -export-dynamic usb.lo error.lo descriptors.lo linux.lo gcc -shared .libs/usb.o .libs/error.o .libs/descriptors.o .libs/linux.o -Wl,-soname -Wl,libusb-0.1.so.4 -o .libs/libusb-0.1.so.4.4.0 (cd .libs && rm -f libusb-0.1.so.4 && ln -s libusb-0.1.so.4.4.0 libusb-0.1.so.4) (cd .libs && rm -f libusb.so && ln -s libusb-0.1.so.4.4.0 libusb.so) ar cru .libs/libusb.a usb.o error.o descriptors.o linux.o ranlib .libs/libusb.a creating libusb.la (cd .libs && rm -f libusb.la && ln -s ../libusb.la libusb.la) make[2]: Leaving directory `/tmp/libusb-0.1.8' Making all in tests make[2]: Entering directory `/tmp/libusb-0.1.8/tests' if gcc -DHAVE_CONFIG_H -I. -I. -I.. -I.. -O2 -Wall -MT testlibusb.o -MD -MP -MF ".deps/testlibusb.Tpo" \ -c -o testlibusb.o `test -f 'testlibusb.c' || echo './'`testlibusb.c; \ then mv -f ".deps/testlibusb.Tpo" ".deps/testlibusb.Po"; \ else rm -f ".deps/testlibusb.Tpo"; exit 1; \ fi /bin/sh ../libtool --mode=link gcc -O2 -Wall -o testlibusb testlibusb.o ../libusb.la mkdir .libs gcc -O2 -Wall -o .libs/testlibusb testlibusb.o ../.libs/libusb.so creating testlibusb make[2]: Leaving directory `/tmp/libusb-0.1.8/tests' Making all in doc make[2]: Entering directory `/tmp/libusb-0.1.8/doc' rm -rf html mkdir html jade -t sgml -d ./website.dsl\#html ./manual.sgml libusb Developers Guide Johannes Erdfelt johannes@erdfelt.com 0.3 June 28, 2002 jerdfelt More cleanups. Add the rest of the API and clean up some places. Add some examples. Hopefully, this should document the entire 0.1 API now. 0.2 June 11, 2002 jerdfelt Cleanup, update for all of the changes that have happened in the last couple of months. 0.1 August 26, 2001 jerdfelt First stab. libusb Preface This document's purpose is to explain the API for libusb and how to use it to make a USB aware application Any suggestions, corrections and comments regarding this document can be sent to the author: Johannes Erdfelt or the libusb developers mailing list. Introduction Overview This documentation will give an overview of how the v0.1 libusb API works and relates to USB. Work is rapidly progressing on a newer version of libusb, to be v1.0, which will be a redesigned API and is intended to obsolete v0.1. You may want to check the libusb website to see if it is stable and recommended. This documentation assumes that you have a good understanding of USB and how it works. If you don't have a good understanding of USB, it is recommended you obtain the USB v1.1 and/or v2.0 specs and read them. libusb is geared towards USB 1.1, however from the perspective of libusb, USB 2.0 won't be a significant change for libusb Current OS support Linux (2.2, 2.4 and on) FreeBSD, NetBSD and OpenBSD Darwin/MacOS X API This is the external API for applications to use. The API is relatively lean and designed to have close analogies to the USB specification. The v0.1 API was mostly hacked together and kludged together without much forethought and as a result, it's missing quite a few features. v1.0 is intended to rectify this. Devices and interfaces The libusb API ties an open device to a specific interface. This means that if you want to claim multiple interfaces on a device, you should open the device multiple times to receive one usb_dev_handle for each interface you want to communicate with. Don't forget to call . Timeouts Timeout's in libusb are always specified in milliseconds. Data Types libusb uses both abstracted and non abstracted structures to maintain portability. Synchronous All functions in libusb v0.1 are synchronous, meaning the functions block and wait for the operation to finish or timeout before returning execution to the calling application. Asynchronous operation will be supported in v1.0, but not v0.1. Return values There are two types of return values used in libusb v0.1. The first is a handle returned by . The second is an int. In all cases where an int is returned, = 0 is a success and 0 is an error condition. Functions Core These functions comprise the core of libusb. They are used by all applications that utilize libusb. usb_init Initialize libusb Description void usb_init Just like the name implies, usb_init sets up some internal structures. usb_init must be called before any other libusb functions. usb_find_busses Finds all USB busses on system Description int usb_find_busses usb_find_busses will find all of the busses on the system. Returns the number of changes since previous call to this function (total of new busses and busses removed). usb_find_devices Find all devices on all USB devices Description int usb_find_devices usb_find_devices will find all of the devices on each bus. This should be called after . Returns the number of changes since the previous call to this function (total of new device and devices removed). usb_get_busses Return the list of USB busses found Description struct usb_bus *usb_get_busses usb_get_busses simply returns the value of the global variable usb_busses. This was implemented for those languages that support C calling convention and can use shared libraries, but don't support C global variables (like Delphi). Device operations This group of functions deal with the device. It allows you to open and close the device as well standard USB operations like setting the configuration, alternate settings, clearing halts and resetting the device. It also provides OS level operations such as claiming and releasing interfaces. usb_open Opens a USB device Description usb_dev_handle *usb_open struct *usb_device dev usb_open is to be used to open up a device for use. usb_open must be called before attempting to perform any operations to the device. Returns a handle used in future communication with the device. usb_close Closes a USB device Description int usb_close usb_dev_handle *dev usb_close closes a device opened with . No further operations may be performed on the handle after usb_close is called. Returns 0 on success or 0 on error. make[2]: Leaving directory `/tmp/libusb-0.1.8/doc' make[1]: Leaving directory `/tmp/libusb-0.1.8' Making install in . make[1]: Entering directory `/tmp/libusb-0.1.8' make[2]: Entering directory `/tmp/libusb-0.1.8' /bin/sh ./mkinstalldirs /tmp/package-libusb/usr/bin mkdir /tmp/package-libusb/usr mkdir /tmp/package-libusb/usr/bin /usr/bin/ginstall -c libusb-config /tmp/package-libusb/usr/bin/libusb-config /bin/sh ./mkinstalldirs /tmp/package-libusb/usr/lib mkdir /tmp/package-libusb/usr/lib /bin/sh ./libtool --mode=install /usr/bin/ginstall -c libusb.la /tmp/package-libusb/usr/lib/libusb.la /usr/bin/ginstall -c .libs/libusb-0.1.so.4.4.0 /tmp/package-libusb/usr/lib/libusb-0.1.so.4.4.0 (cd /tmp/package-libusb/usr/lib && rm -f libusb-0.1.so.4 && ln -s libusb-0.1.so.4.4.0 libusb-0.1.so.4) (cd /tmp/package-libusb/usr/lib && rm -f libusb.so && ln -s libusb-0.1.so.4.4.0 libusb.so) /usr/bin/ginstall -c .libs/libusb.lai /tmp/package-libusb/usr/lib/libusb.la /usr/bin/ginstall -c .libs/libusb.a /tmp/package-libusb/usr/lib/libusb.a ranlib /tmp/package-libusb/usr/lib/libusb.a chmod 644 /tmp/package-libusb/usr/lib/libusb.a /bin/sh ./mkinstalldirs /tmp/package-libusb/usr/include mkdir /tmp/package-libusb/usr/include /usr/bin/ginstall -c -m 644 usb.h /tmp/package-libusb/usr/include/usb.h make[2]: Leaving directory `/tmp/libusb-0.1.8' make[1]: Leaving directory `/tmp/libusb-0.1.8' Making install in tests make[1]: Entering directory `/tmp/libusb-0.1.8/tests' make[2]: Entering directory `/tmp/libusb-0.1.8/tests' make[2]: Nothing to be done for `install-exec-am'. make[2]: Nothing to be done for `install-data-am'. make[2]: Leaving directory `/tmp/libusb-0.1.8/tests' make[1]: Leaving directory `/tmp/libusb-0.1.8/tests' Making install in doc make[1]: Entering directory `/tmp/libusb-0.1.8/doc' make[2]: Entering directory `/tmp/libusb-0.1.8/doc' make[2]: Nothing to be done for `install-exec-am'. make[2]: Nothing to be done for `install-data-am'. make[2]: Leaving directory `/tmp/libusb-0.1.8/doc' make[1]: Leaving directory `/tmp/libusb-0.1.8/doc' Slackware package maker, version 2.1. Searching for symbolic links: usr/lib/libusb-0.1.so.4 -> libusb-0.1.so.4.4.0 usr/lib/libusb.so -> libusb-0.1.so.4.4.0 Making symbolic link creation script: ( cd usr/lib ; rm -rf libusb-0.1.so.4 ) ( cd usr/lib ; ln -sf libusb-0.1.so.4.4.0 libusb-0.1.so.4 ) ( cd usr/lib ; rm -rf libusb.so ) ( cd usr/lib ; ln -sf libusb-0.1.so.4.4.0 libusb.so ) It is recommended that you make these lines your new installation script. Would you like to make this stuff the install script for this package and remove the symbolic links ([y]es, [n]o)? y Removing symbolic links: removed `./usr/lib/libusb-0.1.so.4' removed `./usr/lib/libusb.so' Creating your new ./install/doinst.sh... This next step is optional - you can set the directories in your package to some sane permissions. If any of the directories in your package have special permissions, then DO NOT reset them here! Would you like to reset all directory permissions to 755 (drwxr-xr-x) and directory ownerships to root.root ([y]es, [n]o)? n Creating tar file libusb-0.1.8-sparc-0.tar... ./ usr/ usr/bin/ usr/bin/libusb-config usr/lib/ usr/lib/libusb-0.1.so.4.4.0 usr/lib/libusb.la usr/lib/libusb.a usr/include/ usr/include/usb.h usr/doc/ usr/doc/libusb-0.1.8/ usr/doc/libusb-0.1.8/AUTHORS usr/doc/libusb-0.1.8/COPYING usr/doc/libusb-0.1.8/ChangeLog usr/doc/libusb-0.1.8/NEWS usr/doc/libusb-0.1.8/README usr/doc/libusb-0.1.8/html/ install/ install/slack-desc install/doinst.sh Gzipping libusb-0.1.8-sparc-0.tar... Renaming libusb-0.1.8-sparc-0.tar.gz to libusb-0.1.8-sparc-0.tgz... Moving libusb-0.1.8-sparc-0.tgz to ..... Package creation complete.