Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 42 lines (30 sloc) 1.348 kB
fccc685 Initial open-source release
MLstate authored
1 (*
2 Copyright © 2011 MLstate
3
4 This file is part of OPA.
5
6 OPA is free software: you can redistribute it and/or modify it under the
7 terms of the GNU Affero General Public License, version 3, as published by
8 the Free Software Foundation.
9
10 OPA is distributed in the hope that it will be useful, but WITHOUT ANY
11 WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12 FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for
13 more details.
14
15 You should have received a copy of the GNU Affero General Public License
16 along with OPA. If not, see <http://www.gnu.org/licenses/>.
17 *)
18 (*
19 * A private type of *non-functional* buffer
20 *
21 * Note: It's not serializable, nor is it meant to be.
22 *)
23
24
25 ##extern-type Buffer2_private.buffer = Buffer.t
26 ##register create \ `Buffer.create` : int -> Buffer2_private.buffer
27
28 ##register add \ `Buffer.add_string` : Buffer2_private.buffer, string -> void
29
30 ##register addln: Buffer2_private.buffer, string -> void
31 let addln buf s =
32 Buffer.add_string buf s;
33 Buffer.add_string buf "\n"
34
35 ##register contents \ `Buffer.contents` : Buffer2_private.buffer -> string
36
37 ##register is_empty: Buffer2_private.buffer -> bool
38 let is_empty buf = Buffer.length buf = 0
39
40 ##register reset: Buffer2_private.buffer, int -> void
41 let reset buf _i = Buffer.clear buf
Something went wrong with that request. Please try again.