package odig

  1. Overview
  2. Docs

cma files.

Cma

type t = cma

The type for cma files.

val read : Fpath.t -> (cma, [ `Msg of string ]) Pervasives.result

read f reads a cma file from f.

val name : cma -> string

name cma is cma's basename.

val cmos : cma -> cmo list

cmos cma are the cmos contained in the cma.

val custom : cma -> bool

custom cma is true if it requires custom mode linking.

val custom_cobjs : cma -> string list

cma_custom_cobjs are C objects files needed for custom mode linking.

val custom_copts : cma -> string list

cma_custom_copts are C link options for custom mode linking.

val dllibs : cma -> string list

cma_dllibs are dynamically loaded C libraries for ocamlrun dynamic linking.

val path : cma -> Fpath.t

path cma is the file path to the cma file.

Derived information

FIXME most of this can be removed.

names ~init cma adds to init (defaults to String.Map.empty) the module names defined by cma mapped to their cmi digests. If a name already exists in init it is overriden.

val cmi_digests : ?init:string Digest.map -> cma -> string Digest.map

cmi_digests ~init cma adds to init (defaults to Digest.Map.empty) the cmi digests of the modules defined by cma mapped to their module name. If a digest already exists in init it is overriden.

val to_cmi_deps : ?init:dep list -> cma -> dep list

to_cmi_deps ~init cma adds to init (default to []) the module names and cmi digests of the modules defined by cma.

val cmi_deps : ?conflict:(string -> keep:Digest.t -> Digest.t -> unit) -> cma -> dep list

cmi_deps ~conflict cma is the list of cmi imported by the cmos in the library. The result excludes self-dependencies that is the set cmi_digest of digests that are implemented by the cma itself.

conflict is called if the module interface of a dependency sports two different digests in the archive. The default function logs a warning.

OCaml

Innovation. Community. Security.