Import Upstream version 20180207
[hcoop/debian/mlton.git] / doc / guide / localhost / ForeignFunctionInterface
1 <!DOCTYPE html>
2 <html lang="en">
3 <head>
4 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5 <meta name="generator" content="AsciiDoc 8.6.9">
6 <title>ForeignFunctionInterface</title>
7 <link rel="stylesheet" href="./asciidoc.css" type="text/css">
8 <link rel="stylesheet" href="./pygments.css" type="text/css">
9
10
11 <script type="text/javascript" src="./asciidoc.js"></script>
12 <script type="text/javascript">
13 /*<![CDATA[*/
14 asciidoc.install();
15 /*]]>*/
16 </script>
17 <link rel="stylesheet" href="./mlton.css" type="text/css">
18 </head>
19 <body class="article">
20 <div id="banner">
21 <div id="banner-home">
22 <a href="./Home">MLton 20180207</a>
23 </div>
24 </div>
25 <div id="header">
26 <h1>ForeignFunctionInterface</h1>
27 </div>
28 <div id="content">
29 <div id="preamble">
30 <div class="sectionbody">
31 <div class="paragraph"><p>MLton&#8217;s foreign function interface (FFI) extends Standard ML and makes
32 it easy to take the address of C global objects, access C global
33 variables, call from SML to C, and call from C to SML. MLton also
34 provides <a href="MLNLFFI">ML-NLFFI</a>, which is a higher-level FFI for calling
35 C functions and manipulating C data from SML.</p></div>
36 </div>
37 </div>
38 <div class="sect1">
39 <h2 id="_overview">Overview</h2>
40 <div class="sectionbody">
41 <div class="ulist"><ul>
42 <li>
43 <p>
44 <a href="ForeignFunctionInterfaceTypes">Foreign Function Interface Types</a>
45 </p>
46 </li>
47 <li>
48 <p>
49 <a href="ForeignFunctionInterfaceSyntax">Foreign Function Interface Syntax</a>
50 </p>
51 </li>
52 </ul></div>
53 </div>
54 </div>
55 <div class="sect1">
56 <h2 id="_importing_code_into_sml">Importing Code into SML</h2>
57 <div class="sectionbody">
58 <div class="ulist"><ul>
59 <li>
60 <p>
61 <a href="CallingFromSMLToC">Calling From SML To C</a>
62 </p>
63 </li>
64 <li>
65 <p>
66 <a href="CallingFromSMLToCFunctionPointer">Calling From SML To C Function Pointer</a>
67 </p>
68 </li>
69 </ul></div>
70 </div>
71 </div>
72 <div class="sect1">
73 <h2 id="_exporting_code_from_sml">Exporting Code from SML</h2>
74 <div class="sectionbody">
75 <div class="ulist"><ul>
76 <li>
77 <p>
78 <a href="CallingFromCToSML">Calling From C To SML</a>
79 </p>
80 </li>
81 </ul></div>
82 </div>
83 </div>
84 <div class="sect1">
85 <h2 id="_building_system_libraries">Building System Libraries</h2>
86 <div class="sectionbody">
87 <div class="ulist"><ul>
88 <li>
89 <p>
90 <a href="LibrarySupport">Library Support</a>
91 </p>
92 </li>
93 </ul></div>
94 </div>
95 </div>
96 </div>
97 <div id="footnotes"><hr></div>
98 <div id="footer">
99 <div id="footer-text">
100 </div>
101 <div id="footer-badges">
102 </div>
103 </div>
104 </body>
105 </html>