Home My Page Projects Code Snippets Project Openings SML/NJ
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files

SCM Repository

[smlnj] Annotation of /sml/releases/release-110.37/src/ml-nlffi-lib/iptr.sig
ViewVC logotype

Annotation of /sml/releases/release-110.37/src/ml-nlffi-lib/iptr.sig

Parent Directory Parent Directory | Revision Log Revision Log


Revision 837 - (view) (download) (as text)
Original Path: sml/trunk/src/ml-nlffi-lib/iptr.sig

1 : blume 837 (*
2 :     * iptr.sig Interface to an "incomplete" C pointer type.
3 :     *
4 :     * The code generated from a C interface (call it <A>) containing an
5 :     * "incomplete" type (i.e., a pointer to a named but otherwise undefined
6 :     * struct or union, call it <foo>) will be a functor that takes a structure
7 :     * argument representing this incomplete (pointer-)type. The signature
8 :     * for this argument structure is POINTER_TO_INCOMPLETE_TYPE.
9 :     *
10 :     * Therefore, for each incomplete struct <foo> there will be a functor
11 :     * argument
12 :     * structure I_S_<foo> : POINTER_TO_INCOMPLETE_TYPE
13 :     * and for each incomplete union <bar> there will be a functor argument
14 :     * structure I_U_<bar> : POINTER_TO_INCOMPLETE_TYPE
15 :     * in the definition of functor <A>.<A>Fn.
16 :     *
17 :     * Actual structures matching POINTER_TO_INCOMPLETE_TYPE can be generated
18 :     * using the functors PointerToCompleteType (see c-iptr-fn.sml) and
19 :     * PointerToIncompleteType (see i-iptr-fn.sml).
20 :     *
21 :     * (C) 2001, Lucent Technologies, Bell Labs
22 :     *
23 :     * author: Matthias Blume (blume@research.bell-labs.com)
24 :     *)
25 :     signature POINTER_TO_INCOMPLETE_TYPE = sig
26 :     type 'c iptr (* = (? su, unit, 'c) ptr *)
27 :     type 'c iptr' (* = (? su, unit, 'c) ptr' *)
28 :    
29 :     val typ'rw : C.rw iptr C.T.typ
30 :     val typ'ro : C.ro iptr C.T.typ
31 :    
32 :     val light : 'c iptr -> 'c iptr'
33 :     val heavy : 'c iptr' -> 'c iptr
34 :    
35 :     val get : ('pc iptr, 'c) C.obj -> 'pc iptr
36 :     val get' : ('pc iptr, 'c) C.obj' -> 'pc iptr'
37 :    
38 :     val set : ('pc iptr, C.rw) C.obj * 'pc iptr -> unit
39 :     val set' : ('pc iptr, C.rw) C.obj' * 'pc iptr' -> unit
40 :    
41 :     val set_voidptr : ('pc iptr, C.rw) C.obj * C.voidptr -> unit
42 :     val set_voidptr' : ('pc iptr, C.rw) C.obj' * C.voidptr -> unit
43 :    
44 :     val compare : 'c iptr * 'c iptr -> order
45 :     val compare' : 'c iptr' * 'c iptr' -> order
46 :    
47 :     val inject : 'c iptr -> C.voidptr
48 :     val inject' : 'c iptr' -> C.voidptr
49 :    
50 :     val cast : 'c iptr C.T.typ -> C.voidptr -> 'c iptr
51 :     val cast' : 'c iptr C.T.typ -> C.voidptr -> 'c iptr'
52 :    
53 :     val null : 'c iptr C.T.typ -> 'c iptr
54 :     val null' : 'c iptr'
55 :     end

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0