1 .TH ml-nlffigen 1 "April 25, 2003"
3 ml-nlffigen \- SML No Longer Foreign Function Interface tool
11 This manual page documents briefly the
14 This manual page was written for the Debian distribution
15 because the original program does not have a manual page.
18 a glue-code generator for
21 foreign function interface. The generator reads
22 C source code and emits ML code along with a description file for CM.
24 A summary of options is included below.
25 .IP "\fB-dir \fIdir" 4
29 Output directory where all generated files are placed.
36 to include all structs and unions,
37 even those that are defined in included files (as opposed
38 to files explicitly listed as arguments).
45 Sets output line width (just a guess) to
49 .IP "\fB-smloption \fIx"
56 of options to annotate .sml entries in the generated .cm
64 from the list of sml options.
65 (This re-enables strict handling of type- and object-identity
66 but can have negative impact on CM cutoff recompilation
67 performance if the programmer routinely removes the entire
68 tree of ml-nlffigen-generated files during development.)
69 .IP "\fB-lambdasplit \fIx"
75 to generate "lambdasplit"
76 options for all ML files (see CM manual for what this means;
77 it does not currently work anyway because cross-module
87 (which must be one of "sparc-unix","x86-unix", or "x86-win32").
94 Suppress "heavy" versions of function wrappers and
95 field accessors; also resets any earlier
98 .BR default ": not suppressed."
103 suppress "light" versions of function wrappers and
104 field accessors; also resets any earlier
107 .BR default ": not suppressed"
114 to generated function wrappers that
115 use named arguments (ML records) instead of tuples if
116 there is enough information for this in the C source;
117 (this is not always very useful).
121 Do not do the following:
122 Collect enum constants from truly unnamed enumerations
123 (those without tags that occur at toplevel or in an
124 unnamed context, i.e., not in a typedef or another
125 named struct or union) into a single artificial
126 enumeration tagged by ' (single apostrohe). The corresponding
127 ML-side representative will be a structure named E_'.
128 .IP "\fB-enum-constructors"
132 When possible (i.e., if all values of a given enumeration
133 are different from each other), make the ML representation
134 type of the enumeration a datatype. The default (and
135 fallback) is to make that type the same as
136 .BR MLRep.Signed.int .
137 .IP "\fB-libhandle \fIh"
143 to refer to the handle to the
144 shared library object. Given the constraints of CM,
146 must have the form of a long ML identifier, e.g.,
147 .BR MyLibrary.libhandle . default : Library.libh .
148 .IP "\fB-include \fIf"
154 in the generated .cm file. This option
155 is necessary at least once for providing the library handle.
156 It can be used arbitrarily many times, resulting in more
157 than one such programmer-supplied file to be mentioned.
160 is relative, then it must be relative to the directory
164 .IP "\fB-cmfile \fIf"
168 Specify name of the generated .cm file, relative to
169 the directory specified by the
173 .IR nlffi-generated.cm .
174 .IP "\fB-cppopt \fIo"
178 gets added to the list of options to be
179 passed to cpp (the C preprocessor). The list of options
182 in the cpp command line template.
187 gets added to the list of cpp options.
192 gets added to the list of cpp options.
197 gets added to the list of cpp options.
200 Just write the version number of
203 output and then quit.
210 will include ML definitions for a C
211 declaration if the C declaration textually appears in
212 one of the files specified at the command line. Definitions
213 in #include-d files will normally not appear (unless
214 their absence would lead to inconsistencies).
220 definitions that occur in recursively #include-d files
226 .IP "\fB-prefix \fIp"
230 Generated ML structure names will all have prefix
232 (in addition to the usual "S_" or "U_" or "F_" ...)
233 .IP "\fB-gensym \fIg"
237 (for anonymous struct/union/
238 enums) will get an additional suffix
241 be used if output from several indepdendent runs of
243 are to coexist in the same ML program.)
245 Terminate processing of options, remaining arguments are
246 taken to be C sources.
251 This program described in more detail in
252 .I No-Longer-Foreign: Teaching an ML compiler to speak C \"natively\"
254 which is available via <http://cm.bell-labs.com/who/blume/papers/nlffi.pdf>.
256 This manual page was written by Aaron Matthew Read <amread@nyx.net>,
257 for the Debian GNU/Linux system (but may be used by others).