OSDN Git Service

2004-08-13 Olivier Hainque <hainque@act-europe.fr>
[pf3gnuchains/gcc-fork.git] / gcc / ada / 5xcrtl.ads
1 ------------------------------------------------------------------------------
2 --                                                                          --
3 --                        GNAT RUN-TIME COMPONENTS                          --
4 --                                                                          --
5 --                         S Y S T E M . C R T L                            --
6 --                                                                          --
7 --                                S p e c                                   --
8 --                                                                          --
9 --           Copyright (C) 2004 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 ------------------------------------------------------------------------------
33
34 --  This package provides the low level interface to the C Run Time Library
35 --  on 64 bit VMS
36
37 with System.Parameters;
38 package System.CRTL is
39 pragma Preelaborate (CRTL);
40
41    subtype chars is System.Address;
42    --  Pointer to null-terminated array of characters
43
44    subtype FILEs is System.Address;
45    --  Corresponds to the C type FILE*
46
47    subtype int is Integer;
48
49    type long is range -(2 ** (System.Parameters.long_bits - 1))
50       .. +(2 ** (System.Parameters.long_bits - 1)) - 1;
51
52    subtype off_t is Integer;
53
54    type size_t is mod 2 ** Standard'Address_Size;
55
56    function atoi (A : System.Address) return Integer;
57    pragma Import (C, atoi, "decc$atoi");
58
59    procedure clearerr (stream : FILEs);
60    pragma Import (C, clearerr, "decc$clearerr");
61
62    function fclose (stream : FILEs) return int;
63    pragma Import (C, fclose, "decc$fclose");
64
65    function fdopen (handle : int; mode : chars) return FILEs;
66    pragma Import (C, fdopen, "decc$fdopen");
67
68    function fflush (stream : FILEs) return int;
69    pragma Import (C, fflush, "decc$fflush");
70
71    function fgetc (stream : FILEs) return int;
72    pragma Import (C, fgetc, "decc$fgetc");
73
74    function fgets (strng : chars; n : int; stream : FILEs) return chars;
75    pragma Import (C, fgets, "decc$fgets");
76
77    function fopen (filename : chars; Mode : chars) return FILEs;
78    pragma Import (C, fopen, "decc$fopen");
79
80    function fputc (C : int; stream : FILEs) return int;
81    pragma Import (C, fputc, "decc$fputc");
82
83    function fputs (Strng : chars; Stream : FILEs) return int;
84    pragma Import (C, fputs, "decc$fputs");
85
86    procedure free (Ptr : System.Address);
87    pragma Import (C, free, "decc$free");
88
89    function freopen
90      (filename : chars;
91       mode     : chars;
92       stream   : FILEs)
93       return     FILEs;
94    pragma Import (C, freopen, "decc$freopen");
95
96    function fseek
97      (stream : FILEs;
98       offset : long;
99       origin : int)
100       return   int;
101    pragma Import (C, fseek, "decc$fseek");
102
103    function ftell (stream : FILEs) return long;
104    pragma Import (C, ftell, "decc$ftell");
105
106    function getenv (S : String) return System.Address;
107    pragma Import (C, getenv, "decc$getenv");
108
109    function isatty (handle : int) return int;
110    pragma Import (C, isatty, "decc$isatty");
111
112    function lseek (fd : int; offset : off_t; direction : int) return off_t;
113    pragma Import (C, lseek, "decc$lseek");
114
115    function malloc (Size : size_t) return System.Address;
116    pragma Import (C, malloc, "decc$_malloc64");
117
118    procedure memcpy (S1 : System.Address; S2 : System.Address; N : size_t);
119    pragma Import (C, memcpy, "decc$_memcpy64");
120
121    procedure memmove (S1 : System.Address; S2 : System.Address; N : size_t);
122    pragma Import (C, memmove, "decc$_memmove64");
123
124    procedure mktemp (template : chars);
125    pragma Import (C, mktemp, "decc$_mktemp64");
126
127    function read (fd : int; buffer : chars; nbytes : int) return int;
128    pragma Import (C, read, "decc$read");
129
130    function realloc
131      (Ptr : System.Address; Size : size_t) return System.Address;
132    pragma Import (C, realloc, "decc$_realloc64");
133
134    procedure rewind (stream : FILEs);
135    pragma Import (C, rewind, "decc$rewind");
136
137    function setvbuf
138      (stream : FILEs;
139       buffer : chars;
140       mode   : int;
141       size   : size_t)
142       return   int;
143    pragma Import (C, setvbuf, "decc$setvbuf");
144
145    procedure tmpnam (string : chars);
146    pragma Import (C, tmpnam, "decc$_tmpnam64");
147
148    function tmpfile return FILEs;
149    pragma Import (C, tmpfile, "decc$tmpfile");
150
151    function ungetc (c : int; stream : FILEs) return int;
152    pragma Import (C, ungetc, "decc$ungetc");
153
154    function unlink (filename : chars) return int;
155    pragma Import (C, unlink, "decc$unlink");
156
157    function write (fd : int; buffer : chars; nbytes : int) return int;
158    pragma Import (C, write, "decc$write");
159 end System.CRTL;