(***********************************************************************)
(*                                                                     *)
(*                                 GALAX                               *)
(*                              XQuery Engine                          *)
(*                                                                     *)
(*  Copyright 2001-2003, Lucent Technologies.                          *)
(*  Distributed only by permission.                                    *)
(*                                                                     *)
(***********************************************************************)

(* $Id: glx_pxp.mli,v 1.4 2003/05/13 16:54:01 simeon Exp $ *)

(* Module Glx_pxp
   Description:
     This module contains some stuff used to hook up Galax to PXP.
*)

(* Character encoding *)

type encoding = Pxp_types.encoding
      (* All possible external encodings *)

type rep_encoding = Pxp_types.rep_encoding
      (* All possible internal encodings *)

val encoding_of_string : string -> encoding
val string_of_encoding : encoding -> string

val encoding_of_rep_encoding : rep_encoding -> encoding
val rep_encoding_of_encoding : encoding -> rep_encoding

(* Smart lexing buffers *)

type resolver

val resolve_as_file   : unit -> resolver
val resolve_as_string : string -> resolver
val init_resolver   : resolver -> rep_encoding -> unit
val close_resolver  : resolver -> unit

val change_encoding : resolver -> string -> unit

val open_resolver   : resolver -> string -> Lexing.lexbuf

(* String / character conversion capabilities *)

val write_data_string : rep_encoding -> encoding -> string -> string
val write_markup_string : rep_encoding -> encoding -> string -> string

val character : rep_encoding -> int -> string

