From: Dr. Michael Lauer Date: Tue, 7 Apr 2015 15:52:22 +0000 (+0000) Subject: posix: add gethostbyname(3) and assorted struct X-Git-Tag: 0.29.1~13 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0d8aea145d90ab04a57e2868b0cc56693ddd7e8d;p=thirdparty%2Fvala.git posix: add gethostbyname(3) and assorted struct --- diff --git a/vapi/posix.vapi b/vapi/posix.vapi index 49311cf91..7a4baf5ad 100644 --- a/vapi/posix.vapi +++ b/vapi/posix.vapi @@ -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);