Skip to content

Commit e6d1d3e

Browse files
committed
expose more for testing
1 parent 1775576 commit e6d1d3e

File tree

3 files changed

+26
-7
lines changed

3 files changed

+26
-7
lines changed

jscomp/bsb/bsb_db_encode.mli

+6
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,11 @@
2222
* along with this program; if not, write to the Free Software
2323
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)
2424

25+
26+
val encode :
27+
Bsb_db.t ->
28+
Ext_buffer.t ->
29+
unit
30+
2531
val write_build_cache :
2632
dir:string -> Bsb_db.t -> string

jscomp/bsb_helper/bsb_db_decode.ml

+2-2
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ type cursor = int ref
4545

4646

4747
(*TODO: special case when module_count is zero *)
48-
let rec decode_internal (x : string) : t =
48+
let rec decode (x : string) : t =
4949
let (offset : cursor) = ref 0 in
5050
let lib = decode_single x offset in
5151
let dev = decode_single x offset in
@@ -93,7 +93,7 @@ and decode_modules (x : string) (offset : cursor) module_number : string array =
9393
let read_build_cache ~dir : t =
9494
let all_content =
9595
Ext_io.load_file (Filename.concat dir bsbuild_cache) in
96-
decode_internal all_content
96+
decode all_content
9797

9898

9999

jscomp/bsb_helper/bsb_db_decode.mli

+18-5
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,20 @@
2525

2626

2727

28-
type t
29-
30-
type group
31-
28+
type group = private
29+
| Dummy
30+
| Group of {
31+
modules : string array ;
32+
dir_length : int;
33+
dir_info_offset : int ;
34+
module_info_offset : int;
35+
}
36+
37+
type t = {
38+
lib : group ;
39+
dev : group ;
40+
content : string (* string is whole content*)
41+
}
3242

3343
val read_build_cache :
3444
dir:string -> t
@@ -44,4 +54,7 @@ val find:
4454
t -> (* contains global info *)
4555
string -> (* module name *)
4656
bool -> (* more likely to be zero *)
47-
module_info option
57+
module_info option
58+
59+
60+
val decode : string -> t

0 commit comments

Comments
 (0)