File: uicommon.mli

package info (click to toggle)
unison 2.40.102-2
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 12,648 kB
  • ctags: 4,884
  • sloc: ml: 29,379; objc: 6,745; ansic: 1,384; makefile: 523; sh: 80
file content (117 lines) | stat: -rw-r--r-- 3,699 bytes parent folder | download | duplicates (2)
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
(* Unison file synchronizer: src/uicommon.mli *)
(* Copyright 1999-2009, Benjamin C. Pierce (see COPYING for details) *)

(* Kinds of UI *)
type interface =
   Text
 | Graphic

(* The interface of a concrete UI implementation *)
module type UI =
sig
  val start : interface -> unit
  val defaultUi : interface
end

(* User preference: when true, ask fewer questions *)
val auto : bool Prefs.t

(* User preference: How tall to make the main window in the GTK ui *)
val mainWindowHeight : int Prefs.t

(* User preference: Expert mode *)
val expert : bool Prefs.t

(* User preference: Whether to display 'contacting server' message *)
val contactquietly : bool Prefs.t

(* User preference: The 'contacting server' message itself *)
val contactingServerMsg : unit -> string

(* User preference: Descriptive label for this profile *)
val profileLabel : string Prefs.t

(* User preference: Synchronize repeatedly *)
val repeat : string Prefs.t

(* User preference: Try failing paths N times *)
val retry : int Prefs.t

(* User preference: confirmation before committing merge results *)
val confirmmerge : bool Prefs.t

(* Format the information about current contents of a path in one replica (the second argument
   is used as a separator) *)
val details2string : Common.reconItem -> string -> string

(* Format a path, eliding initial components that are the same as the
   previous path *)
val displayPath : Path.t -> Path.t -> string

(* Format the names of the roots for display at the head of the
   corresponding columns in the UI *)
val roots2string : unit -> string

(* Format a reconItem (and its status string) for display, eliding
   initial components that are the same as the previous path *)
val reconItem2string : Path.t -> Common.reconItem -> string -> string

type action = AError | ASkip of bool | ALtoR of bool | ARtoL of bool | AMerge

(* Same as previous function, but returns a tuple of strings *)
val reconItem2stringList :
  Path.t -> Common.reconItem -> string * action * string * string

(* Format an exception for display *)
val exn2string : exn -> string

(* Calculate and display differences for a file *)
val showDiffs :
     Common.reconItem           (* what path *)
  -> (string->string->unit)     (* how to display the (title and) result *)
  -> (string->unit)             (* how to display errors *)
  -> Uutil.File.t               (* id for transfer progress reports *)
  -> unit

val dangerousPathMsg : Path.t list -> string

(* Utilities for adding ignore patterns *)
val ignorePath : Path.t -> string
val ignoreName : Path.t -> string
val ignoreExt  : Path.t -> string
val addIgnorePattern : string -> unit

val usageMsg : string

val shortUsageMsg : string

val uiInit :
    reportError:(string -> unit) ->
    tryAgainOrQuit:(string -> bool) ->
    displayWaitMessage:(unit -> unit) ->
    getProfile:(unit -> string option) ->
    getFirstRoot:(unit -> string option) ->
    getSecondRoot:(unit -> string option) ->
    termInteract:(string -> string -> string) option ->
    unit

val initPrefs :
  profileName:string ->
  displayWaitMessage:(unit->unit) ->
  getFirstRoot:(unit->string option) ->
  getSecondRoot:(unit->string option) ->
  termInteract:(string -> string -> string) option ->
  unit

val validateAndFixupPrefs : unit -> unit Lwt.t

(* Exit codes *)
val perfectExit: int   (* when everything's okay *)
val skippyExit: int    (* when some items were skipped, but no failure occurred *)
val failedExit: int    (* when there's some non-fatal failure *)
val fatalExit: int     (* when fatal failure occurred *)
val exitCode: bool * bool -> int
(* (anySkipped?, anyFailure?) -> exit code *)

(* Initialization *)
val testFunction : (unit->unit) ref