%%% Part 4 - Standalone application generation %%%

% A few simple support predicates to make standalone cgi-bin applications
save_cgi_bin(_,_) :-
        write('*** save_cgi_bin/2: sorry, not available in this system'), nl,
        fail.

html_protect(Goal) :-
        call(Goal).
html_protect(_) :-
        html_report_error('Sorry, html_pl application failed.').

%%% Support predicates %%%

%% Concatenates two atoms
atom_concat(A,B,AB) :-
        name(A,AS),
        name(B,BS),
        det_append(AS,BS,ABS),
        name(AB,ABS).

% These work for now
atom_chars(A,S) :-
        name(A,S).
number_chars(N,S) :-
        name(N,S).

%% Get Unix environment variable
getenv(Var,Val) :- unix_getenv(Var,Val).

