summaryrefslogtreecommitdiff
path: root/Build/source/utils/asymptote/genv.cc
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2012-05-31 00:02:26 +0000
committerKarl Berry <karl@freefriends.org>2012-05-31 00:02:26 +0000
commit19fc9fd9a26973d87fad437ce549ffaba479df54 (patch)
treef40a9d2592b3cf827970c8bf54a1eebf9cc8f9c0 /Build/source/utils/asymptote/genv.cc
parent24b3bac312553b2cc61e94fda581aba311967f5c (diff)
asy 2.16 sources
git-svn-id: svn://tug.org/texlive/trunk@26734 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/utils/asymptote/genv.cc')
-rw-r--r--Build/source/utils/asymptote/genv.cc14
1 files changed, 14 insertions, 0 deletions
diff --git a/Build/source/utils/asymptote/genv.cc b/Build/source/utils/asymptote/genv.cc
index ba0aea10d2f..396cf63d366 100644
--- a/Build/source/utils/asymptote/genv.cc
+++ b/Build/source/utils/asymptote/genv.cc
@@ -33,6 +33,8 @@ using namespace types;
using settings::getSetting;
using settings::Setting;
+// Dynamic loading of external libraries.
+types::record *transExternalModule(trans::genv& ge, string filename, symbol id);
namespace trans {
@@ -57,7 +59,19 @@ genv::genv()
#endif
}
+bool endswith(string suffix, string str)
+{
+ return std::equal(suffix.rbegin(), suffix.rend(), str.rbegin());
+}
+
record *genv::loadModule(symbol id, string filename) {
+ // Hackish way to load an external library.
+#if 0
+ if (endswith(".so", filename)) {
+ return transExternalModule(*this, filename, id);
+ }
+#endif
+
// Get the abstract syntax tree.
absyntax::file *ast = parser::parseFile(filename,"Loading");