1995-08-09 08:06:35 -07:00
|
|
|
(***********************************************************************)
|
|
|
|
(* *)
|
2011-07-27 07:17:02 -07:00
|
|
|
(* OCaml *)
|
1995-08-09 08:06:35 -07:00
|
|
|
(* *)
|
|
|
|
(* Xavier Leroy, projet Cristal, INRIA Rocquencourt *)
|
|
|
|
(* *)
|
1996-04-30 07:53:58 -07:00
|
|
|
(* Copyright 1996 Institut National de Recherche en Informatique et *)
|
1999-11-17 10:59:06 -08:00
|
|
|
(* en Automatique. All rights reserved. This file is distributed *)
|
2001-12-07 05:41:02 -08:00
|
|
|
(* under the terms of the GNU Library General Public License, with *)
|
|
|
|
(* the special exception on linking described in file ../LICENSE. *)
|
1995-08-09 08:06:35 -07:00
|
|
|
(* *)
|
|
|
|
(***********************************************************************)
|
|
|
|
|
|
|
|
(* $Id$ *)
|
|
|
|
|
2001-10-26 15:37:14 -07:00
|
|
|
(** Character operations. *)
|
1995-05-04 03:15:53 -07:00
|
|
|
|
1998-12-02 02:40:33 -08:00
|
|
|
external code : char -> int = "%identity"
|
2001-12-03 14:01:28 -08:00
|
|
|
(** Return the ASCII code of the argument. *)
|
2005-10-25 11:34:07 -07:00
|
|
|
|
2001-12-03 14:01:28 -08:00
|
|
|
val chr : int -> char
|
2001-10-26 15:37:14 -07:00
|
|
|
(** Return the character with the given ASCII code.
|
|
|
|
Raise [Invalid_argument "Char.chr"] if the argument is
|
|
|
|
outside the range 0--255. *)
|
|
|
|
|
2001-12-03 14:01:28 -08:00
|
|
|
val escaped : char -> string
|
2001-10-26 15:37:14 -07:00
|
|
|
(** Return a string representing the given character,
|
|
|
|
with special characters escaped following the lexical conventions
|
2011-07-27 07:17:02 -07:00
|
|
|
of OCaml. *)
|
2001-10-26 15:37:14 -07:00
|
|
|
|
2001-12-03 14:01:28 -08:00
|
|
|
val lowercase : char -> char
|
2001-10-26 15:37:14 -07:00
|
|
|
(** Convert the given character to its equivalent lowercase character. *)
|
|
|
|
|
2001-12-03 14:01:28 -08:00
|
|
|
val uppercase : char -> char
|
2001-10-26 15:37:14 -07:00
|
|
|
(** Convert the given character to its equivalent uppercase character. *)
|
|
|
|
|
2002-06-26 02:13:59 -07:00
|
|
|
type t = char
|
|
|
|
(** An alias for the type of characters. *)
|
|
|
|
|
|
|
|
val compare: t -> t -> int
|
|
|
|
(** The comparison function for characters, with the same specification as
|
|
|
|
{!Pervasives.compare}. Along with the type [t], this function [compare]
|
|
|
|
allows the module [Char] to be passed as argument to the functors
|
|
|
|
{!Set.Make} and {!Map.Make}. *)
|
|
|
|
|
2001-10-30 08:52:04 -08:00
|
|
|
(**/**)
|
1995-08-09 06:15:01 -07:00
|
|
|
|
2012-03-14 09:03:15 -07:00
|
|
|
(* The following is for system use only. Do not call directly. *)
|
|
|
|
|
2001-12-03 14:01:28 -08:00
|
|
|
external unsafe_chr : int -> char = "%identity"
|