src/sock_tcp.h
changeset 2 a834f0559939
parent 1 cf0e1bb6bcab
child 3 cc94ae754e2a
--- a/src/sock_tcp.h	Sun Feb 22 03:57:44 2009 +0200
+++ b/src/sock_tcp.h	Sun Feb 22 05:27:29 2009 +0200
@@ -20,8 +20,18 @@
 #define SOCK_TCP_BASE(sock_ptr) (&(sock_ptr)->base)
 
 /*
- * Create a new sock_tcp from the given fd, returning it as a sock_stream
+ * Allocate a new blank sock_tcp with a correctly initialized base
  */
-struct sock_stream* sock_tcp_new (int fd);
+struct sock_tcp* sock_tcp_alloc (void);
+
+/*
+ * Initialize a blank sock_tcp with a given already-existing fd
+ */
+int 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);
 
 #endif /* SOCK_TCP_H */