OpenCog Framework  Branch: master, revision 6f0b7fc776b08468cf1b74aa9db028f387b4f0c0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
load-file.h
Go to the documentation of this file.
1 /*
2  * load-file.h
3  *
4  * Utility helper function -- load scheme code from a file
5  * Copyright (c) 2008 Linas Vepstas <linasvepstas@gmail.com>
6  *
7  * This program is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU Affero General Public License v3 as
9  * published by the Free Software Foundation and including the exceptions
10  * at http://opencog.org/wiki/Licenses
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU Affero General Public License
18  * along with this program; if not, write to:
19  * Free Software Foundation, Inc.,
20  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
21  */
22 
23 #ifndef OPENCOG_SERVER_LOAD_FILE_H_
24 #define OPENCOG_SERVER_LOAD_FILE_H_
25 
27 
28 namespace opencog {
34 #ifdef HAVE_GUILE
35 int load_scm_file (AtomSpace& as, const std::string& filename);
36 int load_scm_file_relative (AtomSpace& as, const std::string& filename,
37  std::vector<std::string> paths =
38  std::vector<std::string>());
39 void load_scm_files_from_config (AtomSpace& as,
40  std::vector<std::string> paths =
41  std::vector<std::string>());
42 #else
43 // If there is no guile, then load_scm_file() must always return
44 // an error (i.e. a non-zero return value).
45 static inline int load_scm_file (AtomSpace& as, const std::string&) { return 2; }
46 static inline int load_scm_file_relative (AtomSpace& as, const std::string&,
47  std::vector<std::string> =
48  std::vector<std::string>()) { return 2; }
49 static inline void load_scm_files_from_config (AtomSpace& as,
50  std::vector<std::string> =
51  std::vector<std::string>()) {}
52 #endif /* HAVE_GUILE */
53 
55 }
56 
57 #endif /* OPENCOG_SERVER_LOAD_FILE_H */
void load_scm_files_from_config(AtomSpace &atomSpace, std::vector< std::string > search_paths)
Definition: load-file.cc:112
int load_scm_file(AtomSpace &as, const std::string &filename)
Definition: load-file.cc:46
int load_scm_file_relative(AtomSpace &as, const std::string &filename, std::vector< std::string > search_paths)
Definition: load-file.cc:70