| 1 |
= MLNLFFI |
| 2 |
|
| 3 |
<<References#Blume01,ML-NLFFI>> is the no-longer-foreign-function interface |
| 4 |
library for SML. |
| 5 |
|
| 6 |
As of 20050212, MLton has an initial port of ML-NLFFI from SML/NJ to |
| 7 |
MLton. All of the ML-NLFFI functionality is present. |
| 8 |
|
| 9 |
Additionally, MLton has an initial port of the |
| 10 |
<<MLNLFFIGen#,mlnlffigen>> tool from SML/NJ to MLton. Due to low-level |
| 11 |
details, the code generated by SML/NJ's `ml-nlffigen` is not |
| 12 |
compatible with MLton, and vice-versa. However, the generated code |
| 13 |
has the same interface, so portable client code can be written. |
| 14 |
MLton's `mlnlffigen` does not currently support C functions with |
| 15 |
`struct` or `union` arguments. |
| 16 |
|
| 17 |
== Usage |
| 18 |
|
| 19 |
* You can import the ML-NLFFI Library into an MLB file with |
| 20 |
+ |
| 21 |
[options="header"] |
| 22 |
|=== |
| 23 |
|MLB file|Description |
| 24 |
|`$(SML_LIB)/mlnlffi-lib/mlnlffi-lib.mlb`| |
| 25 |
|=== |
| 26 |
|
| 27 |
* If you are porting a project from SML/NJ's <<CompilationManager#>> to |
| 28 |
MLton's <<MLBasis#,ML Basis system>> using `cm2mlb`, note that the |
| 29 |
following maps are included by default: |
| 30 |
+ |
| 31 |
---- |
| 32 |
# MLNLFFI Library |
| 33 |
$c $(SML_LIB)/mlnlffi-lib |
| 34 |
$c/c.cm $(SML_LIB)/mlnlffi-lib/mlnlffi-lib.mlb |
| 35 |
---- |
| 36 |
+ |
| 37 |
This will automatically convert a `$/c.cm` import in an input `.cm` |
| 38 |
file into a `$(SML_LIB)/mlnlffi-lib/mlnlffi-lib.mlb` import in the |
| 39 |
output `.mlb` file. |
| 40 |
|
| 41 |
== Also see |
| 42 |
|
| 43 |
* <<References#Blume01,Blume01>> |
| 44 |
* <<MLNLFFIImplementation#>> |
| 45 |
* <<MLNLFFIGen#>> |