% compiler: GNU Prolog 1.1.6 (Apr 13 2000)
% file    : os_interf.pl
% date    : 4 17 2000
% time    : 2:15:47


file_name('C:\\GNU-Prolog\\src\\BipsPl\\os_interf.pl').


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


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


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


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


predicate(change_directory/1,51,static,private,built_in,[
    put_atom(change_directory,1),
    put_integer(1,2),
    call_c('Set_Bip_Name_2',[1,2]),
    call_c_test('Change_Directory_1',[0]),
    proceed]).


predicate(directory_files/2,57,static,private,built_in,[
    put_atom(directory_files,2),
    put_integer(2,3),
    call_c('Set_Bip_Name_2',[2,3]),
    call_c_test('Directory_Files_2',[0,1]),
    proceed]).


predicate(rename_file/2,64,static,private,built_in,[
    put_atom(rename_file,2),
    put_integer(2,3),
    call_c('Set_Bip_Name_2',[2,3]),
    call_c_test('Rename_File_2',[0,1]),
    proceed]).


predicate(unlink/1,71,static,private,built_in,[
    put_atom(unlink,1),
    put_integer(2,2),
    call_c('Set_Bip_Name_2',[1,2]),
    call_c('Unlink_1',[0]),
    proceed]).


predicate(delete_file/1,78,static,private,built_in,[
    put_atom(delete_file,1),
    put_integer(2,2),
    call_c('Set_Bip_Name_2',[1,2]),
    call_c_test('Delete_File_1',[0]),
    proceed]).


predicate(file_exists/1,85,static,private,built_in,[
    put_atom(file_exists,1),
    put_integer(1,2),
    call_c('Set_Bip_Name_2',[1,2]),
    call_c_test('File_Exists_1',[0]),
    proceed]).


predicate(file_permission/2,90,static,private,built_in,[
    put_atom(file_permission,2),
    put_integer(2,3),
    call_c('Set_Bip_Name_2',[2,3]),
    call_c_test('File_Permission_2',[0,1]),
    proceed]).


predicate(file_property/2,97,static,private,built_in,[
    load_cut_level(2),
    allocate(3),
    get_variable(y(0),0),
    get_variable(y(1),1),
    get_variable(y(2),2),
    put_atom(file_property,0),
    put_integer(2,1),
    call_c('Set_Bip_Name_2',[0,1]),
    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,106,static,private,built_in,[
    try_me_else(1),
    call_c_test('Blt_Var',[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,131,static,private,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_test('File_Prop_Absolute_File_Name_2',[0,1]),
    proceed,

label(4),
    retry_me_else(6),

label(5),
    get_structure(real_file_name/1,0),
    unify_variable(x(0)),
    call_c_test('File_Prop_Real_File_Name_2',[0,1]),
    proceed,

label(6),
    retry_me_else(8),

label(7),
    get_structure(type/1,0),
    unify_variable(x(0)),
    call_c_test('File_Prop_Type_2',[0,1]),
    proceed,

label(8),
    retry_me_else(10),

label(9),
    get_structure(size/1,0),
    unify_variable(x(0)),
    call_c_test('File_Prop_Size_2',[0,1]),
    proceed,

label(10),
    retry_me_else(12),

label(11),
    get_structure(permission/1,0),
    unify_variable(x(0)),
    call_c_test('Check_Prop_Perm_And_File_2',[0,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),
    call_c_test('File_Prop_Date_2',[0,1]),
    deallocate,
    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),
    call_c_test('File_Prop_Date_2',[0,1]),
    deallocate,
    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),
    call_c_test('File_Prop_Date_2',[0,1]),
    deallocate,
    proceed]).


predicate('$file_prop_perm'/2,161,static,private,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,176,static,private,built_in,[
    put_atom(temporary_name,2),
    put_integer(2,3),
    call_c('Set_Bip_Name_2',[2,3]),
    call_c_test('Temporary_Name_2',[0,1]),
    proceed]).


predicate(temporary_file/3,183,static,private,built_in,[
    put_atom(temporary_file,3),
    put_integer(3,4),
    call_c('Set_Bip_Name_2',[3,4]),
    call_c_test('Temporary_File_3',[0,1,2]),
    proceed]).


predicate(date_time/1,190,static,private,built_in,[
    put_atom(date_time,1),
    put_integer(1,2),
    call_c('Set_Bip_Name_2',[1,2]),
    call_c_test('Date_Time_1',[0]),
    proceed]).


predicate(host_name/1,197,static,private,built_in,[
    put_atom(host_name,1),
    put_integer(1,2),
    call_c('Set_Bip_Name_2',[1,2]),
    call_c_test('Host_Name_1',[0]),
    proceed]).


predicate(os_version/1,204,static,private,built_in,[
    put_atom(os_version,1),
    put_integer(1,2),
    call_c('Set_Bip_Name_2',[1,2]),
    call_c_test('Os_Version_1',[0]),
    proceed]).


predicate(architecture/1,211,static,private,built_in,[
    put_atom(architecture,1),
    put_integer(1,2),
    call_c('Set_Bip_Name_2',[1,2]),
    call_c_test('Architecture_1',[0]),
    proceed]).


predicate(shell/0,218,static,private,built_in,[
    put_atom(shell,0),
    put_integer(0,1),
    call_c('Set_Bip_Name_2',[0,1]),
    put_atom('',0),
    put_integer(0,1),
    call_c_test('Shell_2',[0,1]),
    proceed]).


predicate(shell/1,222,static,private,built_in,[
    put_atom(shell,1),
    put_integer(1,2),
    call_c('Set_Bip_Name_2',[1,2]),
    put_integer(0,1),
    call_c_test('Shell_2',[0,1]),
    proceed]).


predicate(shell/2,226,static,private,built_in,[
    put_atom(shell,2),
    put_integer(2,3),
    call_c('Set_Bip_Name_2',[2,3]),
    call_c_test('Shell_2',[0,1]),
    proceed]).


predicate(system/1,233,static,private,built_in,[
    put_atom(system,1),
    put_integer(1,2),
    call_c('Set_Bip_Name_2',[1,2]),
    put_integer(0,1),
    call_c_test('System_2',[0,1]),
    proceed]).


predicate(system/2,237,static,private,built_in,[
    put_atom(system,2),
    put_integer(2,3),
    call_c('Set_Bip_Name_2',[2,3]),
    call_c_test('System_2',[0,1]),
    proceed]).


predicate(spawn/2,244,static,private,built_in,[
    put_atom(spawn,2),
    put_integer(2,3),
    call_c('Set_Bip_Name_2',[2,3]),
    put_integer(0,2),
    call_c_test('Spawn_3',[0,1,2]),
    proceed]).


predicate(spawn/3,248,static,private,built_in,[
    put_atom(spawn,3),
    put_integer(3,4),
    call_c('Set_Bip_Name_2',[3,4]),
    call_c_test('Spawn_3',[0,1,2]),
    proceed]).


predicate(sleep/1,255,static,private,built_in,[
    put_atom(sleep,1),
    put_integer(1,2),
    call_c('Set_Bip_Name_2',[1,2]),
    call_c('Sleep_1',[0]),
    proceed]).


predicate(popen/3,262,static,private,built_in,[
    allocate(3),
    get_variable(y(0),0),
    get_variable(y(1),1),
    put_atom(popen,0),
    put_integer(3,1),
    call_c('Set_Bip_Name_2',[0,1]),
    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),
    call_c_test('Popen_3',[0,1,2]),
    deallocate,
    proceed]).


predicate(exec/5,274,static,private,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),
    put_atom(exec,0),
    put_integer(5,1),
    call_c('Set_Bip_Name_2',[0,1]),
    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,274,static,private,built_in,[
    load_cut_level(1),
    try_me_else(1),
    call_c_test('Blt_Non_Var',[0]),
    cut(x(1)),
    put_value(x(0),1),
    put_atom(variable,0),
    execute('$pl_err_type'/2),

label(1),
    trust_me_else_fail,
    proceed]).


predicate(exec/4,284,static,private,built_in,[
    allocate(4),
    get_variable(y(0),0),
    get_variable(y(1),1),
    get_variable(y(2),2),
    get_variable(y(3),3),
    put_atom(exec,0),
    put_integer(4,1),
    call_c('Set_Bip_Name_2',[0,1]),
    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,292,static,private,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),
    call_c_test('Exec_5',[0,1,2,3,4]),
    deallocate,
    proceed]).


predicate(select/5,302,static,private,built_in,[
    put_atom(select,5),
    put_integer(5,6),
    call_c('Set_Bip_Name_2',[5,6]),
    call_c_test('Select_5',[0,1,2,3,4]),
    proceed]).


predicate(prolog_pid/1,310,static,private,built_in,[
    put_atom(prolog_pid,1),
    put_integer(1,2),
    call_c('Set_Bip_Name_2',[1,2]),
    call_c_test('Prolog_Pid_1',[0]),
    proceed]).


predicate(send_signal/2,317,static,private,built_in,[
    put_atom(send_signal,2),
    put_integer(2,3),
    call_c('Set_Bip_Name_2',[2,3]),
    call_c_test('Send_Signal_2',[0,1]),
    proceed]).


predicate(wait/2,324,static,private,built_in,[
    put_atom(wait,2),
    put_integer(2,3),
    call_c('Set_Bip_Name_2',[2,3]),
    call_c_test('Wait_2',[0,1]),
    proceed]).
