summaryrefslogtreecommitdiff
path: root/src/ne_socket.h
diff options
context:
space:
mode:
authorJoe Orton <notroj@users.noreply.github.com>2008-03-26 15:44:28 +0000
committerJoe Orton <notroj@users.noreply.github.com>2008-03-26 15:44:28 +0000
commitf7dcdcb6578546c4bb3822d39b368aac35e8ad19 (patch)
treecbdbd8e31824641f7c4c25d7656a50e7d40d671a /src/ne_socket.h
parente44c368875a428e47ea47f898ec645498ea9ee88 (diff)
downloadneon-git-f7dcdcb6578546c4bb3822d39b368aac35e8ad19.tar.gz
Add interface to set socket error string:
* src/ne_socket.c (ne_sock_set_error): New function. * src/ne_socket.h (ne_sock_set_error): New prototype. * test/socket.c (error): New test case.
Diffstat (limited to 'src/ne_socket.h')
-rw-r--r--src/ne_socket.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/ne_socket.h b/src/ne_socket.h
index 9895785..12092b0 100644
--- a/src/ne_socket.h
+++ b/src/ne_socket.h
@@ -207,6 +207,11 @@ int ne_sock_close(ne_socket *sock);
/* Return current error string for socket. */
const char *ne_sock_error(const ne_socket *sock);
+/* Set the error string for the socket; takes printf-like format
+ * string. */
+void ne_sock_set_error(ne_socket *sock, const char *format, ...)
+ ne_attribute((format (printf, 2, 3)));
+
/* Set read timeout for socket, in seconds; must be a non-zero
* positive integer. */
void ne_sock_read_timeout(ne_socket *sock, int timeout);