summaryrefslogtreecommitdiff
path: root/stdlib/scanf.mli
diff options
context:
space:
mode:
authorPierre Weis <Pierre.Weis@inria.fr>2002-05-12 18:40:15 +0000
committerPierre Weis <Pierre.Weis@inria.fr>2002-05-12 18:40:15 +0000
commit3652bd03d9989443eec8f231769f02d76221a279 (patch)
tree404e2092c1c0ed9eb22b088c7ab6e373defff2e6 /stdlib/scanf.mli
parent52d75a5e19f3e973de43dec724ae7dbbe1459629 (diff)
downloadocaml-3652bd03d9989443eec8f231769f02d76221a279.tar.gz
Documentation.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@4805 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Diffstat (limited to 'stdlib/scanf.mli')
-rw-r--r--stdlib/scanf.mli21
1 files changed, 12 insertions, 9 deletions
diff --git a/stdlib/scanf.mli b/stdlib/scanf.mli
index 29930402e2..e024881489 100644
--- a/stdlib/scanf.mli
+++ b/stdlib/scanf.mli
@@ -15,8 +15,7 @@
(** Formatted input functions. *)
-val fscanf : in_channel -> ('a, Scanning.scanbuf, 'b) format -> ('a -> 'b);;
-
+val fscanf : in_channel -> ('a, Scanning.scanbuf, 'b) format -> 'a -> 'b;;
(** [fscanf inchan format f] reads tokens from the channel [inchan] according
to the format string [format], converts these tokens to values, and
applies these values to the function [f].
@@ -34,18 +33,22 @@ val fscanf : in_channel -> ('a, Scanning.scanbuf, 'b) format -> ('a -> 'b);;
- [i]: reads an optionally signed integer
(usual input formats for hexadecimal ([0x\[d\]+] and [0X\[d+\]]),
octal ([0o\[d\]+]), and binary [ob\[d\]+] notations are understood).
- - [u]: convert an integer argument to unsigned decimal
+ - [u]: convert an integer argument to unsigned decimal.
- [x]: convert an integer argument to unsigned hexadecimal,
using lowercase letters.
- [X]: convert an integer argument to unsigned hexadecimal,
using uppercase letters.
- [o]: reads an unsigned octal integer.
- [s]: reads a string argument (string ends with a space).
+ - [S]: reads a delimited string argument (delimitors and special
+ escaped characters follow the lexical conventions of Objective Caml).
- [c]: reads a single character.
+ - [C]: reads a single delimited character (delimitors and special
+ escaped characters follow the lexical conventions of Objective Caml).
- [f]: reads a floating-point number in decimal notation,
- in the style [dddd.ddd]
+ in the style [dddd.ddd].
- [e] or [E]: reads a floating-point argument in decimal notation,
- in the style [d.ddd e+-dd] (mantissa and exponent)
+ in the style [d.ddd e+-dd] (mantissa and exponent).
- [g] or [G]: reads a floating-point argument in decimal notation,
in style [f] or [e], [E].
- [b]: reads a boolean argument ([true] or [false]).
@@ -77,12 +80,12 @@ val fscanf : in_channel -> ('a, Scanning.scanbuf, 'b) format -> ('a -> 'b);;
lexing and parsing; if you need efficient language syntactic analysis,
use the corresponding devoted libraries. *)
-val scanf : ('a, Scanning.scanbuf, 'b) format -> ('a -> 'b);;
+val scanf : ('a, Scanning.scanbuf, 'b) format -> 'a -> 'b;;
(** Same as {!Scanf.fscanf}, but inputs from [stdin]. *)
val bscanf :
- Scanning.scanbuf -> ('a, Scanning.scanbuf, 'b) format -> ('a -> 'b);;
-(** Same as {!Scanf.bscanf}, but inputs from the buffer argument. *)
+ Scanning.scanbuf -> ('a, Scanning.scanbuf, 'b) format -> 'a -> 'b;;
+(** Same as {!Scanf.fscanf}, but inputs from the buffer argument. *)
-val sscanf : string -> ('a, Scanning.scanbuf, 'b) format -> ('a -> 'b);;
+val sscanf : string -> ('a, Scanning.scanbuf, 'b) format -> 'a -> 'b;;
(** Same as {!Scanf.fscanf}, but inputs from the string argument. *)