Skip to content
GitLab
Explore
Sign in
Register
Commits on Source (4)
New upstream version 1.7.3
· e90cb249
Stephane Glondu
authored
Aug 09, 2019
e90cb249
New upstream version 1.7.4
· d4b6b886
Stephane Glondu
authored
Aug 09, 2019
d4b6b886
New upstream version 1.7.5
· c304a338
Stephane Glondu
authored
Aug 09, 2019
c304a338
New upstream version 1.7.6
· 3973f47d
Stephane Glondu
authored
Aug 09, 2019
3973f47d
Show whitespace changes
Inline
Side-by-side
.gitignore
View file @
3973f47d
...
...
@@ -8,6 +8,8 @@
*.cma
*.cmxa
*.cmxs
*.cmt
*.cmti
/src/extBytes.mli
/src/doc/*.html
/test/extlib_test
...
...
.merlin
0 → 100644
View file @
3973f47d
S src
S test
B src
B test
.travis.yml
View file @
3973f47d
...
...
@@ -2,12 +2,31 @@ language: c
sudo
:
required
install
:
wget https://raw.githubusercontent.com/ocaml/ocaml-ci-scripts/master/.travis-opam.sh
script
:
bash -ex .travis-opam.sh
env
:
-
OCAML_VERSION=4.00
-
OCAML_VERSION=4.01
-
OCAML_VERSION=4.02
-
OCAML_VERSION=4.03
-
OCAML_VERSION=4.04
os
:
-
linux
-
osx
matrix
:
include
:
-
env
:
OCAML_VERSION=4.02
os
:
osx
-
env
:
OCAML_VERSION=4.03
os
:
osx
-
env
:
OCAML_VERSION=4.04
os
:
osx
-
env
:
OCAML_VERSION=4.05
os
:
osx
-
env
:
OCAML_VERSION=4.06
os
:
osx
-
env
:
OCAML_VERSION=4.02
os
:
linux
-
env
:
OCAML_VERSION=4.03
os
:
linux
-
env
:
OCAML_VERSION=4.04
os
:
linux
-
env
:
OCAML_VERSION=4.05
os
:
linux
-
env
:
OCAML_VERSION=4.06
os
:
linux
-
env
:
OCAML_VERSION=4.06 OPAM_SWITCH=4.06.1+32bit
os
:
linux
addons
:
apt
:
packages
:
-
gcc-multilib
CHANGES
View file @
3973f47d
1.7.6 (2019-03-03)
* fix Dllist.skip with negative argument (Virgile Robles)
* fix IO.read_bits 31 (Dan Korostelev)
1.7.5 (2018-07-08)
* IO: restore compilation on 32-bit (broken in 1.7.3)
* sync with OCaml 4.07
* install.ml is now deprecated, install with Makefile
+ IO: read_i32_as_int
1.7.4 (2018-03-12)
* fix tests with OCaml 4.06
1.7.3 (2018-03-11)
* String: faster slice
* sync with OCaml 4.06 (thx test/std.ml)
* IO: fix sign bug in read_i31
* IO: add write_i31 and bounds-checking on write_i32
* base64: add encode_string decode_string
* install cmt and cmti
1.7.2 (2017-03-29)
* sync with OCaml 4.05
...
...
LICENSE
View file @
3973f47d
The Library is distributed under the terms of the GNU L
ibrary
General
The Library is distributed under the terms of the GNU L
esser
General
Public License version 2 (included below).
As a special exception to the GNU L
ibrary
General Public License, you
As a special exception to the GNU L
esser
General Public License, you
may link, statically or dynamically, a "work that uses the Library"
with a publicly distributed version of the Library to produce an
executable file containing portions of the Library, and distribute
that executable file under terms of your choice, without any of the
additional requirements listed in clause 6 of the GNU L
ibrary
General
additional requirements listed in clause 6 of the GNU L
esser
General
Public License. By "a publicly distributed version of the Library",
we mean either the unmodified Library as distributed, or a
modified version of the Library that is distributed under the
conditions defined in clause
3
of the GNU L
ibrary
General Public
conditions defined in clause
2
of the GNU L
esser
General Public
License. This exception does not however invalidate any other reasons
why the executable file might be covered by the GNU L
ibrary
General
why the executable file might be covered by the GNU L
esser
General
Public License.
------------
...
...
Makefile
View file @
3973f47d
VERSION
:=
$(
shell git
--git-dir
=
.git describe
--always
--long
)
RELEASE
:=
1.7.
2
RELEASE
:=
1.7.
6
ifndef
VERSION
VERSION
:=
$(
RELEASE
)
...
...
appveyor.yml
View file @
3973f47d
...
...
@@ -2,12 +2,12 @@ platform:
-
x86
environment
:
CYG_ROOT
:
"
C:
\\
cygwin"
CYG_BASH
:
"
%CYG_ROOT%
\\
bin
\\
bash
-lc"
FORK_USER
:
ocaml
FORK_BRANCH
:
master
CYG_ROOT
:
C:\cygwin64
install
:
-
appveyor DownloadFile https://raw.githubusercontent.com/ocaml/ocaml-ci-scripts/master/appveyor-opam.sh
-
"
%CYG_ROOT%
\\
setup-x86.exe
-qnNdO
-R
%CYG_ROOT%
-s
http://cygwin.mirror.constant.com
-l
C:/cygwin/var/cache/setup
-P
rsync
-P
patch
-P
diffutils
-P
make
-P
unzip
-P
git
-P
m4
-P
perl
-P
mingw64-x86_64-gcc-core"
-
ps
:
iex ((new-object net.webclient).DownloadString("https://raw.githubusercontent.com/$env:FORK_USER/ocaml-ci-scripts/$env:FORK_BRANCH/appveyor-install.ps1"))
build_script
:
-
"
%CYG_BASH%
'${
APPVEYOR_BUILD_FOLDER
}/
appveyor-opam.sh
'"
-
call %CYG_ROOT%\bin\bash.exe -l %
APPVEYOR_BUILD_FOLDER
%\
appveyor-opam.sh
opam
View file @
3973f47d
opam-version: "
1.2
"
opam-version: "
2.0
"
maintainer: "ygrek@autistici.org"
homepage: "https://github.com/ygrek/ocaml-extlib"
dev-repo: "git://github.com/ygrek/ocaml-extlib.git"
bug-reports: "https://github.com/ygrek/ocaml-extlib/issues"
doc: ["http://ygrek.org.ua/p/extlib/doc/"]
license: "LGPL-2.1 with OCaml linking exception"
synopsis: "A complete yet small extension for OCaml standard library"
authors: [
"Nicolas Cannasse"
"Brian Hurt"
...
...
@@ -21,15 +22,17 @@ authors: [
]
build: [
[make "minimal=1" "build"]
[make "test"] {with-test}
[make "doc"] {with-doc}
]
install: [ [make "minimal=1" "install"] ]
build-doc: [ [make "doc"] ]
build-test: [ [make "test"] ]
remove: [
["ocamlfind" "remove" "extlib"]
]
depends: [
"ocaml"
"ocamlfind" {build}
"cppo" {build}
"base-bytes" {build}
]
flags: light-uninstall
src/IO.ml
View file @
3973f47d
...
...
@@ -494,19 +494,26 @@ let read_i16 i =
else
n
let
read_i32
ch
=
let
sign_bit_i32
=
lnot
0x7FFF_FFFF
let
read_32
~
i31
ch
=
let
ch1
=
read_byte
ch
in
let
ch2
=
read_byte
ch
in
let
ch3
=
read_byte
ch
in
let
ch4
=
read_byte
ch
in
if
ch4
land
128
<>
0
then
begin
if
ch4
land
64
=
0
then
raise
(
Overflow
"read_i3
2
"
);
ch1
lor
(
ch2
lsl
8
)
lor
(
ch3
lsl
16
)
lor
((
ch4
land
127
)
lsl
24
)
if
i31
&&
ch4
land
64
=
0
then
raise
(
Overflow
"read_i3
1
"
);
ch1
lor
(
ch2
lsl
8
)
lor
(
ch3
lsl
16
)
lor
((
ch4
land
127
)
lsl
24
)
lor
sign_bit_i32
end
else
begin
if
ch4
land
64
<>
0
then
raise
(
Overflow
"read_i3
2
"
);
if
i31
&&
ch4
land
64
<>
0
then
raise
(
Overflow
"read_i3
1
"
);
ch1
lor
(
ch2
lsl
8
)
lor
(
ch3
lsl
16
)
lor
(
ch4
lsl
24
)
end
let
read_i31
ch
=
read_32
~
i31
:
true
ch
let
read_i32_as_int
ch
=
read_32
~
i31
:
false
ch
let
read_i32
=
read_i31
let
read_real_i32
ch
=
let
ch1
=
read_byte
ch
in
let
ch2
=
read_byte
ch
in
...
...
@@ -559,12 +566,24 @@ let write_i16 ch n =
else
write_ui16
ch
n
let
write_
i
32
ch
n
=
let
write_32
ch
n
=
write_byte
ch
n
;
write_byte
ch
(
n
lsr
8
);
write_byte
ch
(
n
lsr
16
);
write_byte
ch
(
n
asr
24
)
let
write_i31
ch
n
=
#
ifndef
WORD_SIZE_32
if
n
<
-
0x4000_0000
||
n
>
0x3FFF_FFFF
then
raise
(
Overflow
"write_i31"
);
#
endif
write_32
ch
n
let
write_i32
ch
n
=
#
ifndef
WORD_SIZE_32
if
n
<
-
0x8000_0000
||
n
>
0x7FFF_FFFF
then
raise
(
Overflow
"write_i32"
);
#
endif
write_32
ch
n
let
write_real_i32
ch
n
=
let
base
=
Int32
.
to_int
n
in
let
big
=
Int32
.
to_int
(
Int32
.
shift_right_logical
n
24
)
in
...
...
@@ -602,19 +621,26 @@ let read_i16 i =
else
n
let
read_i32
ch
=
let
sign_bit_i32
=
lnot
0x7FFF_FFFF
let
read_32
~
i31
ch
=
let
ch4
=
read_byte
ch
in
let
ch3
=
read_byte
ch
in
let
ch2
=
read_byte
ch
in
let
ch1
=
read_byte
ch
in
if
ch4
land
128
<>
0
then
begin
if
ch4
land
64
=
0
then
raise
(
Overflow
"read_i3
2
"
);
ch1
lor
(
ch2
lsl
8
)
lor
(
ch3
lsl
16
)
lor
((
ch4
land
127
)
lsl
24
)
if
i31
&&
ch4
land
64
=
0
then
raise
(
Overflow
"read_i3
1
"
);
ch1
lor
(
ch2
lsl
8
)
lor
(
ch3
lsl
16
)
lor
((
ch4
land
127
)
lsl
24
)
lor
sign_bit_i32
end
else
begin
if
ch4
land
64
<>
0
then
raise
(
Overflow
"read_i3
2
"
);
if
i31
&&
ch4
land
64
<>
0
then
raise
(
Overflow
"read_i3
1
"
);
ch1
lor
(
ch2
lsl
8
)
lor
(
ch3
lsl
16
)
lor
(
ch4
lsl
24
)
end
let
read_i31
ch
=
read_32
~
i31
:
true
ch
let
read_i32_as_int
ch
=
read_32
~
i31
:
false
ch
let
read_i32
=
read_i31
let
read_real_i32
ch
=
let
big
=
Int32
.
shift_left
(
Int32
.
of_int
(
read_byte
ch
))
24
in
let
ch3
=
read_byte
ch
in
...
...
@@ -651,12 +677,24 @@ let write_i16 ch n =
else
write_ui16
ch
n
let
write_
i
32
ch
n
=
let
write_32
ch
n
=
write_byte
ch
(
n
asr
24
);
write_byte
ch
(
n
lsr
16
);
write_byte
ch
(
n
lsr
8
);
write_byte
ch
n
let
write_i31
ch
n
=
#
ifndef
WORD_SIZE_32
if
n
<
-
0x4000_0000
||
n
>
0x3FFF_FFFF
then
raise
(
Overflow
"write_i31"
);
#
endif
write_32
ch
n
let
write_i32
ch
n
=
#
ifndef
WORD_SIZE_32
if
n
<
-
0x8000_0000
||
n
>
0x7FFF_FFFF
then
raise
(
Overflow
"write_i32"
);
#
endif
write_32
ch
n
let
write_real_i32
ch
n
=
let
base
=
Int32
.
to_int
n
in
let
big
=
Int32
.
to_int
(
Int32
.
shift_right_logical
n
24
)
in
...
...
@@ -714,7 +752,7 @@ let rec read_bits b n =
end
else
begin
let
k
=
read_byte
b
.
ch
in
if
b
.
nbits
>=
24
then
begin
if
n
>
=
31
then
raise
Bits_error
;
if
n
>
31
then
raise
Bits_error
;
let
c
=
8
+
b
.
nbits
-
n
in
let
d
=
b
.
bits
land
((
1
lsl
b
.
nbits
)
-
1
)
in
let
d
=
(
d
lsl
(
8
-
c
))
lor
(
k
lsr
c
)
in
...
...
src/IO.mli
View file @
3973f47d
...
...
@@ -207,9 +207,15 @@ val read_ui16 : input -> int
val
read_i16
:
input
->
int
(** Read a signed 16-bit word. *)
val
read_i3
2
:
input
->
int
val
read_i3
1
:
input
->
int
(** Read a signed 32-bit integer. Raise [Overflow] if the
read integer cannot be represented as a Caml 31-bit integer. *)
read integer cannot be represented as an OCaml 31-bit integer. *)
val
read_i32
:
input
->
int
(** Deprecated, same as read_i31 *)
val
read_i32_as_int
:
input
->
int
(** Read a signed 32-bit integer, represented as OCaml integer, wrapping around 31-bit int on 32-bit architecture *)
val
read_real_i32
:
input
->
int32
(** Read a signed 32-bit integer as an OCaml int32. *)
...
...
@@ -241,6 +247,9 @@ val write_ui16 : 'a output -> int -> unit
val
write_i16
:
'
a
output
->
int
->
unit
(** Write a signed 16-bit word. *)
val
write_i31
:
'
a
output
->
int
->
unit
(** Write a signed 31-bit integer as 4 bytes. *)
val
write_i32
:
'
a
output
->
int
->
unit
(** Write a signed 32-bit integer. *)
...
...
@@ -272,7 +281,9 @@ sig
val
read_ui16
:
input
->
int
val
read_i16
:
input
->
int
val
read_i31
:
input
->
int
val
read_i32
:
input
->
int
val
read_i32_as_int
:
input
->
int
val
read_real_i32
:
input
->
int32
val
read_i64
:
input
->
int64
val
read_float32
:
input
->
float
...
...
@@ -280,6 +291,7 @@ sig
val
write_ui16
:
'
a
output
->
int
->
unit
val
write_i16
:
'
a
output
->
int
->
unit
val
write_i31
:
'
a
output
->
int
->
unit
val
write_i32
:
'
a
output
->
int
->
unit
val
write_real_i32
:
'
a
output
->
int32
->
unit
val
write_i64
:
'
a
output
->
int64
->
unit
...
...
src/Makefile
View file @
3973f47d
...
...
@@ -9,17 +9,22 @@ ifdef minimal
MODULES
:=
$(
filter-out unzip uChar uTF8,
$(
MODULES
))
endif
CPPO_ARGS
:=
$(
shell ocaml configure.ml
)
CPPO
=
cppo
$(
CPPO_ARGS
)
CPPO_ARGS
:=
$(
shell ocaml configure.ml
-cppo-args
)
CPPO
:
=
cppo
$(
CPPO_ARGS
)
OCAMLC
=
ocamlfind ocamlc
-pp
"
$(
CPPO
)
"
-g
-package
bytes
OCAMLOPT
=
ocamlfind ocamlopt
-pp
"
$(
CPPO
)
"
-g
-package
bytes
OCAML_ARGS
:=
-pp
"
$(
CPPO
)
"
-g
OCAML_ARGS
+=
$(
shell ocaml configure.ml
-compile-args
)
OCAMLC
=
ocamlfind ocamlc
$(
OCAML_ARGS
)
OCAMLOPT
=
ocamlfind ocamlopt
$(
OCAML_ARGS
)
OCAMLDOC
=
ocamldoc
-pp
"
$(
CPPO
)
"
MLI
=
$(
filter-out extLib.mli,
$(
MODULES:
=
.mli
))
CMI
=
$(
MODULES:
=
.cmi
)
CMO
=
$(
MODULES:
=
.cmo
)
CMX
=
$(
MODULES:
=
.cmx
)
CMT
=
$(
MODULES:
=
.cmt
)
CMTI
=
$(
MODULES:
=
.cmti
)
.NOTPARALLEL
:
.SUFFIXES
:
...
...
@@ -53,7 +58,7 @@ extBytes.mli: extBytes.ml
$(
OCAMLC
)
-i
$<
>
$@
install
:
ocamlfind
install
-patch-version
$(
VERSION
)
extlib META extLib.cma
$(
MLI
)
$(
CMI
)
-optional
extLib.cmxa
$(
CMX
)
extLib.cmxs extLib.a extLib.lib
ocamlfind
install
-patch-version
$(
VERSION
)
extlib META extLib.cma
$(
MLI
)
$(
CMI
)
-optional
extLib.cmxa
$(
CMX
)
extLib.cmxs extLib.a extLib.lib
$(
CMT
)
$(
CMTI
)
uninstall
:
ocamlfind remove extlib
...
...
src/base64.ml
View file @
3973f47d
...
...
@@ -119,3 +119,12 @@ let str_encode ?(tbl=chars) s =
let
str_decode
?
(
tbl
=
inv_chars
)
s
=
let
ch
=
decode
~
tbl
(
IO
.
input_bytes
s
)
in
IO
.
nread_string
ch
((
Bytes
.
length
s
*
6
)
/
8
)
let
encode_string
?
(
tbl
=
chars
)
s
=
let
ch
=
encode
~
tbl
(
IO
.
output_string
()
)
in
IO
.
nwrite_string
ch
s
;
IO
.
close_out
ch
let
decode_string
?
(
tbl
=
inv_chars
)
s
=
let
ch
=
decode
~
tbl
(
IO
.
input_string
s
)
in
IO
.
nread_string
ch
((
String
.
length
s
*
6
)
/
8
)
src/base64.mli
View file @
3973f47d
...
...
@@ -42,12 +42,18 @@ type encoding_table = char array
or -1 if the char is not accepted. *)
type
decoding_table
=
int
array
(**
Encode a
string in
to Base64.
*)
(**
erroneous interface, kept for compatibility use [encode_
string
]
in
stead
*)
val
str_encode
:
?
tbl
:
encoding_table
->
string
->
Bytes
.
t
(** erroneous interface, kept for compatibility use [decode_string] instead *)
val
str_decode
:
?
tbl
:
decoding_table
->
Bytes
.
t
->
string
(** Encode a string into Base64. *)
val
encode_string
:
?
tbl
:
encoding_table
->
string
->
string
(** Decode a string encoded into Base64, raise [Invalid_char] if a
character in the input string is not a valid one. *)
val
str_
decode
:
?
tbl
:
decoding_table
->
Bytes
.
t
->
string
val
decode
_string
:
?
tbl
:
decoding_table
->
string
->
string
(** Generic base64 encoding over an output. *)
val
encode
:
?
tbl
:
encoding_table
->
'
a
IO
.
output
->
'
a
IO
.
output
...
...
src/configure.ml
View file @
3973f47d
open
Printf
let
show_bytes
s
=
let
(
_
:
int
)
=
Sys
.
command
(
sprintf
"ocamlfind query -format %s bytes"
(
Filename
.
quote
s
))
in
()
let
()
=
print_endline
(
if
Sys
.
ocaml_version
>=
"4.00.0"
then
"-D OCAML4 "
else
""
);
print_endline
(
if
Sys
.
ocaml_version
>=
"4.02.0"
then
"-D OCAML4_02 "
else
""
);
print_endline
(
if
Sys
.
ocaml_version
>=
"4.03.0"
then
"-D OCAML4_03 "
else
""
);
print
_endline
(
if
Sys
.
ocaml_version
>=
"4.04.0"
then
"-D OCAML4_04 "
else
""
)
;
print_endline
(
if
Sys
.
ocaml_version
>=
"4.05.0"
then
"-D OCAML4_05
"
else
""
);
let
(
_
:
int
)
=
Sys
.
command
"ocamlfind query -format
\"
-D WITH_BYTES
\"
bytes"
in
()
;
match
Sys
.
argv
with
|
[
|_;
"-cppo-args"
|
]
->
let
version
=
Scanf
.
sscanf
Sys
.
ocaml_version
"%d.%d."
(
fun
major
minor
->
major
*
100
+
minor
)
in
print
f
"-D
\\\"
OCAML %d
\\\"\n
"
version
;
print_endline
(
if
Sys
.
word_size
=
32
then
"-D WORD_SIZE_32
"
else
""
);
show_bytes
"-D WITH_BYTES"
;
exit
0
|
[
|_;
"-compile-args"
|
]
->
if
Sys
.
ocaml_version
>=
"4.00.0"
then
print_endline
"-bin-annot"
;
show_bytes
"-package bytes"
;
exit
0
|
_
->
failwith
"not gonna happen"
src/dllist.ml
View file @
3973f47d
...
...
@@ -126,14 +126,14 @@ let next node = node.next
let
prev
node
=
node
.
prev
let
skip
node
idx
=
let
m
=
if
idx
>
0
then
-
1
else
1
in
let
f
=
if
idx
>
0
then
next
else
prev
in
let
rec
loop
idx
n
=
if
idx
==
0
then
n
else
loop
(
idx
+
m
)
n
.
next
loop
(
idx
-
1
)
(
f
n
)
in
loop
idx
node
loop
(
abs
idx
)
node
let
rev
node
=
let
rec
loop
next
n
=
...
...
src/extArray.ml
View file @
3973f47d
...
...
@@ -37,7 +37,7 @@ let rev xs =
rev_in_place
ys
;
ys
#
if
ndef
OCAML4
_
03
#
if
OCAML
<
403
let
for_all
p
xs
=
let
n
=
length
xs
in
let
rec
loop
i
=
...
...
@@ -164,7 +164,7 @@ let of_enum e =
|
Some
x
->
x
|
None
->
assert
false
)
#
if
ndef
OCAML4
_
03
#
if
OCAML
<
403
let
iter2
f
a1
a2
=
if
Array
.
length
a1
<>
Array
.
length
a2
then
raise
(
Invalid_argument
"Array.iter2"
);
...
...
@@ -178,12 +178,13 @@ let map2 f a1 a2 =
Array
.
init
(
Array
.
length
a1
)
(
fun
i
->
f
a1
.
(
i
)
a2
.
(
i
))
#
endif
#
if
def
OCAML4
_
03
#
if
OCAML
>=
403
#
else
#
if
def
OCAML4
_
02
#
if
OCAML
>=
402
let
create_float
=
make_float
#
else
let
make_float
n
=
make
n
0
.
let
create_float
=
make_float
#
endif
#
endif
...
...
src/extArray.mli
View file @
3973f47d
...
...
@@ -110,15 +110,24 @@ sig
(** These functions are reimplemented in extlib when they are missing from the stdlib *)
#
if
def
OCAML4
_
03
#
if
OCAML
>=
403
external
create_float
:
int
->
float
array
=
"caml_make_float_vect"
val
make_float
:
int
->
float
array
#
else
#
ifdef
OCAML4_02
external
make_float
:
int
->
float
array
=
"caml_make_float_vect"
#
else
val
mak
e_float
:
int
->
float
array
val
creat
e_float
:
int
->
float
array
#
endif
val
make_float
:
int
->
float
array
#
if
OCAML
>=
406
module
Floatarray
:
sig
external
create
:
int
->
floatarray
=
"caml_floatarray_create"
external
length
:
floatarray
->
int
=
"%floatarray_length"
external
get
:
floatarray
->
int
->
float
=
"%floatarray_safe_get"
external
set
:
floatarray
->
int
->
float
->
unit
=
"%floatarray_safe_set"
external
unsafe_get
:
floatarray
->
int
->
float
=
"%floatarray_unsafe_get"
external
unsafe_set
:
floatarray
->
int
->
float
->
unit
=
"%floatarray_unsafe_set"
end
#
endif
(** {6 Old functions} *)
...
...
@@ -155,4 +164,11 @@ sig
external
unsafe_get
:
'
a
array
->
int
->
'
a
=
"%array_unsafe_get"
external
unsafe_set
:
'
a
array
->
int
->
'
a
->
unit
=
"%array_unsafe_set"
#
if
OCAML
>=
407
(** [*_seq] functions were introduced in OCaml 4.07.0, and are _not_ implemented in extlib for older OCaml versions *)
val
to_seq
:
'
a
array
->
'
a
Seq
.
t
val
to_seqi
:
'
a
array
->
(
int
*
'
a
)
Seq
.
t
val
of_seq
:
'
a
Seq
.
t
->
'
a
array
#
endif
end
src/extBuffer.ml
View file @
3973f47d
...
...
@@ -4,7 +4,7 @@ module Buffer = struct
include
Buffer
#
if
ndef
OCAML4
_
02
#
if
OCAML
<
402
(* The uses of unsafe_{of,to}_string above are not semantically
justified, as the Buffer implementation may very well capture and
share parts of its internal buffer, or of input string given as
...
...
src/extBuffer.mli
View file @
3973f47d
...
...
@@ -67,10 +67,26 @@ val add_channel : t -> in_channel -> int -> unit
val
output_buffer
:
out_channel
->
t
->
unit
#
if
def
OCAML4
_
05
#
if
OCAML
>=
405
val
truncate
:
t
->
int
->
unit
#
endif
#
if
OCAML
>=
406
val
add_utf_8_uchar
:
t
->
Uchar
.
t
->
unit
val
add_utf_16le_uchar
:
t
->
Uchar
.
t
->
unit
val
add_utf_16be_uchar
:
t
->
Uchar
.
t
->
unit
#
endif
#
if
OCAML
>=
407
(** [*_seq] functions were introduced in OCaml 4.07.0, and are _not_ implemented in extlib for older OCaml versions *)
val
to_seq
:
t
->
char
Seq
.
t
val
to_seqi
:
t
->
(
int
*
char
)
Seq
.
t
val
add_seq
:
t
->
char
Seq
.
t
->
unit
val
of_seq
:
char
Seq
.
t
->
t
#
endif
end
src/extBytes.ml
View file @
3973f47d
#
if
defined
OCAML4_
02
||
defined
WITH_BYTES
#
if
OCAML
>=
4
02
||
defined
WITH_BYTES
module
Bytes
=
Bytes
#
else
module
Bytes
=
struct
...
...
Prev
1
2
Next