predlist are true, i.e. the names of the packages required by pkg. The returned list is unsorted.

Raises No_such_package if the package pkg or one of its ancestors could not be found.

val package_deep_ancestors : string list -> string list -> string list
package_deep_ancestors predlist pkglist: determines the list of direct or indirect ancestors of the packages named in pkglist under the assumption that the predicates in predlist are true.

The returned list is topologically sorted: The first element is the deepest ancestor; the last element is one of pkglist.

Raises No_such_package if one of the packages in pkglist or one of the ancestors cannot be found. Raises Package_loop if there is a cyclic dependency.

val resolve_path : ?base:string -> string -> string
Resolves findlib notation in filename paths. The notation +name/path can be used to refer to the subdirectory name of the standard library directory; the continuation /path is optional. The notation @name/path can be used to refer to the directory of the package name; the continuation /path is optional. For these two notations, absolute paths are returned.


base : When the function is applied on a relative path, the base path is prepended. Otherwise, the path is returned as it is.
val list_packages : ?tab:int -> ?descr:bool -> Pervasives.out_channel -> unit
Prints the list of available packages to the out_channel.


tab : The tabulator width, by default 20
descr : Whether package descriptions are printed. Default: false
./usr/share/doc/ocaml-findlib/html/api/Fl_metascanner.html0000644000000000000000000001617611003374405022425 0ustar rootroot Fl_metascanner

Module Fl_metascanner


module Fl_metascanner: sig .. end
Parses META files

type formal_pred = [ `NegPred of string | `Pred of string ] 
type flavour = [ `Appendix | `BaseDef ] 
`BaseDef refers to META definitions using the "=" operator, and `Appendix refers to definitions using the "+=" operator.

type pkg_definition = {
   def_var : string; (*The name of the defined variable*)
   def_flav : flavour; (*The flavour of the definition*)
   def_preds : formal_pred list; (*The formal predicates of the def*)
   def_value : string; (*The value assigned to the variable*)
}
A pkg_definition is expressed by the syntax
 var(p1,p2,...) = "value" 
(flavour `BaseDef), or the syntax
 var(p1,p2,...) += "value" 
(flavour `Appendix) in the META file. The list of predicates may be omitted. Predicates may be negated by using "-", e.g. "-x".

type pkg_expr = {
   pkg_defs : pkg_definition list;
   pkg_children : (string * pkg_expr) list;
}
A value of type pkg_expr denotes the contents of a META file. The component pkg_defs are the variable definitions. The component pkg_children contains the definitions of the subpackages.
val parse : Pervasives.in_channel -> pkg_expr
parse ch: scans and parses the file connected with channel ch. The file must have a syntax compatible with the META format. The return value contains the found definitions for the package and all subpackages.

exception Stream.Error of string: is raised on syntax errors. The string explains the error.

val print : Pervasives.out_channel -> pkg_expr -> unit
print ch expr: Outputs the package expression to a channel.
val lookup : string -> string list -> pkg_definition list -> string
lookup variable_name predicate_list def:

Returns the value of variable_name in def under the assumption that the predicates in predicate_list hold, but no other predicates.

The rules are as follows: In the step (A), only the `BaseDef definitions are considered. The first base definition is determined that matches all predicates and that has the longest predicate list. In the step (B) only the `Appendix definitions are considered. All definitions are determined that match all predicates. The final result is the concatenation of the single result of (A) and all results of (B) (in the order they are defined). A space character is inserted between two concatenated strings.

When step (A) does not find any matching definition