<commit_before>(** Raw bindings for LMDB. *)

type bigstring =
  (char, Bigarray.int8_unsigned_elt, Bigarray.c_layout) Bigarray.Array1.t 

val version : string * int * int * int


(** {2 Exceptions} *)

exception Exists
exception Error of int
external strerror : int -> string = "mdbs_strerror"


(** {2 Flags} *)

(** Operations on sets of flags. *)
module type Flags = sig
  type t
  (** The type of a set of flags *)

  external ( + ) : t -> t -> t = "%orint"
  (** [a + b] is the {e union} of flag sets [a] and [b].
      This corresponds to a bitwise {e or} on C bitfields. *)

  external ( * ) : t -> t -> t = "%andint"
  (** [a * b] is the intersection of flag sets a and b.
      This corresponds to a bitwise {e and} on C bitfields. *)

  val test : t -> t -> bool
  (** [test a b] is [true] only if [a] is a subset of [b].
      This corresponds to [a & b == a] for C bitfields. *)

  val unset : t -> t -> t
  (** [unset a b] removes flags [a] from flag set [b].
      This corresponds to [a & ~b] for C bitfields. *)

  external eq : t -> t -> bool = "%equal"
  (** [eq a b] The equals relation. *)

  external of_int : int -> t   = "%identity"
  external to_int : t -> int   = "%identity"

  val none : t
  (** [none] The empty set of flags. *)
end


(** {2 Environment} *)

type env
module EnvFlags :
  sig
    include Flags
    val fixed_map : t
    val no_subdir : t
      (** Create the environment not in an existing directory,
          but create the data file with exactly the filename given to {!Env.create}.
          The lock file will have "-lock" appended.
      *)
<commit_msg>Export Lmdb_bindings.Flags for opportunistic re-use (#30)<commit_after>(** Raw bindings for LMDB. *)

type bigstring =
  (char, Bigarray.int8_unsigned_elt, Bigarray.c_layout) Bigarray.Array1.t 

val version : string * int * int * int


(** {2 Exceptions} *)

exception Exists
exception Error of int
external strerror : int -> string = "mdbs_strerror"


(** {2 Flags} *)

(** Operations on sets of flags. *)
module type Flags = sig
  type t
  (** The type of a set of flags *)

  external ( + ) : t -> t -> t = "%orint"
  (** [a + b] is the {e union} of flag sets [a] and [b].
      This corresponds to a bitwise {e or} on C bitfields. *)

  external ( * ) : t -> t -> t = "%andint"
  (** [a * b] is the intersection of flag sets a and b.
      This corresponds to a bitwise {e and} on C bitfields. *)

  val test : t -> t -> bool
  (** [test a b] is [true] only if [a] is a subset of [b].
      This corresponds to [a & b == a] for C bitfields. *)

  val unset : t -> t -> t
  (** [unset a b] removes flags [a] from flag set [b].
      This corresponds to [a & ~b] for C bitfields. *)

  external eq : t -> t -> bool = "%equal"
  (** [eq a b] The equals relation. *)

  external of_int : int -> t   = "%identity"
  external to_int : t -> int   = "%identity"

  val none : t
  (** [none] The empty set of flags. *)
end

module Flags : Flags


(** {2 Environment} *)

type env
module EnvFlags :
  sig
    include Flags
    val fixed_map : t
    val no_subdir : t
      (** Create the environment not in an existing directory,
          but create the data file with exactly the filename given to {!Env.create}.
          The lock file will have "-lock" appended.
      *)

{'fraction_non_alphanumeric': 0.13622480146609653, 'fraction_numerical': 0.0036652412950519244, 'mean_word_length': 2.510182207931404, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 29, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6500778', 'n_tokens_mistral': 1100, 'n_tokens_neox': 1062, 'n_words': 462}