Import Debian changes 20180207-1
[hcoop/debian/mlton.git] / doc / guide / localhost / MLNLFFI
CommitLineData
7f918cf1
CE
1<!DOCTYPE html>\r
2<html lang="en">\r
3<head>\r
4<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">\r
5<meta name="generator" content="AsciiDoc 8.6.9">\r
6<title>MLNLFFI</title>\r
7<link rel="stylesheet" href="./asciidoc.css" type="text/css">\r
8<link rel="stylesheet" href="./pygments.css" type="text/css">\r
9\r
10\r
11<script type="text/javascript" src="./asciidoc.js"></script>\r
12<script type="text/javascript">\r
13/*<![CDATA[*/\r
14asciidoc.install();\r
15/*]]>*/\r
16</script>\r
17<link rel="stylesheet" href="./mlton.css" type="text/css">\r
18</head>\r
19<body class="article">\r
20<div id="banner">\r
21<div id="banner-home">\r
22<a href="./Home">MLton 20180207</a>\r
23</div>\r
24</div>\r
25<div id="header">\r
26<h1>MLNLFFI</h1>\r
27</div>\r
28<div id="content">\r
29<div id="preamble">\r
30<div class="sectionbody">\r
31<div class="paragraph"><p><a href="References#Blume01"> ML-NLFFI</a> is the no-longer-foreign-function interface\r
32library for SML.</p></div>\r
33<div class="paragraph"><p>As of 20050212, MLton has an initial port of ML-NLFFI from SML/NJ to\r
34MLton. All of the ML-NLFFI functionality is present.</p></div>\r
35<div class="paragraph"><p>Additionally, MLton has an initial port of the\r
36<a href="MLNLFFIGen">mlnlffigen</a> tool from SML/NJ to MLton. Due to low-level\r
37details, the code generated by SML/NJ&#8217;s <span class="monospaced">ml-nlffigen</span> is not\r
38compatible with MLton, and vice-versa. However, the generated code\r
39has the same interface, so portable client code can be written.\r
40MLton&#8217;s <span class="monospaced">mlnlffigen</span> does not currently support C functions with\r
41<span class="monospaced">struct</span> or <span class="monospaced">union</span> arguments.</p></div>\r
42</div>\r
43</div>\r
44<div class="sect1">\r
45<h2 id="_usage">Usage</h2>\r
46<div class="sectionbody">\r
47<div class="ulist"><ul>\r
48<li>\r
49<p>\r
50You can import the ML-NLFFI Library into an MLB file with\r
51</p>\r
52<table class="tableblock frame-all grid-all"\r
53style="\r
54width:100%;\r
55">\r
56<col style="width:50%;">\r
57<col style="width:50%;">\r
58<thead>\r
59<tr>\r
60<th class="tableblock halign-left valign-top" >MLB file</th>\r
61<th class="tableblock halign-left valign-top" >Description</th>\r
62</tr>\r
63</thead>\r
64<tbody>\r
65<tr>\r
66<td class="tableblock halign-left valign-top" ><p class="tableblock"><span class="monospaced">$(SML_LIB)/mlnlffi-lib/mlnlffi-lib.mlb</span></p></td>\r
67<td class="tableblock halign-left valign-top" ><p class="tableblock"></p></td>\r
68</tr>\r
69</tbody>\r
70</table>\r
71</li>\r
72<li>\r
73<p>\r
74If you are porting a project from SML/NJ&#8217;s <a href="CompilationManager">CompilationManager</a> to\r
75MLton&#8217;s <a href="MLBasis"> ML Basis system</a> using <span class="monospaced">cm2mlb</span>, note that the\r
76following maps are included by default:\r
77</p>\r
78<div class="listingblock">\r
79<div class="content monospaced">\r
80<pre># MLNLFFI Library\r
81$c $(SML_LIB)/mlnlffi-lib\r
82$c/c.cm $(SML_LIB)/mlnlffi-lib/mlnlffi-lib.mlb</pre>\r
83</div></div>\r
84<div class="paragraph"><p>This will automatically convert a <span class="monospaced">$/c.cm</span> import in an input <span class="monospaced">.cm</span>\r
85file into a <span class="monospaced">$(SML_LIB)/mlnlffi-lib/mlnlffi-lib.mlb</span> import in the\r
86output <span class="monospaced">.mlb</span> file.</p></div>\r
87</li>\r
88</ul></div>\r
89</div>\r
90</div>\r
91<div class="sect1">\r
92<h2 id="_also_see">Also see</h2>\r
93<div class="sectionbody">\r
94<div class="ulist"><ul>\r
95<li>\r
96<p>\r
97<a href="References#Blume01">Blume01</a>\r
98</p>\r
99</li>\r
100<li>\r
101<p>\r
102<a href="MLNLFFIImplementation">MLNLFFIImplementation</a>\r
103</p>\r
104</li>\r
105<li>\r
106<p>\r
107<a href="MLNLFFIGen">MLNLFFIGen</a>\r
108</p>\r
109</li>\r
110</ul></div>\r
111</div>\r
112</div>\r
113</div>\r
114<div id="footnotes"><hr></div>\r
115<div id="footer">\r
116<div id="footer-text">\r
117</div>\r
118<div id="footer-badges">\r
119</div>\r
120</div>\r
121</body>\r
122</html>\r