Skip to content

Commit 72b7759

Browse files
committed
Updated distribution files
1 parent 2fbd1fe commit 72b7759

File tree

5 files changed

+222
-35
lines changed

5 files changed

+222
-35
lines changed

CHANGES.txt

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
2016-05-24: Fixed a bug finalizing user-defined functions for a database.
2+
3+
Thanks to Mark Bradley <[email protected]> for this patch!
4+
15
2015-11-18: More build process improvements for Homebrew users.
26

37
Thanks to Leonid Rozenberg <[email protected]> for this patch!

_oasis

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
OASISFormat: 0.4
22
Name: sqlite3
3-
Version: 4.0.3
3+
Version: 4.0.4
44
Synopsis: sqlite3-ocaml - SQLite3 bindings
55
Description: sqlite3-ocaml is an OCaml library with bindings to the
66
SQLite3 client API. Sqlite3 is a self-contained, serverless,

lib/META

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# OASIS_START
2-
# DO NOT EDIT (digest: fa8ee36501416c86cd1e145c553d9aae)
3-
version = "4.0.3"
2+
# DO NOT EDIT (digest: 56d9dac34e0e883dec973a08d6bbc316)
3+
version = "4.0.4"
44
description = "sqlite3-ocaml - SQLite3 bindings"
55
archive(byte) = "sqlite3.cma"
66
archive(byte, plugin) = "sqlite3.cma"

myocamlbuild.ml

+167-7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
(* OASIS_START *)
2-
(* DO NOT EDIT (digest: ef3f6bb7de5d2441c8248057cdf28ea3) *)
2+
(* DO NOT EDIT (digest: 0c8d8e3d3d3f32d2cf322309bc1cc8f0) *)
33
module OASISGettext = struct
44
(* # 22 "src/oasis/OASISGettext.ml" *)
55

@@ -29,6 +29,166 @@ module OASISGettext = struct
2929

3030
end
3131

32+
module OASISString = struct
33+
(* # 22 "src/oasis/OASISString.ml" *)
34+
35+
36+
(** Various string utilities.
37+
38+
Mostly inspired by extlib and batteries ExtString and BatString libraries.
39+
40+
@author Sylvain Le Gall
41+
*)
42+
43+
44+
let nsplitf str f =
45+
if str = "" then
46+
[]
47+
else
48+
let buf = Buffer.create 13 in
49+
let lst = ref [] in
50+
let push () =
51+
lst := Buffer.contents buf :: !lst;
52+
Buffer.clear buf
53+
in
54+
let str_len = String.length str in
55+
for i = 0 to str_len - 1 do
56+
if f str.[i] then
57+
push ()
58+
else
59+
Buffer.add_char buf str.[i]
60+
done;
61+
push ();
62+
List.rev !lst
63+
64+
65+
(** [nsplit c s] Split the string [s] at char [c]. It doesn't include the
66+
separator.
67+
*)
68+
let nsplit str c =
69+
nsplitf str ((=) c)
70+
71+
72+
let find ~what ?(offset=0) str =
73+
let what_idx = ref 0 in
74+
let str_idx = ref offset in
75+
while !str_idx < String.length str &&
76+
!what_idx < String.length what do
77+
if str.[!str_idx] = what.[!what_idx] then
78+
incr what_idx
79+
else
80+
what_idx := 0;
81+
incr str_idx
82+
done;
83+
if !what_idx <> String.length what then
84+
raise Not_found
85+
else
86+
!str_idx - !what_idx
87+
88+
89+
let sub_start str len =
90+
let str_len = String.length str in
91+
if len >= str_len then
92+
""
93+
else
94+
String.sub str len (str_len - len)
95+
96+
97+
let sub_end ?(offset=0) str len =
98+
let str_len = String.length str in
99+
if len >= str_len then
100+
""
101+
else
102+
String.sub str 0 (str_len - len)
103+
104+
105+
let starts_with ~what ?(offset=0) str =
106+
let what_idx = ref 0 in
107+
let str_idx = ref offset in
108+
let ok = ref true in
109+
while !ok &&
110+
!str_idx < String.length str &&
111+
!what_idx < String.length what do
112+
if str.[!str_idx] = what.[!what_idx] then
113+
incr what_idx
114+
else
115+
ok := false;
116+
incr str_idx
117+
done;
118+
if !what_idx = String.length what then
119+
true
120+
else
121+
false
122+
123+
124+
let strip_starts_with ~what str =
125+
if starts_with ~what str then
126+
sub_start str (String.length what)
127+
else
128+
raise Not_found
129+
130+
131+
let ends_with ~what ?(offset=0) str =
132+
let what_idx = ref ((String.length what) - 1) in
133+
let str_idx = ref ((String.length str) - 1) in
134+
let ok = ref true in
135+
while !ok &&
136+
offset <= !str_idx &&
137+
0 <= !what_idx do
138+
if str.[!str_idx] = what.[!what_idx] then
139+
decr what_idx
140+
else
141+
ok := false;
142+
decr str_idx
143+
done;
144+
if !what_idx = -1 then
145+
true
146+
else
147+
false
148+
149+
150+
let strip_ends_with ~what str =
151+
if ends_with ~what str then
152+
sub_end str (String.length what)
153+
else
154+
raise Not_found
155+
156+
157+
let replace_chars f s =
158+
let buf = Buffer.create (String.length s) in
159+
String.iter (fun c -> Buffer.add_char buf (f c)) s;
160+
Buffer.contents buf
161+
162+
let lowercase_ascii =
163+
replace_chars
164+
(fun c ->
165+
if (c >= 'A' && c <= 'Z') then
166+
Char.chr (Char.code c + 32)
167+
else
168+
c)
169+
170+
let uncapitalize_ascii s =
171+
if s <> "" then
172+
(lowercase_ascii (String.sub s 0 1)) ^ (String.sub s 1 ((String.length s) - 1))
173+
else
174+
s
175+
176+
let uppercase_ascii =
177+
replace_chars
178+
(fun c ->
179+
if (c >= 'a' && c <= 'z') then
180+
Char.chr (Char.code c - 32)
181+
else
182+
c)
183+
184+
let capitalize_ascii s =
185+
if s <> "" then
186+
(uppercase_ascii (String.sub s 0 1)) ^ (String.sub s 1 ((String.length s) - 1))
187+
else
188+
s
189+
190+
end
191+
32192
module OASISExpr = struct
33193
(* # 22 "src/oasis/OASISExpr.ml" *)
34194

@@ -129,7 +289,7 @@ module OASISExpr = struct
129289
end
130290

131291

132-
# 132 "myocamlbuild.ml"
292+
# 292 "myocamlbuild.ml"
133293
module BaseEnvLight = struct
134294
(* # 22 "src/base/BaseEnvLight.ml" *)
135295

@@ -234,7 +394,7 @@ module BaseEnvLight = struct
234394
end
235395

236396

237-
# 237 "myocamlbuild.ml"
397+
# 397 "myocamlbuild.ml"
238398
module MyOCamlbuildFindlib = struct
239399
(* # 22 "src/plugins/ocamlbuild/MyOCamlbuildFindlib.ml" *)
240400

@@ -516,7 +676,7 @@ module MyOCamlbuildBase = struct
516676
| nm, [], intf_modules ->
517677
ocaml_lib nm;
518678
let cmis =
519-
List.map (fun m -> (String.uncapitalize m) ^ ".cmi")
679+
List.map (fun m -> (OASISString.uncapitalize_ascii m) ^ ".cmi")
520680
intf_modules in
521681
dep ["ocaml"; "link"; "library"; "file:"^nm^".cma"] cmis
522682
| nm, dir :: tl, intf_modules ->
@@ -529,7 +689,7 @@ module MyOCamlbuildBase = struct
529689
["compile"; "infer_interface"; "doc"])
530690
tl;
531691
let cmis =
532-
List.map (fun m -> dir^"/"^(String.uncapitalize m)^".cmi")
692+
List.map (fun m -> dir^"/"^(OASISString.uncapitalize_ascii m)^".cmi")
533693
intf_modules in
534694
dep ["ocaml"; "link"; "library"; "file:"^dir^"/"^nm^".cma"]
535695
cmis)
@@ -603,7 +763,7 @@ module MyOCamlbuildBase = struct
603763
end
604764

605765

606-
# 606 "myocamlbuild.ml"
766+
# 766 "myocamlbuild.ml"
607767
open Ocamlbuild_plugin;;
608768
let package_default =
609769
{
@@ -712,7 +872,7 @@ let conf = {MyOCamlbuildFindlib.no_automatic_syntax = false}
712872

713873
let dispatch_default = MyOCamlbuildBase.dispatch_default conf package_default;;
714874

715-
# 716 "myocamlbuild.ml"
875+
# 876 "myocamlbuild.ml"
716876
(* OASIS_STOP *)
717877

718878
let read_lines_from_cmd ~max_lines cmd =

0 commit comments

Comments
 (0)