Remove some compile time warnings about duplicate definitions.
[official-gcc.git] / gcc / ada / i-os2lib.ads
blob45bc8e94b9666728a4b3787d935900f3f79cf683
1 ------------------------------------------------------------------------------
2 -- --
3 -- GNAT COMPILER COMPONENTS --
4 -- --
5 -- I N T E R F A C E S . O S 2 L I B --
6 -- --
7 -- S p e c --
8 -- --
9 -- $Revision: 1.14 $ --
10 -- --
11 -- Copyright (C) 1993-1997 Free Software Foundation, Inc. --
12 -- --
13 -- GNAT is free software; you can redistribute it and/or modify it under --
14 -- terms of the GNU General Public License as published by the Free Soft- --
15 -- ware Foundation; either version 2, or (at your option) any later ver- --
16 -- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
17 -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
18 -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
19 -- for more details. You should have received a copy of the GNU General --
20 -- Public License distributed with GNAT; see file COPYING. If not, write --
21 -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, --
22 -- MA 02111-1307, USA. --
23 -- --
24 -- As a special exception, if other files instantiate generics from this --
25 -- unit, or you link this unit with other files to produce an executable, --
26 -- this unit does not by itself cause the resulting executable to be --
27 -- covered by the GNU General Public License. This exception does not --
28 -- however invalidate any other reasons why the executable file might be --
29 -- covered by the GNU Public License. --
30 -- --
31 -- GNAT was originally developed by the GNAT team at New York University. --
32 -- It is now maintained by Ada Core Technologies Inc (http://www.gnat.com). --
33 -- --
34 ------------------------------------------------------------------------------
36 -- This package (and children) provide interface definitions to the standard
37 -- OS/2 Library. They are merely a translation of the various <bse*.h> files.
39 -- It is intended that higher level interfaces (with better names, and
40 -- stronger typing!) be built on top of this one for Ada (i.e. clean)
41 -- programming.
43 -- We have chosen to keep names, types, etc. as close as possible to the
44 -- C definition to provide easier reference to the documentation. The main
45 -- exception is when a formal and its type (in C) differed only by the case
46 -- of letters (like in HMUX hmux). In this case, we have prepended "F_" to
47 -- the formal (i.e. F_hmux : HMUX).
49 with Interfaces.C;
50 with Interfaces.C.Strings;
51 with System;
53 package Interfaces.OS2Lib is
54 pragma Preelaborate (OS2Lib);
56 package IC renames Interfaces.C;
57 package ICS renames Interfaces.C.Strings;
59 -------------------
60 -- General Types --
61 -------------------
63 type APIRET is new IC.unsigned_long;
64 type APIRET16 is new IC.unsigned_short;
65 subtype APIRET32 is APIRET;
67 subtype PSZ is ICS.chars_ptr;
68 subtype PCHAR is ICS.chars_ptr;
69 subtype PVOID is System.Address;
70 type PPVOID is access all PVOID;
72 type BOOL32 is new IC.unsigned_long;
73 False32 : constant BOOL32 := 0;
74 True32 : constant BOOL32 := 1;
76 type UCHAR is new IC.unsigned_char;
77 type USHORT is new IC.unsigned_short;
78 type ULONG is new IC.unsigned_long;
79 type PULONG is access all ULONG;
81 -- Coprocessor stack register element.
83 type FPREG is record
84 losig : ULONG; -- Low 32-bits of the mantissa
85 hisig : ULONG; -- High 32-bits of the mantissa
86 signexp : USHORT; -- Sign and exponent
87 end record;
88 pragma Convention (C, FPREG);
90 type AULONG is array (IC.size_t range <>) of ULONG;
91 type AFPREG is array (IC.size_t range <>) of FPREG;
93 type LHANDLE is new IC.unsigned_long;
95 NULLHANDLE : constant := 0;
97 ---------------------
98 -- Time Management --
99 ---------------------
101 function DosSleep (How_long : ULONG) return APIRET;
102 pragma Import (C, DosSleep, "DosSleep");
104 type DATETIME is record
105 hours : UCHAR;
106 minutes : UCHAR;
107 seconds : UCHAR;
108 hundredths : UCHAR;
109 day : UCHAR;
110 month : UCHAR;
111 year : USHORT;
112 timezone : IC.short;
113 weekday : UCHAR;
114 end record;
116 type PDATETIME is access all DATETIME;
118 function DosGetDateTime (pdt : PDATETIME) return APIRET;
119 pragma Import (C, DosGetDateTime, "DosGetDateTime");
121 function DosSetDateTime (pdt : PDATETIME) return APIRET;
122 pragma Import (C, DosSetDateTime, "DosSetDateTime");
124 ----------------------------
125 -- Miscelleneous Features --
126 ----------------------------
128 -- Features which do not fit any child
130 function DosBeep (Freq : ULONG; Dur : ULONG) return APIRET;
131 pragma Import (C, DosBeep, "DosBeep");
133 procedure Must_Not_Fail (Return_Code : OS2Lib.APIRET);
134 pragma Inline (Must_Not_Fail);
135 -- Many OS/2 functions return APIRET and are not supposed to fail. In C
136 -- style, these would be called as procedures, disregarding the returned
137 -- value. This procedure can be used to achieve the same effect with a
138 -- call of the form: Must_Not_Fail (Some_OS2_Function (...));
140 procedure Sem_Must_Not_Fail (Return_Code : OS2Lib.APIRET);
141 pragma Inline (Sem_Must_Not_Fail);
142 -- Similar to Must_Not_Fail, but used in the case of DosPostEventSem,
143 -- where the "error" code ERROR_ALREADY_POSTED is not really an error.
145 end Interfaces.OS2Lib;