Bap_main.ExtensionWriting and declaring BAP extensions.
type 'a typdefines a data type for a parameter.
val declare :
?features:string list ->
?provides:string list ->
?doc:string ->
(ctxt -> (unit, error) Stdlib.result) ->
unitdeclare extension declares the extension function.
The function is run when one of the features provided by the extension is required by the call to Bap_main.init and all features needed by the extension are present.
If extension evaluates to Error condition, then no other extensions will be evaluated and the initialization procedure will stop immediately with the Error condition as the final result.
If extension raises an exception e, then it will be caught, and the initialization procedure will terminated immediately with the Error (Error.Bug (e,backtrace).
@parameter features is a set of application features that the declared extension expects. If there is a feature that is required but not provided by an application, then the extension will not be evaluated. See the corresponding features parameter of the init function, as well as the Features section.
@parameter provides is a set of features that the extension provides. During the initialization, only those extensions that provide features that are requested by the application are loaded. All configuration parameters of the extension will be attributed with tags from the provides set, so that they will only affect those components that explicitly depend on of the specified features. Note that, the set of provided features is shared by all extensions of a plugin, in other words it is an attribute of a plugin rather than of a particular extension function.
@parameter doc is the documentation provided with the extension. It can take a form of a one line description or a full manual written in the markdown syntax. See the corresponding man parameter of the Bap_main.init function.
val documentation : string -> unitdocumentation s specifies plugin documentation.
A non-declarative way of specifying documentation. Each occurrence of the documentation s appends s to the plugin documentation, as well as each occurrence of the doc parameter of the Extension.declare function.
See the doc parameter of the Extension.declare and !Bap_main.init functions for more information on the accepted formats.
module Command : sig ... endInterface for specifying commands.
module Configuration : sig ... endConfiguration Parameters.
module Syntax : sig ... endA lightweight syntax for accessing configuration parameters.
module Type : sig ... endData types for parameters.
module Error : sig ... endAn extensible set of possible errors