comp.lang.ada
 help / color / mirror / Atom feed
* Help with calling gethostbyname in Win32-winsock binding
@ 2000-08-04  0:00 Marin D. Condic
  2000-08-04  0:00 ` tmoran
  0 siblings, 1 reply; 3+ messages in thread
From: Marin D. Condic @ 2000-08-04  0:00 UTC (permalink / raw)


I'm trying to use the Win32-winsock interface provided with the GNAT
compiler to get the dotted quad(s) for the machine I'm running on. The
binding provides the following call:

    function gethostbyname(
                name: Win32.PCSTR)
               return PHOSTENT;

where:

    type PHOSTENT is access all HOSTENT;

    type HOSTENT is 
        record
            h_name     : Win32.PSTR;
            h_aliases  : PPCHAR;
            h_addrtype : Win32.SHORT;
            h_length   : Win32.SHORT;
            h_addr_list: PPCHAR;
        end record;

    type PPCHAR is access all Win32.PSTR;

What I'm having a hard time figuring out is how to actually call this
thing. The confusion lies with the multitude of data types here, in
particular the PPCHAR type which is supposed to be, as far as I can
figure, a pointer to a list of pointers to strings. Has anybody used
this before? Could someone possibly post a code segment that shows how
to declare appropriate parameters and access them? Thanks.

MDC
-- 
======================================================================
Marin David Condic - Quadrus Corporation - http://www.quadruscorp.com/
Send Replies To: m c o n d i c @ q u a d r u s c o r p . c o m
Visit my web site at:  http://www.mcondic.com/

"Nothing in the world is more dangerous than sincere ignorance and
conscientious stupidity."

    -- Martin Luther King, Jr
======================================================================




^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2000-08-05  0:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-08-04  0:00 Help with calling gethostbyname in Win32-winsock binding Marin D. Condic
2000-08-04  0:00 ` tmoran
2000-08-05  0:00   ` Marin D. Condic

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox