io: Fix race condition in handle_timeout()
[platform/upstream/libusb.git] / libusb / strerror.c
index 0212df8..d2be0e2 100644 (file)
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
-#include "config.h"
+
+#include <config.h>
 
 #include <locale.h>
 #include <stdlib.h>
 #include <string.h>
+#if defined(HAVE_STRINGS_H)
+#include <strings.h>
+#endif
 
-#include "libusb.h"
 #include "libusbi.h"
 
 #if defined(_MSC_VER)
 
 static size_t usbi_locale = 0;
 
-/** \ingroup misc
+/** \ingroup libusb_misc
  * How to add a new \ref libusb_strerror() translation:
  * <ol>
  * <li> Download the latest \c strerror.c from:<br>
- *      https://raw.github.com/libusbx/libusbx/master/libusb/sterror.c </li>
+ *      https://raw.github.com/libusb/libusb/master/libusb/sterror.c </li>
  * <li> Open the file in an UTF-8 capable editor </li>
  * <li> Add the 2 letter <a href="http://en.wikipedia.org/wiki/List_of_ISO_639-1_codes">ISO 639-1</a>
  *      code for your locale at the end of \c usbi_locale_supported[]<br>
@@ -53,11 +56,11 @@ static size_t usbi_locale = 0;
  *     }
  * };\endcode </li>
  * <li> Translate each of the English messages from the section you copied into your language </li>
- * <li> Save the file (in UTF-8 format) and send it to \c libusbx-devel\@lists.sourceforge.net </li>
+ * <li> Save the file (in UTF-8 format) and send it to \c libusb-devel\@lists.sourceforge.net </li>
  * </ol>
  */
 
-static const char* usbi_locale_supported[] = { "en", "nl", "fr" };
+static const char* usbi_locale_supported[] = { "en", "nl", "fr", "ru" };
 static const char* usbi_localized_errors[ARRAYSIZE(usbi_locale_supported)][LIBUSB_ERROR_COUNT] = {
        { /* English (en) */
                "Success",
@@ -103,11 +106,26 @@ static const char* usbi_localized_errors[ARRAYSIZE(usbi_locale_supported)][LIBUS
                "Appel système abandonné (peut-être à cause d’un signal)",
                "Mémoire insuffisante",
                "Opération non supportée or non implémentée sur cette plateforme",
-               "Autre erreur"
+               "Autre erreur",
+       }, { /* Russian (ru) */
+               "Успех",
+               "Ошибка ввода/вывода",
+               "Неверный параметр",
+               "Доступ запрещён (не хватает прав)",
+               "Устройство отсутствует (возможно, оно было отсоединено)",
+               "Элемент не найден",
+               "Ресурс занят",
+               "Истекло время ожидания операции",
+               "Переполнение",
+               "Ошибка канала",
+               "Системный вызов прерван (возможно, сигналом)",
+               "Память исчерпана",
+               "Операция не поддерживается данной платформой",
+               "Неизвестная ошибка"
        }
 };
 
-/** \ingroup misc
+/** \ingroup libusb_misc
  * Set the language, and only the language, not the encoding! used for
  * translatable libusb messages.
  *
@@ -158,7 +176,7 @@ int API_EXPORTED libusb_setlocale(const char *locale)
        return LIBUSB_SUCCESS;
 }
 
-/** \ingroup misc
+/** \ingroup libusb_misc
  * Returns a constant string with a short description of the given error code,
  * this description is intended for displaying to the end user and will be in
  * the language set by libusb_setlocale().