Module Cudf_types


module Cudf_types: sig .. end
CUDF type library

Implement core CUDF types (see CUDF spec. ยง3.2.2), together with parsing and pretty printing for them



CUDF types

type version = int 
type relop = [ `Eq | `Geq | `Gt | `Leq | `Lt | `Neq ] 
type constr = (relop * version) option 

CUDF spec. types

type pkgname = string 
type vpkg = pkgname * constr 
type vpkglist = vpkg list 
type vpkgformula = vpkg list list 
CNF formula. Inner lists are OR-ed, outer AND-ed. E.g.:
type veqpkg = pkgname * ([ `Eq ] * version) option 
type veqpkglist = veqpkg list 
type enum_keep = [ `Keep_feature | `Keep_package | `Keep_version ] 

Parsers

exception Parse_error of string * string
error while parsing the lexical representation of some type arguments:

Public types

val parse_bool : string -> bool
val parse_pkgname : string -> pkgname
val parse_version : string -> version
val parse_vpkg : string -> vpkg
val parse_vpkglist : string -> vpkglist
val parse_vpkgformula : string -> vpkgformula
val parse_veqpkg : string -> veqpkg
val parse_veqpkglist : string -> veqpkglist
val parse_keep : string -> enum_keep

Private (i.e., low-level) types

val parse_relop : string -> relop

Pretty printers


Pretty print to abstract formatters

val pp_bool : Format.formatter -> bool -> unit
val pp_keep : Format.formatter -> enum_keep -> unit
val pp_pkgname : Format.formatter -> pkgname -> unit
val pp_version : Format.formatter -> version -> unit
val pp_vpkg : Format.formatter -> vpkg -> unit
val pp_vpkglist : Format.formatter -> vpkglist -> unit
val pp_vpkgformula : Format.formatter -> vpkgformula -> unit
val pp_veqpkg : Format.formatter -> veqpkg -> unit
val pp_veqpkglist : Format.formatter -> veqpkglist -> unit

Pretty print to string

Shorthand functions.

val string_of_bool : bool -> string
val string_of_keep : enum_keep -> string
val string_of_pkgname : pkgname -> string
val string_of_version : version -> string
val string_of_vpkg : vpkg -> string
val string_of_vpkglist : vpkglist -> string
val string_of_vpkgformula : vpkgformula -> string
val string_of_veqpkg : veqpkg -> string
val string_of_veqpkglist : veqpkglist -> string