src/sock_tcp.h
changeset 3 cc94ae754e2a
parent 2 a834f0559939
child 10 9fe218576d13
--- a/src/sock_tcp.h	Sun Feb 22 05:27:29 2009 +0200
+++ b/src/sock_tcp.h	Sun Feb 22 06:44:16 2009 +0200
@@ -18,20 +18,26 @@
 };
 
 #define SOCK_TCP_BASE(sock_ptr) (&(sock_ptr)->base)
+#define SOCK_TCP_ERR(sock_ptr) SOCK_ERR(SOCK_TCP_BASE(sock_ptr))
 
 /*
  * Allocate a new blank sock_tcp with a correctly initialized base
  */
-struct sock_tcp* sock_tcp_alloc (void);
+err_t sock_tcp_alloc (struct sock_tcp **sock_ptr);
 
 /*
  * Initialize a blank sock_tcp with a given already-existing fd
  */
-int sock_tcp_init_fd (struct sock_tcp *sock, int fd);
+err_t sock_tcp_init_fd (struct sock_tcp *sock, int fd);
 
 /*
  * Initialize a blank sock_tcp by connecting
  */
-int sock_tcp_init_connect (struct sock_tcp *sock, const char *hostname, const char *service);
+err_t sock_tcp_init_connect (struct sock_tcp *sock, const char *hostname, const char *service);
+
+/*
+ * Release a non-connected sock_tcp
+ */
+void sock_tcp_release (struct sock_tcp *sock);
 
 #endif /* SOCK_TCP_H */