1:- module(env_dict, [initialize_env/0]).    2
    3% initialization for CGI on local mac.
    4
    5paths_to_exec([	CGIBIN,
    6				USERBIN,
    7				"/usr/local/bin/",
    8				"/Library/TeX/texbin/",
    9				"/bin/",
   10				"/usr/bin/"])	:-
   11		getenv(cgi_bin, CGIBIN),
   12		getenv(home, HOME),
   13		concat_atom([HOME, 'local/bin'], /, USERBIN).
   14%
   15expand_file_path(F, Full):- expand_file_name(F, [Full]).
   16%
   17initialize_env:-
   18	getenv(user, USER),
   19	getenv(home, HOME),
   20	paths_to_exec(Ps),
   21	maplist(expand_file_path, Ps, Qs),
   22	concat_atom(Qs, ':', P),
   23	setenv(path, P),
   24	getenv(home, HOME),
   25	concat_atom([HOME, public_html], /, Public_html),
   26	setenv(public_html_dir, Public_html),
   27	setenv(exercise_js_name, 'http_request.js'),
   28	setenv(http_prefix, 'http://localhost'),  % http://web.sfc.keio.ac.jp' for CNS.
   29	getenv(http_prefix, H),
   30	concat_atom([H, '/~', USER, /, 'cgi-bin'], C),
   31	setenv(cgi_prefix, C),
   32	setenv(notify_cgi_access_by_mail, false). 	% true for CNS