const type: socketAddress is newtype;
IN_PARAM_IS_REFERENCE(socketAddress);
const proc: destroy (ref socketAddress: aValue) is action "BST_DESTR";
const proc: (ref socketAddress: dest) ::= (in socketAddress: source) is action "BST_CREATE";
const proc: (inout socketAddress: dest) := (in socketAddress: source) is action "BST_CPY";
const func socketAddress: _GENERATE_EMPTY_SOCKET_ADDRESS is action "BST_EMPTY";
const socketAddress: (attr socketAddress) . value is _GENERATE_EMPTY_SOCKET_ADDRESS;
const func boolean: (in socketAddress: addr1) = (in socketAddress: addr2) is action "BST_EQ";
const func boolean: (in socketAddress: addr1) <> (in socketAddress: addr2) is action "BST_NE";
const func integer: addrFamily (in socketAddress: address) is action "SOC_ADDR_FAMILY";
const func integer: compare (in socketAddress: addr1, in socketAddress: addr2) is action "BST_CMP";
const func integer: hashCode (in socketAddress: address) is action "BST_HASHCODE";
const func string: numericAddress (in socketAddress: address) is action "SOC_ADDR_NUMERIC";
const func string: service (in socketAddress: address) is action "SOC_ADDR_SERVICE";
const func socketAddress: inetSocketAddress (in string: hostName,
in integer: port) is action "SOC_INET_ADDR";
const func socketAddress: inetSocketAddress (in integer: port) is action "SOC_INET_LOCAL_ADDR";
const func socketAddress: inetListenerAddress (in integer: port) is action "SOC_INET_SERV_ADDR";
const func string: getHostname is action "SOC_GET_HOSTNAME";
const type: PRIMITIVE_SOCKET is newtype;
IN_PARAM_IS_VALUE(PRIMITIVE_SOCKET);
const proc: destroy (ref PRIMITIVE_SOCKET: aValue) is action "GEN_DESTR";
const proc: (ref PRIMITIVE_SOCKET: dest) ::= (in PRIMITIVE_SOCKET: source) is action "SOC_CREATE";
const proc: (inout PRIMITIVE_SOCKET: dest) := (in PRIMITIVE_SOCKET: source) is action "SOC_CPY";
const func boolean: (in PRIMITIVE_SOCKET: sock1) = (in PRIMITIVE_SOCKET: sock2) is action "SOC_EQ";
const func boolean: (in PRIMITIVE_SOCKET: sock1) <> (in PRIMITIVE_SOCKET: sock2) is action "SOC_NE";
const func PRIMITIVE_SOCKET: _GENERATE_EMPTY_PRIMITIVE_SOCKET is action "SOC_EMPTY";
const PRIMITIVE_SOCKET: (attr PRIMITIVE_SOCKET) . value is _GENERATE_EMPTY_PRIMITIVE_SOCKET;
const PRIMITIVE_SOCKET: PRIMITIVE_NULL_SOCKET is PRIMITIVE_SOCKET.value;
const proc: close (in PRIMITIVE_SOCKET: aSocket) is action "SOC_CLOSE";
const func socketAddress: localAddress (in PRIMITIVE_SOCKET: aSocket) is action "SOC_GET_LOCAL_ADDR";
const func socketAddress: peerAddress (in PRIMITIVE_SOCKET: aSocket) is action "SOC_GET_PEER_ADDR";
const func integer: ord (in PRIMITIVE_SOCKET: aSocket) is action "SOC_ORD";
const func char: getc (in PRIMITIVE_SOCKET: inSocket,
inout char: eofIndicator) is action "SOC_GETC";
const func string: gets (in PRIMITIVE_SOCKET: inSocket, in integer: maxLength,
inout char: eofIndicator) is action "SOC_GETS";
const func boolean: hasNext (in PRIMITIVE_SOCKET: inSocket) is action "SOC_HAS_NEXT";
const func string: word_read (in PRIMITIVE_SOCKET: inSocket,
inout char: terminationChar) is action "SOC_WORD_READ";
const func string: line_read (in PRIMITIVE_SOCKET: inSocket,
inout char: terminationChar) is action "SOC_LINE_READ";
const proc: write (in PRIMITIVE_SOCKET: outSocket, in string: stri) is action "SOC_WRITE";
const func integer: recv (in PRIMITIVE_SOCKET: inSocket, inout string: stri,
in integer: length, in integer: flags) is action "SOC_RECV";
const func integer: recvfrom (in PRIMITIVE_SOCKET: inSocket, inout string: stri,
in integer: length, in integer: flags,
inout socketAddress: address) is action "SOC_RECVFROM";
const func integer: send (in PRIMITIVE_SOCKET: outSocket, in string: stri,
in integer: flags) is action "SOC_SEND";
const func integer: sendto (in PRIMITIVE_SOCKET: outSocket, in string: stri,
in integer: flags, in socketAddress: address) is action "SOC_SENDTO";
const proc: setSockOpt (in PRIMITIVE_SOCKET: outSocket, in integer: optname,
in boolean: optval) is action "SOC_SET_OPT_BOOL";
const integer: SO_REUSEADDR is 1;
const func PRIMITIVE_SOCKET: PRIMITIVE_SOCKET (in integer: domain,
in integer: sockType,
in integer: protocol) is action "SOC_SOCKET";
const proc: connect (in PRIMITIVE_SOCKET: aSocket,
in socketAddress: address) is action "SOC_CONNECT";
const func PRIMITIVE_SOCKET: accept (in PRIMITIVE_SOCKET: listenerSocket,
inout socketAddress: address) is action "SOC_ACCEPT";
const proc: bind (in PRIMITIVE_SOCKET: listenerSocket,
in socketAddress: address) is action "SOC_BIND";
const proc: listen (in PRIMITIVE_SOCKET: listenerSocket,
in integer: backlog) is action "SOC_LISTEN";
const func boolean: inputReady (in PRIMITIVE_SOCKET: inSocket, in integer: seconds,
in integer: microSeconds) is action "SOC_INPUT_READY";