/usr/share/ada/adainclude/adacgi/ustrings.adb is in libadacgi1-dev 1.6-20.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 | package body Ustrings is
Input_Line_Buffer_Length : constant := 1024;
-- If an input line is longer, Get_Line will recurse to read in the line.
procedure Swap(Left, Right : in out Unbounded_String) is
-- Implement Swap. This is the portable but slow approach.
Temporary : Unbounded_String;
begin
Temporary := Left;
Left := Right;
Right := Temporary;
end Swap;
-- Implement Unbounded_String I/O by calling Text_IO String routines.
-- Get_Line gets a line of text, limited only by the maximum number of
-- characters in an Unbounded_String. It reads characters into a buffer
-- and if that isn't enough, recurses to read the rest.
procedure Get_Line (File : in File_Type; Item : out Unbounded_String) is
function More_Input return Unbounded_String is
Input : String (1 .. Input_Line_Buffer_Length);
Last : Natural;
begin
Get_Line (File, Input, Last);
if Last < Input'Last then
return To_Unbounded_String (Input(1..Last));
else
return To_Unbounded_String (Input(1..Last)) & More_Input;
end if;
end More_Input;
begin
Item := More_Input;
end Get_Line;
procedure Get_Line(Item : out Unbounded_String) is
begin
Get_Line(Current_Input, Item);
end Get_Line;
procedure Put(File : in File_Type; Item : in Unbounded_String) is
begin
Put(File, To_String(Item));
end Put;
procedure Put(Item : in Unbounded_String) is
begin
Put(Current_Output, To_String(Item));
end Put;
procedure Put_Line(File : in File_Type; Item : in Unbounded_String) is
begin
Put(File, Item);
New_Line(File);
end Put_Line;
procedure Put_Line(Item : in Unbounded_String) is
begin
Put(Current_Output, Item);
New_Line;
end Put_Line;
end Ustrings;
|