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/trunk/src/ml-nlffi-lib/zstring.sig
ViewVC logotype

Annotation of /sml/trunk/src/ml-nlffi-lib/zstring.sig

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1078 - (view) (download) (as text)

1 : blume 837 (*
2 :     * Functions for translating between 0-terminated C strings and native
3 :     * ML strings.
4 :     *
5 :     * (C) 2001, Lucent Technologies, Bell Laboratories
6 :     *
7 : blume 975 * author: Matthias Blume (blume@research.bell-labs.com)
8 : blume 837 *)
9 :     signature ZSTRING = sig
10 :    
11 : blume 1078 type 'c zstring = (C.uchar, 'c) C.obj C.ptr
12 :     type 'c zstring' = (C.uchar, 'c) C.obj C.ptr'
13 : blume 837
14 :     (* the C strlen function *)
15 :     val length : 'c zstring -> int
16 :     val length' : 'c zstring' -> int
17 :    
18 :     (* make ML string from 0-terminated C string *)
19 :     val toML : 'c zstring -> string
20 :     val toML' : 'c zstring' -> string
21 :    
22 :     (* Copy contents of ML string into C string and add terminating 0. *)
23 :     val cpML : { from: string, to: C.rw zstring } -> unit
24 :     val cpML' : { from: string, to: C.rw zstring' } -> unit
25 :    
26 :     (* Make C-duplicate of ML string (allocate memory and then copy). *)
27 : blume 1021 val dupML : string -> 'c zstring
28 :     val dupML' : string -> 'c zstring'
29 : blume 837 end

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