Core: Add a libusb_strerror() function
commit511ed18228dd097dfe6d5c6fd926eaea24435f64
authorHans de Goede <hdegoede@redhat.com>
Fri, 7 Jun 2013 18:07:16 +0000 (7 19:07 +0100)
committerPete Batard <pete@akeo.ie>
Sun, 9 Jun 2013 23:16:36 +0000 (10 00:16 +0100)
treefeac0f60d3f98ef91aa7413d227fe144cd3f2207
parent3604998dbec67ec098c802416d19cc7e1e93ee02
Core: Add a libusb_strerror() function

This patch adds the much requested libusb_strerror() function, taking into
account all issues people raised wrt previous attempts.

Criteria / Decisions underlying this implementation:
- Must support translated messages
- Must not use gettext as that does not work well in combination with Windows
 (when building with Visual C, or for Windows CE)
- API compatible with FreeBSD and various patched libusb-s floating around
- KISS:
 - Do not add any (other) library dependencies
 - Do not try to deal with message encodings (iconv), simply always return UTF-8
   making encoding the problem of the application using libusb_strerror.
 - Defaults to English, so apps which don't want translated messages,
   don't need to do anything special
 - Defaults to English (with pure ASCII messages), so apps which don't
   call libusb_setlocale() don't need to worry about encoding
20 files changed:
examples/xusb.c
libusb/Makefile.am
libusb/libusb-1.0.def
libusb/libusb.h
libusb/libusbi.h
libusb/strerror.c [new file with mode: 0644]
libusb/version_nano.h
msvc/libusb_dll_2005.vcproj
msvc/libusb_dll_2010.vcxproj
msvc/libusb_dll_2010.vcxproj.filters
msvc/libusb_dll_2012.vcxproj
msvc/libusb_dll_2012.vcxproj.filters
msvc/libusb_dll_wince.vcproj
msvc/libusb_sources
msvc/libusb_static_2005.vcproj
msvc/libusb_static_2010.vcxproj
msvc/libusb_static_2010.vcxproj.filters
msvc/libusb_static_2012.vcxproj
msvc/libusb_static_2012.vcxproj.filters
msvc/libusb_static_wince.vcproj