Frama-C:
Plug-ins:
Libraries:

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.

  • since Nitrogen-20111001
type ('a, 'b) gen_accessor = {
  1. get : unit -> 'a;
  2. set : 'a -> unit;
  3. add_set_hook : ('b -> 'b -> unit) -> unit;
  4. add_update_hook : ('b -> 'b -> unit) -> unit;
}

generic accessor type

type 'a accessor = ('a, 'a) gen_accessor
type typed_accessor =
  1. | Bool of bool accessor * string option
    (*

    the negative option, if any

    *)
  2. | Int of int accessor * unit -> int * int
    (*

    getting range

    *)
  3. | String of string accessor * unit -> string list
    (*

    possible values

    *)
type parameter = private {
  1. name : string;
    (*

    Name of the option corresponding to the parameter. It is exactly the state name of the option (see State.get_name).

    *)
  2. help : string;
    (*

    Help message

    *)
  3. accessor : typed_accessor;
    (*

    How to get and set the value of the parameter

    *)
  4. visible : bool;
    (*

    Is visible to the user, e.g. in the command-line help

    *)
  5. reconfigurable : bool;
    (*

    Can be reconfigured, e.g. in the GUI

    *)
  6. 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 name : string

Unique name of the datatype.

val descr : t Descr.t

Datatype descriptor.

val packed_descr : Structural_descr.pack

Packed version of the descriptor.

val reprs : t list

List of representants of the descriptor.

val equal : t -> t -> bool
val compare : t -> t -> int

Comparison: same spec than Stdlib.compare.

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.

val copy : t -> t

Deep copy: no possible sharing between x and copy x.

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.