22 Commits

Author SHA1 Message Date
Chris Dickens
32a2206942 core: Refactor initialization and how the default context is handled
Highlights for this change:

 - usbi_default_context is only set if libusb_init() is called with NULL.
 - All hotplug related functionality (e.g. initialization, processing) has been
   moved to hotplug.c
 - Backends are simplified by removing initialization mutexes. Mutual exclusion
   between init()/exit() is provided by default_context_lock.
 - Make hotplug types and functions part of libusbi.h with the common usbi_
   prefixes (removes hotplug.h).

Addresses issue highlighted in #855

Closes #856

Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
Signed-off-by: Nathan Hjelm <hjelmn@google.com>
2021-06-02 22:53:59 -06:00
Ludovic Rousseau
bda2344f5e Doxygen: fix warning about PAPER_TYPE
warning: argument 'a4wide' for option PAPER_TYPE is not a valid enum value
Using the default: a4!

Signed-off-by: Ludovic Rousseau <ludovic.rousseau@free.fr>
2021-02-22 21:34:10 +01:00
Ludovic Rousseau
90273023db Doxygen: update config file from 1.8.16 to 1.9.0
warning: Tag 'TCL_SUBST' at line 255 of file 'doxygen.cfg.in' has become obsolete.
         This tag has been removed.
warning: Tag 'COLS_IN_ALPHA_INDEX' at line 1056 of file 'doxygen.cfg.in' has become obsolete.
         This tag has been removed.

Signed-off-by: Ludovic Rousseau <ludovic.rousseau@free.fr>
2021-02-22 18:01:13 +01:00
Aurelien Jarno
442305ec3d autotools: fix out-of-tree building of documentation
When building libusb out-of-tree, ie when running configure from another
directory, building the documentation fails with:

  $ make -C doc
  make: Entering directory '/tmp/build/doc'
  make: *** No rule to make target 'libusb.png', needed by 'api-1.0'.  Stop.
  make: Leaving directory '/tmp/build/doc'

This has likely been broken by commit 4a5540a925 ("autotools: Fix a number of
issues"). This patch fixes that by prefixing libusb.png with @top_srcdir@/doc.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2020-12-03 18:51:45 +01:00
Chris Dickens
e83f39ba6e libusb.h: Ensure that struct libusb_control_transfer is not padded
There is nothing explicitly preventing the compiler from adding any sort
of padding to the libusb_control_transfer structure. It does not seem
that any sane compiler would do so, but there is library functionality
that depends on this not happening. Address this by explicitly
instructing the compiler to pack the structure.

Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
2020-04-16 15:57:15 -07:00
Chris Dickens
60c8395eec Makefiles: Remove target-specific variables
Improve portability with non-GNU make by using standard variables.

Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
2020-04-09 12:30:57 -07:00
Chris Dickens
4a5540a925 autotools: Fix a number of issues
Change the name of the project to be what it actually is called
everywhere: libusb-1.0. This allows the public libusb.h header file to
be tracked by automake through pkginclude_HEADERS.

Decouple the doc directory from automake. There aren't any targets that
automake understands, so the build uselessly recurses into the directory.
Update the makefile targets with the correct dependencies so that the
docs aren't regenerated unnecessarily. Update the doxygen config file to
include the version, exclude irrelevant source files and create the
output into 'api-1.0' instead of 'html'. Also fix a deprecation tag for
the libusb_get_port_path() function and add Solaris to the list of
supported platforms.

Fix the 'dist' target. Clean up the README file to remote the GitHub
Markdown and remove the .gitattributes file from the msvc directory.
Add doc/libusb.png to EXTRA_DIST.

Enhance the {dist,doc}-upload targets to look at the SF_USER environment
variable to get the SourceForge username. This allows maintainers (like
me!) to have a local username that is different from their SourceForge
username. Switch the docs-upload recipe to use rsync with --delete to
clean up obsolete files.

Fix the Windows shared library (DLL) targets. The dependencies for the
RC file were incorrect, leading to cases of missed recompilation. The
'all' rule should not be overridden, so define an 'all-local' rule when
necessary. Fix the rule for running dlltool on the just generated DLL so
that it only fires when the correct dependencies change and do not
bother to run the rule when not building a DLL.

Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
2020-03-25 00:09:26 -07:00
Aleksandr Mezin
b454b9a4d3 Set project name for doxygen
Currently, generated documentation shows `My Project` as the title: see http://libusb.sourceforge.net/api-1.0/index.html
Set it to `libusb`.

Signed-off-by: Aleksandr Mezin <mezin.alexander@gmail.com>
2019-12-22 15:43:03 +01:00
Ludovic Rousseau
5a0788318f Doxygen: do not hardcode the sourceforge.net username
The username to use to login to web.sourceforge.net should be configured
in ~/.ssh/config so that different developers (with different login
names) can update the documentation.
2019-10-30 13:06:57 +01:00
Ludovic Rousseau
e9d6dc2a84 Doxygen: update config file from 1.8.8 to 1.8.16 2019-10-30 12:49:08 +01:00
Ludovic Rousseau
7924c1fc67 Doxygen: upgrade doxygen.cfg.in file
Warning: Tag `XML_SCHEMA' at line 942 of file `doxygen.cfg' has become obsolete.
         To avoid this warning please remove this line from your configuration file or upgrade it using "doxygen -u"
Warning: Tag `XML_DTD' at line 948 of file `doxygen.cfg' has become obsolete.
         To avoid this warning please remove this line from your configuration file or upgrade it using "doxygen -u"

I upgrade the doxygen.cfg.in using: "doxygen -u doxygen.cfg.in"

The configuration file changed from Doxyfile 1.5.3 to Doxyfile 1.8.8
2014-12-16 21:57:42 +01:00
Pete Batard
8eaf66c7af Documentation: Update the doxygen tagline
* Make it the same as the one used on the website and elsewhere
2014-03-20 00:03:56 +00:00
hjelmn@cs.unm.edu
1eff220474 Misc: Revert all references to libusb/libusb.info 2014-01-08 23:51:01 +00:00
Nathan Hjelm
7801ff94fa Add hotplug support.
The internal API is changing as follows:
 - Adding two new functions. usbi_connect_device, and usbi_disconnect_device.
   Backends must call these functions to add them to the context's device list
   at one of two places: initial enumeration (done at init), and on device
   attach and removal. These functions need to be called once per context.
 - Backends that support hotplug should not provide a get_device_list funtion.
   This function is now deprecated and will likely be removed once all backends
   support hotplug.

The external API is changing as follows:
 - Two new functions have been added to register and deregister callbacks for
   hotplug notification: libusb_hotplug_register_callback(),
   libusb_hotplug_deregister_callback(). Hotplug callbacks are called by
   libusb_handle_events(). Details of the new API can be found in libusb.h.
 - A new capability check has been added to check for hotplug support. See
   LIBUSB_CAP_HAS_HOTPLUG.

Aa suggested by Xiaofan add new example has been added to show how to use
the new external hotplug API. See examples/hotplugtest.c.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2013-05-15 17:28:06 +02:00
Pete Batard
517f9827c4 Doc: Fix doxygen warnings and issues
* Remove obsolete tags
* Use QUIET = yes to make issues more prominent
* Fix code display for LIBUSBX_API_VERSION and missing parameter
  documentation for libusb_get_port_path()
* Most of the above suggested by Ludovic Rousseau
2012-09-16 17:23:48 +01:00
Pete Batard
ca159f1573 Doc: Update doxygen for libusbx and add logo 2012-04-03 15:42:13 +01:00
Pete Batard
791b7473ec Misc: Rebrand to libusbx
* Mentions of 'libusb' in doxygen are changed to 'libusbx'
* Also update copyright notices and remove unneeded EOF LFs
2012-04-03 15:42:10 +01:00
Pete Batard
29f9f9e3af Introduced calling convention (for Windows)
Under Windows, a variety of compilers and configurations are available,
meaning that the manner of parameter passing (e.g. registers vs stack)
can vary.

Match the Windows API calling convention and document this appropriately.
This calling convention will be used regardless of the configuration of
the user's development platform.

The only user-level complication is that all functions used as libusb
callbacks must use the same calling convention as libusb. The
LIBUSB_CALL macro is provided to make this easy.

Signed-off-by: Michael Plante <michael.plante@gmail.com>
Signed-off-by: Pete Batard <pbatard@gmail.com>
[dsd: slight change of strategy, add documentation]
2010-08-23 18:48:55 -06:00
Daniel Drake
0e5b0fcb77 SourceForge website upload system changed 2008-11-21 11:00:47 +00:00
Aurelien Jarno
d25b566b3b Support for out-of-tree building
Contrary to libusb 0.1, libusb 1.0 does not support out-of-tree building
for the documentation part. This patch fixes that by using a
doxygen.cfg.in file, which contains @top_srcdir@ to refer to the
location of the libusb source code.
2008-11-02 15:05:47 +00:00
Daniel Drake
f3f17846dc remove "references" and "referenced by" listings in documentation 2008-05-02 12:32:46 +01:00
Daniel Drake
ead09cde68 API documentation
Hopefully mostly complete. Some constants were renamed and move into
enums.
2008-03-20 21:19:45 +00:00