sig
exception Syntax of string option * string
exception Err of int * string
exception Invalid_record of string
val fold :
?err:(string -> int -> 'a -> string list -> 'a) ->
(int -> 'a -> (string * string) list -> 'a) -> 'a -> Kwchan.src -> 'a
val withoutln : ('a -> 'b -> 'c) -> 'a -> 'd -> 'b -> 'c
val records :
?loc:string -> char Stream.t -> (int * (string * string) list) Stream.t
val parse : ?loc:string -> string -> (string * string) list
val assemble : (string * string) list -> string
val keys : ('a * 'b) list -> 'a list
val keycounts : ('a * 'b) list -> ('a * int) list
val getall : 'a -> ('a * 'b) list -> 'b list
type prop = OPT | REQ | UNIQ | REP | KEY | ENUM | COMMENT
type pprop
val prop_of_string : string -> Kwrefer.prop
val string_of_prop : Kwrefer.prop -> string
module PS :
sig
type elt = pprop
type t
val empty : t
val is_empty : t -> bool
val mem : elt -> t -> bool
val add : elt -> t -> t
val singleton : elt -> t
val remove : elt -> t -> t
val union : t -> t -> t
val inter : t -> t -> t
val diff : t -> t -> t
val compare : t -> t -> int
val equal : t -> t -> bool
val subset : t -> t -> bool
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 cardinal : t -> int
val elements : t -> elt list
val min_elt : t -> elt
val max_elt : t -> elt
val choose : t -> elt
val split : elt -> t -> t * bool * t
val find : elt -> t -> elt
val map : (elt -> elt) -> t -> t
val of_list : elt list -> t
val to_list : t -> elt list
end
module SS :
sig
type elt = string
type t
val empty : t
val is_empty : t -> bool
val mem : elt -> t -> bool
val add : elt -> t -> t
val singleton : elt -> t
val remove : elt -> t -> t
val union : t -> t -> t
val inter : t -> t -> t
val diff : t -> t -> t
val compare : t -> t -> int
val equal : t -> t -> bool
val subset : t -> t -> bool
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 cardinal : t -> int
val elements : t -> elt list
val min_elt : t -> elt
val max_elt : t -> elt
val choose : t -> elt
val split : elt -> t -> t * bool * t
val find : elt -> t -> elt
val map : (elt -> elt) -> t -> t
val of_list : elt list -> t
val to_list : t -> elt list
end
module SM :
sig
type key = string
type +'a t
val empty : 'a t
val is_empty : 'a t -> bool
val mem : key -> 'a t -> bool
val add : key -> 'a -> 'a t -> 'a t
val singleton : key -> 'a -> 'a t
val remove : key -> 'a t -> 'a t
val merge :
(key -> 'a option -> 'b option -> 'c option) -> 'a t -> 'b t -> 'c t
val compare : ('a -> 'a -> int) -> 'a t -> 'a t -> int
val equal : ('a -> 'a -> bool) -> 'a t -> 'a t -> bool
val iter : (key -> 'a -> unit) -> 'a t -> unit
val fold : (key -> 'a -> 'b -> 'b) -> 'a t -> 'b -> 'b
val for_all : (key -> 'a -> bool) -> 'a t -> bool
val exists : (key -> 'a -> bool) -> 'a t -> bool
val filter : (key -> 'a -> bool) -> 'a t -> 'a t
val partition : (key -> 'a -> bool) -> 'a t -> 'a t * 'a t
val cardinal : 'a t -> int
val bindings : 'a t -> (key * 'a) list
val min_binding : 'a t -> key * 'a
val max_binding : 'a t -> key * 'a
val choose : 'a t -> key * 'a
val split : key -> 'a t -> 'a t * 'a option * 'a t
val find : key -> 'a t -> 'a
val map : ('a -> 'b) -> 'a t -> 'b t
val mapi : (key -> 'a -> 'b) -> 'a t -> 'b t
val keys : 'a t -> key list
val adjoin : ('a -> 'b -> 'b) -> 'b -> key -> 'a -> 'b t -> 'b t
val append : 'a list t -> key -> 'a -> 'a list t
val size : 'a t -> int
val diff : 'a t -> 'b t -> 'a t
val replace : key -> 'a -> 'a t -> 'a t
val of_list : (key * 'a) list -> 'a t -> 'a t
val values : 'a t -> 'a list
val intersect : (key -> 'a -> 'b -> 'c) -> 'a t -> 'b t -> 'c t
val union : 'a t -> 'a t -> 'a t
val incr : ?i:int -> key -> int t -> int t
val to_list : 'a t -> (key * 'a) list
val comparer :
?def:'a -> ?result:int -> (key * 'a) list -> key -> key -> int
end
module PM :
sig
type key = pprop
type +'a t
val empty : 'a t
val is_empty : 'a t -> bool
val mem : key -> 'a t -> bool
val add : key -> 'a -> 'a t -> 'a t
val singleton : key -> 'a -> 'a t
val remove : key -> 'a t -> 'a t
val merge :
(key -> 'a option -> 'b option -> 'c option) -> 'a t -> 'b t -> 'c t
val compare : ('a -> 'a -> int) -> 'a t -> 'a t -> int
val equal : ('a -> 'a -> bool) -> 'a t -> 'a t -> bool
val iter : (key -> 'a -> unit) -> 'a t -> unit
val fold : (key -> 'a -> 'b -> 'b) -> 'a t -> 'b -> 'b
val for_all : (key -> 'a -> bool) -> 'a t -> bool
val exists : (key -> 'a -> bool) -> 'a t -> bool
val filter : (key -> 'a -> bool) -> 'a t -> 'a t
val partition : (key -> 'a -> bool) -> 'a t -> 'a t * 'a t
val cardinal : 'a t -> int
val bindings : 'a t -> (key * 'a) list
val min_binding : 'a t -> key * 'a
val max_binding : 'a t -> key * 'a
val choose : 'a t -> key * 'a
val split : key -> 'a t -> 'a t * 'a option * 'a t
val find : key -> 'a t -> 'a
val map : ('a -> 'b) -> 'a t -> 'b t
val mapi : (key -> 'a -> 'b) -> 'a t -> 'b t
val keys : 'a t -> key list
val adjoin : ('a -> 'b -> 'b) -> 'b -> key -> 'a -> 'b t -> 'b t
val append : 'a list t -> key -> 'a -> 'a list t
val size : 'a t -> int
val diff : 'a t -> 'b t -> 'a t
val replace : key -> 'a -> 'a t -> 'a t
val of_list : (key * 'a) list -> 'a t -> 'a t
val values : 'a t -> 'a list
val intersect : (key -> 'a -> 'b -> 'c) -> 'a t -> 'b t -> 'c t
val union : 'a t -> 'a t -> 'a t
val incr : ?i:int -> key -> int t -> int t
val to_list : 'a t -> (key * 'a) list
val comparer :
?def:'a -> ?result:int -> (key * 'a) list -> key -> key -> int
end
type validation_error =
Key of (string option * int * string * string)
| Illegal of (string option * int * string)
| Missing of (string option * int * string)
| Repeat of (string option * int * string)
| Enum of (string option * int * string)
| Skey of (string option * int * string * string)
val string_of_validation_error : Kwrefer.validation_error -> string
type schemaerror =
REQOPT of (int * string)
| UNIQREP of (int * string)
| BADPROP of (int * string)
| TOOMANY of int
| INVALID of Kwrefer.validation_error list
| MANYSKEYS of int
val string_of_schemaerror : string -> Kwrefer.schemaerror -> string
type schema
type multi
type schemas =
Simple of Kwrefer.schema
| Multi of Kwrefer.multi
| Bad of Kwrefer.schemaerror list
val string_of_schemas : Kwrefer.schemas -> string
val getref :
?def:'a list ->
Kwrefer.prop * Kwrefer.prop -> 'b -> ('b * 'a list) list -> 'a list
val compile_stream :
?loc:string -> ?skey:Kwrefer.SM.key -> char Stream.t -> Kwrefer.schemas
val compile_channel :
?loc:string ->
?skey:Kwrefer.SM.key -> Pervasives.in_channel -> Kwrefer.schemas
val compile_file : ?skey:Kwrefer.SM.key -> string -> Kwrefer.schemas
val compile_string :
?loc:string -> ?skey:Kwrefer.SM.key -> string -> Kwrefer.schemas
val validate :
?loc:string ->
?strict:bool ->
Kwrefer.schemas ->
Kwrefer.SS.t Kwrefer.SM.t * Kwrefer.validation_error list ->
int ->
(Kwrefer.SM.key * Kwrefer.SS.elt) list ->
Kwrefer.SS.t Kwrefer.SM.t * Kwrefer.validation_error list
val validate_record :
?loc:string ->
?strict:bool ->
Kwrefer.schemas ->
(Kwrefer.SM.key * Kwrefer.SS.elt) list -> Kwrefer.validation_error list
val validate_channel :
?strict:bool ->
Kwrefer.schemas -> string -> Kwchan.src -> Kwrefer.validation_error list
val validate_file :
?strict:bool ->
Kwrefer.schemas -> string -> Kwrefer.validation_error list
val validate_files :
?strict:bool ->
Kwrefer.schemas -> string list -> Kwrefer.validation_error list
type refermap = string list Kwrefer.SM.t
val bucket :
?err:('a list option ->
'b ->
('c * 'a) list -> ('a * ('c * 'a) list) list * ('c * 'a) list list) ->
'c ->
('a * ('c * 'a) list) list * ('c * 'a) list list ->
'b -> ('c * 'a) list -> ('a * ('c * 'a) list) list * ('c * 'a) list list
exception Unbucketed of int
val unbucket : ?strict:bool -> 'a * 'b list -> 'a
val to_mmap :
?loc:string ->
?validate:(?loc:string ->
Kwrefer.SS.t Kwrefer.SM.t * Kwrefer.validation_error list ->
int ->
(Kwrefer.SM.key * Kwrefer.SS.elt) list ->
Kwrefer.SS.t Kwrefer.SM.t * Kwrefer.validation_error list) ->
?map:Kwrefer.refermap Kwrefer.SM.t ->
string -> Pervasives.in_channel -> Kwrefer.refermap Kwrefer.SM.t
val get : string list -> Kwrefer.refermap -> string list list
val getu : string list -> Kwrefer.refermap -> string list
val get1 : string -> Kwrefer.refermap -> string list
val get1u : string -> Kwrefer.refermap -> string
val get2 : string * string -> Kwrefer.refermap -> string list * string list
val get2u : string * string -> Kwrefer.refermap -> string * string
val get3 :
string * string * string ->
Kwrefer.refermap -> string list * string list * string list
val get3u :
string * string * string -> Kwrefer.refermap -> string * string * string
val get4 :
string * string * string * string ->
Kwrefer.refermap -> string list * string list * string list * string list
val get4u :
string * string * string * string ->
Kwrefer.refermap -> string * string * string * string
end