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

SCM Repository

[smlnj] Diff of /sml/trunk/src/ml-nlffi-lib/c.sig
ViewVC logotype

Diff of /sml/trunk/src/ml-nlffi-lib/c.sig

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 975, Wed Oct 31 20:22:44 2001 UTC revision 1015, Tue Jan 15 21:46:00 2002 UTC
# Line 7  Line 7 
7   *)   *)
8  signature C = sig  signature C = sig
9    
10        exception OutOfMemory
11    
12      (* objects of type 't, constness 'c;      (* objects of type 't, constness 'c;
13       * The 't type variable will be instantiated with the object's "witness"       * The 't type variable will be instantiated with the object's "witness"
14       * type. The intention is that there be an isomorphism between such       * type. The intention is that there be an isomorphism between such
# Line 489  Line 491 
491      end      end
492    
493      (* allocating new objects *)      (* allocating new objects *)
494      val new : 't T.typ -> ('t, rw) obj option      val new : 't T.typ -> ('t, rw) obj
495    
496      (* alt *)      (* alt *)
497      val new' : 't S.size -> ('t, rw) obj' option      val new' : 't S.size -> ('t, rw) obj'
498    
499      (* freeing objects that were allocated earlier *)      (* freeing objects that were allocated earlier *)
500      val discard : ('t, 'c) obj -> unit      val discard : ('t, 'c) obj -> unit
# Line 501  Line 503 
503      val discard' : ('t, 'c) obj' -> unit      val discard' : ('t, 'c) obj' -> unit
504    
505      (* allocating a dynamically-sized array *)      (* allocating a dynamically-sized array *)
506      val alloc : 't T.typ -> word -> ('t, rw) ptr option      val alloc : 't T.typ -> word -> ('t, rw) ptr
507    
508      (* alt *)      (* alt *)
509      val alloc' : 't S.size -> word -> ('t, rw) ptr' option      val alloc' : 't S.size -> word -> ('t, rw) ptr'
510    
511      (* freeing through pointers *)      (* freeing through pointers *)
512      val free : ('t, 'c) ptr -> unit      val free : ('t, 'c) ptr -> unit
# Line 517  Line 519 
519    
520      (* alt; needs explicit type for the function pointer *)      (* alt; needs explicit type for the function pointer *)
521      val call' : ('a -> 'b) fptr T.typ -> ('a -> 'b) fptr' * 'a -> 'b      val call' : ('a -> 'b) fptr T.typ -> ('a -> 'b) fptr' * 'a -> 'b
522    
523        (* completely unsafe stuff that every C programmer just *loves* to do *)
524        structure U : sig
525            val fcast : 'a fptr' -> 'b fptr'
526            val p2i : voidptr -> ulong
527            val i2p : ulong -> voidptr
528        end
529  end  end

Legend:
Removed from v.975  
changed lines
  Added in v.1015

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