diff options
author | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-04-06 09:23:12 +0000 |
---|---|---|
committer | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-04-06 09:23:12 +0000 |
commit | b4fde0cf29d17f951cc51fe014d8fb877ab9f47f (patch) | |
tree | 6b7e25930e8254d2db9568b0aa6ac5b49373b92d /gcc/ada/s-ficobl.ads | |
parent | e9553e01b9b3f21919d925a3552f70cc0f25e435 (diff) | |
download | gcc-b4fde0cf29d17f951cc51fe014d8fb877ab9f47f.tar.gz |
2007-04-06 Pascal Obry <obry@adacore.com>
* i-cstrea.ads: (fopen): Add encoding parameter.
(freopen): Idem.
Change reference from a-sysdep.c to sysdep.c in comment.
Update copyright notice.
This set of patch add support for the encoding form parameter.
* mingw32.h (S2WSU): New macro to convert from a string to a
wide-string using the UTF-8 encoding. The S2WS macro supports now only
standard 8bits encoding.
(WS2SU): As above but converting from wide-sring to string.
This is needed as it is necessary to have access to both versions in the
runtime for the form parameter encoding support.
This set of patch add support for the encoding form parameter.
(S2WS): Improve implementation to handle cases where the filename is not
UTF-8 encoded. In this case we default to using the current code page
for the conversion.
* s-crtl-vms64.ads, s-crtl.ads (Filename_Encoding): New enumeration
type (UTF8, ASCII_8bits). This enumeration has a rep clause to match
the constants defined in adaint.h.
(fopen): Add encoding parameter.
(freopen): Idem.
* s-ficobl.ads (AFCB): Add Encoding field to record the filename
encoding. This is needed for the Reset routine (freopen low level-call).
* s-fileio.adb (Open): Decode encoding form parameter and set the
corresponding encoding value into AFCB structure.
(Reset): Pass the encoding value to freopen.
(Close): Move the call to Lock_Task to the beginning of the procedure.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@123578 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/s-ficobl.ads')
-rw-r--r-- | gcc/ada/s-ficobl.ads | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/gcc/ada/s-ficobl.ads b/gcc/ada/s-ficobl.ads index f19ea793bf2..7c1e1c45024 100644 --- a/gcc/ada/s-ficobl.ads +++ b/gcc/ada/s-ficobl.ads @@ -6,7 +6,7 @@ -- -- -- S p e c -- -- -- --- Copyright (C) 1992-2004 Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2006, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -39,6 +39,7 @@ with Ada.Streams; with Interfaces.C_Streams; +with System.CRTL; package System.File_Control_Block is @@ -90,6 +91,9 @@ package System.File_Control_Block is -- files, and also for standard files (stdin, stdout, stderr). The -- name is always null-terminated if it is non-null. + Encoding : System.CRTL.Filename_Encoding; + -- Encoding used to specified the filename + Form : Pstring; -- A pointer to the form string. This is the string used in the -- fopen call, and must be supplied by the caller (there are no @@ -143,13 +147,13 @@ package System.File_Control_Block is -- that the argument Control_Block is not used other than as the argument -- that controls which version of AFCB_Allocate is called. - procedure AFCB_Close (File : access AFCB) is abstract; + procedure AFCB_Close (File : not null access AFCB) is abstract; -- Performs any specialized close actions on a file before the file is -- actually closed at the system level. This is called by Close, and -- the reason we need the primitive operation is for the automatic -- close operations done as part of finalization. - procedure AFCB_Free (File : access AFCB) is abstract; + procedure AFCB_Free (File : not null access AFCB) is abstract; -- Frees the AFCB referenced by the given parameter. It is not necessary -- to free the strings referenced by the Form and Name fields, but if the -- extension has any other heap objects, they must be freed as well. This |