This file is indexed.

/usr/share/ada/adainclude/gtkada/glib-string.adb is in libgtkada16.1.0-dev 17.0.2017-2.

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
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
------------------------------------------------------------------------------
--                                                                          --
--      Copyright (C) 1998-2000 E. Briot, J. Brobecker and A. Charlet       --
--                     Copyright (C) 2000-2017, AdaCore                     --
--                                                                          --
-- This library is free software;  you can redistribute it and/or modify it --
-- under terms of the  GNU General Public License  as published by the Free --
-- Software  Foundation;  either version 3,  or (at your  option) any later --
-- version. This library is distributed in the hope that it will be useful, --
-- but WITHOUT ANY WARRANTY;  without even the implied warranty of MERCHAN- --
-- TABILITY or FITNESS FOR A PARTICULAR PURPOSE.                            --
--                                                                          --
--                                                                          --
--                                                                          --
--                                                                          --
--                                                                          --
-- You should have received a copy of the GNU General Public License and    --
-- a copy of the GCC Runtime Library Exception along with this program;     --
-- see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see    --
-- <http://www.gnu.org/licenses/>.                                          --
--                                                                          --
------------------------------------------------------------------------------

pragma Style_Checks (Off);
pragma Warnings (Off, "*is already use-visible*");
with Gtkada.Bindings; use Gtkada.Bindings;

package body Glib.String is

   function From_Object_Free (B : access Gstring) return Gstring is
      Result : constant Gstring := B.all;
   begin
      Glib.g_free (B.all'Address);
      return Result;
   end From_Object_Free;

   ------------
   -- Append --
   ------------

   function Append (Self : Gstring; Val : UTF8_String) return Gstring is
      function Internal
         (Self : Gstring;
          Val  : Interfaces.C.Strings.chars_ptr) return access Gstring;
      pragma Import (C, Internal, "g_string_append");
      Tmp_Val    : Interfaces.C.Strings.chars_ptr := New_String (Val);
      Tmp_Return : access Gstring;
   begin
      Tmp_Return := Internal (Self, Tmp_Val);
      Free (Tmp_Val);
      return From_Object_Free (Tmp_Return);
   end Append;

   ----------------
   -- Append_Len --
   ----------------

   function Append_Len
      (Self : Gstring;
       Val  : UTF8_String;
       Len  : Gssize) return Gstring
   is
      function Internal
         (Self : Gstring;
          Val  : Interfaces.C.Strings.chars_ptr;
          Len  : Gssize) return access Gstring;
      pragma Import (C, Internal, "g_string_append_len");
      Tmp_Val    : Interfaces.C.Strings.chars_ptr := New_String (Val);
      Tmp_Return : access Gstring;
   begin
      Tmp_Return := Internal (Self, Tmp_Val, Len);
      Free (Tmp_Val);
      return From_Object_Free (Tmp_Return);
   end Append_Len;

   ------------------------
   -- Append_Uri_Escaped --
   ------------------------

   function Append_Uri_Escaped
      (Self                   : Gstring;
       Unescaped              : UTF8_String;
       Reserved_Chars_Allowed : UTF8_String;
       Allow_Utf8             : Boolean) return Gstring
   is
      function Internal
         (Self                   : Gstring;
          Unescaped              : Interfaces.C.Strings.chars_ptr;
          Reserved_Chars_Allowed : Interfaces.C.Strings.chars_ptr;
          Allow_Utf8             : Glib.Gboolean) return access Gstring;
      pragma Import (C, Internal, "g_string_append_uri_escaped");
      Tmp_Unescaped              : Interfaces.C.Strings.chars_ptr := New_String (Unescaped);
      Tmp_Reserved_Chars_Allowed : Interfaces.C.Strings.chars_ptr := New_String (Reserved_Chars_Allowed);
      Tmp_Return                 : access Gstring;
   begin
      Tmp_Return := Internal (Self, Tmp_Unescaped, Tmp_Reserved_Chars_Allowed, Boolean'Pos (Allow_Utf8));
      Free (Tmp_Reserved_Chars_Allowed);
      Free (Tmp_Unescaped);
      return From_Object_Free (Tmp_Return);
   end Append_Uri_Escaped;

   ------------
   -- Assign --
   ------------

   function Assign (Self : Gstring; Rval : UTF8_String) return Gstring is
      function Internal
         (Self : Gstring;
          Rval : Interfaces.C.Strings.chars_ptr) return access Gstring;
      pragma Import (C, Internal, "g_string_assign");
      Tmp_Rval   : Interfaces.C.Strings.chars_ptr := New_String (Rval);
      Tmp_Return : access Gstring;
   begin
      Tmp_Return := Internal (Self, Tmp_Rval);
      Free (Tmp_Rval);
      return From_Object_Free (Tmp_Return);
   end Assign;

   -----------
   -- Equal --
   -----------

   function Equal (Self : Gstring; V2 : Gstring) return Boolean is
      function Internal (Self : Gstring; V2 : Gstring) return Glib.Gboolean;
      pragma Import (C, Internal, "g_string_equal");
   begin
      return Internal (Self, V2) /= 0;
   end Equal;

   ----------
   -- Free --
   ----------

   function Free (Self : Gstring; Free_Segment : Boolean) return UTF8_String is
      function Internal
         (Self         : Gstring;
          Free_Segment : Glib.Gboolean)
          return Interfaces.C.Strings.chars_ptr;
      pragma Import (C, Internal, "g_string_free");
   begin
      return Gtkada.Bindings.Value_And_Free (Internal (Self, Boolean'Pos (Free_Segment)));
   end Free;

   ------------
   -- Insert --
   ------------

   function Insert
      (Self : Gstring;
       Pos  : Gssize;
       Val  : UTF8_String) return Gstring
   is
      function Internal
         (Self : Gstring;
          Pos  : Gssize;
          Val  : Interfaces.C.Strings.chars_ptr) return access Gstring;
      pragma Import (C, Internal, "g_string_insert");
      Tmp_Val    : Interfaces.C.Strings.chars_ptr := New_String (Val);
      Tmp_Return : access Gstring;
   begin
      Tmp_Return := Internal (Self, Pos, Tmp_Val);
      Free (Tmp_Val);
      return From_Object_Free (Tmp_Return);
   end Insert;

   ----------------
   -- Insert_Len --
   ----------------

   function Insert_Len
      (Self : Gstring;
       Pos  : Gssize;
       Val  : UTF8_String;
       Len  : Gssize) return Gstring
   is
      function Internal
         (Self : Gstring;
          Pos  : Gssize;
          Val  : Interfaces.C.Strings.chars_ptr;
          Len  : Gssize) return access Gstring;
      pragma Import (C, Internal, "g_string_insert_len");
      Tmp_Val    : Interfaces.C.Strings.chars_ptr := New_String (Val);
      Tmp_Return : access Gstring;
   begin
      Tmp_Return := Internal (Self, Pos, Tmp_Val, Len);
      Free (Tmp_Val);
      return From_Object_Free (Tmp_Return);
   end Insert_Len;

   ---------------
   -- Overwrite --
   ---------------

   function Overwrite
      (Self : Gstring;
       Pos  : Gsize;
       Val  : UTF8_String) return Gstring
   is
      function Internal
         (Self : Gstring;
          Pos  : Gsize;
          Val  : Interfaces.C.Strings.chars_ptr) return access Gstring;
      pragma Import (C, Internal, "g_string_overwrite");
      Tmp_Val    : Interfaces.C.Strings.chars_ptr := New_String (Val);
      Tmp_Return : access Gstring;
   begin
      Tmp_Return := Internal (Self, Pos, Tmp_Val);
      Free (Tmp_Val);
      return From_Object_Free (Tmp_Return);
   end Overwrite;

   -------------------
   -- Overwrite_Len --
   -------------------

   function Overwrite_Len
      (Self : Gstring;
       Pos  : Gsize;
       Val  : UTF8_String;
       Len  : Gssize) return Gstring
   is
      function Internal
         (Self : Gstring;
          Pos  : Gsize;
          Val  : Interfaces.C.Strings.chars_ptr;
          Len  : Gssize) return access Gstring;
      pragma Import (C, Internal, "g_string_overwrite_len");
      Tmp_Val    : Interfaces.C.Strings.chars_ptr := New_String (Val);
      Tmp_Return : access Gstring;
   begin
      Tmp_Return := Internal (Self, Pos, Tmp_Val, Len);
      Free (Tmp_Val);
      return From_Object_Free (Tmp_Return);
   end Overwrite_Len;

   -------------
   -- Prepend --
   -------------

   function Prepend (Self : Gstring; Val : UTF8_String) return Gstring is
      function Internal
         (Self : Gstring;
          Val  : Interfaces.C.Strings.chars_ptr) return access Gstring;
      pragma Import (C, Internal, "g_string_prepend");
      Tmp_Val    : Interfaces.C.Strings.chars_ptr := New_String (Val);
      Tmp_Return : access Gstring;
   begin
      Tmp_Return := Internal (Self, Tmp_Val);
      Free (Tmp_Val);
      return From_Object_Free (Tmp_Return);
   end Prepend;

   -----------------
   -- Prepend_Len --
   -----------------

   function Prepend_Len
      (Self : Gstring;
       Val  : UTF8_String;
       Len  : Gssize) return Gstring
   is
      function Internal
         (Self : Gstring;
          Val  : Interfaces.C.Strings.chars_ptr;
          Len  : Gssize) return access Gstring;
      pragma Import (C, Internal, "g_string_prepend_len");
      Tmp_Val    : Interfaces.C.Strings.chars_ptr := New_String (Val);
      Tmp_Return : access Gstring;
   begin
      Tmp_Return := Internal (Self, Tmp_Val, Len);
      Free (Tmp_Val);
      return From_Object_Free (Tmp_Return);
   end Prepend_Len;

end Glib.String;