summaryrefslogtreecommitdiffstats
path: root/otherlibs/labltk/support/support.ml
diff options
context:
space:
mode:
authorJacques Garrigue <garrigue at math.nagoya-u.ac.jp>1999-11-16 10:29:03 +0000
committerJacques Garrigue <garrigue at math.nagoya-u.ac.jp>1999-11-16 10:29:03 +0000
commit27c082c04663ff18459777e111aca4cde20df265 (patch)
treed74a2991f4712aa20929a763bb65997c16da94ff /otherlibs/labltk/support/support.ml
parent8f492b2886fb03a3c23f0d2581222445285d6d28 (diff)
leave labltk only in olabl branch
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@2536 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Diffstat (limited to 'otherlibs/labltk/support/support.ml')
-rw-r--r--otherlibs/labltk/support/support.ml61
1 files changed, 0 insertions, 61 deletions
diff --git a/otherlibs/labltk/support/support.ml b/otherlibs/labltk/support/support.ml
deleted file mode 100644
index 4f67d62c7..000000000
--- a/otherlibs/labltk/support/support.ml
+++ /dev/null
@@ -1,61 +0,0 @@
-(* $Id$ *)
-
-(* Extensible buffers *)
-type extensible_buffer = {
- mutable buffer : string;
- mutable pos : int;
- mutable len : int}
-
-let new_buffer () = {
- buffer = String.create len:128;
- pos = 0;
- len = 128
- }
-
-let print_in_buffer buf s =
- let l = String.length s in
- if buf.pos + l > buf.len then begin
- buf.buffer <- buf.buffer ^ (String.create len:(l+128));
- buf.len <- buf.len + 128 + l
- end;
- String.blit s pos:0 to:buf.buffer to_pos:buf.pos len:l;
- buf.pos <- buf.pos + l
-
-let get_buffer buf =
- String.sub buf.buffer pos:0 len:buf.pos
-
-
-
-(* Used by list converters *)
-let catenate_sep sep =
- function
- [] -> ""
- | [x] -> x
- | x::l ->
- let b = new_buffer() in
- print_in_buffer b x;
- List.iter l
- fun:(function s -> print_in_buffer b sep; print_in_buffer b s);
- get_buffer b
-
-(* Parsing results of Tcl *)
-(* List.split a string according to char_sep predicate *)
-let split_str char_sep str =
- let len = String.length str in
- let rec skip_sep cur =
- if cur >= len then cur
- else if char_sep str.[cur] then skip_sep (succ cur)
- else cur in
- let rec split beg cur =
- if cur >= len then
- if beg = cur then []
- else [String.sub str pos:beg len:(len - beg)]
- else if char_sep str.[cur]
- then
- let nextw = skip_sep cur in
- (String.sub str pos:beg len:(cur - beg))
- ::(split nextw nextw)
- else split beg (succ cur) in
- let wstart = skip_sep 0 in
- split wstart wstart
-