File: ml-nlffigen.1

package info (click to toggle)
smlnj 110.79-4
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 82,508 kB
  • ctags: 117,516
  • sloc: ansic: 32,532; asm: 6,314; sh: 2,303; makefile: 1,821; perl: 1,170; pascal: 295; yacc: 190; cs: 78; python: 77; lisp: 19
file content (258 lines) | stat: -rw-r--r-- 6,145 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
.TH ml-nlffigen 1 "April 25, 2003"
.SH NAME
ml-nlffigen \- SML No Longer Foreign Function Interface tool
.SH SYNOPSIS
.B ml-nlffigen
.RI [ option ] 
-- 
.I file
.br
.SH DESCRIPTION
This manual page documents briefly the
.B ml-nlffigen
command.
This manual page was written for the Debian distribution
because the original program does not have a manual page.
.PP
.BR ml-nlffigen , 
a glue-code generator for
the new 
.SM NLFFI
foreign function interface.  The generator reads
C source code and emits ML code along with a description file for CM.
.SH OPTIONS
A summary of options is included below.
.IP "\fB-dir \fIdir" 4
.PD 0
.IP "\fB-d \fId" 4
.PD
Output directory where all generated files are placed. 
.BR default :
.IR NLFFI-Generated .
.IP "\fB-allSU"
.PD
Instructs 
.B ml-nlffigen 
to include all structs and unions,
even those that are defined in included files (as opposed
to files explicitly listed as arguments).
.BR default : 
.IR off .
.IP "\fB-width \fIw"
.PD 0
.IP "\fB-w \fIw"
.PD
Sets output line width (just a guess) to 
.IR w .
.BR default :
.IR 75 .
.IP "\fB-smloption \fIx"
.PD
Instructs 
.B ml-nlffigen 
to include 
.I x
into the list
of options to annotate .sml entries in the generated .cm
file with. 
.BR default : 
.IR noguid .
.IP "\fB-guid"
.PD
Removes the default
.B -noguid
from the list of sml options.
(This re-enables strict handling of type- and object-identity
but can have negative impact on CM cutoff recompilation
performance if the programmer routinely removes the entire
tree of ml-nlffigen-generated files during development.)
.IP "\fB-lambdasplit \fIx"
.PD 0
.IP "\fB-ls \fIx"
.PD
Instructs 
.B ml-nlffigen 
to generate "lambdasplit"
options for all ML files (see CM manual for what this means;
it does not currently work anyway because cross-module
inlining is broken). 
.BR default : 
nothing.
.IP "\fB-target \fIt"
.PD 0
.IP "\fB-t \fIt"
.PD
Sets the target to 
.I t 
(which must be one of "sparc-unix","x86-unix", or "x86-win32").
.BR default : 
current architecture.
.IP "\fB-light"
.PD 0
.IP "\fB-l"
.PD
Suppress "heavy" versions of function wrappers and
field accessors; also resets any earlier 
.B -heavy
to default. 
.BR default ": not suppressed."
.IP "\fB-heavy"
.PD 0
.IP "\fB-h"
.PD
suppress "light" versions of function wrappers and
field accessors; also resets any earlier 
.B -light 
to default.
.BR default ": not suppressed"
.IP "\fB-namedargs"
.PD 0
.IP "\fB-na"
.PD
Instruct 
.B ml-nlffigen 
to generated function wrappers that
use named arguments (ML records) instead of tuples if
there is enough information for this in the C source;
(this is not always very useful). 
.BR default ": off."
.IP "\fB-nocollect"
.PD
Do not do the following:
Collect enum constants from truly unnamed enumerations
(those without tags that occur at toplevel or in an
unnamed context, i.e., not in a typedef or another
named struct or union) into a single artificial
enumeration tagged by ' (single apostrohe).  The corresponding
ML-side representative will be a structure named E_'.
.IP "\fB-enum-constructors"
.PD 0
.IP "\fB-ec"
.PD
When possible (i.e., if all values of a given enumeration
are different from each other), make the ML representation
type of the enumeration a datatype.  The default (and
fallback) is to make that type the same as  
.BR MLRep.Signed.int .
.IP "\fB-libhandle \fIh"
.PD 0
.IP "\fB-lh \fIh"
.PD
Use the variable 
.I h
to refer to the handle to the
shared library object.  Given the constraints of CM, 
.I h
must have the form of a long ML identifier, e.g.,
.BR MyLibrary.libhandle . default : Library.libh .
.IP "\fB-include \fIf"
.PD 0
.IP "\fB-add \fIf"     
.PD
Mention file
.I f 
in the generated .cm file.  This option
is necessary at least once for providing the library handle.
It can be used arbitrarily many times, resulting in more
than one such programmer-supplied file to be mentioned.
If 
.I f 
is relative, then it must be relative to the directory
specified in the 
.BI -dir " dir"
option.
.IP "\fB-cmfile \fIf"
.PD 0
.IP "\fB-cm \fIf"
.PD
Specify name of the generated .cm file, relative to
the directory specified by the 
.BI -dir " dir"
option.
.BR default :
.IR nlffi-generated.cm .
.IP "\fB-cppopt \fIo"
.PD
The string 
.I o
gets added to the list of options to be
passed to cpp (the C preprocessor).  The list of options
gets substituted for 
.I %o 
in the cpp command line template.
.IP "\fB-U \fIx"
.PD
The string 
.BI -U x 
gets added to the list of cpp options.
.IP "\fB-D \fIx"
.PD
The string 
.BI -D x 
gets added to the list of cpp options.
.IP "\fB-I \fIx"
.PD
The string 
.BI -I x 
gets added to the list of cpp options.
.IP "\fB-version"
.PD
Just write the version number of 
.B ml-nlffigen 
to standard
output and then quit.
.IP "\fB-match \fIr"   
.PD 0
.IP "\fB-m \fIr"
.PD
Normally 
.B ml-nlffigen 
will include ML definitions for a C
declaration if the C declaration textually appears in
one of the files specified at the command line.  Definitions
in #include-d files will normally not appear (unless
their absence would lead to inconsistencies).
By specifying 
.BI -match r
, 
.B ml-nlffigen 
will also include
definitions that occur in recursively #include-d files
for which the 
.BR awk -style 
regular expression 
.I r 
matches their names.
.IP "\fB-prefix \fIp"
.PD 0
.IP "\fB-p \fIp"
.PD
Generated ML structure names will all have prefix 
.I p
(in addition to the usual "S_" or "U_" or "F_" ...)
.IP "\fB-gensym \fIg"
.IP "\fB-g \fIg"
Names "gensym-ed" by 
.B ml-nlffigen 
(for anonymous struct/union/
enums) will get an additional suffix 
.RI _ g.  
(This should
be used if output from several indepdendent runs of
.B ml-nlffigen 
are to coexist in the same ML program.)
.IP "\fB--"
Terminate processing of options, remaining arguments are
taken to be C sources.
.SH SEE ALSO
.BR sml (1),
.BR ml-build (1).
.br
This program described in more detail in
.I NLFFI: A new SML/NJ Foreign-Function Interface
, Matthias Blume,
which is available in
.IR /usr/share/doc/smlnj-doc/nlffi.pdf.gz .
.SH AUTHOR
This manual page was written by Aaron Matthew Read <amread@nyx.net>,
for the Debian GNU/Linux system (but may be used by others).