aboutsummaryrefslogtreecommitdiff
path: root/xs_curl.h
diff options
context:
space:
mode:
Diffstat (limited to 'xs_curl.h')
-rw-r--r--xs_curl.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/xs_curl.h b/xs_curl.h
index d98ac4c..0609a08 100644
--- a/xs_curl.h
+++ b/xs_curl.h
@@ -13,6 +13,8 @@ int xs_smtp_request(const char *url, const char *user, const char *pass,
const char *from, const char *to, const xs_str *body,
int use_ssl);
+const char *xs_curl_strerr(int errnum);
+
#ifdef XS_IMPLEMENTATION
#include <curl/curl.h>
@@ -240,6 +242,15 @@ int xs_smtp_request(const char *url, const char *user, const char *pass,
return (int)res;
}
+
+const char *xs_curl_strerr(int errnum)
+{
+ CURLcode cc = errnum < 0 ? -errnum : errnum;
+
+ return curl_easy_strerror(cc);
+}
+
+
#endif /* XS_IMPLEMENTATION */
#endif /* _XS_CURL_H */