PreviousUpNext

15.3.545  src/lib/std/src/socket/unix-domain-socket–premicrothread.api

## unix-domain-socket--premicrothread.api

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

#                               Love Your Tools!
#
#                 "It is said, with reason, that you may know
#                  the workman by his tools.
#
#                 "Independence is the sin qua non of creativity.
#
#                 "The essential difference between the true hacker and
#                  the drone programmer is that the true hacker breaks new
#                  ground, making computers do things they have never
#                  done before.
#
#                 "You will invariably break your tools when you do
#                  such work.  Thus, the hacker, like the traditional
#                  Swiss watchmaker, must be able to adapt or create his
#                  own tools as he goes along.
#
#                 "This is why C was born with Unix:  It took a new
#                  language and new compiler to express new thoughts.
#
#                 "If you can't strip down  and rebuild your compiler
#                  over a weekend, your range of possible achievement
#                  as a hacker will be severely limited.
#
#                 "Open source tools make this degree of control possible.
#
#                 "But only extended study motivated by a deep love of the
#                  art can make it a reality."
#
#                                               -- William Schiller




stipulate
    package ps  =  proto_socket__premicrothread;                                # proto_socket__premicrothread  is from   src/lib/std/src/socket/proto-socket--premicrothread.pkg
    package sg  =  socket_guts;                                                 # socket_guts                   is from   src/lib/std/src/socket/socket-guts.pkg

herein

    # This api is implemented in:
    #
    #     src/lib/std/src/socket/unix-domain-socket--premicrothread.pkg
    #
    api Unix_Domain_Socket__Premicrothread {
        #
        Unix;

        Socket(X)        =   sg::Socket( Unix, X );
        Stream_Socket(X) =   Socket( sg::Stream(X) );
        Datagram_Socket  =   Socket( sg::Datagram );

        Unix_Domain_Socket_Address
            =
            sg::Socket_Address( Unix );

        unix_address_family:  sg::af::Address_Family;                                           # 4.3BSD internal protocols 

        string_to_unix_domain_socket_address:    String -> Unix_Domain_Socket_Address;
        unix_domain_socket_address_to_string:  Unix_Domain_Socket_Address -> String;

        package stream:  api {
            #
            make_socket:       Void ->  Stream_Socket(X);
            make_socket_pair:  Void -> (Stream_Socket(X), Stream_Socket(X));
        };

        package datagram:  api {
            #
            make_socket:       Void -> Datagram_Socket;
            make_socket_pair:  Void -> (Datagram_Socket, Datagram_Socket);
        };



        #######################################################################
        # 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

             string_to_unix_domain_socket_address__syscall:    String -> ps::Internet_Address;
        set__string_to_unix_domain_socket_address__ref:      ({ lib_name: String, fun_name: String, io_call: (String -> ps::Internet_Address) } -> (String -> ps::Internet_Address)) -> Void;

             unix_domain_socket_address_to_string__syscall:    ps::Internet_Address -> String;
        set__unix_domain_socket_address_to_string__ref:      ({ lib_name: String, fun_name: String, io_call: (ps::Internet_Address -> String) } -> (ps::Internet_Address -> 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