Resolver SWIs

Tom Hughes tom at compton.nu
Wed Sep 4 07:08:16 BST 2002


In message <eddd60704b.druck at druck.freeuk.net>
          David J. Ruck <druck at druck.org.uk> wrote:

> Any chance of support for the resolver module SWI's in OSLib?
> 
> Specifically Resolver_GetHostByName and Resolver_GetHost (ByAddr) and the
> hostent structure.

Attached is the definition for Resolver_GetHostByName that I've been
using - adding the ByAddr call shouldn't be difficult. I'll try and
get around to it at the weekend and commit the result.

Tom

-- 
Tom Hughes (tom at compton.nu)
http://www.compton.nu/
-------------- next part --------------
TITLE Resolver;

AUTHOR "Tom Hughes";

NEEDS Socket;

TYPE
  Resolver_HostDetails =
  .Struct
  (  .Ref .Char: name,
     .Ref .Ref .Char: aliases,
     Socket_AF: address_type,
     .Int: address_size,
     .Ref .Ref .Byte: addresses
  );

SWI
   Resolver_GetHostByName =
   (  NUMBER &46000 "Lookup a hostname string (single-tasking)",
      ENTRY
      (  R1 -> .Char: host_name
      ),
      EXIT
      (  R1! = .Ref Resolver_HostDetails: host_details
   )  )


More information about the oslib-user mailing list