1/* 2 * BEGIN LICENSE BLOCK 3 * Version: CMPL 1.1 4 * 5 * The contents of this file are subject to the Cisco-style Mozilla Public 6 * License Version 1.1 (the "License"); you may not use this file except 7 * in compliance with the License. You may obtain a copy of the License 8 * at www.eclipse-clp.org/license. 9 * 10 * Software distributed under the License is distributed on an "AS IS" 11 * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See 12 * the License for the specific language governing rights and limitations 13 * under the License. 14 * 15 * The Original Code is The ECLiPSe Constraint Logic Programming System. 16 * The Initial Developer of the Original Code is Cisco Systems, Inc. 17 * Portions created by the Initial Developer are 18 * Copyright (C) 1990,2006 Cisco Systems, Inc. All Rights Reserved. 19 * 20 * Contributor(s): Mireille Ducasse, ECRC. 21 * 22 * END LICENSE BLOCK 23 * 24 * $Id: opiumtop.pl,v 1.1 2006/09/23 01:54:34 snovello Exp $ 25 * 26 */ 27 28/* 29 * bootstrapping of Opium scenarios in module opium 30 * (loadfile is loadopium.pl) 31 */ 32 33:- module(opium_kernel). 34 35:- import extension/1 from sepia_kernel. 36:- global get_opium_file/2. /* for manual/1 */ 37 38:- (extension(development) -> 39 make_local_array(opiumdir), 40 getcwd(D), 41 setval(opiumdir, D), 42 compile_term([ 43 get_opiumdir(D) :- 44 getval(opiumdir, D) 45 ]) 46 ; 47 (import get_opiumdir/1 from sepia_kernel) 48 ). 49 50/* 51 * get_opium_file(+File, -OpFile) 52 * determines full name of File according to opiumdir 53 */ 54get_opium_file(File, OpFile) :- 55 get_opiumdir(Dir), 56 get_op_file(File, Dir, OpFile). 57 58get_op_file(File, Dir, OpFile) :- 59 concat_string([Dir, "/", File], OpFile), 60 exists(OpFile), 61 !. 62get_op_file(File, Dir, OpFile) :- 63 get_flag(prolog_suffix, Suff), 64 member(S, Suff), 65 concat_string([Dir, "/", File, S], OpFile), 66 exists(OpFile), 67 !. 68 69/* 70 * compile Opium loadfile 71 */ 72 73/* to avoid that file is dumped in compiled query 74 */ 75mycompile(F) :- 76 compile(F). 77 78:- argv(5, LoadF), 79 get_opium_file(LoadF, LoadFile), 80 mycompile(LoadFile). 81 82 83 84 85 86 87 88 89 90 91 92 93 94