mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-29 08:14:31 +00:00
Estimated hours taken: 5 extras/dynamic_linking/dl.m: New module, containing support for dynamic linking (i.e. a binding to dlopen(), dlsym(), and dlclose()). extras/dynamic_linking/name_mangle.m: New module, containing a representation for Mercury procedure specifiers and a function for mangling them into symbol names. extras/dynamic_linking/dl_test.m: extras/dynamic_linking/dl_test.exp: extras/dynamic_linking/hello.m: A test case (and sample program) for the use of dynamic linking. extras/dynamic_linking/README: A brief README file describing the files in this directory. extras/dynamic_linking/Mmakefile: A simple Mmakefile to build it all and test it. NEWS: Mention the new dynamic linking support. compiler/llds_out.m: Add some comments warning about code duplication between the code here and that in extras/dynamic_linking/name_mangle.m (and also profiler/demangle.m and util/mdemangle.c).
16 lines
401 B
Mathematica
16 lines
401 B
Mathematica
% Example module for use with dynamic linking.
|
|
% The driver program dl_test.m dynamically loads the object code
|
|
% for this module and then calls the predicate hello/2.
|
|
|
|
% This source file is hereby placed in the public domain. -fjh (the author).
|
|
|
|
:- module hello.
|
|
:- interface.
|
|
:- import_module io.
|
|
|
|
:- pred hello(state::di, state::uo) is det.
|
|
|
|
:- implementation.
|
|
|
|
hello --> print("Hello, world\n").
|