Module Pretty_source


module Pretty_source: sig .. end
Utilities to pretty print source with located elements in a Gtk TextBuffer.
Consult the Plugin Development Guide for additional details.


type localizable =
| PStmt of (Db_types.kernel_function * Cil_types.stmt)
| PLval of (Db_types.kernel_function option * Cil_types.kinstr * Cil_types.lval)
| PTermLval of (Db_types.kernel_function option * Cil_types.kinstr * Cil_types.term_lval)
| PVDecl of (Db_types.kernel_function option * Cil_types.varinfo)
| PGlobal of Cil_types.global
| PIP of Property.t
The kind of object that can be selected in the source viewer.
Consult the Plugin Development Guide for additional details.
module Localizable: Datatype.S  with type t = localizable
module Locs: sig .. end
val display_source : Cil_types.global list ->
GSourceView2.source_buffer ->
host:Gtk_helper.host ->
highlighter:(localizable -> start:int -> stop:int -> unit) ->
selector:(button:int -> localizable -> unit) ->
Locs.state
The selector and the highlighter are always host#protected. The selector will not be called when not !Gtk_helper.gui_unlocked. This returns a state to pass to the functions defined hereafter.
val hilite : Locs.state -> unit
val locate_localizable : Locs.state -> localizable -> (int * int) option
Returns Some (start,stop) in offset from start of buffer if the given localizable has been displayed according to Locs.locs.
Consult the Plugin Development Guide for additional details.
val kf_of_localizable : localizable -> Db_types.kernel_function option
val ki_of_localizable : localizable -> Cil_types.kinstr
val varinfo_of_localizable : localizable -> Cil_types.varinfo option
val localizable_from_locs : Locs.state ->
file:string -> line:int -> localizable list
Returns the lists of localizable in file at line visible in the current Locs.state. This function is inefficient as it iterates on all the current Locs.state.