]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
posix: add gethostbyname(3) and assorted struct
authorDr. Michael Lauer <mickey@vanille-media.de>
Wed, 8 Apr 2015 10:44:56 +0000 (10:44 +0000)
committerDr. Michael Lauer <mickey@vanille-media.de>
Wed, 8 Apr 2015 10:44:56 +0000 (10:44 +0000)
vapi/posix.vapi

index 49311cf91ba501d47b1efbb20a1e6af86df75e23..86316945393a96b1e1f999374e6ccca39e4f047d 100644 (file)
@@ -1432,6 +1432,8 @@ namespace Posix {
        public void freeaddrinfo (AddrInfo *res);
        [CCode (cheader_filename = "netdb.h")]
        public unowned string gai_strerror (int errcode);
+       [CCode (cheader_filename = "netdb.h")]
+       public unowned HostEnt gethostbyname (string name);
 
        [CCode (cname = "socklen_t", cheader_filename = "sys/socket.h", default_value = "0", has_type_id = false)]
        public struct socklen_t : int {
@@ -1483,6 +1485,17 @@ namespace Posix {
                public AddrInfo *ai_next;
        }
 
+       [CCode (cname = "struct hostent", cheader_filename = "netdb.h", destroy_function = "", has_type_id = false)]
+       public class HostEnt {
+               public string h_name;
+               [CCode (array_length=false, array_null_terminated=true)]
+               public string[] h_aliases;
+               public int h_addrtype;
+               public int h_length;
+               [CCode (array_length=false, array_null_terminated=true)]
+               public string[] h_addr_list;
+       }
+
        [CCode (cheader_filename = "sys/stat.h")]
        public int mkfifo (string filename, mode_t mode);