PreviousUpNext

15.3.534  src/lib/std/src/socket/dns-host-lookup.api

## dns-host-lookup.api

# Compiled by:
#     src/lib/std/src/standard-core.sublib


stipulate
    package ns  =  number_string;                                       # number_string                         is from   src/lib/std/src/number-string.pkg
    package ps  =  proto_socket__premicrothread;                        # proto_socket__premicrothread          is from   src/lib/std/src/socket/proto-socket--premicrothread.pkg
herein

    # This api is implemented in:
    #
    #     src/lib/std/src/socket/dns-host-lookup.pkg
    #
    api Dns_Host_Lookup {
        #
        eqtype Internet_Address;
        eqtype Address_Family;

        Entry;

        name:             Entry -> String;
        aliases:          Entry -> List( String );

        address_type:     Entry -> Address_Family;
        address:          Entry -> Internet_Address;
        addresses:        Entry -> List( Internet_Address );

        get_by_name:      String -> Null_Or( Entry );
        get_by_address:   Internet_Address -> Null_Or( Entry );

        get_host_name:    Void -> String;

        scan:             ns::Reader (Char, X) -> ns::Reader (Internet_Address, X);

        from_string:      String -> Null_Or( Internet_Address );
        to_string:        Internet_Address -> String;


        #######################################################################
        # Below stuff is intended only for one-time use during
        # booting, to switch from direct to indirect syscalls:                  # For background see Note[1]            in   src/lib/std/src/unsafe/mythryl-callable-c-library-interface.pkg

        Hostent;

             get_host_by_name__syscall:  String -> Null_Or(Hostent);
        set__get_host_by_name__ref:      ({ lib_name: String, fun_name: String, io_call:  (String -> Null_Or(Hostent)) } -> (String -> Null_Or(Hostent))) -> Void;

             get_host_by_addr__syscall:  ps::Internet_Address -> Null_Or(Hostent);
        set__get_host_by_addr__ref:      ({ lib_name: String, fun_name: String, io_call: (ps::Internet_Address -> Null_Or(Hostent)) } -> (ps::Internet_Address -> Null_Or(Hostent))) -> Void;

             get_host_name__syscall:     Void -> String;
        set__get_host_name__ref:         ({ lib_name: String, fun_name: String, io_call: (Void -> String) } -> (Void -> String)) -> Void;
    };
end;

## COPYRIGHT (c) 1995 AT&T Bell Laboratories.
## Subsequent changes by Jeff Prothero Copyright (c) 2010-2015,
## released per terms of SMLNJ-COPYRIGHT.


Comments and suggestions to: bugs@mythryl.org

PreviousUpNext