111
|
1 .. _Standard_Library_Routines:
|
|
2
|
|
3 *************************
|
|
4 Standard Library Routines
|
|
5 *************************
|
|
6
|
|
7 The Ada Reference Manual contains in Annex A a full description of an
|
|
8 extensive set of standard library routines that can be used in any Ada
|
|
9 program, and which must be provided by all Ada compilers. They are
|
|
10 analogous to the standard C library used by C programs.
|
|
11
|
|
12 GNAT implements all of the facilities described in annex A, and for most
|
|
13 purposes the description in the Ada Reference Manual, or appropriate Ada
|
|
14 text book, will be sufficient for making use of these facilities.
|
|
15
|
|
16 In the case of the input-output facilities,
|
|
17 :ref:`The_Implementation_of_Standard_I/O`,
|
|
18 gives details on exactly how GNAT interfaces to the
|
|
19 file system. For the remaining packages, the Ada Reference Manual
|
|
20 should be sufficient. The following is a list of the packages included,
|
|
21 together with a brief description of the functionality that is provided.
|
|
22
|
|
23 For completeness, references are included to other predefined library
|
|
24 routines defined in other sections of the Ada Reference Manual (these are
|
|
25 cross-indexed from Annex A). For further details see the relevant
|
|
26 package declarations in the run-time library. In particular, a few units
|
|
27 are not implemented, as marked by the presence of pragma Unimplemented_Unit,
|
|
28 and in this case the package declaration contains comments explaining why
|
|
29 the unit is not implemented.
|
|
30
|
|
31
|
|
32
|
|
33 ``Ada`` *(A.2)*
|
|
34 This is a parent package for all the standard library packages. It is
|
|
35 usually included implicitly in your program, and itself contains no
|
|
36 useful data or routines.
|
|
37
|
|
38
|
|
39 ``Ada.Assertions`` *(11.4.2)*
|
|
40 ``Assertions`` provides the ``Assert`` subprograms, and also
|
|
41 the declaration of the ``Assertion_Error`` exception.
|
|
42
|
|
43
|
|
44 ``Ada.Asynchronous_Task_Control`` *(D.11)*
|
|
45 ``Asynchronous_Task_Control`` provides low level facilities for task
|
|
46 synchronization. It is typically not implemented. See package spec for details.
|
|
47
|
|
48
|
|
49 ``Ada.Calendar`` *(9.6)*
|
|
50 ``Calendar`` provides time of day access, and routines for
|
|
51 manipulating times and durations.
|
|
52
|
|
53
|
|
54 ``Ada.Calendar.Arithmetic`` *(9.6.1)*
|
|
55 This package provides additional arithmetic
|
|
56 operations for ``Calendar``.
|
|
57
|
|
58
|
|
59 ``Ada.Calendar.Formatting`` *(9.6.1)*
|
|
60 This package provides formatting operations for ``Calendar``.
|
|
61
|
|
62
|
|
63 ``Ada.Calendar.Time_Zones`` *(9.6.1)*
|
|
64 This package provides additional ``Calendar`` facilities
|
|
65 for handling time zones.
|
|
66
|
|
67
|
|
68 ``Ada.Characters`` *(A.3.1)*
|
|
69 This is a dummy parent package that contains no useful entities
|
|
70
|
|
71
|
|
72 ``Ada.Characters.Conversions`` *(A.3.2)*
|
|
73 This package provides character conversion functions.
|
|
74
|
|
75
|
|
76 ``Ada.Characters.Handling`` *(A.3.2)*
|
|
77 This package provides some basic character handling capabilities,
|
|
78 including classification functions for classes of characters (e.g., test
|
|
79 for letters, or digits).
|
|
80
|
|
81
|
|
82 ``Ada.Characters.Latin_1`` *(A.3.3)*
|
|
83 This package includes a complete set of definitions of the characters
|
|
84 that appear in type CHARACTER. It is useful for writing programs that
|
|
85 will run in international environments. For example, if you want an
|
|
86 upper case E with an acute accent in a string, it is often better to use
|
|
87 the definition of ``UC_E_Acute`` in this package. Then your program
|
|
88 will print in an understandable manner even if your environment does not
|
|
89 support these extended characters.
|
|
90
|
|
91
|
|
92 ``Ada.Command_Line`` *(A.15)*
|
|
93 This package provides access to the command line parameters and the name
|
|
94 of the current program (analogous to the use of ``argc`` and ``argv``
|
|
95 in C), and also allows the exit status for the program to be set in a
|
|
96 system-independent manner.
|
|
97
|
|
98
|
|
99 ``Ada.Complex_Text_IO`` *(G.1.3)*
|
|
100 This package provides text input and output of complex numbers.
|
|
101
|
|
102
|
|
103 ``Ada.Containers`` *(A.18.1)*
|
|
104 A top level package providing a few basic definitions used by all the
|
|
105 following specific child packages that provide specific kinds of
|
|
106 containers.
|
|
107
|
|
108 ``Ada.Containers.Bounded_Priority_Queues`` *(A.18.31)*
|
|
109
|
|
110 ``Ada.Containers.Bounded_Synchronized_Queues`` *(A.18.29)*
|
|
111
|
|
112 ``Ada.Containers.Doubly_Linked_Lists`` *(A.18.3)*
|
|
113
|
|
114 ``Ada.Containers.Generic_Array_Sort`` *(A.18.26)*
|
|
115
|
|
116 ``Ada.Containers.Generic_Constrained_Array_Sort`` *(A.18.26)*
|
|
117
|
|
118 ``Ada.Containers.Generic_Sort`` *(A.18.26)*
|
|
119
|
|
120 ``Ada.Containers.Hashed_Maps`` *(A.18.5)*
|
|
121
|
|
122 ``Ada.Containers.Hashed_Sets`` *(A.18.8)*
|
|
123
|
|
124 ``Ada.Containers.Indefinite_Doubly_Linked_Lists`` *(A.18.12)*
|
|
125
|
|
126 ``Ada.Containers.Indefinite_Hashed_Maps`` *(A.18.13)*
|
|
127
|
|
128 ``Ada.Containers.Indefinite_Hashed_Sets`` *(A.18.15)*
|
|
129
|
|
130 ``Ada.Containers.Indefinite_Holders`` *(A.18.18)*
|
|
131
|
|
132 ``Ada.Containers.Indefinite_Multiway_Trees`` *(A.18.17)*
|
|
133
|
|
134 ``Ada.Containers.Indefinite_Ordered_Maps`` *(A.18.14)*
|
|
135
|
|
136 ``Ada.Containers.Indefinite_Ordered_Sets`` *(A.18.16)*
|
|
137
|
|
138 ``Ada.Containers.Indefinite_Vectors`` *(A.18.11)*
|
|
139
|
|
140 ``Ada.Containers.Multiway_Trees`` *(A.18.10)*
|
|
141
|
|
142 ``Ada.Containers.Ordered_Maps`` *(A.18.6)*
|
|
143
|
|
144 ``Ada.Containers.Ordered_Sets`` *(A.18.9)*
|
|
145
|
|
146 ``Ada.Containers.Synchronized_Queue_Interfaces`` *(A.18.27)*
|
|
147
|
|
148 ``Ada.Containers.Unbounded_Priority_Queues`` *(A.18.30)*
|
|
149
|
|
150 ``Ada.Containers.Unbounded_Synchronized_Queues`` *(A.18.28)*
|
|
151
|
|
152 ``Ada.Containers.Vectors`` *(A.18.2)*
|
|
153
|
|
154 ``Ada.Directories`` *(A.16)*
|
|
155 This package provides operations on directories.
|
|
156
|
|
157
|
|
158 ``Ada.Directories.Hierarchical_File_Names`` *(A.16.1)*
|
|
159 This package provides additional directory operations handling
|
|
160 hiearchical file names.
|
|
161
|
|
162
|
|
163 ``Ada.Directories.Information`` *(A.16)*
|
|
164 This is an implementation defined package for additional directory
|
|
165 operations, which is not implemented in GNAT.
|
|
166
|
|
167
|
|
168 ``Ada.Decimal`` *(F.2)*
|
|
169 This package provides constants describing the range of decimal numbers
|
|
170 implemented, and also a decimal divide routine (analogous to the COBOL
|
|
171 verb DIVIDE ... GIVING ... REMAINDER ...)
|
|
172
|
|
173
|
|
174 ``Ada.Direct_IO`` *(A.8.4)*
|
|
175 This package provides input-output using a model of a set of records of
|
|
176 fixed-length, containing an arbitrary definite Ada type, indexed by an
|
|
177 integer record number.
|
|
178
|
|
179
|
|
180 ``Ada.Dispatching`` *(D.2.1)*
|
|
181 A parent package containing definitions for task dispatching operations.
|
|
182
|
|
183
|
|
184 ``Ada.Dispatching.EDF`` *(D.2.6)*
|
|
185 Not implemented in GNAT.
|
|
186
|
|
187
|
|
188 ``Ada.Dispatching.Non_Preemptive`` *(D.2.4)*
|
|
189 Not implemented in GNAT.
|
|
190
|
|
191
|
|
192 ``Ada.Dispatching.Round_Robin`` *(D.2.5)*
|
|
193 Not implemented in GNAT.
|
|
194
|
|
195
|
|
196 ``Ada.Dynamic_Priorities`` *(D.5)*
|
|
197 This package allows the priorities of a task to be adjusted dynamically
|
|
198 as the task is running.
|
|
199
|
|
200
|
|
201 ``Ada.Environment_Variables`` *(A.17)*
|
|
202 This package provides facilities for accessing environment variables.
|
|
203
|
|
204
|
|
205 ``Ada.Exceptions`` *(11.4.1)*
|
|
206 This package provides additional information on exceptions, and also
|
|
207 contains facilities for treating exceptions as data objects, and raising
|
|
208 exceptions with associated messages.
|
|
209
|
|
210
|
|
211 ``Ada.Execution_Time`` *(D.14)*
|
|
212 This package provides CPU clock functionalities. It is not implemented on
|
|
213 all targets (see package spec for details).
|
|
214
|
|
215
|
|
216 ``Ada.Execution_Time.Group_Budgets`` *(D.14.2)*
|
|
217 Not implemented in GNAT.
|
|
218
|
|
219
|
|
220 ``Ada.Execution_Time.Timers`` *(D.14.1)'*
|
|
221 Not implemented in GNAT.
|
|
222
|
|
223
|
|
224 ``Ada.Finalization`` *(7.6)*
|
|
225 This package contains the declarations and subprograms to support the
|
|
226 use of controlled types, providing for automatic initialization and
|
|
227 finalization (analogous to the constructors and destructors of C++).
|
|
228
|
|
229
|
|
230 ``Ada.Float_Text_IO`` *(A.10.9)*
|
|
231 A library level instantiation of Text_IO.Float_IO for type Float.
|
|
232
|
|
233
|
|
234 ``Ada.Float_Wide_Text_IO`` *(A.10.9)*
|
|
235 A library level instantiation of Wide_Text_IO.Float_IO for type Float.
|
|
236
|
|
237
|
|
238 ``Ada.Float_Wide_Wide_Text_IO`` *(A.10.9)*
|
|
239 A library level instantiation of Wide_Wide_Text_IO.Float_IO for type Float.
|
|
240
|
|
241
|
|
242 ``Ada.Integer_Text_IO`` *(A.10.9)*
|
|
243 A library level instantiation of Text_IO.Integer_IO for type Integer.
|
|
244
|
|
245
|
|
246 ``Ada.Integer_Wide_Text_IO`` *(A.10.9)*
|
|
247 A library level instantiation of Wide_Text_IO.Integer_IO for type Integer.
|
|
248
|
|
249
|
|
250 ``Ada.Integer_Wide_Wide_Text_IO`` *(A.10.9)*
|
|
251 A library level instantiation of Wide_Wide_Text_IO.Integer_IO for type Integer.
|
|
252
|
|
253
|
|
254 ``Ada.Interrupts`` *(C.3.2)*
|
|
255 This package provides facilities for interfacing to interrupts, which
|
|
256 includes the set of signals or conditions that can be raised and
|
|
257 recognized as interrupts.
|
|
258
|
|
259
|
|
260 ``Ada.Interrupts.Names`` *(C.3.2)*
|
|
261 This package provides the set of interrupt names (actually signal
|
|
262 or condition names) that can be handled by GNAT.
|
|
263
|
|
264
|
|
265 ``Ada.IO_Exceptions`` *(A.13)*
|
|
266 This package defines the set of exceptions that can be raised by use of
|
|
267 the standard IO packages.
|
|
268
|
|
269
|
|
270 ``Ada.Iterator_Interfaces`` *(5.5.1)*
|
|
271 This package provides a generic interface to generalized iterators.
|
|
272
|
|
273
|
|
274 ``Ada.Locales`` *(A.19)*
|
|
275 This package provides declarations providing information (Language
|
131
|
276 and Country) about the current locale.
|
111
|
277
|
|
278
|
|
279 ``Ada.Numerics``
|
|
280 This package contains some standard constants and exceptions used
|
|
281 throughout the numerics packages. Note that the constants pi and e are
|
|
282 defined here, and it is better to use these definitions than rolling
|
|
283 your own.
|
|
284
|
|
285
|
|
286 ``Ada.Numerics.Complex_Arrays`` *(G.3.2)*
|
|
287 Provides operations on arrays of complex numbers.
|
|
288
|
|
289
|
|
290 ``Ada.Numerics.Complex_Elementary_Functions``
|
|
291 Provides the implementation of standard elementary functions (such as
|
|
292 log and trigonometric functions) operating on complex numbers using the
|
|
293 standard ``Float`` and the ``Complex`` and ``Imaginary`` types
|
|
294 created by the package ``Numerics.Complex_Types``.
|
|
295
|
|
296
|
|
297 ``Ada.Numerics.Complex_Types``
|
|
298 This is a predefined instantiation of
|
|
299 ``Numerics.Generic_Complex_Types`` using ``Standard.Float`` to
|
|
300 build the type ``Complex`` and ``Imaginary``.
|
|
301
|
|
302
|
|
303 ``Ada.Numerics.Discrete_Random``
|
|
304 This generic package provides a random number generator suitable for generating
|
|
305 uniformly distributed values of a specified discrete subtype.
|
|
306
|
|
307
|
|
308 ``Ada.Numerics.Float_Random``
|
|
309 This package provides a random number generator suitable for generating
|
|
310 uniformly distributed floating point values in the unit interval.
|
|
311
|
|
312
|
|
313 ``Ada.Numerics.Generic_Complex_Elementary_Functions``
|
|
314 This is a generic version of the package that provides the
|
|
315 implementation of standard elementary functions (such as log and
|
|
316 trigonometric functions) for an arbitrary complex type.
|
|
317
|
|
318 The following predefined instantiations of this package are provided:
|
|
319
|
|
320 * ``Short_Float``
|
|
321
|
|
322 ``Ada.Numerics.Short_Complex_Elementary_Functions``
|
|
323
|
|
324 * ``Float``
|
|
325
|
|
326 ``Ada.Numerics.Complex_Elementary_Functions``
|
|
327
|
|
328 * ``Long_Float``
|
|
329
|
|
330 ``Ada.Numerics.Long_Complex_Elementary_Functions``
|
|
331
|
|
332 ``Ada.Numerics.Generic_Complex_Types``
|
|
333 This is a generic package that allows the creation of complex types,
|
|
334 with associated complex arithmetic operations.
|
|
335
|
|
336 The following predefined instantiations of this package exist
|
|
337
|
|
338 * ``Short_Float``
|
|
339
|
|
340 ``Ada.Numerics.Short_Complex_Complex_Types``
|
|
341
|
|
342 * ``Float``
|
|
343
|
|
344 ``Ada.Numerics.Complex_Complex_Types``
|
|
345
|
|
346 * ``Long_Float``
|
|
347
|
|
348 ``Ada.Numerics.Long_Complex_Complex_Types``
|
|
349
|
|
350 ``Ada.Numerics.Generic_Elementary_Functions``
|
|
351 This is a generic package that provides the implementation of standard
|
|
352 elementary functions (such as log an trigonometric functions) for an
|
|
353 arbitrary float type.
|
|
354
|
|
355 The following predefined instantiations of this package exist
|
|
356
|
|
357 * ``Short_Float``
|
|
358
|
|
359 ``Ada.Numerics.Short_Elementary_Functions``
|
|
360
|
|
361 * ``Float``
|
|
362
|
|
363 ``Ada.Numerics.Elementary_Functions``
|
|
364
|
|
365 * ``Long_Float``
|
|
366
|
|
367 ``Ada.Numerics.Long_Elementary_Functions``
|
|
368
|
|
369 ``Ada.Numerics.Generic_Real_Arrays`` *(G.3.1)*
|
|
370 Generic operations on arrays of reals
|
|
371
|
|
372 ``Ada.Numerics.Real_Arrays`` *(G.3.1)*
|
|
373 Preinstantiation of Ada.Numerics.Generic_Real_Arrays (Float).
|
|
374
|
|
375 ``Ada.Real_Time`` *(D.8)*
|
|
376 This package provides facilities similar to those of ``Calendar``, but
|
|
377 operating with a finer clock suitable for real time control. Note that
|
|
378 annex D requires that there be no backward clock jumps, and GNAT generally
|
|
379 guarantees this behavior, but of course if the external clock on which
|
|
380 the GNAT runtime depends is deliberately reset by some external event,
|
|
381 then such a backward jump may occur.
|
|
382
|
|
383 ``Ada.Real_Time.Timing_Events`` *(D.15)*
|
|
384 Not implemented in GNAT.
|
|
385
|
|
386 ``Ada.Sequential_IO`` *(A.8.1)*
|
|
387 This package provides input-output facilities for sequential files,
|
|
388 which can contain a sequence of values of a single type, which can be
|
|
389 any Ada type, including indefinite (unconstrained) types.
|
|
390
|
|
391 ``Ada.Storage_IO`` *(A.9)*
|
|
392 This package provides a facility for mapping arbitrary Ada types to and
|
|
393 from a storage buffer. It is primarily intended for the creation of new
|
|
394 IO packages.
|
|
395
|
|
396 ``Ada.Streams`` *(13.13.1)*
|
|
397 This is a generic package that provides the basic support for the
|
|
398 concept of streams as used by the stream attributes (``Input``,
|
|
399 ``Output``, ``Read`` and ``Write``).
|
|
400
|
|
401 ``Ada.Streams.Stream_IO`` *(A.12.1)*
|
|
402 This package is a specialization of the type ``Streams`` defined in
|
|
403 package ``Streams`` together with a set of operations providing
|
|
404 Stream_IO capability. The Stream_IO model permits both random and
|
|
405 sequential access to a file which can contain an arbitrary set of values
|
|
406 of one or more Ada types.
|
|
407
|
|
408 ``Ada.Strings`` *(A.4.1)*
|
|
409 This package provides some basic constants used by the string handling
|
|
410 packages.
|
|
411
|
|
412
|
|
413 ``Ada.Strings.Bounded`` *(A.4.4)*
|
|
414 This package provides facilities for handling variable length
|
|
415 strings. The bounded model requires a maximum length. It is thus
|
|
416 somewhat more limited than the unbounded model, but avoids the use of
|
|
417 dynamic allocation or finalization.
|
|
418
|
|
419 ``Ada.Strings.Bounded.Equal_Case_Insensitive`` *(A.4.10)*
|
|
420 Provides case-insensitive comparisons of bounded strings
|
|
421
|
|
422 ``Ada.Strings.Bounded.Hash`` *(A.4.9)*
|
|
423 This package provides a generic hash function for bounded strings
|
|
424
|
|
425 ``Ada.Strings.Bounded.Hash_Case_Insensitive`` *(A.4.9)*
|
|
426 This package provides a generic hash function for bounded strings that
|
|
427 converts the string to be hashed to lower case.
|
|
428
|
|
429 ``Ada.Strings.Bounded.Less_Case_Insensitive`` *(A.4.10)*
|
|
430 This package provides a comparison function for bounded strings that works
|
|
431 in a case insensitive manner by converting to lower case before the comparison.
|
|
432
|
|
433 ``Ada.Strings.Fixed`` *(A.4.3)*
|
|
434 This package provides facilities for handling fixed length strings.
|
|
435
|
|
436 ``Ada.Strings.Fixed.Equal_Case_Insensitive`` *(A.4.10)*
|
|
437 This package provides an equality function for fixed strings that compares
|
|
438 the strings after converting both to lower case.
|
|
439
|
|
440 ``Ada.Strings.Fixed.Hash_Case_Insensitive`` *(A.4.9)*
|
|
441 This package provides a case insensitive hash function for fixed strings that
|
|
442 converts the string to lower case before computing the hash.
|
|
443
|
|
444 ``Ada.Strings.Fixed.Less_Case_Insensitive`` *(A.4.10)*
|
|
445 This package provides a comparison function for fixed strings that works
|
|
446 in a case insensitive manner by converting to lower case before the comparison.
|
|
447
|
|
448 ``Ada.Strings.Hash`` *(A.4.9)*
|
|
449 This package provides a hash function for strings.
|
|
450
|
|
451 ``Ada.Strings.Hash_Case_Insensitive`` *(A.4.9)*
|
|
452 This package provides a hash function for strings that is case insensitive.
|
|
453 The string is converted to lower case before computing the hash.
|
|
454
|
|
455 ``Ada.Strings.Less_Case_Insensitive`` *(A.4.10)*
|
|
456 This package provides a comparison function for\\strings that works
|
|
457 in a case insensitive manner by converting to lower case before the comparison.
|
|
458
|
|
459 ``Ada.Strings.Maps`` *(A.4.2)*
|
|
460 This package provides facilities for handling character mappings and
|
|
461 arbitrarily defined subsets of characters. For instance it is useful in
|
|
462 defining specialized translation tables.
|
|
463
|
|
464 ``Ada.Strings.Maps.Constants`` *(A.4.6)*
|
|
465 This package provides a standard set of predefined mappings and
|
|
466 predefined character sets. For example, the standard upper to lower case
|
|
467 conversion table is found in this package. Note that upper to lower case
|
|
468 conversion is non-trivial if you want to take the entire set of
|
|
469 characters, including extended characters like E with an acute accent,
|
|
470 into account. You should use the mappings in this package (rather than
|
|
471 adding 32 yourself) to do case mappings.
|
|
472
|
|
473 ``Ada.Strings.Unbounded`` *(A.4.5)*
|
|
474 This package provides facilities for handling variable length
|
|
475 strings. The unbounded model allows arbitrary length strings, but
|
|
476 requires the use of dynamic allocation and finalization.
|
|
477
|
|
478 ``Ada.Strings.Unbounded.Equal_Case_Insensitive`` *(A.4.10)*
|
|
479 Provides case-insensitive comparisons of unbounded strings
|
|
480
|
|
481 ``Ada.Strings.Unbounded.Hash`` *(A.4.9)*
|
|
482 This package provides a generic hash function for unbounded strings
|
|
483
|
|
484 ``Ada.Strings.Unbounded.Hash_Case_Insensitive`` *(A.4.9)*
|
|
485 This package provides a generic hash function for unbounded strings that
|
|
486 converts the string to be hashed to lower case.
|
|
487
|
|
488 ``Ada.Strings.Unbounded.Less_Case_Insensitive`` *(A.4.10)*
|
|
489 This package provides a comparison function for unbounded strings that works
|
|
490 in a case insensitive manner by converting to lower case before the comparison.
|
|
491
|
|
492 ``Ada.Strings.UTF_Encoding`` *(A.4.11)*
|
|
493 This package provides basic definitions for dealing with UTF-encoded strings.
|
|
494
|
|
495 ``Ada.Strings.UTF_Encoding.Conversions`` *(A.4.11)*
|
|
496 This package provides conversion functions for UTF-encoded strings.
|
|
497
|
|
498 ``Ada.Strings.UTF_Encoding.Strings`` *(A.4.11)*
|
|
499
|
|
500 ``Ada.Strings.UTF_Encoding.Wide_Strings`` *(A.4.11)*
|
|
501
|
|
502 ``Ada.Strings.UTF_Encoding.Wide_Wide_Strings`` *(A.4.11)*
|
|
503 These packages provide facilities for handling UTF encodings for
|
|
504 Strings, Wide_Strings and Wide_Wide_Strings.
|
|
505
|
|
506 ``Ada.Strings.Wide_Bounded`` *(A.4.7)*
|
|
507
|
|
508 ``Ada.Strings.Wide_Fixed`` *(A.4.7)*
|
|
509
|
|
510 ``Ada.Strings.Wide_Maps`` *(A.4.7)*
|
|
511
|
|
512 ``Ada.Strings.Wide_Unbounded`` *(A.4.7)*
|
|
513 These packages provide analogous capabilities to the corresponding
|
|
514 packages without ``Wide_`` in the name, but operate with the types
|
|
515 ``Wide_String`` and ``Wide_Character`` instead of ``String``
|
|
516 and ``Character``. Versions of all the child packages are available.
|
|
517
|
|
518 ``Ada.Strings.Wide_Wide_Bounded`` *(A.4.7)*
|
|
519
|
|
520 ``Ada.Strings.Wide_Wide_Fixed`` *(A.4.7)*
|
|
521
|
|
522 ``Ada.Strings.Wide_Wide_Maps`` *(A.4.7)*
|
|
523
|
|
524 ``Ada.Strings.Wide_Wide_Unbounded`` *(A.4.7)*
|
|
525 These packages provide analogous capabilities to the corresponding
|
|
526 packages without ``Wide_`` in the name, but operate with the types
|
|
527 ``Wide_Wide_String`` and ``Wide_Wide_Character`` instead
|
|
528 of ``String`` and ``Character``.
|
|
529
|
|
530 ``Ada.Synchronous_Barriers`` *(D.10.1)*
|
|
531 This package provides facilities for synchronizing tasks at a low level
|
|
532 with barriers.
|
|
533
|
|
534 ``Ada.Synchronous_Task_Control`` *(D.10)*
|
|
535 This package provides some standard facilities for controlling task
|
|
536 communication in a synchronous manner.
|
|
537
|
|
538 ``Ada.Synchronous_Task_Control.EDF`` *(D.10)*
|
|
539 Not implemented in GNAT.
|
|
540
|
|
541 ``Ada.Tags``
|
|
542 This package contains definitions for manipulation of the tags of tagged
|
|
543 values.
|
|
544
|
|
545 ``Ada.Tags.Generic_Dispatching_Constructor`` *(3.9)*
|
|
546 This package provides a way of constructing tagged class-wide values given
|
|
547 only the tag value.
|
|
548
|
|
549 ``Ada.Task_Attributes`` *(C.7.2)*
|
|
550 This package provides the capability of associating arbitrary
|
|
551 task-specific data with separate tasks.
|
|
552
|
|
553 ``Ada.Task_Identifification`` *(C.7.1)*
|
|
554 This package provides capabilities for task identification.
|
|
555
|
|
556 ``Ada.Task_Termination`` *(C.7.3)*
|
|
557 This package provides control over task termination.
|
|
558
|
|
559 ``Ada.Text_IO``
|
|
560 This package provides basic text input-output capabilities for
|
|
561 character, string and numeric data. The subpackages of this
|
|
562 package are listed next. Note that although these are defined
|
|
563 as subpackages in the RM, they are actually transparently
|
|
564 implemented as child packages in GNAT, meaning that they
|
|
565 are only loaded if needed.
|
|
566
|
|
567 ``Ada.Text_IO.Decimal_IO``
|
|
568 Provides input-output facilities for decimal fixed-point types
|
|
569
|
|
570 ``Ada.Text_IO.Enumeration_IO``
|
|
571 Provides input-output facilities for enumeration types.
|
|
572
|
|
573 ``Ada.Text_IO.Fixed_IO``
|
|
574 Provides input-output facilities for ordinary fixed-point types.
|
|
575
|
|
576 ``Ada.Text_IO.Float_IO``
|
|
577 Provides input-output facilities for float types. The following
|
|
578 predefined instantiations of this generic package are available:
|
|
579
|
|
580 * ``Short_Float``
|
|
581
|
|
582 ``Short_Float_Text_IO``
|
|
583
|
|
584 * ``Float``
|
|
585
|
|
586 ``Float_Text_IO``
|
|
587
|
|
588 * ``Long_Float``
|
|
589
|
|
590 ``Long_Float_Text_IO``
|
|
591
|
|
592 ``Ada.Text_IO.Integer_IO``
|
|
593 Provides input-output facilities for integer types. The following
|
|
594 predefined instantiations of this generic package are available:
|
|
595
|
|
596 * ``Short_Short_Integer``
|
|
597
|
|
598 ``Ada.Short_Short_Integer_Text_IO``
|
|
599
|
|
600 * ``Short_Integer``
|
|
601
|
|
602 ``Ada.Short_Integer_Text_IO``
|
|
603
|
|
604 * ``Integer``
|
|
605
|
|
606 ``Ada.Integer_Text_IO``
|
|
607
|
|
608 * ``Long_Integer``
|
|
609
|
|
610 ``Ada.Long_Integer_Text_IO``
|
|
611
|
|
612 * ``Long_Long_Integer``
|
|
613
|
|
614 ``Ada.Long_Long_Integer_Text_IO``
|
|
615
|
|
616 ``Ada.Text_IO.Modular_IO``
|
|
617 Provides input-output facilities for modular (unsigned) types.
|
|
618
|
|
619 ``Ada.Text_IO.Bounded_IO (A.10.11)``
|
|
620 Provides input-output facilities for bounded strings.
|
|
621
|
|
622 ``Ada.Text_IO.Complex_IO (G.1.3)``
|
|
623 This package provides basic text input-output capabilities for complex
|
|
624 data.
|
|
625
|
|
626 ``Ada.Text_IO.Editing (F.3.3)``
|
|
627 This package contains routines for edited output, analogous to the use
|
|
628 of pictures in COBOL. The picture formats used by this package are a
|
|
629 close copy of the facility in COBOL.
|
|
630
|
|
631 ``Ada.Text_IO.Text_Streams (A.12.2)``
|
|
632 This package provides a facility that allows Text_IO files to be treated
|
|
633 as streams, so that the stream attributes can be used for writing
|
|
634 arbitrary data, including binary data, to Text_IO files.
|
|
635
|
|
636 ``Ada.Text_IO.Unbounded_IO (A.10.12)``
|
|
637 This package provides input-output facilities for unbounded strings.
|
|
638
|
|
639 ``Ada.Unchecked_Conversion (13.9)``
|
|
640 This generic package allows arbitrary conversion from one type to
|
|
641 another of the same size, providing for breaking the type safety in
|
|
642 special circumstances.
|
|
643
|
|
644 If the types have the same Size (more accurately the same Value_Size),
|
|
645 then the effect is simply to transfer the bits from the source to the
|
|
646 target type without any modification. This usage is well defined, and
|
|
647 for simple types whose representation is typically the same across
|
|
648 all implementations, gives a portable method of performing such
|
|
649 conversions.
|
|
650
|
|
651 If the types do not have the same size, then the result is implementation
|
|
652 defined, and thus may be non-portable. The following describes how GNAT
|
|
653 handles such unchecked conversion cases.
|
|
654
|
|
655 If the types are of different sizes, and are both discrete types, then
|
|
656 the effect is of a normal type conversion without any constraint checking.
|
|
657 In particular if the result type has a larger size, the result will be
|
|
658 zero or sign extended. If the result type has a smaller size, the result
|
|
659 will be truncated by ignoring high order bits.
|
|
660
|
|
661 If the types are of different sizes, and are not both discrete types,
|
|
662 then the conversion works as though pointers were created to the source
|
|
663 and target, and the pointer value is converted. The effect is that bits
|
|
664 are copied from successive low order storage units and bits of the source
|
|
665 up to the length of the target type.
|
|
666
|
|
667 A warning is issued if the lengths differ, since the effect in this
|
|
668 case is implementation dependent, and the above behavior may not match
|
|
669 that of some other compiler.
|
|
670
|
|
671 A pointer to one type may be converted to a pointer to another type using
|
|
672 unchecked conversion. The only case in which the effect is undefined is
|
|
673 when one or both pointers are pointers to unconstrained array types. In
|
|
674 this case, the bounds information may get incorrectly transferred, and in
|
|
675 particular, GNAT uses double size pointers for such types, and it is
|
|
676 meaningless to convert between such pointer types. GNAT will issue a
|
|
677 warning if the alignment of the target designated type is more strict
|
|
678 than the alignment of the source designated type (since the result may
|
|
679 be unaligned in this case).
|
|
680
|
|
681 A pointer other than a pointer to an unconstrained array type may be
|
|
682 converted to and from System.Address. Such usage is common in Ada 83
|
|
683 programs, but note that Ada.Address_To_Access_Conversions is the
|
|
684 preferred method of performing such conversions in Ada 95 and Ada 2005.
|
|
685 Neither
|
|
686 unchecked conversion nor Ada.Address_To_Access_Conversions should be
|
|
687 used in conjunction with pointers to unconstrained objects, since
|
|
688 the bounds information cannot be handled correctly in this case.
|
|
689
|
|
690 ``Ada.Unchecked_Deallocation`` *(13.11.2)*
|
|
691 This generic package allows explicit freeing of storage previously
|
|
692 allocated by use of an allocator.
|
|
693
|
|
694 ``Ada.Wide_Text_IO`` *(A.11)*
|
|
695 This package is similar to ``Ada.Text_IO``, except that the external
|
|
696 file supports wide character representations, and the internal types are
|
|
697 ``Wide_Character`` and ``Wide_String`` instead of ``Character``
|
|
698 and ``String``. The corresponding set of nested packages and child
|
|
699 packages are defined.
|
|
700
|
|
701 ``Ada.Wide_Wide_Text_IO`` *(A.11)*
|
|
702 This package is similar to ``Ada.Text_IO``, except that the external
|
|
703 file supports wide character representations, and the internal types are
|
|
704 ``Wide_Character`` and ``Wide_String`` instead of ``Character``
|
|
705 and ``String``. The corresponding set of nested packages and child
|
|
706 packages are defined.
|
|
707
|
|
708 For packages in Interfaces and System, all the RM defined packages are
|
|
709 available in GNAT, see the Ada 2012 RM for full details.
|