2003-05-31 Bud Davis <bdavis9659@comcast.net>
[official-gcc.git] / gcc / ada / dec-io.ads
blobc65d7632cff78dcddc92daa919a659d3b8084ae1
1 ------------------------------------------------------------------------------
2 -- --
3 -- GNAT RUNTIME COMPONENTS --
4 -- --
5 -- D E C . I O --
6 -- --
7 -- S p e c --
8 -- --
9 -- Copyright (C) 1996-2001 Free Software Foundation, Inc. --
10 -- --
11 -- GNAT is free software; you can redistribute it and/or modify it under --
12 -- terms of the GNU General Public License as published by the Free Soft- --
13 -- ware Foundation; either version 2, or (at your option) any later ver- --
14 -- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
15 -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
16 -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
17 -- for more details. You should have received a copy of the GNU General --
18 -- Public License distributed with GNAT; see file COPYING. If not, write --
19 -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, --
20 -- MA 02111-1307, USA. --
21 -- --
22 -- As a special exception, if other files instantiate generics from this --
23 -- unit, or you link this unit with other files to produce an executable, --
24 -- this unit does not by itself cause the resulting executable to be --
25 -- covered by the GNU General Public License. This exception does not --
26 -- however invalidate any other reasons why the executable file might be --
27 -- covered by the GNU Public License. --
28 -- --
29 -- GNAT was originally developed by the GNAT team at New York University. --
30 -- Extensive contributions were provided by Ada Core Technologies Inc. --
31 -- --
32 ------------------------------------------------------------------------------
34 -- This is an AlphaVMS package that contains the declarations and
35 -- function specifications needed by the DECLib IO packages.
37 with System.Task_Primitives;
38 package DEC.IO is
39 private
41 type Exception_Number is (
42 GNAT_EN_LOCK_ERROR,
43 GNAT_EN_EXISTENCE_ERROR,
44 GNAT_EN_KEY_ERROR,
45 GNAT_EN_KEYSIZERR,
46 GNAT_EN_STAOVF,
47 GNAT_EN_CONSTRAINT_ERRO,
48 GNAT_EN_IOSYSFAILED,
49 GNAT_EN_LAYOUT_ERROR,
50 GNAT_EN_STORAGE_ERROR,
51 GNAT_EN_DATA_ERROR,
52 GNAT_EN_DEVICE_ERROR,
53 GNAT_EN_END_ERROR,
54 GNAT_EN_MODE_ERROR,
55 GNAT_EN_NAME_ERROR,
56 GNAT_EN_STATUS_ERROR,
57 GNAT_EN_NOT_OPEN,
58 GNAT_EN_ALREADY_OPEN,
59 GNAT_EN_USE_ERROR,
60 GNAT_EN_UNSUPPORTED,
61 GNAT_EN_FAC_MODE_MISMAT,
62 GNAT_EN_ORG_MISMATCH,
63 GNAT_EN_RFM_MISMATCH,
64 GNAT_EN_RAT_MISMATCH,
65 GNAT_EN_MRS_MISMATCH,
66 GNAT_EN_MRN_MISMATCH,
67 GNAT_EN_KEY_MISMATCH,
68 GNAT_EN_MAXLINEXC,
69 GNAT_EN_LINEXCMRS);
71 for Exception_Number'Size use 32;
73 for Exception_Number use (
74 GNAT_EN_LOCK_ERROR => 1,
75 GNAT_EN_EXISTENCE_ERROR => 2,
76 GNAT_EN_KEY_ERROR => 3,
77 GNAT_EN_KEYSIZERR => 4,
78 GNAT_EN_STAOVF => 5,
79 GNAT_EN_CONSTRAINT_ERRO => 6,
80 GNAT_EN_IOSYSFAILED => 7,
81 GNAT_EN_LAYOUT_ERROR => 8,
82 GNAT_EN_STORAGE_ERROR => 9,
83 GNAT_EN_DATA_ERROR => 10,
84 GNAT_EN_DEVICE_ERROR => 11,
85 GNAT_EN_END_ERROR => 12,
86 GNAT_EN_MODE_ERROR => 13,
87 GNAT_EN_NAME_ERROR => 14,
88 GNAT_EN_STATUS_ERROR => 15,
89 GNAT_EN_NOT_OPEN => 16,
90 GNAT_EN_ALREADY_OPEN => 17,
91 GNAT_EN_USE_ERROR => 18,
92 GNAT_EN_UNSUPPORTED => 19,
93 GNAT_EN_FAC_MODE_MISMAT => 20,
94 GNAT_EN_ORG_MISMATCH => 21,
95 GNAT_EN_RFM_MISMATCH => 22,
96 GNAT_EN_RAT_MISMATCH => 23,
97 GNAT_EN_MRS_MISMATCH => 24,
98 GNAT_EN_MRN_MISMATCH => 25,
99 GNAT_EN_KEY_MISMATCH => 26,
100 GNAT_EN_MAXLINEXC => 27,
101 GNAT_EN_LINEXCMRS => 28);
103 procedure Raise_IO_Exception (EN : Exception_Number);
104 pragma Export_Procedure (Raise_IO_Exception, "GNAT$RAISE_IO_EXCEPTION",
105 Mechanism => Value);
107 package IO_Locking is
108 type Access_Mutex is private;
109 function Create_Mutex return Access_Mutex;
110 procedure Acquire (M : Access_Mutex);
111 procedure Release (M : Access_Mutex);
113 private
114 type Access_Mutex is access System.Task_Primitives.RTS_Lock;
115 pragma Export_Function (Create_Mutex, "GNAT$CREATE_MUTEX",
116 Mechanism => Value);
117 pragma Export_Procedure (Acquire, "GNAT$ACQUIRE_MUTEX",
118 Mechanism => Value);
119 pragma Export_Procedure (Release, "GNAT$RELEASE_MUTEX",
120 Mechanism => Value);
121 end IO_Locking;
123 end DEC.IO;