% compiler: GNU Prolog 0.9.0 (Mar 16 1999)
% file    : sockets.pl
% date    : 4 16 1999
% time    : 15:53:52


file_name('/home/loews/loco/diaz/GNU-Prolog/src/BipsPl/sockets.pl').


predicate('$use_sockets'/0,27,static,private,built_in,[
    proceed]).


predicate(socket/2,30,static,private,built_in,[
    put_atom(socket,2),
    put_integer(2,3),
    call_c('Set_Bip_Name_2',[2,3]),
    call_c_test('Socket_2',[0,1]),
    proceed]).


predicate(socket_close/1,37,static,private,built_in,[
    put_atom(socket_close,1),
    put_integer(1,2),
    call_c('Set_Bip_Name_2',[1,2]),
    call_c_test('Socket_Close_1',[0]),
    proceed]).


predicate(socket_bind/2,44,static,private,built_in,[
    put_atom(socket_bind,2),
    put_integer(2,3),
    call_c('Set_Bip_Name_2',[2,3]),
    call_c_test('Socket_Bind_2',[0,1]),
    proceed]).


predicate(socket_connect/4,51,static,private,built_in,[
    allocate(5),
    get_variable(y(0),0),
    get_variable(y(1),1),
    get_variable(y(2),3),
    put_atom(socket_connect,0),
    put_integer(4,1),
    call_c('Set_Bip_Name_2',[0,1]),
    put_value(x(2),0),
    put_variable(y(3),1),
    call('$get_open_stm'/2),
    put_value(y(2),0),
    put_variable(y(4),1),
    call('$get_open_stm'/2),
    put_value(y(0),0),
    put_value(y(1),1),
    put_unsafe_value(y(3),2),
    put_unsafe_value(y(4),3),
    call_c_test('Socket_Connect_4',[0,1,2,3]),
    deallocate,
    proceed]).


predicate(socket_listen/2,60,static,private,built_in,[
    put_atom(socket_listen,2),
    put_integer(2,3),
    call_c('Set_Bip_Name_2',[2,3]),
    call_c_test('Socket_Listen_2',[0,1]),
    proceed]).


predicate(socket_accept/3,67,static,private,built_in,[
    allocate(4),
    get_variable(y(0),0),
    get_variable(y(1),2),
    put_atom(socket_accept,0),
    put_integer(3,2),
    call_c('Set_Bip_Name_2',[0,2]),
    put_value(x(1),0),
    put_variable(y(2),1),
    call('$get_open_stm'/2),
    put_value(y(1),0),
    put_variable(y(3),1),
    call('$get_open_stm'/2),
    put_value(y(0),0),
    put_void(1),
    put_unsafe_value(y(2),2),
    put_unsafe_value(y(3),3),
    call_c_test('Socket_Accept_4',[0,1,2,3]),
    deallocate,
    proceed]).


predicate(socket_accept/4,74,static,private,built_in,[
    allocate(6),
    get_variable(y(0),0),
    get_variable(y(1),1),
    get_variable(y(2),2),
    get_variable(y(3),3),
    put_atom(socket_accept,0),
    put_integer(4,1),
    call_c('Set_Bip_Name_2',[0,1]),
    put_value(y(1),0),
    call('$socket_accept/4_$aux1'/1),
    put_value(y(2),0),
    put_variable(y(4),1),
    call('$get_open_stm'/2),
    put_value(y(3),0),
    put_variable(y(5),1),
    call('$get_open_stm'/2),
    put_value(y(0),0),
    put_value(y(1),1),
    put_unsafe_value(y(4),2),
    put_unsafe_value(y(5),3),
    call_c_test('Socket_Accept_4',[0,1,2,3]),
    deallocate,
    proceed]).


predicate('$socket_accept/4_$aux1'/1,74,static,private,built_in,[
    load_cut_level(1),
    try_me_else(1),
    call_c_test('Blt_Var',[0]),
    cut(x(1)),
    proceed,

label(1),
    trust_me_else_fail,
    put_value(x(0),1),
    put_atom(variable,0),
    execute('$pl_err_type'/2)]).


predicate('$assoc_socket_streams'/3,85,static,private,built_in,[
    allocate(4),
    get_variable(y(0),0),
    get_variable(y(1),2),
    put_atom('$assoc_socket_streams',0),
    put_integer(3,2),
    call_c('Set_Bip_Name_2',[0,2]),
    put_value(x(1),0),
    put_variable(y(2),1),
    call('$get_open_stm'/2),
    put_value(y(1),0),
    put_variable(y(3),1),
    call('$get_open_stm'/2),
    put_value(y(0),0),
    put_unsafe_value(y(2),1),
    put_unsafe_value(y(3),2),
    call_c_test('Assoc_Socket_Streams_3',[0,1,2]),
    deallocate,
    proceed]).


predicate(hostname_address/2,94,static,private,built_in,[
    put_atom(hostname_address,2),
    put_integer(2,3),
    call_c('Set_Bip_Name_2',[2,3]),
    call_c_test('Hostname_Address_2',[0,1]),
    proceed]).
