summaryrefslogtreecommitdiff
path: root/gcc/ada/i-cstrea.ads
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2014-07-18 10:56:54 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2014-07-18 10:56:54 +0000
commit715eae3662267766e2cac9642b84bb6d9df76d93 (patch)
tree623ebcb7d17d16425291f23fee7e8a60a5be9602 /gcc/ada/i-cstrea.ads
parent7a878515053b16eb4372724906e905b5208dce4e (diff)
downloadgcc-715eae3662267766e2cac9642b84bb6d9df76d93.tar.gz
2014-07-18 Pascal Obry <obry@adacore.com>
* a-textio.adb: Rename Is_Text_File to Text_Encoding. * a-ztexio.adb: Likewise. * a-witeio.adb: Likewise. (Open): Pass file's translation mode to set_text_mode. * s-ficobl.ads (Content_Encoding): New type. (Text_Content_Encoding): New subtype. (AFCB): Rename Is_Text_File to Text_Encoding. * s-fileio.adb (Open): Handles new text_translation values. Remove Is_Text_File which is equivalent to Text_Encoding in Text_Content_Encoding. * adaint.h (__gnat_set_mode): New routine. * sysdep.c (__gnat_set_wide_text_mode): Removed. (__gnat_set_mode): New routine. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@212810 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/i-cstrea.ads')
-rw-r--r--gcc/ada/i-cstrea.ads18
1 files changed, 12 insertions, 6 deletions
diff --git a/gcc/ada/i-cstrea.ads b/gcc/ada/i-cstrea.ads
index ed2a5593ade..add85b33bf8 100644
--- a/gcc/ada/i-cstrea.ads
+++ b/gcc/ada/i-cstrea.ads
@@ -228,11 +228,17 @@ package Interfaces.C_Streams is
-- versa. These functions have no effect if text_translation_required is
-- false (e.g. in normal unix mode). Use fileno to get a stream handle.
- procedure set_wide_text_mode (handle : int);
- -- This is similar to set_text_mode but switches the translation to 16-bit
- -- wide-character instead of 8-bit character. Again, this routine has no
- -- effect if text_translation_required is false. On Windows this is used
- -- to have proper 16-bit wide-string output on the console for example.
+ procedure set_mode (handle : int; Mode : int);
+ -- As above but can set the handle to any mode. On Windows this can be used
+ -- to have proper 16-bit wide-string output on the console for example. The
+ -- mode value corresponds to Content_Encoding'Pos:
+ -- 0 = binary, equivalent to set_binary_mode
+ -- 1 = default mode, as set by the GNAT_CCS_ENCODING or equivalent to 2
+ -- 2 = text, equivalent to set_text_mode
+ -- 3 = u8text, set encoding to Unicode UTF-8
+ -- 4 = wide-text, set encoding to Unicode
+ -- 5 = u16text, set encoding to Unicode UTF-16
+ -- Wouldn't it be better to use an enumeration type here???
----------------------------
-- Full Path Name support --
@@ -264,7 +270,7 @@ private
pragma Import (C, set_binary_mode, "__gnat_set_binary_mode");
pragma Import (C, set_text_mode, "__gnat_set_text_mode");
- pragma Import (C, set_wide_text_mode, "__gnat_set_wide_text_mode");
+ pragma Import (C, set_mode, "__gnat_set_mode");
pragma Import (C, max_path_len, "__gnat_max_path_len");
pragma Import (C, full_name, "__gnat_full_name");