[vala] posix.vapi: add inet_addr(3), inet_ntoa(3), htonl(3), htons(3), ntohl(3), ntohs(3), and InAddr



commit f6ba6826da5169f731eefb307a9da9ea81868fa7
Author: Michael 'Mickey' Lauer <mickey vanille-media de>
Date:   Sat Oct 24 14:40:36 2009 +0200

    posix.vapi: add inet_addr(3), inet_ntoa(3), htonl(3), htons(3), ntohl(3), ntohs(3), and InAddr
    
    Signed-off-by: Michael 'Mickey' Lauer <mickey vanille-media de>

 vapi/posix.vapi |   18 ++++++++++++++++++
 1 files changed, 18 insertions(+), 0 deletions(-)
---
diff --git a/vapi/posix.vapi b/vapi/posix.vapi
index af9227f..f2267a3 100644
--- a/vapi/posix.vapi
+++ b/vapi/posix.vapi
@@ -470,6 +470,19 @@ namespace Posix {
 	public unowned Group? getgrent ();
 	public void setgrent ();
 
+	[CCode (cheader_filename = "arpa/inet.h")]
+	public uint32 inet_addr (string host);
+	[CCode (cheader_filename = "arpa/inet.h")]
+	public weak string inet_ntoa (InAddr addr);
+	[CCode (cheader_filename = "arpa/inet.h")]
+	public uint32 htonl (uint32 hostlong);
+	[CCode (cheader_filename = "arpa/inet.h")]
+	public uint32 ntohl (uint32 netlong);
+	[CCode (cheader_filename = "arpa/inet.h")]
+	public uint16 htons (uint16 hostshort);
+	[CCode (cheader_filename = "arpa/inet.h")]
+	public uint16 ntohs (uint16 netshort);
+
 	[CCode (cheader_filename = "math.h")]
 	public double acos (double x);
 	[CCode (cheader_filename = "math.h")]
@@ -1239,6 +1252,11 @@ namespace Posix {
 	[CCode (cheader_filename = "sys/socket.h")]
 	public int socketpair (int domain, int type, int protocol, int[] sv);
 
+	[CCode (cname = "struct in_addr", cheader_filename = "sys/socket.h", destroy_function = "")]
+	public struct InAddr {
+		public uint32 s_addr;
+	}
+
 	[CCode (cname = "struct sock_addr", cheader_filename = "sys/socket.h", destroy_function = "")]
 	public struct SockAddr {
 	}



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]