cmt and cmti files format.
The layout of a cmt file is as follows: <cmt> := {<cmi>} <cmt magic> {cmt infos} {<source info>} where <cmi> is the cmi file format: <cmi> := <cmi magic> <cmi info>. More precisely, the optional <cmi> part must be present if and only if the file is:
Thus, we provide a common reading function for cmi and cmt(i) files which returns an option for each of the three parts: cmi info, cmt info, source info.
#
cmt_modname
| : string | ; | |||
#
cmt_annots
| : binary_annots | ; | |||
#
cmt_value_dependencies
| : (Types.value_description * Types.value_description) list | ; | |||
#
cmt_comments
| : (string * Location.t) list | ; | |||
#
cmt_args
| : string array | ; | |||
#
cmt_sourcefile
| : string option | ; | |||
#
cmt_builddir
| : string | ; | |||
#
cmt_loadpath
| : string list | ; | |||
#
cmt_source_digest
| : string option | ; | |||
#
cmt_initial_env
| : Env.t | ; | |||
#
cmt_imports
| : (string * Digest.t option) list | ; | |||
#
cmt_interface_digest
| : Digest.t option | ; | |||
#
cmt_use_summaries
| : bool | ; |
read filename
opens filename, and extract both the cmi_infos, if
it exists, and the cmt_infos, if it exists. Thus, it can be used
with .cmi, .cmt and .cmti files.
.cmti files always contain a cmi_infos at the beginning. .cmt files only contain a cmi_infos at the beginning if there is no associated .cmti file.
save_cmt modname filename binary_annots sourcefile initial_env sg
writes a cmt(i) file.