module Extlib:Useful operations.sig
..end
This module does not depend of any of frama-c module.
Consult the Plugin Development Guide for additional details.
val nop : 'a -> unit
val adapt_filename : string -> string
val max_cpt : int -> int -> int
val number_to_color : int -> int
exception NotYetImplemented of string
val not_yet_implemented : string -> 'a
NotYetImplemented
with the given string.val mk_fun : string -> ('a -> 'b) Pervasives.ref
NotYetImplemented
if it is called).val ($) : ('a -> 'b) -> ('c -> 'a) -> 'c -> 'b
val swap : ('a -> 'b -> 'c) -> 'b -> 'a -> 'c
val as_singleton : 'a list -> 'a
Invalid_argument
on a non singleton list.val filter_out : ('a -> bool) -> 'a list -> 'a list
val filter_map : ('a -> bool) -> ('a -> 'b) -> 'a list -> 'b list
filter
and map
.val product_fold : ('a -> 'b -> 'c -> 'a) -> 'a -> 'b list -> 'c list -> 'a
product f acc l1 l2
is similar to fold_left f acc l12
with l12 the
list of all pairs of an elt of l1
and an elt of l2
val product : ('a -> 'b -> 'c) -> 'a list -> 'b list -> 'c list
product f l1 l2
applies f
to all the pairs of an elt of l1
and
an element of l2
.val find_index : ('a -> bool) -> 'a list -> int
Not_found
if no element in the list matches the conditionval list_compare : ('a -> 'a -> int) -> 'a list -> 'a list -> int
val may : ('a -> unit) -> 'a option -> unit
val may_map : ('a -> 'b) -> ?dft:'b -> 'a option -> 'b
may_map f ?dft x
applies f
to the value of x
if exists. Otherwise
returns the default value dft
.
Assume that either x
or dft
is defined.val opt_map : ('a -> 'b) -> 'a option -> 'b option
val opt_filter : ('a -> bool) -> 'a option -> 'a option
val the : 'a option -> 'a
Invalid_argument
if the value is none.val find_or_none : ('a -> 'b) -> 'a -> 'b option
val opt_equal : ('a -> 'a -> bool) -> 'a option -> 'a option -> bool
val opt_compare : ('a -> 'a -> int) -> 'a option -> 'a option -> int
val string_prefix : ?strict:bool -> string -> string -> bool
string_prefix ~strict p s
returns true
if and only if p
is a
prefix of the string s
. If strict
is true, the prefix must be strict
(that is, s
must moreover be strictly longer than p
. strict
is false by default.val getperfcount : unit -> int
val getperfcount1024 : unit -> int
val time : ?msg:string -> ('a -> 'b) -> 'a -> 'b
val time1024 : ?msg:string -> ('a -> 'b) -> 'a -> 'b
val address_of_value : 'a -> int
val try_finally : finally:(unit -> unit) -> ('a -> 'b) -> 'a -> 'b
val cleanup_at_exit : string -> unit
cleanup_at_exit file
indicates that file
must be removed when the
program exits (except if exit is caused by a signal).
If file
does not exist, nothing happens.val temp_file_cleanup_at_exit : string -> string -> string
Filename.temp_file
except that the temporary file will be
deleted at the end of the execution (see above).val safe_remove : string -> unit