summaryrefslogtreecommitdiff
path: root/src/core/net-nonblock.h
diff options
context:
space:
mode:
authorTimo Sirainen <cras@irssi.org>2000-04-26 08:03:38 +0000
committercras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564>2000-04-26 08:03:38 +0000
commitc95034c6de1bf72536595e1e3431d8ec64b9880e (patch)
treee51aa4528257ed8aa9d53640649519f299aaf0c7 /src/core/net-nonblock.h
parentd01b094151705d433bc43cae9eeb304e6f110a17 (diff)
downloadirssi-c95034c6de1bf72536595e1e3431d8ec64b9880e.zip
..adding new files..
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@171 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src/core/net-nonblock.h')
-rw-r--r--src/core/net-nonblock.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/core/net-nonblock.h b/src/core/net-nonblock.h
new file mode 100644
index 00000000..6ae05e82
--- /dev/null
+++ b/src/core/net-nonblock.h
@@ -0,0 +1,26 @@
+#ifndef __NET_NONBLOCK_H
+#define __NET_NONBLOCK_H
+
+#include "network.h"
+
+typedef struct {
+ IPADDR ip; /* resolved ip addres */
+ int error; /* error, 0 = no error, -1 = error: */
+ int errlen; /* error text length */
+ char *errorstr; /* error string - dynamically allocated, you'll
+ need to free() it yourself unless it's NULL */
+} RESOLVED_IP_REC;
+
+typedef void (*NET_CALLBACK) (int, void *);
+
+/* nonblocking gethostbyname(), PID of the resolver child is returned. */
+int net_gethostname_nonblock(const char *addr, int pipe);
+/* get the resolved IP address. returns -1 if some error occured with read() */
+int net_gethostbyname_return(int pipe, RESOLVED_IP_REC *rec);
+
+/* Connect to server, call func when finished */
+int net_connect_nonblock(const char *server, int port, const IPADDR *my_ip, NET_CALLBACK func, void *data);
+/* Kill the resolver child */
+void net_disconnect_nonblock(int pid);
+
+#endif