summaryrefslogtreecommitdiff
path: root/lib/hstrerror.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/hstrerror.c')
-rw-r--r--lib/hstrerror.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/lib/hstrerror.c b/lib/hstrerror.c
new file mode 100644
index 000000000..87f7f6411
--- /dev/null
+++ b/lib/hstrerror.c
@@ -0,0 +1,24 @@
+#include "config.h"
+
+#ifdef WIN32
+#include <winsock.h>
+#else
+#include <netdb.h>
+#endif
+#include <errno.h>
+
+#include "xineintl.h"
+
+/**
+ * get error descriptions in DNS lookups
+ */
+const char *_xine_private_hstrerror(int err) {
+ switch (err) {
+ case 0: return _("No error");
+ case HOST_NOT_FOUND: return _("Unknown host");
+ case NO_DATA: return _("No address associated with name");
+ case NO_RECOVERY: return _("Unknown server error");
+ case TRY_AGAIN: return _("Host name lookup failure");
+ default: return _("Unknown error");
+ }
+}