summaryrefslogtreecommitdiffstats
path: root/libaar/aar.h
diff options
context:
space:
mode:
Diffstat (limited to 'libaar/aar.h')
-rw-r--r--libaar/aar.h36
1 files changed, 36 insertions, 0 deletions
diff --git a/libaar/aar.h b/libaar/aar.h
new file mode 100644
index 0000000..92b5358
--- /dev/null
+++ b/libaar/aar.h
@@ -0,0 +1,36 @@
+#ifndef fooaarhfoo
+#define fooaarhfoo
+
+#include <sys/socket.h>
+#include <netdb.h>
+
+struct aar;
+typedef struct aar aar_t;
+
+struct aar_query;
+typedef struct aar_query aar_query_t;
+
+aar_t* aar_new(int n_proc);
+void aar_free(aar_t *aar);
+int aar_fd(aar_t *aar);
+int aar_wait(aar_t *aar, int block);
+
+aar_query_t* aar_getaddrinfo(aar_t *aar, const char *node, const char *service, const struct addrinfo *hints);
+int aar_getaddrinfo_done(aar_t *aar, aar_query_t* q, struct addrinfo **ret_res);
+
+aar_query_t* aar_getnameinfo(aar_t *aar, const struct sockaddr *sa, socklen_t salen, int flags, int gethost, int getserv);
+int aar_getnameinfo_done(aar_t *aar, aar_query_t* q, char *ret_host, size_t hostlen, char *ret_serv, size_t servlen);
+
+aar_query_t* aar_getnext(aar_t *aar);
+int aar_getnqueries(aar_t *aar);
+
+void aar_cancel(aar_t *aar, aar_query_t* q);
+
+void aar_freeaddrinfo(struct addrinfo *ai);
+
+int aar_isdone(aar_t *aar, aar_query_t*q);
+
+void aar_setuserdata(aar_t *aar, aar_query_t *q, void *userdata);
+void* aar_getuserdata(aar_t *aar, aar_query_t *q);
+
+#endif