Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion deb_lib.mli
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ module PkgDenseTbl : sig
val remove : 'a t -> package_name -> unit
val iteri : (package_name -> 'a -> unit) -> 'a t -> unit
end
module PkgSet : Set.S with type elt = package_name
module PkgSet : Ptset.SET_SIG with type elt = package_name

val find_package_by_num : pool -> int -> p
val find_packages_by_name : pool -> package_name -> p list
Expand Down
34 changes: 34 additions & 0 deletions ptset.ml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,40 @@

(*i $Id: ptset.ml,v 1.17 2008-07-22 06:44:06 filliatr Exp $ i*)

(*s Restricted Set.S signature *)

module type SET_SIG = sig
type elt
type t
val empty : t
val is_empty : t -> bool
val mem : elt -> t -> bool
val find : elt -> t -> int
val add : elt -> t -> t
val of_list : elt list -> t
val singleton : elt -> t
val remove : elt -> t -> t
val union : t -> t -> t
val subset : t -> t -> bool
val inter : t -> t -> t
val diff : t -> t -> t
val equal : t -> t -> bool
val compare : t -> t -> int
val elements : t -> elt list
val choose : t -> elt
val cardinal : t -> int
val iter : (elt -> unit) -> t -> unit
val fold : (elt -> 'a -> 'a) -> t -> 'a -> 'a
val for_all : (elt -> bool) -> t -> bool
val exists : (elt -> bool) -> t -> bool
val filter : (elt -> bool) -> t -> t
val partition : (elt -> bool) -> t -> t * t
val split : elt -> t -> t * bool * t
val min_elt : t -> int
val max_elt : t -> int
val intersect : t -> t -> bool
end

(*s Sets of integers implemented as Patricia trees, following Chris
Okasaki and Andrew Gill's paper {\em Fast Mergeable Integer Maps}
({\tt\small http://www.cs.columbia.edu/\~{}cdo/papers.html\#ml98maps}).
Expand Down
116 changes: 43 additions & 73 deletions ptset.mli
Original file line number Diff line number Diff line change
Expand Up @@ -15,87 +15,62 @@

(*i $Id: ptset.mli,v 1.10 2008-07-21 14:53:06 filliatr Exp $ i*)

(*s Restricted Set.S signature *)

module type SET_SIG = sig
type elt
type t
val empty : t
val is_empty : t -> bool
val mem : elt -> t -> bool
val find : elt -> t -> int
val add : elt -> t -> t
val of_list : elt list -> t
val singleton : elt -> t
val remove : elt -> t -> t
val union : t -> t -> t
val subset : t -> t -> bool
val inter : t -> t -> t
val diff : t -> t -> t
val equal : t -> t -> bool
val compare : t -> t -> int
val elements : t -> elt list
val choose : t -> elt
val cardinal : t -> int
val iter : (elt -> unit) -> t -> unit
val fold : (elt -> 'a -> 'a) -> t -> 'a -> 'a
val for_all : (elt -> bool) -> t -> bool
val exists : (elt -> bool) -> t -> bool
val filter : (elt -> bool) -> t -> t
val partition : (elt -> bool) -> t -> t * t
val split : elt -> t -> t * bool * t
val min_elt : t -> int
val max_elt : t -> int

(*s Additional functions not appearing in the signature [Set.S] from ocaml
standard library. *)

(* [intersect u v] determines if sets [u] and [v] have a non-empty
intersection. *)
val intersect : t -> t -> bool
end

(*s Sets of integers implemented as Patricia trees. The following
signature is exactly [Set.S with type elt = int], with the same
specifications. This is a purely functional data-structure. The
performances are similar to those of the standard library's module
[Set]. The representation is unique and thus structural comparison
can be performed on Patricia trees. *)

type t

type elt = int

val empty : t

val is_empty : t -> bool

val mem : int -> t -> bool

val find : int -> t -> int

val add : int -> t -> t

val of_list : elt list -> t

val singleton : int -> t

val remove : int -> t -> t

val union : t -> t -> t

val subset : t -> t -> bool

val inter : t -> t -> t

val diff : t -> t -> t

val equal : t -> t -> bool

val compare : t -> t -> int

val elements : t -> int list

val choose : t -> int

val cardinal : t -> int

val iter : (int -> unit) -> t -> unit

val fold : (int -> 'a -> 'a) -> t -> 'a -> 'a

val for_all : (int -> bool) -> t -> bool

val exists : (int -> bool) -> t -> bool

val filter : (int -> bool) -> t -> t

val partition : (int -> bool) -> t -> t * t

val split : int -> t -> t * bool * t
include SET_SIG with type elt = int

(*s Warning: [min_elt] and [max_elt] are linear w.r.t. the size of the
set. In other words, [min_elt t] is barely more efficient than [fold
min t (choose t)]. *)

val min_elt : t -> int
val max_elt : t -> int

(*s Additional functions not appearing in the signature [Set.S] from ocaml
standard library. *)

(* [intersect u v] determines if sets [u] and [v] have a non-empty
intersection. *)

val intersect : t -> t -> bool


(*s Big-endian Patricia trees *)

module Big : sig
include Set.S with type elt = int
val intersect : t -> t -> bool
end
module Big : SET_SIG with type elt = int


(*s Big-endian Patricia trees with non-negative elements. Changes:
Expand All @@ -105,9 +80,4 @@ end
- [elements] returns a list with elements in ascending order
*)

module BigPos : sig
include Set.S with type elt = int
val intersect : t -> t -> bool
end


module BigPos : SET_SIG with type elt = int
2 changes: 1 addition & 1 deletion repository.ml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ module type S = sig
val of_index_list : int list -> t list
end

module PSet : Set.S with type elt = Package.t
module PSet : Ptset.SET_SIG with type elt = Package.t
module PMap : Map.S with type key = Package.t
val pset_indices : PSet.t -> Util.IntSet.t

Expand Down
2 changes: 1 addition & 1 deletion repository.mli
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ module type S = sig
val of_index_list : int list -> t list
end

module PSet : Set.S with type elt = Package.t
module PSet : Ptset.SET_SIG with type elt = Package.t
module PMap : Map.S with type key = Package.t
val pset_indices : PSet.t -> Util.IntSet.t

Expand Down
5 changes: 3 additions & 2 deletions task.ml
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,9 @@ let spawn f =
let (sr, cw) = Unix.pipe () in
let fd = Unix.openfile "/dev/zero" [Unix.O_RDWR] 0 in
let mem =
Bigarray.Array1.map_file
fd Bigarray.char Bigarray.c_layout true mem_size
Unix.map_file
fd Bigarray.char Bigarray.c_layout true [|mem_size|]
|> Bigarray.array1_of_genarray
in
Unix.close fd;
match Unix.fork () with
Expand Down
10 changes: 5 additions & 5 deletions update_data.ml
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@

let src = ref "http://http.debian.net/debian/dists/"
let hint_src = "https://release.debian.org/britney/hints/"
let britney_src = "https://release.debian.org/britney/data-b2/"
let britney_src = "https://release.debian.org/britney/state/"
let britney_files =
[("Dates", `Testing, "Dates");
("Urgency", `Testing, "Urgency");
("testing_BugsV", `Testing, "BugsV");
("unstable_BugsV", `Unstable, "BugsV")]
[("age-policy-dates", `Testing, "Dates");
("age-policy-urgencies", `Testing, "Urgency");
("rc-bugs-testing", `Testing, "BugsV");
("rc-bugs-unstable", `Unstable, "BugsV")]

let sects = ["main"; "contrib"; "non-free"]

Expand Down
2 changes: 1 addition & 1 deletion util.mli
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ module Utimer : sig
val stop : t -> float
end

module IntSet : Set.S with type elt = int
module IntSet : Ptset.SET_SIG with type elt = int
module StringSet : Set.S with type elt = string

module ListTbl : sig
Expand Down
6 changes: 3 additions & 3 deletions viewer/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ OCAMLDEP=ocamlfind ocamldep
OCAMLYACC=ocamlyacc
OCAMLLEX=ocamllex

COMPFLAGS=-package str,cairo.lablgtk2,js_of_ocaml,js_of_ocaml.syntax -syntax camlp4o
COMPFLAGS=-package str,cairo.lablgtk2,js_of_ocaml,js_of_ocaml-ppx,js_of_ocaml-lwt
DEPFLAGS=$(COMPFLAGS)

GENERATED=dot_parser.ml dot_lexer.ml
Expand All @@ -18,7 +18,7 @@ CONVERTER=scene.cmx scene_extents.cmx scene_json.cmx \
OPTLINKFLAGS=-package str,cairo.lablgtk2 -linkpkg

JSOBJS=scene.cmo viewer_common.cmo viewer_js.cmo
LINKFLAGS=-package js_of_ocaml -linkpkg
LINKFLAGS=-package js_of_ocaml,js_of_ocaml-lwt -linkpkg

all: coinst_viewer jsviewer.js coinst_converter
opt: all
Expand All @@ -37,7 +37,7 @@ coinst_converter.byte: $(CONVERTER:.cmx=.cmo)
$(OCAMLC) -o $@ $(OPTLINKFLAGS) $^

jsviewer.js: jsviewer.byte
js_of_ocaml $^ -pretty
js_of_ocaml $^ --pretty

jsviewer.byte: $(JSOBJS)
$(OCAMLC) -o $@ $(LINKFLAGS) $^
Expand Down
Loading