% compiler: GNU Prolog 1.4.2
% file    : os_interf.pl


file_name('/home/diaz/GP/src/src/BipsPl/os_interf.pl').


predicate('$use_os_interf'/0,42,static,private,monofile,built_in,[
    proceed]).


predicate(make_directory/1,45,static,private,monofile,built_in,[
    call_c('Pl_Set_Bip_Name_Untagged_2',[by_value],[make_directory,1]),
    call_c('Pl_Make_Directory_1',[boolean],[x(0)]),
    proceed]).


predicate(delete_directory/1,52,static,private,monofile,built_in,[
    call_c('Pl_Set_Bip_Name_Untagged_2',[by_value],[delete_directory,2]),
    call_c('Pl_Delete_Directory_1',[boolean],[x(0)]),
    proceed]).


predicate(working_directory/1,59,static,private,monofile,built_in,[
    call_c('Pl_Set_Bip_Name_Untagged_2',[by_value],[working_directory,1]),
    call_c('Pl_Working_Directory_1',[boolean],[x(0)]),
    proceed]).


predicate(change_directory/1,66,static,private,monofile,built_in,[
    call_c('Pl_Set_Bip_Name_Untagged_2',[by_value],[change_directory,1]),
    call_c('Pl_Change_Directory_1',[boolean],[x(0)]),
    proceed]).


predicate(directory_files/2,72,static,private,monofile,built_in,[
    call_c('Pl_Set_Bip_Name_Untagged_2',[by_value],[directory_files,2]),
    call_c('Pl_Directory_Files_2',[boolean],[x(0),x(1)]),
    proceed]).


predicate(rename_file/2,79,static,private,monofile,built_in,[
    call_c('Pl_Set_Bip_Name_Untagged_2',[by_value],[rename_file,2]),
    call_c('Pl_Rename_File_2',[boolean],[x(0),x(1)]),
    proceed]).


predicate(unlink/1,86,static,private,monofile,built_in,[
    call_c('Pl_Set_Bip_Name_Untagged_2',[by_value],[unlink,2]),
    call_c('Pl_Unlink_1',[],[x(0)]),
    proceed]).


predicate(delete_file/1,93,static,private,monofile,built_in,[
    call_c('Pl_Set_Bip_Name_Untagged_2',[by_value],[delete_file,2]),
    call_c('Pl_Delete_File_1',[boolean],[x(0)]),
    proceed]).


predicate(file_exists/1,100,static,private,monofile,built_in,[
    call_c('Pl_Set_Bip_Name_Untagged_2',[by_value],[file_exists,1]),
    call_c('Pl_File_Exists_1',[boolean],[x(0)]),
    proceed]).


predicate(file_permission/2,105,static,private,monofile,built_in,[
    call_c('Pl_Set_Bip_Name_Untagged_2',[by_value],[file_permission,2]),
    call_c('Pl_File_Permission_2',[boolean],[x(0),x(1)]),
    proceed]).


predicate(file_property/2,112,static,private,monofile,built_in,[
    pragma_arity(3),
    get_current_choice(x(2)),
    allocate(3),
    get_variable(y(0),0),
    get_variable(y(1),1),
    get_variable(y(2),2),
    call_c('Pl_Set_Bip_Name_Untagged_2',[by_value],[file_property,2]),
    put_value(y(1),0),
    call('$check_file_prop'/1),
    cut(y(2)),
    put_value(y(1),0),
    put_value(y(0),1),
    deallocate,
    execute('$file_prop'/2)]).


predicate('$check_file_prop'/1,120,static,private,monofile,built_in,[
    try_me_else(1),
    call_c('Pl_Blt_Var',[fast_call,boolean],[x(0)]),
    proceed,

label(1),
    retry_me_else(19),
    switch_on_term(3,fail,fail,fail,2),

label(2),
    switch_on_structure([(absolute_file_name/1,4),(real_file_name/1,6),(type/1,8),(size/1,10),(permission/1,12),(creation/1,14),(last_access/1,16),(last_modification/1,18)]),

label(3),
    try_me_else(5),

label(4),
    get_structure(absolute_file_name/1,0),
    unify_void(1),
    proceed,

label(5),
    retry_me_else(7),

label(6),
    get_structure(real_file_name/1,0),
    unify_void(1),
    proceed,

label(7),
    retry_me_else(9),

label(8),
    get_structure(type/1,0),
    unify_void(1),
    proceed,

label(9),
    retry_me_else(11),

label(10),
    get_structure(size/1,0),
    unify_void(1),
    proceed,

label(11),
    retry_me_else(13),

label(12),
    get_structure(permission/1,0),
    unify_void(1),
    proceed,

label(13),
    retry_me_else(15),

label(14),
    get_structure(creation/1,0),
    unify_void(1),
    proceed,

label(15),
    retry_me_else(17),

label(16),
    get_structure(last_access/1,0),
    unify_void(1),
    proceed,

label(17),
    trust_me_else_fail,

label(18),
    get_structure(last_modification/1,0),
    unify_void(1),
    proceed,

label(19),
    trust_me_else_fail,
    put_value(x(0),1),
    put_atom(os_file_property,0),
    execute('$pl_err_domain'/2)]).


predicate('$file_prop'/2,145,static,private,monofile,built_in,[
    switch_on_term(2,fail,fail,fail,1),

label(1),
    switch_on_structure([(absolute_file_name/1,3),(real_file_name/1,5),(type/1,7),(size/1,9),(permission/1,11),(creation/1,13),(last_access/1,15),(last_modification/1,17)]),

label(2),
    try_me_else(4),

label(3),
    get_structure(absolute_file_name/1,0),
    unify_variable(x(0)),
    call_c('Pl_File_Prop_Absolute_File_Name_2',[boolean],[x(0),x(1)]),
    proceed,

label(4),
    retry_me_else(6),

label(5),
    get_structure(real_file_name/1,0),
    unify_variable(x(0)),
    call_c('Pl_File_Prop_Real_File_Name_2',[boolean],[x(0),x(1)]),
    proceed,

label(6),
    retry_me_else(8),

label(7),
    get_structure(type/1,0),
    unify_variable(x(0)),
    call_c('Pl_File_Prop_Type_2',[boolean],[x(0),x(1)]),
    proceed,

label(8),
    retry_me_else(10),

label(9),
    get_structure(size/1,0),
    unify_variable(x(0)),
    call_c('Pl_File_Prop_Size_2',[boolean],[x(0),x(1)]),
    proceed,

label(10),
    retry_me_else(12),

label(11),
    get_structure(permission/1,0),
    unify_variable(x(0)),
    call_c('Pl_Check_Prop_Perm_And_File_2',[boolean],[x(0),x(1)]),
    execute('$file_prop_perm'/2),

label(12),
    retry_me_else(14),

label(13),
    allocate(2),
    get_structure(creation/1,0),
    unify_variable(y(0)),
    get_variable(y(1),1),
    put_integer(0,0),
    put_integer(0,1),
    call('$sys_var_write'/2),
    put_value(y(0),0),
    put_value(y(1),1),
    deallocate,
    call_c('Pl_File_Prop_Date_2',[boolean],[x(0),x(1)]),
    proceed,

label(14),
    retry_me_else(16),

label(15),
    allocate(2),
    get_structure(last_access/1,0),
    unify_variable(y(0)),
    get_variable(y(1),1),
    put_integer(0,0),
    put_integer(1,1),
    call('$sys_var_write'/2),
    put_value(y(0),0),
    put_value(y(1),1),
    deallocate,
    call_c('Pl_File_Prop_Date_2',[boolean],[x(0),x(1)]),
    proceed,

label(16),
    trust_me_else_fail,

label(17),
    allocate(2),
    get_structure(last_modification/1,0),
    unify_variable(y(0)),
    get_variable(y(1),1),
    put_integer(0,0),
    put_integer(2,1),
    call('$sys_var_write'/2),
    put_value(y(0),0),
    put_value(y(1),1),
    deallocate,
    call_c('Pl_File_Prop_Date_2',[boolean],[x(0),x(1)]),
    proceed]).


predicate('$file_prop_perm'/2,174,static,private,monofile,built_in,[
    switch_on_term(2,1,fail,fail,fail),

label(1),
    switch_on_atom([(read,3),(write,5),(execute,7),(search,9)]),

label(2),
    try_me_else(4),

label(3),
    get_atom(read,0),
    put_value(x(1),0),
    put_atom(read,1),
    execute(file_permission/2),

label(4),
    retry_me_else(6),

label(5),
    get_atom(write,0),
    put_value(x(1),0),
    put_atom(write,1),
    execute(file_permission/2),

label(6),
    retry_me_else(8),

label(7),
    get_atom(execute,0),
    put_value(x(1),0),
    put_atom(execute,1),
    execute(file_permission/2),

label(8),
    trust_me_else_fail,

label(9),
    get_atom(search,0),
    put_value(x(1),0),
    put_atom(search,1),
    execute(file_permission/2)]).


predicate(temporary_name/2,189,static,private,monofile,built_in,[
    call_c('Pl_Set_Bip_Name_Untagged_2',[by_value],[temporary_name,2]),
    call_c('Pl_Temporary_Name_2',[boolean],[x(0),x(1)]),
    proceed]).


predicate(temporary_file/3,196,static,private,monofile,built_in,[
    call_c('Pl_Set_Bip_Name_Untagged_2',[by_value],[temporary_file,3]),
    call_c('Pl_Temporary_File_3',[boolean],[x(0),x(1),x(2)]),
    proceed]).


predicate(date_time/1,203,static,private,monofile,built_in,[
    call_c('Pl_Set_Bip_Name_Untagged_2',[by_value],[date_time,1]),
    call_c('Pl_Date_Time_1',[boolean],[x(0)]),
    proceed]).


predicate(host_name/1,210,static,private,monofile,built_in,[
    call_c('Pl_Set_Bip_Name_Untagged_2',[by_value],[host_name,1]),
    call_c('Pl_Host_Name_1',[boolean],[x(0)]),
    proceed]).


predicate(os_version/1,217,static,private,monofile,built_in,[
    call_c('Pl_Set_Bip_Name_Untagged_2',[by_value],[os_version,1]),
    call_c('Pl_Os_Version_1',[boolean],[x(0)]),
    proceed]).


predicate(architecture/1,224,static,private,monofile,built_in,[
    call_c('Pl_Set_Bip_Name_Untagged_2',[by_value],[architecture,1]),
    call_c('Pl_Architecture_1',[boolean],[x(0)]),
    proceed]).


predicate(shell/0,231,static,private,monofile,built_in,[
    call_c('Pl_Set_Bip_Name_Untagged_2',[by_value],[shell,0]),
    put_atom('',0),
    put_integer(0,1),
    call_c('Pl_Shell_2',[boolean],[x(0),x(1)]),
    proceed]).


predicate(shell/1,235,static,private,monofile,built_in,[
    call_c('Pl_Set_Bip_Name_Untagged_2',[by_value],[shell,1]),
    put_integer(0,1),
    call_c('Pl_Shell_2',[boolean],[x(0),x(1)]),
    proceed]).


predicate(shell/2,239,static,private,monofile,built_in,[
    call_c('Pl_Set_Bip_Name_Untagged_2',[by_value],[shell,2]),
    call_c('Pl_Shell_2',[boolean],[x(0),x(1)]),
    proceed]).


predicate(system/1,246,static,private,monofile,built_in,[
    call_c('Pl_Set_Bip_Name_Untagged_2',[by_value],[system,1]),
    put_integer(0,1),
    call_c('Pl_System_2',[boolean],[x(0),x(1)]),
    proceed]).


predicate(system/2,250,static,private,monofile,built_in,[
    call_c('Pl_Set_Bip_Name_Untagged_2',[by_value],[system,2]),
    call_c('Pl_System_2',[boolean],[x(0),x(1)]),
    proceed]).


predicate(spawn/2,257,static,private,monofile,built_in,[
    call_c('Pl_Set_Bip_Name_Untagged_2',[by_value],[spawn,2]),
    put_integer(0,2),
    call_c('Pl_Spawn_3',[boolean],[x(0),x(1),x(2)]),
    proceed]).


predicate(spawn/3,261,static,private,monofile,built_in,[
    call_c('Pl_Set_Bip_Name_Untagged_2',[by_value],[spawn,3]),
    call_c('Pl_Spawn_3',[boolean],[x(0),x(1),x(2)]),
    proceed]).


predicate(sleep/1,268,static,private,monofile,built_in,[
    call_c('Pl_Set_Bip_Name_Untagged_2',[by_value],[sleep,1]),
    call_c('Pl_Sleep_1',[],[x(0)]),
    proceed]).


predicate(popen/3,275,static,private,monofile,built_in,[
    allocate(3),
    get_variable(y(0),0),
    get_variable(y(1),1),
    call_c('Pl_Set_Bip_Name_Untagged_2',[by_value],[popen,3]),
    put_value(x(2),0),
    put_variable(y(2),1),
    call('$get_open_stm'/2),
    put_value(y(0),0),
    put_value(y(1),1),
    put_unsafe_value(y(2),2),
    deallocate,
    call_c('Pl_Popen_3',[boolean],[x(0),x(1),x(2)]),
    proceed]).


predicate(exec/5,287,static,private,monofile,built_in,[
    allocate(5),
    get_variable(y(0),0),
    get_variable(y(1),1),
    get_variable(y(2),2),
    get_variable(y(3),3),
    get_variable(y(4),4),
    call_c('Pl_Set_Bip_Name_Untagged_2',[by_value],[exec,5]),
    put_value(y(4),0),
    call('$exec/5_$aux1'/1),
    put_integer(0,0),
    put_integer(0,1),
    call('$sys_var_write'/2),
    put_integer(0,0),
    put_integer(0,1),
    call('$sys_var_set_bit'/2),
    put_value(y(0),0),
    put_value(y(1),1),
    put_value(y(2),2),
    put_value(y(3),3),
    put_value(y(4),4),
    deallocate,
    execute('$exec'/5)]).


predicate('$exec/5_$aux1'/1,287,static,private,monofile,local,[
    pragma_arity(2),
    get_current_choice(x(1)),
    try_me_else(1),
    call_c('Pl_Blt_Non_Var',[fast_call,boolean],[x(0)]),
    cut(x(1)),
    execute('$pl_err_uninstantiation'/1),

label(1),
    trust_me_else_fail,
    proceed]).


predicate(exec/4,299,static,private,monofile,built_in,[
    allocate(4),
    get_variable(y(0),0),
    get_variable(y(1),1),
    get_variable(y(2),2),
    get_variable(y(3),3),
    call_c('Pl_Set_Bip_Name_Untagged_2',[by_value],[exec,4]),
    put_integer(0,0),
    put_integer(0,1),
    call('$sys_var_write'/2),
    put_value(y(0),0),
    put_value(y(1),1),
    put_value(y(2),2),
    put_value(y(3),3),
    put_integer(0,4),
    deallocate,
    execute('$exec'/5)]).


predicate('$exec'/5,307,static,private,monofile,built_in,[
    allocate(7),
    get_variable(y(0),0),
    get_variable(y(1),2),
    get_variable(y(2),3),
    get_variable(y(3),4),
    put_value(x(1),0),
    put_variable(y(4),1),
    call('$get_open_stm'/2),
    put_value(y(1),0),
    put_variable(y(5),1),
    call('$get_open_stm'/2),
    put_value(y(2),0),
    put_variable(y(6),1),
    call('$get_open_stm'/2),
    put_value(y(0),0),
    put_unsafe_value(y(4),1),
    put_unsafe_value(y(5),2),
    put_unsafe_value(y(6),3),
    put_value(y(3),4),
    deallocate,
    call_c('Pl_Exec_5',[boolean],[x(0),x(1),x(2),x(3),x(4)]),
    proceed]).


predicate(create_pipe/2,317,static,private,monofile,built_in,[
    allocate(3),
    get_variable(y(0),1),
    call_c('Pl_Set_Bip_Name_Untagged_2',[by_value],[create_pipe,2]),
    put_variable(y(1),1),
    call('$get_open_stm'/2),
    put_value(y(0),0),
    put_variable(y(2),1),
    call('$get_open_stm'/2),
    put_unsafe_value(y(1),0),
    put_unsafe_value(y(2),1),
    deallocate,
    call_c('Pl_Create_Pipe_2',[boolean],[x(0),x(1)]),
    proceed]).


predicate(fork_prolog/1,326,static,private,monofile,built_in,[
    allocate(1),
    get_variable(y(0),0),
    call_c('Pl_Set_Bip_Name_Untagged_2',[by_value],[fork_prolog,1]),
    put_value(y(0),0),
    call('$fork_prolog/1_$aux1'/1),
    put_value(y(0),0),
    deallocate,
    call_c('Pl_Fork_Prolog_1',[boolean],[x(0)]),
    proceed]).


predicate('$fork_prolog/1_$aux1'/1,326,static,private,monofile,local,[
    pragma_arity(2),
    get_current_choice(x(1)),
    try_me_else(1),
    call_c('Pl_Blt_Non_Var',[fast_call,boolean],[x(0)]),
    cut(x(1)),
    execute('$pl_err_uninstantiation'/1),

label(1),
    trust_me_else_fail,
    proceed]).


predicate(select/5,337,static,private,monofile,built_in,[
    call_c('Pl_Set_Bip_Name_Untagged_2',[by_value],[select,5]),
    call_c('Pl_Select_5',[boolean],[x(0),x(1),x(2),x(3),x(4)]),
    proceed]).


predicate(prolog_pid/1,344,static,private,monofile,built_in,[
    call_c('Pl_Set_Bip_Name_Untagged_2',[by_value],[prolog_pid,1]),
    call_c('Pl_Prolog_Pid_1',[boolean],[x(0)]),
    proceed]).


predicate(send_signal/2,351,static,private,monofile,built_in,[
    call_c('Pl_Set_Bip_Name_Untagged_2',[by_value],[send_signal,2]),
    call_c('Pl_Send_Signal_2',[boolean],[x(0),x(1)]),
    proceed]).


predicate(wait/2,358,static,private,monofile,built_in,[
    call_c('Pl_Set_Bip_Name_Untagged_2',[by_value],[wait,2]),
    call_c('Pl_Wait_2',[boolean],[x(0),x(1)]),
    proceed]).
