Frama-C API - Typed_parameter
Parameter settable through a command line option. This is a low level API, internally used by the kernel. As a plug-in developer, you certainly prefer to use the API of Plugin
instead.
type ('a, 'b) gen_accessor = {
get : unit -> 'a;
set : 'a -> unit;
add_set_hook : ('b -> 'b -> unit) -> unit;
add_update_hook : ('b -> 'b -> unit) -> unit;
}
generic accessor type
type 'a accessor = ('a, 'a) gen_accessor
type parameter = private {
name : string;
(*Name of the option corresponding to the parameter. It is exactly the state name of the option (see
*)State.get_name
).help : string;
(*Help message
*)accessor : typed_accessor;
(*How to get and set the value of the parameter
*)visible : bool;
(*Is visible to the user, e.g. in the command-line help
*)reconfigurable : bool;
(*Can be reconfigured, e.g. in the GUI
*)is_set : unit -> bool;
(*Is this option really set?
*)
}
include Datatype.S_with_collections with type t = parameter
include Datatype.S with type t = parameter
include Datatype.S_no_copy with type t = parameter
val packed_descr : Structural_descr.pack
Packed version of the descriptor.
val reprs : t list
List of representants of the descriptor.
val hash : t -> int
Hash function: same spec than Hashtbl.hash
.
val pretty : Stdlib.Format.formatter -> t -> unit
Pretty print each value in an user-friendly way.
val mem_project : (Project_skeleton.t -> bool) -> t -> bool
mem_project f x
must return true
iff there is a value p
of type Project.t
in x
such that f p
returns true
.
module Set : Datatype.Set with type elt = t
module Map : Datatype.Map with type key = t
module Hashtbl : Datatype.Hashtbl with type key = t
val get : string -> t
Get the parameter from the option name.
val get_value : t -> string
Get the current value of the parameter, as a string.