summaryrefslogtreecommitdiff
path: root/gcc/ada/a-swunau.ads
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2005-03-15 15:53:10 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2005-03-15 15:53:10 +0000
commit90fd25c58b1661a5ad762daba6800b86eb95485e (patch)
tree5ce32e503ea5e4af6010553a51d8e39be3fbf801 /gcc/ada/a-swunau.ads
parent20e42bc1b770789e9db37f51ca755d305f5b2eec (diff)
downloadgcc-90fd25c58b1661a5ad762daba6800b86eb95485e.tar.gz
2005-03-08 Robert Dewar <dewar@adacore.com>
PR ada/13470 * a-stunau.ads, a-stunau.adb: Change interface to allow efficient (and correct) implementation The previous changes to allow extra space in unbounded strings had left this interface a bit broken. * a-suteio.adb: Avoid unnecessary use of Get/Set_String * g-spipat.ads, g-spipat.adb: New interface for Get_String Minor reformatting (function specs) * g-spitbo.adb: New interface for Get_String * g-spitbo.ads: Minor reformatting * a-swunau.ads, a-swunau.adb: New interface for Get_Wide_String * a-szunau.ads, a-szunau.adb: New interface for Get_Wide_Wide_String git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@96488 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/a-swunau.ads')
-rw-r--r--gcc/ada/a-swunau.ads24
1 files changed, 13 insertions, 11 deletions
diff --git a/gcc/ada/a-swunau.ads b/gcc/ada/a-swunau.ads
index dbecd4f0b11..da8bfc02342 100644
--- a/gcc/ada/a-swunau.ads
+++ b/gcc/ada/a-swunau.ads
@@ -39,20 +39,22 @@
package Ada.Strings.Wide_Unbounded.Aux is
pragma Preelaborate (Aux);
- function Get_Wide_String
- (U : Unbounded_Wide_String) return Wide_String_Access;
+ procedure Get_Wide_String
+ (U : Unbounded_Wide_String;
+ S : out Wide_String_Access;
+ L : out Natural);
pragma Inline (Get_Wide_String);
- -- This function returns the internal string pointer used in the
- -- representation of an unbounded string. There is no copy involved,
- -- so the value obtained references the same string as the original
- -- unbounded string. The characters of this string may not be modified
- -- via the returned pointer, and are valid only as long as the original
- -- unbounded string is not modified. Violating either of these two
- -- rules results in erroneous execution.
+ -- This procedure returns the internal string pointer used in the
+ -- representation of an unbounded string as well as the actual current
+ -- length (which may be less than S.all'Length because in general there
+ -- can be extra space assigned). The characters of this string may be
+ -- not be modified via the returned pointer, and are valid only as
+ -- long as the original unbounded string is not accessed or modified.
--
- -- This function is much more efficient than the use of To_Wide_String
+ -- This procedure is much more efficient than the use of To_Wide_String
-- since it avoids the need to copy the string. The lower bound of the
- -- referenced string returned by this call is always one.
+ -- referenced string returned by this call is always one, so the actual
+ -- string data is always accessible as S (1 .. L).
procedure Set_Wide_String
(UP : in out Unbounded_Wide_String;