aboutsummaryrefslogtreecommitdiffhomepage
path: root/library/lib.mli
blob: d87c4573a8c1e13a2ef2d994ab66932b7fb0cb69 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59

(* $Id$ *)

(*i*)
open Names
open Libobject
open Summary
(*i*)

(* This module provides a general mechanism to keep a trace of all operations
   and to backtrack (undo) those operations. It provides also the section
   mechanism (at a low level; discharge is not known at this step). *)

type node = 
  | Leaf of obj
  | OpenedSection of string
  | ClosedSection of string * library_segment
  | FrozenState of Summary.frozen

and library_segment = (section_path * node) list

type library_entry = section_path * node


(*s Adding operations, and getting the current list of operations (most 
  recent ones coming first). *)

val add_leaf : identifier -> path_kind -> obj -> section_path
val add_anonymous_leaf : obj -> section_path

val contents_after : section_path option -> library_segment

val map_leaf : section_path -> obj

(*s Opening and closing a section. *)

val open_section : string -> section_path
val close_section : string -> unit

val make_path : identifier -> path_kind -> section_path
val cwd : unit -> string list

val open_module : string -> unit
val export_module : unit -> library_segment


(*s Backtracking (undo). *)

val reset_to : section_path -> unit


(*s We can get and set the state of the operations (used in [States]). *)

type frozen

val freeze : unit -> frozen
val unfreeze : frozen -> unit

val init : unit -> unit