sig
  type host =
      H_hostname of string
    | H_ip4_addr of Cf_ip4_addr.opaque Cf_ip4_addr.t
  type server = {
    srv_user : string option;
    srv_host : Cf_uri.host;
    srv_port : int option;
  }
  type authority = A_server of Cf_uri.server option | A_reg_name of string
  type segment = { seg_name : string; seg_params : string list; }
  type net_path = {
    net_authority : Cf_uri.authority;
    net_path : Cf_uri.segment list;
  }
  type net = [ `Net of Cf_uri.net_path ]
  type abs = [ `Abs of Cf_uri.segment * Cf_uri.segment list ]
  type rel = [ `Rel of Cf_uri.segment list ]
  type path =
      [ `Abs of Cf_uri.segment * Cf_uri.segment list
      | `Net of Cf_uri.net_path
      | `Rel of Cf_uri.segment list ]
  type abs_special_hier = {
    abs_hier_path :
      [ `Abs of Cf_uri.segment * Cf_uri.segment list
      | `Net of Cf_uri.net_path ];
    abs_hier_query : string option;
  }
  type abs_special = S_hier of Cf_uri.abs_special_hier | S_opaque of string
  type absolute = { abs_scheme : string; abs_special : Cf_uri.abs_special; }
  type relative = { rel_path : Cf_uri.path; rel_query : string option; }
  type t = A of Cf_uri.absolute | R of Cf_uri.relative
  type reference = { ref_uri : Cf_uri.t; ref_fragment : string option; }
  exception Rel_undefined
  val escape : ?allow:(char -> bool) -> string -> string
  val unescape : string -> string
  val refer_to_base :
    base:Cf_uri.absolute -> rel:Cf_uri.relative -> Cf_uri.absolute
  val message_to_uri : Cf_message.t -> Cf_uri.t
  val message_to_absolute_uri :
    base:Cf_uri.absolute -> Cf_message.t -> Cf_uri.absolute
  val message_to_uri_reference : Cf_message.t -> Cf_uri.reference
  val message_to_absolute_uri_reference :
    base:Cf_uri.absolute -> Cf_message.t -> Cf_uri.reference
  val emit_host : Format.formatter -> Cf_uri.host -> unit
  val emit_server : Format.formatter -> Cf_uri.server -> unit
  val emit_authority : Format.formatter -> Cf_uri.authority -> unit
  val emit_path : Format.formatter -> [< Cf_uri.path ] -> unit
  val emit_abs_special : Format.formatter -> Cf_uri.abs_special -> unit
  val emit_uri : Format.formatter -> Cf_uri.t -> unit
  val emit_uri_reference : Format.formatter -> Cf_uri.reference -> unit
  val message_of_uri : Cf_uri.t -> Cf_message.t
  val message_of_uri_reference : Cf_uri.reference -> Cf_message.t
end