.libs
Makefile
Makefile.in
+!doc/Makefile.in
*.la
*.lo
*.o
tests/stress
*.exe
*.pc
-doc/html
+doc/api-1.0
*.plg
*.ncb
*.opt
AUTOMAKE_OPTIONS = dist-bzip2 no-dist-gzip
ACLOCAL_AMFLAGS = -I m4
-DISTCLEANFILES = libusb-1.0.pc
-EXTRA_DIST = TODO PORTING msvc libusb/libusb-1.0.def libusb/version_nano.h \
- examples/getopt/getopt.c examples/getopt/getopt1.c examples/getopt/getopt.h \
- android Xcode
-SUBDIRS = libusb doc
+EXTRA_DIST = INSTALL_WIN.txt PORTING doc/libusb.png \
+ android msvc Xcode
+SUBDIRS = libusb
if BUILD_EXAMPLES
SUBDIRS += examples
SUBDIRS += tests
endif
-pkgconfigdir=$(libdir)/pkgconfig
-pkgconfig_DATA=libusb-1.0.pc
+pkgconfigdir = $(libdir)/pkgconfig
+pkgconfig_DATA = libusb-1.0.pc
-.PHONY: dist-up
+# The package name is libusb-1.0, but we want the distribution
+# to be created as libusb-x.y.z instead of libusb-1.0-x.y.z
+distdir = libusb-$(VERSION)
-reldir = .release/$(distdir)
-dist-up: dist
+# Ensure any generated docs are cleaned out
+# We need this here because make does not recurse into doc/
+clean-local:
+ rm -rf doc/$(DOXYGEN_HTMLDIR)
+
+# Use dist-hook to accomplish the following things for the dist recipe:
+# 1) Remove the GitHub Markdown from the README file
+# 2) Remove the .gitattributes file from the msvc directory
+dist-hook:
+ chmod u+w $(distdir)/README $(distdir)/msvc
+ $(SED) -i.orig -e '/Build Status/d' $(distdir)/README
+ $(SED) -i.orig -e '/^$$/N;/^\n$$/D' $(distdir)/README
+ $(SED) -i.orig -e 's/\[\([A-Z]*\)\](\1)/\1/' $(distdir)/README
+ rm -f $(distdir)/README.orig
+ rm -f $(distdir)/msvc/.gitattributes
+
+.PHONY: dist-upload
+dist-upload: reldir = .release/$(distdir)
+dist-upload: sfurl = frs.sourceforge.net:/home/frs/project/libusb/libusb-1.0
+dist-upload: dist
rm -rf $(reldir)
mkdir -p $(reldir)
cp $(distdir).tar.bz2 $(reldir)
- rsync -rv $(reldir) frs.sourceforge.net:/home/frs/project/l/li/libusb/libusb-1.0/
+ if [ -z "$$SF_USER" ]; then \
+ rsync -rv $(reldir) $(sfurl); \
+ else \
+ rsync -rv $(reldir) $$SF_USER@$(sfurl); \
+ fi
rm -rf $(reldir)
libusb repository under this account from https://github.com/libusb/libusb.
Then you can create a git branch for your work, that we will be able to better
-reference and test.
+reference and test.
We also suggest that, if you are planning to bring in a large development, you
try to involve the libusb community early by letting the mailing list know, as
-you may find that other people might be eager to help you out.
-See http://mailing-list.libusb.info for details on how to join the mailing list.
\ No newline at end of file
+you may find that other people might be eager to help you out.
+See http://mailing-list.libusb.info for details on how to join the mailing list.
# libusb
[![Build Status](https://travis-ci.org/libusb/libusb.svg?branch=master)](https://travis-ci.org/libusb/libusb)
-[![Build status](https://ci.appveyor.com/api/projects/status/xvrfam94jii4a6lw?svg=true)](https://ci.appveyor.com/project/LudovicRousseau/libusb)
+[![Build Status](https://ci.appveyor.com/api/projects/status/xvrfam94jii4a6lw?svg=true)](https://ci.appveyor.com/project/LudovicRousseau/libusb)
[![Coverity Scan Build Status](https://scan.coverity.com/projects/2180/badge.svg)](https://scan.coverity.com/projects/libusb-libusb)
libusb is a library for USB device access from Linux, macOS,
-Windows, OpenBSD/NetBSD and Haiku userspace.
+Windows, OpenBSD/NetBSD, Haiku and Solaris userspace.
It is written in C (Haiku backend in C++) and licensed under the GNU
Lesser General Public License version 2.1 or, at your option, any later
version (see [COPYING](COPYING)).
LU_DEFINE_VERSION_ATOM([LIBUSB_MICRO])
LU_DEFINE_VERSION_RC_ATOM([LIBUSB_RC])
-AC_INIT([libusb],[LIBUSB_MAJOR[.]LIBUSB_MINOR[.]LIBUSB_MICRO[]LIBUSB_RC],[libusb-devel@lists.sourceforge.net],[libusb],[http://libusb.info])
+AC_INIT([libusb-1.0], [LIBUSB_MAJOR[.]LIBUSB_MINOR[.]LIBUSB_MICRO[]LIBUSB_RC], [libusb-devel@lists.sourceforge.net], [libusb-1.0], [http://libusb.info])
dnl Library versioning
dnl These numbers should be tweaked on every release. Read carefully:
backend=windows
poll=windows
threads=windows
- create_import_lib=yes
+ test "x$enable_shared" = xyes && create_import_lib=yes
AM_CFLAGS="${AM_CFLAGS} -fno-omit-frame-pointer"
;;
*)
AC_SUBST(AM_CFLAGS)
AC_SUBST(LTLDFLAGS)
+dnl set name of html output directory for doxygen
+AC_SUBST(DOXYGEN_HTMLDIR, [api-1.0])
+
AC_CONFIG_FILES([libusb-1.0.pc])
AC_CONFIG_FILES([Makefile])
AC_CONFIG_FILES([libusb/Makefile])
+++ /dev/null
-EXTRA_DIST = doxygen.cfg.in
-
-docs: doxygen.cfg
- doxygen $^
-
-docs-upload: docs
- ln -s html api-1.0
- scp -r api-1.0 web.sourceforge.net:/home/project-web/libusb/htdocs
- rm -f api-1.0
--- /dev/null
+LIBUSB_SRC_DIR = @top_srcdir@/libusb
+EXCLUDED_FILES = hotplug.h libusbi.h version.h version_nano.h
+LIBUSB_SRC = $(wildcard $(LIBUSB_SRC_DIR)/*.c) $(wildcard $(LIBUSB_SRC_DIR)/*.h)
+LIBUSB_DOC_SRC = $(filter-out $(addprefix $(LIBUSB_SRC_DIR)/,$(EXCLUDED_FILES)),$(LIBUSB_SRC))
+
+docs: @DOXYGEN_HTMLDIR@
+
+@DOXYGEN_HTMLDIR@: doxygen.cfg libusb.png $(LIBUSB_DOC_SRC)
+ doxygen $<
+
+docs-upload: sfurl = web.sourceforge.net:/home/project-web/libusb/htdocs
+docs-upload: @DOXYGEN_HTMLDIR@
+ if [ -z "$$SF_USER" ]; then \
+ rsync -rv --delete $< $(sfurl); \
+ else \
+ rsync -rv --delete $< $$SF_USER@$(sfurl); \
+ fi
+
+clean:
+ rm -rf @DOXYGEN_HTMLDIR@
+
+.PHONY: clean docs docs-upload
# could be handy for archiving the generated documentation or if some version
# control system is used.
-PROJECT_NUMBER =
+PROJECT_NUMBER = @PACKAGE_VERSION@
# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer a
# *.f, *.for, *.tcl, *.vhd, *.vhdl, *.ucf, *.qsf and *.ice.
FILE_PATTERNS = *.c \
- *.cc \
- *.cxx \
- *.cpp \
- *.c++ \
- *.java \
- *.ii \
- *.ixx \
- *.ipp \
- *.i++ \
- *.inl \
- *.idl \
- *.ddl \
- *.odl \
- *.h \
- *.hh \
- *.hxx \
- *.hpp \
- *.h++ \
- *.cs \
- *.d \
- *.php \
- *.php4 \
- *.php5 \
- *.phtml \
- *.inc \
- *.m \
- *.markdown \
- *.md \
- *.mm \
- *.dox \
- *.py \
- *.pyw \
- *.f90 \
- *.f95 \
- *.f03 \
- *.f08 \
- *.f \
- *.for \
- *.tcl \
- *.vhd \
- *.vhdl \
- *.ucf \
- *.qsf \
- *.ice
+ *.h
# The RECURSIVE tag can be used to specify whether or not subdirectories should
# be searched for input files as well.
# Note that relative paths are relative to the directory from which doxygen is
# run.
-EXCLUDE = @top_srcdir@/libusb/libusbi.h \
- @top_srcdir@/libusb/hotplug.h
+EXCLUDE = @top_srcdir@/libusb/hotplug.h \
+ @top_srcdir@/libusb/libusbi.h \
+ @top_srcdir@/libusb/version.h \
+ @top_srcdir@/libusb/version_nano.h \
+ @top_srcdir@/libusb/os
# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or
# directories that are symbolic links (a Unix file system feature) are excluded
# The default directory is: html.
# This tag requires that the tag GENERATE_HTML is set to YES.
-HTML_OUTPUT = html
+HTML_OUTPUT = @DOXYGEN_HTMLDIR@
# The HTML_FILE_EXTENSION tag can be used to specify the file extension for each
# generated HTML page (for example: .htm, .php, .asp).
# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
PREDEFINED = API_EXPORTED= \
- LIBUSB_CALL= \
- DEFAULT_VISIBILITY=
+ DEFAULT_VISIBILITY= \
+ LIBUSB_CALL=
# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this
# tag can be used to specify a list of macro names that should be expanded. The
-all: libusb-1.0.la libusb-1.0.dll
-
AUTOMAKE_OPTIONS = subdir-objects
lib_LTLIBRARIES = libusb-1.0.la
OS_SRC = $(OS_WINDOWS_SRC)
.rc.lo:
- $(AM_V_GEN)$(LIBTOOL) $(AM_V_lt) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --tag=RC --mode=compile $(RC) $(RCFLAGS) -i $< -o $@
+ $(AM_V_GEN)$(LIBTOOL) $(AM_V_lt) --tag=RC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(RC) $(RCFLAGS) -i $< -o $@
-libusb-1.0.rc: version.h version_nano.h
-endif
+libusb-1.0.lo: libusb-1.0.rc version.h version_nano.h
-libusb-1.0.dll: libusb-1.0.def libusb-1.0.la
if CREATE_IMPORT_LIB
+all-local: .libs/libusb-1.0.dll.a
# Rebuild the import lib from the .def so that MS and MinGW DLLs can be interchanged
- $(AM_V_GEN)$(DLLTOOL) $(DLLTOOLFLAGS) --kill-at --input-def $(srcdir)/libusb-1.0.def --dllname $@ --output-lib .libs/$@.a
+.libs/libusb-1.0.dll.a: libusb-1.0.def libusb-1.0.la
+ $(AM_V_GEN)$(DLLTOOL) $(DLLTOOLFLAGS) --kill-at --input-def $(srcdir)/$< --dllname libusb-1.0.dll --output-lib $@
+endif
endif
libusb_1_0_la_CFLAGS = $(AM_CFLAGS)
libusb_1_0_la_LDFLAGS = $(LTLDFLAGS)
-libusb_1_0_la_SOURCES = libusbi.h libusb.h version.h version_nano.h \
+libusb_1_0_la_SOURCES = libusbi.h version.h version_nano.h \
core.c descriptor.c hotplug.h hotplug.c io.c strerror.c sync.c \
$(POLL_SRC) $(THREADS_SRC) $(OS_SRC)
-hdrdir = $(includedir)/libusb-1.0
-hdr_HEADERS = libusb.h
+pkginclude_HEADERS = libusb.h
#include "libusbi.h"
#include "hotplug.h"
+#include "version.h"
#ifdef __ANDROID__
#include <android/log.h>
}
/** \ingroup libusb_dev
- * Deprecated please use libusb_get_port_numbers instead.
+ * \deprecated Please use \ref libusb_get_port_numbers() instead.
*/
int API_EXPORTED libusb_get_port_path(libusb_context *ctx, libusb_device *dev,
uint8_t* port_numbers, uint8_t port_numbers_len)
* function and make sure that you only access the parent before issuing
* \ref libusb_free_device_list(). The reason is that libusb currently does
* not maintain a permanent list of device instances, and therefore can
- * only guarantee that parents are fully instantiated within a
+ * only guarantee that parents are fully instantiated within a
* libusb_get_device_list() - libusb_free_device_list() block.
*/
DEFAULT_VISIBILITY
const char *rc;
/** For ABI compatibility only. */
- const char* describe;
+ const char *describe;
};
/** \ingroup libusb_lib
struct libusb_container_id_descriptor *container_id);
uint8_t LIBUSB_CALL libusb_get_bus_number(libusb_device *dev);
uint8_t LIBUSB_CALL libusb_get_port_number(libusb_device *dev);
-int LIBUSB_CALL libusb_get_port_numbers(libusb_device *dev, uint8_t* port_numbers, int port_numbers_len);
+int LIBUSB_CALL libusb_get_port_numbers(libusb_device *dev, uint8_t *port_numbers, int port_numbers_len);
LIBUSB_DEPRECATED_FOR(libusb_get_port_numbers)
-int LIBUSB_CALL libusb_get_port_path(libusb_context *ctx, libusb_device *dev, uint8_t* path, uint8_t path_length);
+int LIBUSB_CALL libusb_get_port_path(libusb_context *ctx, libusb_device *dev, uint8_t *path, uint8_t path_length);
libusb_device * LIBUSB_CALL libusb_get_parent(libusb_device *dev);
uint8_t LIBUSB_CALL libusb_get_device_address(libusb_device *dev);
int LIBUSB_CALL libusb_get_device_speed(libusb_device *dev);
#endif
#include "libusb.h"
-#include "version.h"
#define container_of(ptr, type, member) \
((type *)((uintptr_t)(ptr) - (uintptr_t)offsetof(type, member)))
#define TIMESPEC_IS_SET(ts) ((ts)->tv_sec || (ts)->tv_nsec)
#define TIMESPEC_CLEAR(ts) (ts)->tv_sec = (ts)->tv_nsec = 0
-#define TIMESPEC_CMP(a, b, CMP) \
+#define TIMESPEC_CMP(a, b, CMP) \
(((a)->tv_sec == (b)->tv_sec) \
? ((a)->tv_nsec CMP (b)->tv_nsec) \
: ((a)->tv_sec CMP (b)->tv_sec))
-#define LIBUSB_NANO 11469
+#define LIBUSB_NANO 11470